LBJ2.nlp
Class Affixes

java.lang.Object
  extended by LBJ2.classify.Classifier
      extended by LBJ2.nlp.Affixes
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Affixes
extends Classifier

This class implements a classifier that takes a Word as input and generates features representing the prefixes and suffixes of the input word. The generated features include prefixes of length 3 and 4 and suffixes of lengths 1 through 4 of the input word only. If any of those words do not exist, the corresponding features aren't generated.

This class's implementation was automatically generated by the LBJ compiler.

See Also:
Serialized Form

Field Summary
private static java.lang.ThreadLocal cache
           
private static java.lang.ThreadLocal exampleCache
           
 
Fields inherited from class LBJ2.classify.Classifier
containingPackage, name
 
Constructor Summary
Affixes()
           
 
Method Summary
 FeatureVector classify(java.lang.Object __example)
          This method makes one or more decisions about a single object, returning those decisions as Features in a vector.
 FeatureVector[] classify(java.lang.Object[] examples)
          Use this method to make a batch of classification decisions about several objects.
static void clearCache()
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getInputType()
          Returns a string describing the input type of this classifier.
 java.lang.String getOutputType()
          Returns a string describing the output feature type of this classifier.
 int hashCode()
           
 
Methods inherited from class LBJ2.classify.Classifier
allowableValues, binaryRead, binaryRead, binaryRead, binaryRead, binaryWrite, binaryWrite, clone, discreteValue, discreteValueArray, getCompositeChildren, realValue, realValueArray, test, toString, valueIndexOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cache

private static java.lang.ThreadLocal cache

exampleCache

private static java.lang.ThreadLocal exampleCache
Constructor Detail

Affixes

public Affixes()
Method Detail

clearCache

public static void clearCache()

getInputType

public java.lang.String getInputType()
Description copied from class: Classifier
Returns a string describing the input type of this classifier. The type name must be fully specified (i.e. including its package name). For example, the default return value of this method is:
 "java.lang.Object" 
This method should be overridden by derived classes.

Overrides:
getInputType in class Classifier
Returns:
A string representation of the expected input type of this classifier.

getOutputType

public java.lang.String getOutputType()
Description copied from class: Classifier
Returns a string describing the output feature type of this classifier. It should either contain the basic type (discrete or real) and square brackets or a percent sign if the classifier returns an array or is a generator respectively, or simply mixed%. In the case that the basic type is discrete, the curly braces containing a list of allowable values should be omitted, as this list is provided by the allowableValues() method. The default return value of this method is:
 "discrete" 
This method should be overridden by derived classes.

Overrides:
getOutputType in class Classifier
Returns:
A string representation of the output feature type of this classifier.

classify

public FeatureVector classify(java.lang.Object __example)
Description copied from class: Classifier
This method makes one or more decisions about a single object, returning those decisions as Features in a vector.

Specified by:
classify in class Classifier
Parameters:
__example - The object to make decisions about.
Returns:
A vector of Features about the input object.

classify

public FeatureVector[] classify(java.lang.Object[] examples)
Description copied from class: Classifier
Use this method to make a batch of classification decisions about several objects. This function is implemented in the most naive way (simply calling classify(Object) repeatedly) and should be overridden if there is a more efficient implementation.

Overrides:
classify in class Classifier
Parameters:
examples - The objects to make decisions about.
Returns:
An array of feature vectors, one per input object.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object