edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer

## Class ExtendedSimpleSpellingStandardizer

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.AbstractSpellingStandardizer
    - - edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.SimpleSpellingStandardizer
      - - edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.ExtendedSimpleSpellingStandardizer

- All Implemented Interfaces:
    SpellingStandardizer, UsesLogger
  Direct Known Subclasses:
    DefaultSpellingStandardizer, ExtendedSearchSpellingStandardizer

      public class ExtendedSimpleSpellingStandardizer
      extends SimpleSpellingStandardizer
      implements SpellingStandardizer

  SimpleSpellingStandardizer maps alternate spellings to standard spellings.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected GapFiller` | `gapFiller` Gap filler.

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.AbstractSpellingStandardizer

      `alternateSpellingsWordClasses, defaultSpellingsByWordClassFileName, lexicon, logger, mappedSpellings, spellingsByWordClass, standardSpellingSet`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtendedSimpleSpellingStandardizer()` Create extended simple spelling standardizer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String[]` | `doStandardizeSpelling(java.lang.String spelling, boolean addToCache)` Returns standard spellings given a spelling.
    `protected java.lang.String` | `fixGaps(java.lang.String word)` Fix gaps in a word.
    `GapFiller` | `getGapFiller()` Get gap filler.
    `java.lang.String` | `preprocessSpelling(java.lang.String spelling)` Preprocess spelling.
    `void` | `setGapFiller(GapFiller gapFiller)` Set gap filler.
    `java.lang.String[]` | `standardizeSpelling(java.lang.String spelling)` Returns standard spellings given a spelling.
    `java.lang.String` | `toString()` Return standardizer description.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.AbstractSpellingStandardizer

      `addCachedSpelling, addMappedSpelling, addStandardSpelling, addStandardSpellings, fixCapitalization, getLexicon, getLogger, getMappedSpellings, getNumberOfAlternateSpellings, getNumberOfAlternateSpellingsByWordClass, getNumberOfStandardSpellings, getStandardSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, loadStandardSpellings, setLexicon, setLogger, setMappedSpellings, setStandardSpellings, standardizeSpelling`

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

      `close`

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

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

    - ### Methods inherited from interface edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.SpellingStandardizer

      `addMappedSpelling, addStandardSpelling, addStandardSpellings, fixCapitalization, getMappedSpellings, getNumberOfAlternateSpellings, getNumberOfAlternateSpellingsByWordClass, getNumberOfStandardSpellings, getStandardSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellings, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, loadStandardSpellings, setMappedSpellings, setStandardSpellings, standardizeSpelling`

- - ### Field Detail

    - #### gapFiller

          protected GapFiller gapFiller

      Gap filler. Only allocated if needed.

  - ### Constructor Detail

    - #### ExtendedSimpleSpellingStandardizer

          public ExtendedSimpleSpellingStandardizer()

      Create extended simple spelling standardizer.

  - ### Method Detail

    - #### fixGaps

          protected java.lang.String fixGaps(java.lang.String word)

      Fix gaps in a word.
      Parameters:
        `word` - Word with gaps.
      Returns:
        Word with gaps possibly filled. Original word return if gaps cannot be filled.

    - #### preprocessSpelling

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

      Preprocess spelling.
      Specified by:
        `preprocessSpelling` in interface `SpellingStandardizer`
      Overrides:
        `preprocessSpelling` in class `AbstractSpellingStandardizer`
      Parameters:
        `spelling` - Spelling to preprocess.
      Returns:
        Preprocessed spelling.

    - #### doStandardizeSpelling

          protected java.lang.String[] doStandardizeSpelling(java.lang.String spelling,
                                                 boolean addToCache)

      Returns standard spellings given a spelling.
      Parameters:
        `spelling` - The spelling.
        `addToCache` - Add standardized spelling to spelling map.
      Returns:
        The standard spellings as an array of String.

    - #### standardizeSpelling

          public java.lang.String[] standardizeSpelling(java.lang.String spelling)

      Returns standard spellings given a spelling.
      Specified by:
        `standardizeSpelling` in interface `SpellingStandardizer`
      Overrides:
        `standardizeSpelling` in class `AbstractSpellingStandardizer`
      Parameters:
        `spelling` - The spelling.
      Returns:
        The standard spellings as an array of String.

    - #### setGapFiller

          public void setGapFiller(GapFiller gapFiller)

      Set gap filler.
      Parameters:
        `gapFiller` - The gap filler.

    - #### getGapFiller

          public GapFiller getGapFiller()

      Get gap filler.
      Returns:
        gapFiller The gap filler.

    - #### toString

          public java.lang.String toString()

      Return standardizer description.
      Overrides:
        `toString` in class `SimpleSpellingStandardizer`
      Returns:
        Standardizer description.