edu.northwestern.at.morphadorner.corpuslinguistics.spellingstandardizer

## Class GapFiller

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

-     public class GapFiller
      extends java.lang.Object

  Gap Filler: Finds candidate words to match words with gaps.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TernaryTrie` | `trie` Ternary trie to hold word list to search.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GapFiller(java.util.List<java.lang.String> wordsList)` Create GapFiller from a list containing words.
    `GapFiller(java.util.Map<java.lang.String,java.lang.String> wordsMap)` Create GapFiller from a map containing words.
    `GapFiller(java.util.Set<java.lang.String> wordsSet)` Create GapFiller from a set containing words.
    `GapFiller(TaggedStrings wordsList)` Create GapFiller from a tagged strings list.
    `GapFiller(TernaryTrie trie)` Create GapFiller from an existing trie.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addWord(java.lang.String word)` Add a word to the filler.
    `protected void` | `addWordPrivate(java.lang.String word)` Add a word to the filler.
    `void` | `addWords(java.util.Collection<java.lang.String> words)` Add multiple words to the filler from string collection.
    `void` | `addWords(java.lang.String[] words)` Add multiple words to the filler from string array.
    `java.util.List<java.lang.String>` | `getMatchingWords(java.lang.String word)` Get list of candidate words matching a word with one or more gaps.
    `java.util.List<java.lang.String>` | `getMatchingWords(java.lang.String word, char gapChar)` Get list of candidate words matching a word with one or more gaps.

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

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

- - ### Field Detail

    - #### trie

          protected TernaryTrie trie

      Ternary trie to hold word list to search.

  - ### Constructor Detail

    - #### GapFiller

          public GapFiller(java.util.Map<java.lang.String,java.lang.String> wordsMap)

      Create GapFiller from a map containing words.
      Parameters:
        `wordsMap` - Map with words to add to the filler.

    - #### GapFiller

          public GapFiller(java.util.Set<java.lang.String> wordsSet)

      Create GapFiller from a set containing words.
      Parameters:
        `wordsSet` - Set with words to add to the filler.

    - #### GapFiller

          public GapFiller(java.util.List<java.lang.String> wordsList)

      Create GapFiller from a list containing words.
      Parameters:
        `wordsList` - List with words to add to the filler.

    - #### GapFiller

          public GapFiller(TaggedStrings wordsList)

      Create GapFiller from a tagged strings list.
      Parameters:
        `wordsList` - Tagged strings list with words to add to the filler.

    - #### GapFiller

          public GapFiller(TernaryTrie trie)

      Create GapFiller from an existing trie.
      Parameters:
        `trie` - Trie.

  - ### Method Detail

    - #### addWordPrivate

          protected void addWordPrivate(java.lang.String word)

      Add a word to the filler.
      Parameters:
        `word` - The word to add to the filler.

    - #### addWord

          public void addWord(java.lang.String word)

      Add a word to the filler.
      Parameters:
        `word` - The word to add to the filler.

    - #### addWords

          public void addWords(java.lang.String[] words)

      Add multiple words to the filler from string array.
      Parameters:
        `words` - The words to add to the filler.

    - #### addWords

          public void addWords(java.util.Collection<java.lang.String> words)

      Add multiple words to the filler from string collection.
      Parameters:
        `words` - The words to add to the filler.

    - #### getMatchingWords

          public java.util.List<java.lang.String> getMatchingWords(java.lang.String word,
                                                          char gapChar)

      Get list of candidate words matching a word with one or more gaps.
      Parameters:
        `word` - Word with gaps.
        `gapChar` - Gap marker character.
      Returns:
        String list of candidate matching words. May be empty if no matching words.

    - #### getMatchingWords

          public java.util.List<java.lang.String> getMatchingWords(java.lang.String word)

      Get list of candidate words matching a word with one or more gaps.
      Parameters:
        `word` - Word with gaps.
      Returns:
        String list of candidate matching words. May be empty if no matching words.

        Assumes either the Unicode blackcircle or the solid circle are gap character markers.