Class BrownCluster

Namespace
NOpenNLP.Tools.Util.Featuregen
Assembly
NOpenNLP.Tools.dll

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.

public class BrownCluster : ISerializableArtifact
Inheritance
BrownCluster
Implements
Inherited Members

Constructors

BrownCluster(Stream)

Generates the token to cluster map from Brown cluster input file. NOTE: we only add those tokens with frequency bigger than 5.

public BrownCluster(Stream @in)

Parameters

in Stream

the inputstream

Exceptions

IOException

the io exception

Properties

ArtifactSerializerClass

Retrieves 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.

public virtual Type ArtifactSerializerClass { get; }

Property Value

Type

the corresponding IArtifactSerializer class.

Methods

LookupToken(string)

Check if a token is in the Brown:paths, token map.

public virtual string? LookupToken(string @string)

Parameters

string string

the token to look-up

Returns

string

the brown class if such token is in the brown cluster map

Serialize(Stream)

Writes the cluster dictionary to the given Stream.

public virtual void Serialize(Stream @out)

Parameters

out Stream

the Stream to write the dictionary into.

Exceptions

IOException