public class POSDictionary extends java.lang.Object implements java.lang.Iterable<java.lang.String>, MutableTagDictionary
| Constructor and Description |
|---|
POSDictionary()
Initializes an empty case sensitive
POSDictionary. |
POSDictionary(boolean caseSensitive)
Initializes an empty
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. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
isCaseSensitive()
Whether if the dictionary is case sensitive or not
|
java.util.Iterator<java.lang.String> |
iterator()
Retrieves an iterator over all words in the dictionary.
|
java.lang.String[] |
put(java.lang.String word,
java.lang.String... tags)
Associates the specified tags with the specified word.
|
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() |
public POSDictionary()
POSDictionary.public POSDictionary(boolean caseSensitive)
POSDictionary.caseSensitive - the POSDictionary case sensitivity@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.public java.lang.String[] getTags(java.lang.String word)
getTags in interface TagDictionaryword - 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.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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.IOExceptionInvalidFormatExceptionpublic java.lang.String[] put(java.lang.String word,
java.lang.String... tags)
MutableTagDictionaryput in interface MutableTagDictionaryword - word with which the specified tags is to be associatedtags - tags to be associated with the specified wordpublic boolean isCaseSensitive()
MutableTagDictionaryisCaseSensitive in interface MutableTagDictionaryCopyright © 2010 - 2020 Adobe. All Rights Reserved