Class POSDictionary
java.lang.Object
opennlp.tools.postag.POSDictionary
- All Implemented Interfaces:
Iterable<String>, opennlp.tools.postag.MutableTagDictionary, opennlp.tools.postag.TagDictionary, opennlp.tools.util.model.SerializableArtifact
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes an empty case sensitivePOSDictionary.POSDictionary(boolean caseSensitive) Initializes an emptyPOSDictionary. -
Method Summary
Modifier and TypeMethodDescriptionstatic POSDictionarycreate(InputStream in) Creates a newPOSDictionaryfrom anInputStream.booleanClass<?> String[]Returns a list of valid tags for the specifiedword.inthashCode()booleaniterator()Retrieves anIteratorover all words in the dictionary.String[]voidserialize(OutputStream out) Writes thePOSDictionaryto the givenOutputStream;toString()Methods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
POSDictionary
public POSDictionary()Initializes an empty case sensitivePOSDictionary. -
POSDictionary
public POSDictionary(boolean caseSensitive) Initializes an emptyPOSDictionary.- Parameters:
caseSensitive-trueif thePOSDictionaryis case sensitive,falseotherwise.
-
-
Method Details
-
getTags
-
iterator
-
serialize
Writes thePOSDictionaryto the givenOutputStream;After the serialization is finished the provided
OutputStreamremains open.- Parameters:
out- theOutputStreamto write the dictionary into.- Throws:
IOException- Throw if writing to theOutputStreamfails
-
hashCode
-
equals
-
toString
-
create
Creates a newPOSDictionaryfrom anInputStream.After creation is finished the provided
InputStreamis closed.- Parameters:
in- TheInputStreamused for creating thePOSDictionary. The stream must be open and have bytes available to read from.- Returns:
- A valid
POSDictionaryinstance. - Throws:
IOException- Thrown if IO errors occurred during creation.opennlp.tools.util.InvalidFormatException- Thrown if the entries don't have exactly one token.
-
put
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitivein interfaceopennlp.tools.postag.TagDictionary
-
getArtifactSerializerClass
- Specified by:
getArtifactSerializerClassin interfaceopennlp.tools.util.model.SerializableArtifact
-