Package opennlp.tools.util.featuregen
Class BrownCluster
- java.lang.Object
- 
- opennlp.tools.util.featuregen.BrownCluster
 
- 
- All Implemented Interfaces:
- SerializableArtifact
 
 public class BrownCluster extends Object implements SerializableArtifact Class to load a Brown cluster document: word\tword_class\tprob http://metaoptimize.com/projects/wordreprs/ 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 Modifier and Type Class Description static classBrownCluster.BrownClusterSerializer
 - 
Constructor SummaryConstructors Constructor Description BrownCluster(InputStream in)Generates the token to cluster map from Brown cluster input file.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getArtifactSerializerClass()Retrieves the class which can serialize and recreate this artifact.StringlookupToken(String string)Check if a token is in the Brown:paths, token map.voidserialize(OutputStream out)
 
- 
- 
- 
Constructor Detail- 
BrownClusterpublic BrownCluster(InputStream in) throws IOException Generates the token to cluster map from Brown cluster input file. NOTE: we only add those tokens with frequency bigger than 5.- Parameters:
- in- the inputstream
- Throws:
- IOException- the io exception
 
 
- 
 - 
Method Detail- 
lookupTokenpublic String lookupToken(String string) Check 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
 
 - 
serializepublic void serialize(OutputStream out) throws IOException - Throws:
- IOException
 
 - 
getArtifactSerializerClasspublic Class<?> getArtifactSerializerClass() Description copied from interface:SerializableArtifactRetrieves the class which can serialize and recreate this artifact.
 Note: The serializer class must have a public zero argument constructor or an exception is thrown during model serialization/loading.- Specified by:
- getArtifactSerializerClassin interface- SerializableArtifact
- Returns:
- the corresponding ArtifactSerializer class.
 
 
- 
 
-