public class FileDictionary extends 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 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(InputStream dictFile)
Creates a dictionary based on an inputstream.
|
FileDictionary(InputStream dictFile,
String fieldDelimiter)
Creates a dictionary based on an inputstream.
|
FileDictionary(Reader reader)
Creates a dictionary based on a reader.
|
FileDictionary(Reader reader,
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 String DEFAULT_FIELD_DELIMITER
public FileDictionary(InputStream dictFile)
DEFAULT_FIELD_DELIMITER
as the
field separator in a line.
NOTE: content is treated as UTF-8
public FileDictionary(Reader reader)
DEFAULT_FIELD_DELIMITER
as the
field separator in a line.public FileDictionary(Reader reader, String fieldDelimiter)
fieldDelimiter
to separate out the
fields in a line.public FileDictionary(InputStream dictFile, String fieldDelimiter)
fieldDelimiter
to separate out the
fields in a line.
NOTE: content is treated as UTF-8
public InputIterator getEntryIterator()
Dictionary
getEntryIterator
in interface Dictionary
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.