edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer

## Class EnglishDecruftifier

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer.EnglishDecruftifier

-     public class EnglishDecruftifier
      extends java.lang.Object

  Spelling decruftifier.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `EnglishDecruftifier.CruftySpelling` Holds spelling in process of decruftification.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.util.List<PatternReplacer>` | `cmList1` Lists of combining macron replacement patterns.
    `protected static java.util.List<PatternReplacer>` | `cmList2`
    `protected static java.util.regex.Pattern` | `initIVowelPattern`
    `protected static java.lang.String` | `initIVowelPatternReplacement`
    `protected static java.util.regex.Pattern` | `initPrefixvVowelPattern`
    `protected static java.lang.String` | `initPrefixvVowelPatternReplacement`
    `protected static java.util.regex.Pattern` | `initUVowelPattern`
    `protected static java.lang.String` | `initUVowelPatternReplacement`
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `macronMap` Demacronization map.
    `protected static java.lang.String` | `macronMapResourceName` Macron map resource file.
    `protected static java.util.regex.Pattern` | `prefixUVowelPattern`
    `protected static java.lang.String` | `prefixUVowelPatternReplacement`
    `protected static java.util.regex.Pattern` | `syllableIsyllablePattern`
    `protected static java.lang.String` | `syllableIsyllablePatternReplacement`
    `protected static java.util.regex.Pattern` | `underlineCapCap`
    `protected static java.lang.String` | `underlineCapCapPatternReplacement`
    `protected static java.util.regex.Pattern` | `vConsonantPattern`
    `protected static java.lang.String` | `vConsonantPatternReplacement`
    `protected static java.util.regex.Pattern` | `vuvPattern`
    `protected static java.lang.String` | `vuvPatternReplacement`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `EnglishDecruftifier()` Allow overrides but not instantiation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `addCombiningMacronPattern(java.util.List<PatternReplacer> list, java.lang.String pattern, java.lang.String replacement)` Add entry to combining macrons replacement list.
    `static java.lang.String` | `decruftify(java.lang.String cruftySpelling)` Decruftify a spelling (extended).
    `static java.lang.String[]` | `decruftify2(java.lang.String cruftySpelling)` Decruftify a spelling (simple and extended).
    `static EnglishDecruftifier.CruftySpelling` | `decruftifyStep1(java.lang.String cruftySpelling)` Decruftify step one.
    `static EnglishDecruftifier.CruftySpelling` | `decruftifyStep2(java.lang.String cruftySpelling)` Decruftify step two.
    `static EnglishDecruftifier.CruftySpelling` | `decruftifyStep3(java.lang.String cruftySpelling)` Decruftify step three.
    `static java.lang.String` | `fixEnd(java.lang.String spelling, java.lang.String ending, java.lang.String replacement)` Replace string at end of spelling.
    `static java.lang.String` | `fixStart1(java.lang.String spelling, java.lang.String charsToEvict)` Remove specified leading characters from spelling.
    `static java.lang.String` | `patternReplacer(java.util.regex.Pattern pattern, java.lang.String result, java.lang.String replacement)`
    `static java.lang.String` | `patternReplacer(java.lang.String pattern, java.lang.String result, java.lang.String replacement)`
    `static java.lang.String` | `replaceCombiningMacrons(java.lang.String s, java.util.List<PatternReplacer> cmList)` Replace combining macrons.
    `static java.lang.String` | `replacePatterns(java.lang.String s, java.util.List<PatternReplacer> patternList)` Replace patterns.
    `static java.lang.String` | `simpleDecruftify(java.lang.String cruftySpelling)` Decruftify a spelling (simple).

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

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

- - ### Field Detail

    - #### cmList1

          protected static java.util.List<PatternReplacer> cmList1

      Lists of combining macron replacement patterns.

    - #### cmList2

          protected static java.util.List<PatternReplacer> cmList2

    - #### vConsonantPattern

          protected static java.util.regex.Pattern vConsonantPattern

    - #### vConsonantPatternReplacement

          protected static java.lang.String vConsonantPatternReplacement

    - #### vuvPattern

          protected static java.util.regex.Pattern vuvPattern

    - #### vuvPatternReplacement

          protected static java.lang.String vuvPatternReplacement

    - #### initUVowelPattern

          protected static java.util.regex.Pattern initUVowelPattern

    - #### initUVowelPatternReplacement

          protected static java.lang.String initUVowelPatternReplacement

    - #### initPrefixvVowelPattern

          protected static java.util.regex.Pattern initPrefixvVowelPattern

    - #### initPrefixvVowelPatternReplacement

          protected static java.lang.String initPrefixvVowelPatternReplacement

    - #### initIVowelPattern

          protected static java.util.regex.Pattern initIVowelPattern

    - #### initIVowelPatternReplacement

          protected static java.lang.String initIVowelPatternReplacement

    - #### prefixUVowelPattern

          protected static java.util.regex.Pattern prefixUVowelPattern

    - #### prefixUVowelPatternReplacement

          protected static java.lang.String prefixUVowelPatternReplacement

    - #### syllableIsyllablePattern

          protected static java.util.regex.Pattern syllableIsyllablePattern

    - #### syllableIsyllablePatternReplacement

          protected static java.lang.String syllableIsyllablePatternReplacement

    - #### underlineCapCap

          protected static java.util.regex.Pattern underlineCapCap

    - #### underlineCapCapPatternReplacement

          protected static java.lang.String underlineCapCapPatternReplacement

    - #### macronMap

          protected static java.util.Map<java.lang.String,java.lang.String> macronMap

      Demacronization map. Key is spelling with macrons, value is word with macrons replaced.

    - #### macronMapResourceName

          protected static final java.lang.String macronMapResourceName

      Macron map resource file.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EnglishDecruftifier

          protected EnglishDecruftifier()

      Allow overrides but not instantiation.

  - ### Method Detail

    - #### addCombiningMacronPattern

          protected static void addCombiningMacronPattern(java.util.List<PatternReplacer> list,
                                       java.lang.String pattern,
                                       java.lang.String replacement)

      Add entry to combining macrons replacement list.
      Parameters:
        `list` - List.
        `pattern` - Pattern.
        `replacement` - Replacement.

    - #### replaceCombiningMacrons

          public static java.lang.String replaceCombiningMacrons(java.lang.String s,
                                                 java.util.List<PatternReplacer> cmList)

      Replace combining macrons.
      Parameters:
        `s` - String in which to replace macrons.
        `cmList` - List of combining macron replacement patterns.
      Returns:
        String with macrons replaced/expanded.

    - #### replacePatterns

          public static java.lang.String replacePatterns(java.lang.String s,
                                         java.util.List<PatternReplacer> patternList)

      Replace patterns.
      Parameters:
        `s` - String in which to replace patterns.
        `patternList` - List of replacement patterns.
      Returns:
        String with patterns replaced.

    - #### fixEnd

          public static java.lang.String fixEnd(java.lang.String spelling,
                                java.lang.String ending,
                                java.lang.String replacement)

      Replace string at end of spelling.
      Parameters:
        `spelling` - The spelling.
        `ending` - The ending string to look for.
        `replacement` - The replacement string.
      Returns:
        The fixed spelling.

    - #### fixStart1

          public static java.lang.String fixStart1(java.lang.String spelling,
                                   java.lang.String charsToEvict)

      Remove specified leading characters from spelling.
      Parameters:
        `spelling` - The spelling.
        `charsToEvict` - Character to evict from start of spelling.
      Returns:
        The fixed spelling.

    - #### patternReplacer

          public static java.lang.String patternReplacer(java.util.regex.Pattern pattern,
                                         java.lang.String result,
                                         java.lang.String replacement)

    - #### patternReplacer

          public static java.lang.String patternReplacer(java.lang.String pattern,
                                         java.lang.String result,
                                         java.lang.String replacement)

    - #### decruftifyStep1

          public static EnglishDecruftifier.CruftySpelling decruftifyStep1(java.lang.String cruftySpelling)

      Decruftify step one.
      Parameters:
        `cruftySpelling` - Spelling to decruftify.
      Returns:
        CruftySpelling containing step1 decruftication results.

    - #### decruftifyStep2

          public static EnglishDecruftifier.CruftySpelling decruftifyStep2(java.lang.String cruftySpelling)

      Decruftify step two.
      Parameters:
        `cruftySpelling` - Spelling to decruftify.
      Returns:
        CruftySpelling containing step2 decruftication results.

    - #### decruftifyStep3

          public static EnglishDecruftifier.CruftySpelling decruftifyStep3(java.lang.String cruftySpelling)

      Decruftify step three.
      Parameters:
        `cruftySpelling` - Spelling to decruftify.
      Returns:
        CruftySpelling containing step3 decruftication results.

    - #### decruftify

          public static java.lang.String decruftify(java.lang.String cruftySpelling)

      Decruftify a spelling (extended).
      Parameters:
        `cruftySpelling` - The crufty spelling.
      Returns:
        The decruftified spelling.

    - #### simpleDecruftify

          public static java.lang.String simpleDecruftify(java.lang.String cruftySpelling)

      Decruftify a spelling (simple).
      Parameters:
        `cruftySpelling` - The crufty spelling.
      Returns:
        The decruftified spelling.

    - #### decruftify2

          public static java.lang.String[] decruftify2(java.lang.String cruftySpelling)

      Decruftify a spelling (simple and extended).
      Parameters:
        `cruftySpelling` - The crufty spelling.
      Returns:
        Two element string array. [0] = extended decruftified spelling. [1] = simple decruftified spelling.