edu.cmu.minorthird.classify
Class FeatureFactory

java.lang.Object
  extended by edu.cmu.minorthird.classify.FeatureFactory
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SGMFeatureFactory

public class FeatureFactory
extends java.lang.Object
implements java.io.Serializable

Creates Features, and maintains a mapping between Features and numeric ids. Also ensures that only a single feature instance exists with a particular name.

See Also:
Serialized Form

Nested Class Summary
protected  class FeatureFactory.CompactInstance
          A compact but immutable implementation of an instance.
 
Constructor Summary
FeatureFactory()
           
 
Method Summary
 Example compress(Example example)
          Return a version of the Example in which all features have been translated to canonical versions from the feature factory.
 FeatureFactory.CompactInstance compress(Instance instance)
          Return a version of the instance in which all features have been translated to canonical versions from the feature factory
 MultiExample compress(MultiExample example)
          Return a version of the MultiExample in which all features have been translated to canonical versions from the feature factory.
 boolean contains(Feature f)
           
 Feature getFeature(Feature f)
           
 Feature getFeature(int id)
           
 Feature getFeature(java.lang.String fullName)
           
 Feature getFeature(java.lang.String[] name)
           
 int getID(Feature feature)
           
 int getMaxFeatureIndex()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureFactory

public FeatureFactory()
Method Detail

getMaxFeatureIndex

public int getMaxFeatureIndex()

contains

public boolean contains(Feature f)

getFeature

public Feature getFeature(Feature f)

getFeature

public Feature getFeature(java.lang.String fullName)

getFeature

public Feature getFeature(java.lang.String[] name)

getFeature

public Feature getFeature(int id)

getID

public int getID(Feature feature)

compress

public FeatureFactory.CompactInstance compress(Instance instance)
Return a version of the instance in which all features have been translated to canonical versions from the feature factory


compress

public Example compress(Example example)
Return a version of the Example in which all features have been translated to canonical versions from the feature factory.


compress

public MultiExample compress(MultiExample example)
Return a version of the MultiExample in which all features have been translated to canonical versions from the feature factory.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object