|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectopennlp.tools.dictionary.Dictionary
public class Dictionary
This class is a dictionary.
| Constructor Summary | |
|---|---|
Dictionary()
Initializes an empty Dictionary. |
|
Dictionary(boolean caseSensitive)
|
|
Dictionary(java.io.InputStream in)
Initializes the Dictionary from an existing dictionary resource. |
|
Dictionary(java.io.InputStream in,
boolean caseSensitive)
|
|
| Method Summary | |
|---|---|
boolean |
contains(StringList tokens)
Checks if this dictionary has the given entry. |
boolean |
equals(java.lang.Object obj)
|
int |
hashCode()
|
java.util.Iterator<StringList> |
iterator()
Retrieves an Iterator over all tokens. |
static Dictionary |
parseOneEntryPerLine(java.io.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(java.io.OutputStream out)
Writes the current instance to the given OutputStream. |
int |
size()
Retrieves the number of tokens in the current instance. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Dictionary()
Dictionary.
public Dictionary(boolean caseSensitive)
public Dictionary(java.io.InputStream in)
throws java.io.IOException,
InvalidFormatException
Dictionary from an existing dictionary resource.
in -
java.io.IOException
InvalidFormatException
public Dictionary(java.io.InputStream in,
boolean caseSensitive)
throws java.io.IOException,
InvalidFormatException
java.io.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 java.util.Iterator<StringList> iterator()
iterator in interface java.lang.Iterable<StringList>Iteratorpublic int size()
public void serialize(java.io.OutputStream out)
throws java.io.IOException
OutputStream.
out -
java.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public static Dictionary parseOneEntryPerLine(java.io.Reader in)
throws java.io.IOException
in -
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||