types
Class Alphabet

java.lang.Object
  extended by types.Alphabet
All Implemented Interfaces:
Serializable

public class Alphabet
extends Object
implements Serializable

This class is used to map from some descriptive features (e.g. words in text) to an index in an array.

Author:
kuzman
See Also:
Serialized Form

Constructor Summary
Alphabet()
           
 
Method Summary
 Object lookupIndex(int ind)
           
 String lookupInt(int key)
          returns the string representation of feature associated with a index.
 int lookupObject(Object feature)
          returns the index associated with a feature.
 int size()
           
 void startGrowth()
           
 void stopGrowth()
          at test time, we need to stop the growth of the alphabet so we do not increase the size of the feature vector in case the user tries to use features not encountered at training time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Alphabet

public Alphabet()
Method Detail

lookupObject

public int lookupObject(Object feature)
returns the index associated with a feature. This should be the same for all features a,b where a.equals(b).

Parameters:
feature -
Returns:
the index corresponding to the feature

lookupIndex

public Object lookupIndex(int ind)

stopGrowth

public void stopGrowth()
at test time, we need to stop the growth of the alphabet so we do not increase the size of the feature vector in case the user tries to use features not encountered at training time.


startGrowth

public void startGrowth()

size

public int size()

lookupInt

public String lookupInt(int key)
returns the string representation of feature associated with a index. This should be the same for all features a,b where a.equals(b).

Parameters:
index - of feature
Returns:
the String representation of a feature


Copyright © 2009. All Rights Reserved.