public class GapFiller
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected TernaryTrie |
trie
Ternary trie to hold word list to search.
|
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.
|
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.
|
protected TernaryTrie trie
public GapFiller(java.util.Map<java.lang.String,java.lang.String> wordsMap)
wordsMap
- Map with words to add to the filler.public GapFiller(java.util.Set<java.lang.String> wordsSet)
wordsSet
- Set with words to add to the filler.public GapFiller(java.util.List<java.lang.String> wordsList)
wordsList
- List with words to add to the filler.public GapFiller(TaggedStrings wordsList)
wordsList
- Tagged strings list with words
to add to the filler.public GapFiller(TernaryTrie trie)
trie
- Trie.protected void addWordPrivate(java.lang.String word)
word
- The word to add to the filler.public void addWord(java.lang.String word)
word
- The word to add to the filler.public void addWords(java.lang.String[] words)
words
- The words to add to the filler.public void addWords(java.util.Collection<java.lang.String> words)
words
- The words to add to the filler.public java.util.List<java.lang.String> getMatchingWords(java.lang.String word, char gapChar)
word
- Word with gaps.gapChar
- Gap marker character.public java.util.List<java.lang.String> getMatchingWords(java.lang.String word)
word
- Word with gaps.Assumes either the Unicode blackcircle or the solid circle are gap character markers.