edu.northwestern.at.morphadorner.corpuslinguistics.contractionexpander

## Class AbstractContractionExpander

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.contractionexpander.AbstractContractionExpander

- All Implemented Interfaces:
    ContractionExpander, UsesLogger
  Direct Known Subclasses:
    EnglishContractionExpander

      public abstract class AbstractContractionExpander
      extends IsCloseableObject
      implements ContractionExpander, UsesLogger

  Abstract ContractionExpander.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TaggedStrings` | `contractedSpellings` Contracted spelings.
    `protected Logger` | `logger` Logger used for output.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractContractionExpander()` Create abstract contraction expander.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `expandContraction(java.lang.String spelling)` Returns an expanded spelling for a contracted spelling.
    `Logger` | `getLogger()` Get the logger.
    `protected void` | `loadContractedSpellings(java.io.Reader reader)` Load map from contracted to expanded spellings.
    `void` | `setLogger(Logger logger)` Set the logger.

    - ### Methods inherited from class edu.northwestern.at.utils.IsCloseableObject

      `close`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### contractedSpellings

          protected TaggedStrings contractedSpellings

      Contracted spelings.

      Contracted spellings are stored as TaggedStrings. The tag is the contracted form. The value is the uncontracted forn.

    - #### logger

          protected Logger logger

      Logger used for output.

  - ### Constructor Detail

    - #### AbstractContractionExpander

          public AbstractContractionExpander()

      Create abstract contraction expander.

  - ### Method Detail

    - #### loadContractedSpellings

          protected void loadContractedSpellings(java.io.Reader reader)
                                          throws java.io.IOException

      Load map from contracted to expanded spellings.
      Parameters:
        `reader` - Reader from which to read contractions.
      Throws:
        `java.io.IOException` - When contracted spellings cannot be read.

    - #### expandContraction

          public java.lang.String expandContraction(java.lang.String spelling)

      Returns an expanded spelling for a contracted spelling.
      Specified by:
        `expandContraction` in interface `ContractionExpander`
      Parameters:
        `spelling` - The spelling.
      Returns:
        The expanded form of the contraction.

    - #### getLogger

          public Logger getLogger()

      Get the logger.
      Specified by:
        `getLogger` in interface `UsesLogger`
      Returns:
        The logger.

    - #### setLogger

          public void setLogger(Logger logger)

      Set the logger.
      Specified by:
        `setLogger` in interface `UsesLogger`
      Parameters:
        `logger` - The logger.