public class GazetteerTree extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
GazetteerTree.StringSplitterInterface
instances of this interface can be passed in to control how strings are split.
|
Constructor and Description |
---|
GazetteerTree(int phrase_length)
Initialize the tree, data will be read via a separate call.
|
GazetteerTree(int phrase_length,
GazetteerTree.StringSplitterInterface splitr)
Initialize the tree, data will be read via a separate call.
|
Modifier and Type | Method and Description |
---|---|
void |
match(List<Constituent> words,
int which,
SpanLabelView view) |
void |
readDictionary(String filename,
String suffix,
InputStream res)
read the given dictionary file from the input stream.
|
String |
toString()
to string prints a representation of every string contained in the gazetteer.
|
void |
trimToSize()
trim off excess size dead space.
|
public GazetteerTree(int phrase_length)
phrase_length
- the max number of terms to match per phrase.public GazetteerTree(int phrase_length, GazetteerTree.StringSplitterInterface splitr)
phrase_length
- the max number of terms to match per phrase.splitr
- this interface implementation will determin how we split strings.public void readDictionary(String filename, String suffix, InputStream res) throws IOException
filename
- the file nae.suffix
- the parse tag suffix.res
- the input stream to read the data from.IOException
public final void match(List<Constituent> words, int which, SpanLabelView view)
word
- the token to match.which
- the index of the token.public final void trimToSize()
Copyright © 2017. All rights reserved.