|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.tools.postag.POSDictionary
public class POSDictionary
Provides a means of determining which tags are valid for a particular word based on a tag dictionary read from a file.
Constructor Summary | |
---|---|
POSDictionary()
|
|
POSDictionary(java.io.BufferedReader reader,
boolean caseSensitive)
Deprecated. Use create(InputStream) instead, old format might removed. |
|
POSDictionary(java.lang.String file)
Deprecated. Use create(InputStream) instead, old format might removed. |
|
POSDictionary(java.lang.String file,
boolean caseSensitive)
Deprecated. Use create(InputStream) instead, old format might removed. |
|
POSDictionary(java.lang.String file,
java.lang.String encoding,
boolean caseSensitive)
Deprecated. Use create(InputStream) instead, old format might removed. |
Method Summary | |
---|---|
static POSDictionary |
create(java.io.InputStream in)
Creates a new POSDictionary from a provided InputStream . |
boolean |
equals(java.lang.Object o)
|
java.lang.String[] |
getTags(java.lang.String word)
Returns a list of valid tags for the specified word. |
java.util.Iterator<java.lang.String> |
iterator()
|
static void |
main(java.lang.String[] args)
|
void |
serialize(java.io.OutputStream out)
Writes the POSDictionary to the given OutputStream ;
After the serialization is finished the provided
OutputStream remains open. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public POSDictionary()
@Deprecated public POSDictionary(java.lang.String file) throws java.io.IOException
create(InputStream)
instead, old format might removed.
file
- The file name for the tag dictionary.
java.io.IOException
- when the specified file can not be read.@Deprecated public POSDictionary(java.lang.String file, boolean caseSensitive) throws java.io.IOException
create(InputStream)
instead, old format might removed.
file
- The file name for the tag dictionary.caseSensitive
- Specifies whether the tag dictionary is case sensitive or not.
java.io.IOException
- when the specified file can not be read.@Deprecated public POSDictionary(java.lang.String file, java.lang.String encoding, boolean caseSensitive) throws java.io.IOException
create(InputStream)
instead, old format might removed.
file
- The file name for the tag dictionary.encoding
- The encoding of the tag dictionary file.caseSensitive
- Specifies whether the tag dictionary is case sensitive or not.
java.io.IOException
- when the specified file can not be read.@Deprecated public POSDictionary(java.io.BufferedReader reader, boolean caseSensitive) throws java.io.IOException
create(InputStream)
instead, old format might removed.
reader
- A reader for the tag dictionary.caseSensitive
- Specifies whether the tag dictionary is case sensitive or not.
java.io.IOException
- when the specified file can not be read.Method Detail |
---|
public java.lang.String[] getTags(java.lang.String word)
getTags
in interface TagDictionary
word
- The word.
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public void serialize(java.io.OutputStream out) throws java.io.IOException
POSDictionary
to the given OutputStream
;
After the serialization is finished the provided
OutputStream
remains open.
out
- the OutputStream
to write the dictionary into.
java.io.IOException
- if writing to the OutputStream
failspublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static POSDictionary create(java.io.InputStream in) throws java.io.IOException, InvalidFormatException
POSDictionary
from a provided InputStream
.
After creation is finished the provided InputStream
is closed.
in
-
java.io.IOException
InvalidFormatException
public static void main(java.lang.String[] args) throws java.io.IOException, InvalidFormatException
java.io.IOException
InvalidFormatException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |