edu.stanford.nlp.sequences
Class FeatureFactory

java.lang.Object
  extended by edu.stanford.nlp.sequences.FeatureFactory
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NERFeatureFactory

public abstract class FeatureFactory
extends Object
implements Serializable

This is the abstract class that all feature factories must subclass. It also defines most of the basic Cliques that you would want to make features over. It contains a convenient method, getCliques(maxLeft, maxRight) which will give you all the cliques within the specified limits.

Author:
Jenny Finkel
See Also:
Serialized Form

Field Summary
static Clique cliqueC
           
static Clique cliqueCnC
           
static Clique cliqueCp2C
           
static Clique cliqueCp3C
           
static Clique cliqueCp4C
           
static Clique cliqueCp5C
           
static Clique cliqueCpC
           
static Clique cliqueCpCnC
           
static Clique cliqueCpCp2C
           
static Clique cliqueCpCp2Cp3C
           
static Clique cliqueCpCp2Cp3Cp4C
           
static Clique cliqueCpCp2Cp3Cp4Cp5C
           
protected  SeqClassifierFlags flags
           
static List<Clique> knownCliques
           
 
Constructor Summary
FeatureFactory()
           
 
Method Summary
protected  void addAllInterningAndSuffixing(Collection<String> accumulator, Collection<String> addend, String suffix)
          Makes more complete feature names out of partial feature names, by adding a suffix to the String feature name, adding results to an accumulator
abstract  Collection getCliqueFeatures(PaddedList<? extends CoreLabel> info, int position, Clique clique)
          This method returns a Collection of the features calculated for the word at the specified position in info (the list of words) for the specified Clique.
 Index<Clique> getCliques()
           
static Index<Clique> getCliques(int maxLeft, int maxRight)
           
 void init(SeqClassifierFlags flags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flags

protected SeqClassifierFlags flags

cliqueC

public static final Clique cliqueC

cliqueCpC

public static final Clique cliqueCpC

cliqueCp2C

public static final Clique cliqueCp2C

cliqueCp3C

public static final Clique cliqueCp3C

cliqueCp4C

public static final Clique cliqueCp4C

cliqueCp5C

public static final Clique cliqueCp5C

cliqueCpCp2C

public static final Clique cliqueCpCp2C

cliqueCpCp2Cp3C

public static final Clique cliqueCpCp2Cp3C

cliqueCpCp2Cp3Cp4C

public static final Clique cliqueCpCp2Cp3Cp4C

cliqueCpCp2Cp3Cp4Cp5C

public static final Clique cliqueCpCp2Cp3Cp4Cp5C

cliqueCnC

public static final Clique cliqueCnC

cliqueCpCnC

public static final Clique cliqueCpCnC

knownCliques

public static final List<Clique> knownCliques
Constructor Detail

FeatureFactory

public FeatureFactory()
Method Detail

init

public void init(SeqClassifierFlags flags)

getCliques

public Index<Clique> getCliques()

getCliques

public static Index<Clique> getCliques(int maxLeft,
                                       int maxRight)

getCliqueFeatures

public abstract Collection getCliqueFeatures(PaddedList<? extends CoreLabel> info,
                                             int position,
                                             Clique clique)
This method returns a Collection of the features calculated for the word at the specified position in info (the list of words) for the specified Clique. It should return the actual features, NOT wrapped in a Features object, as the wrapping will be done automatically. Because it takes a PaddedList you don't need to worry about indices which are outside of the list.

Parameters:
info - A PaddedList of the feature-value pairs
position - The current position to extract features at
clique - The particular clique for which to extract features. It should be a member of the knownCliques list.
Returns:
A Collection of the features calculated for the word at the specified position in info.

addAllInterningAndSuffixing

protected void addAllInterningAndSuffixing(Collection<String> accumulator,
                                           Collection<String> addend,
                                           String suffix)
Makes more complete feature names out of partial feature names, by adding a suffix to the String feature name, adding results to an accumulator

Parameters:
accumulator - The output features are added here
addend - The base set of features
suffix - The suffix added to each feature in the addend set


Stanford NLP Group