LBJ2.nlp
Class WordTypeInformation

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

public class WordTypeInformation
extends Classifier

This class implements a classifier that takes a Word as input and generates Boolean features representing interesting information about the forms of the words in a [-2, +2] window around the input word. The generated features include one that indicates if the entire input word consists only of capital letters, one that indicates if the entire input word consists only of digits, and one that indicates if the entire input word consists only of non-letters. The same features are also produced for the two words before and after the input word. 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
WordTypeInformation()
           
 
Method Summary
 java.lang.String[] allowableValues()
          Returns the array of allowable values that a feature returned by this classifier may take.
 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
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

WordTypeInformation

public WordTypeInformation()
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.

allowableValues

public java.lang.String[] allowableValues()
Description copied from class: Classifier
Returns the array of allowable values that a feature returned by this classifier may take. If the array has length 0, it means either that the feature has discrete type and allowable values were not specified or that the feature has real or mixed type. The default return value of this method is a 0 length array.

This method should be overridden by derived classes.

Overrides:
allowableValues in class Classifier
Returns:
The allowable values that a feature returned by this classifier may take.

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