Package opennlp.tools.util.featuregen
Class BrownCluster
java.lang.Object
opennlp.tools.util.featuregen.BrownCluster
- All Implemented Interfaces:
- SerializableArtifact
Class to load a Brown cluster document in the format: 
word\tword_class\tprob.
 Originally available at: http://metaoptimize.com/projects/wordreprs/.
Further details can be found in the related research paper.
 The file containing the clustering lexicon has to be passed as the
 value of the dict attribute of each BrownCluster feature generator.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionInstatiates aBrownClusterand its related token to cluster map via anInputStream.
- 
Method SummaryModifier and TypeMethodDescriptionClass<?>Retrieves the class which can serialize and recreate this artifact.lookupToken(String string) Check if a token is in the Brown:paths, token map.voidserialize(OutputStream out) 
- 
Constructor Details- 
BrownClusterInstatiates aBrownClusterand its related token to cluster map via anInputStream.- Parameters:
- in- A valid, open- InputStreamto read from.
- Throws:
- IOException- Thrown if errors occurred reading from- in.
 
 
- 
- 
Method Details- 
lookupTokenCheck if a token is in the Brown:paths, token map.- Parameters:
- string- the token to look-up
- Returns:
- the brown class if such token is in the brown cluster map.
 
- 
serialize- Throws:
- IOException
 
- 
getArtifactSerializerClassDescription copied from interface:SerializableArtifactRetrieves the class which can serialize and recreate this artifact.Note: The serializer class must have a public zero argument constructoror an exception is thrown during model serialization/loading.- Specified by:
- getArtifactSerializerClassin interface- SerializableArtifact
- Returns:
- The corresponding ArtifactSerializerclass.
 
 
-