edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer

## Class DecruftifyingSpellingStandardizer

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

- All Implemented Interfaces:
    SpellingStandardizer, UsesLogger

      public class DecruftifyingSpellingStandardizer
      extends AbstractSpellingStandardizer
      implements SpellingStandardizer

  DecruftifyingSpellingStandardizer cleans up spellings.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.String,java.lang.String>` | `cache` Cache for decruftified entries.

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DecruftifyingSpellingStandardizer()` Create decruftifying spelling standardizer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `loadAlternativeSpellings(java.io.Reader reader, java.lang.String delimChars)` Loads alternative spellings from a reader.
    `java.lang.String[]` | `standardizeSpelling(java.lang.String spelling)` Returns standard spellings given a spelling.
    `java.lang.String` | `standardizeSpelling(java.lang.String spelling, java.lang.String wordClass)` Returns a standard spelling given a standard or alternate 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, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, loadStandardSpellings, preprocessSpelling, setLexicon, setLogger, setMappedSpellings, setStandardSpellings`

    - ### 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, loadAlternativeSpellingsByWordClass, loadStandardSpellings, loadStandardSpellings, loadStandardSpellings, preprocessSpelling, setMappedSpellings, setStandardSpellings`

- - ### Field Detail

    - #### cache

          protected java.util.Map<java.lang.String,java.lang.String> cache

      Cache for decruftified entries.

  - ### Constructor Detail

    - #### DecruftifyingSpellingStandardizer

          public DecruftifyingSpellingStandardizer()

      Create decruftifying spelling standardizer.

  - ### Method Detail

    - #### loadAlternativeSpellings

          public void loadAlternativeSpellings(java.io.Reader reader,
                                      java.lang.String delimChars)
                                        throws java.io.IOException

      Loads alternative spellings from a reader.
      Specified by:
        `loadAlternativeSpellings` in interface `SpellingStandardizer`
      Overrides:
        `loadAlternativeSpellings` in class `AbstractSpellingStandardizer`
      Parameters:
        `reader` - The reader.
        `delimChars` - Delimiter characters separating spelling pairs.

        Unused in this standardizer.

      Throws:
        `java.io.IOException`

    - #### 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.

    - #### standardizeSpelling

          public java.lang.String standardizeSpelling(java.lang.String spelling,
                                             java.lang.String wordClass)

      Returns a standard spelling given a standard or alternate spelling.
      Specified by:
        `standardizeSpelling` in interface `SpellingStandardizer`
      Overrides:
        `standardizeSpelling` in class `AbstractSpellingStandardizer`
      Parameters:
        `spelling` - The spelling.
        `wordClass` - The word class.
      Returns:
        The standard spelling.

    - #### toString

          public java.lang.String toString()

      Return standardizer description.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Standardizer description.