org.maltparser.parser.guide.feature
Class Feature
java.lang.Object
org.maltparser.parser.guide.feature.Feature
- Direct Known Subclasses:
- AtomicFeature, SplitFeature, SuffixFeature
public abstract class Feature
- extends Object
- Since:
- 1.0
- Author:
- Johan Hall
featureValues
protected SortedMap<Integer,String> featureValues
cardinality
protected int cardinality
featureKnown
protected Map<Integer,Boolean> featureKnown
nullValue
protected boolean nullValue
parsingAlgorithm
protected ParsingAlgorithm parsingAlgorithm
Feature
public Feature()
throws MaltChainedException
- Throws:
MaltChainedException
init
public void init()
throws MaltChainedException
- Throws:
MaltChainedException
initialize
public void initialize(ParsingAlgorithm parsingAlgorithm)
throws MaltChainedException
- Throws:
MaltChainedException
setParsingAlgorithm
protected void setParsingAlgorithm(ParsingAlgorithm parsingAlgorithm)
getCardinality
public int getCardinality()
- Returns the cardinality (the number of distinct values) of the feature
- Returns:
- the cardinality (the number of distinct values) of the feature
setCardinality
public void setCardinality(int cardinality)
- Sets the cardinality (the number of distinct values) of the feature
- Parameters:
cardinality
- the cardinality (the number of distinct values)
update
public abstract void update()
throws MaltChainedException
- Throws:
MaltChainedException
init
public abstract boolean init(String spec)
throws MaltChainedException
- Throws:
MaltChainedException
updateCardinality
public abstract void updateCardinality()
throws MaltChainedException
- Throws:
MaltChainedException
getStringValue
public abstract String getStringValue(Integer value)
throws MaltChainedException
- Throws:
MaltChainedException
getIntegerValue
public abstract Integer getIntegerValue(String value)
throws MaltChainedException
- Throws:
MaltChainedException
setValue
public abstract void setValue(Integer value)
throws MaltChainedException
- Throws:
MaltChainedException
setValue
public abstract void setValue(String value)
throws MaltChainedException
- Throws:
MaltChainedException
getValues
public Map<Integer,String> getValues()
getIntegerValues
public Set<Integer> getIntegerValues()
getFirstIntegerValue
public Integer getFirstIntegerValue()
getStringValues
public Set<String> getStringValues()
getFirstStringValue
public String getFirstStringValue()
isKnown
public boolean isKnown(int value)
isNullValue
public boolean isNullValue()
getParsingAlgorithm
protected ParsingAlgorithm getParsingAlgorithm()
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright 2007 Johan Hall, Jens Nilsson and Joakim Nivre.