public class DictionaryBuilder extends Object
WordListDictionary
backed by an ArrayWordList
from one
or more files containing a list of words, one per line.Constructor and Description |
---|
DictionaryBuilder() |
Modifier and Type | Method and Description |
---|---|
DictionaryBuilder |
addFile(String path)
Adds a word list to the dictionary to be built.
|
DictionaryBuilder |
addReader(Reader reader)
Adds a word list to the dictionary to be built.
|
Dictionary |
build()
Builds a dictionary from the configured properties.
|
DictionaryBuilder |
setCaseSensitive(boolean flag)
Sets the case sensitivity flag on the dictionary to be built.
|
public DictionaryBuilder addFile(String path)
path
- Path to word list, one word per line.public DictionaryBuilder addReader(Reader reader)
reader
- Reader which returns a word list, one word per line.public DictionaryBuilder setCaseSensitive(boolean flag)
flag
- True for case sensitive, false otherwise.public Dictionary build()
WordListDictionary
instance.Copyright © 2003-2024 Virginia Tech. All Rights Reserved.