public class FileDictionary extends java.lang.Object implements Dictionary
Format allowed: 1 entry per line:
An entry can be:
fieldDelimiter weightfieldDelimiter weight fieldDelimiter payloadfieldDelimiter is "\t"NOTE:
fieldDelimiter
Example:
word1 word2 TAB 100 TAB payload1
word3 TAB 101
word4 word3 TAB 102
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_FIELD_DELIMITER
Tab-delimited fields are most common thus the default, but one can override this via the constructor
|
| Constructor and Description |
|---|
FileDictionary(java.io.InputStream dictFile)
Creates a dictionary based on an inputstream.
|
FileDictionary(java.io.InputStream dictFile,
java.lang.String fieldDelimiter)
Creates a dictionary based on an inputstream.
|
FileDictionary(java.io.Reader reader)
Creates a dictionary based on a reader.
|
FileDictionary(java.io.Reader reader,
java.lang.String fieldDelimiter)
Creates a dictionary based on a reader.
|
| Modifier and Type | Method and Description |
|---|---|
InputIterator |
getEntryIterator()
Returns an iterator over all the entries
|
public static final java.lang.String DEFAULT_FIELD_DELIMITER
public FileDictionary(java.io.InputStream dictFile)
DEFAULT_FIELD_DELIMITER as the
field separator in a line.
NOTE: content is treated as UTF-8
public FileDictionary(java.io.Reader reader)
DEFAULT_FIELD_DELIMITER as the
field separator in a line.public FileDictionary(java.io.Reader reader,
java.lang.String fieldDelimiter)
fieldDelimiter to separate out the
fields in a line.public FileDictionary(java.io.InputStream dictFile,
java.lang.String fieldDelimiter)
fieldDelimiter to separate out the
fields in a line.
NOTE: content is treated as UTF-8
public InputIterator getEntryIterator()
DictionarygetEntryIterator in interface DictionaryData In Motion GmbH all rights reserved