|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.dictionary.Dictionary
public class Dictionary
This class is a dictionary.
Constructor Summary | |
---|---|
Dictionary()
Initializes an empty Dictionary . |
|
Dictionary(boolean caseSensitive)
|
|
Dictionary(InputStream in)
Initializes the Dictionary from an existing dictionary resource. |
|
Dictionary(InputStream in,
boolean caseSensitive)
|
Method Summary | |
---|---|
boolean |
contains(StringList tokens)
Checks if this dictionary has the given entry. |
boolean |
equals(Object obj)
|
int |
hashCode()
|
Iterator<StringList> |
iterator()
Retrieves an Iterator over all tokens. |
static Dictionary |
parseOneEntryPerLine(Reader in)
Reads a dictionary which has one entry per line. |
void |
put(StringList tokens)
Adds the tokens to the dictionary as one new entry. |
void |
remove(StringList tokens)
Removes the given tokens form the current instance. |
void |
serialize(OutputStream out)
Writes the current instance to the given OutputStream . |
int |
size()
Retrieves the number of tokens in the current instance. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Dictionary()
Dictionary
.
public Dictionary(boolean caseSensitive)
public Dictionary(InputStream in) throws IOException, InvalidFormatException
Dictionary
from an existing dictionary resource.
in
-
IOException
InvalidFormatException
public Dictionary(InputStream in, boolean caseSensitive) throws IOException, InvalidFormatException
IOException
InvalidFormatException
Method Detail |
---|
public void put(StringList tokens)
tokens
- the new entrypublic boolean contains(StringList tokens)
tokens
-
public void remove(StringList tokens)
tokens
- public Iterator<StringList> iterator()
iterator
in interface Iterable<StringList>
Iterator
public int size()
public void serialize(OutputStream out) throws IOException
OutputStream
.
out
-
IOException
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static Dictionary parseOneEntryPerLine(Reader in) throws IOException
in
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |