public class Unifier
extends Object
| Constructor and Description |
|---|
Unifier()
Instantiates the unifier.
|
| Modifier and Type | Method and Description |
|---|---|
AnalyzedTokenReadings[] |
getFinalUnified()
Used for getting a unified sequence in case when simple test method
isUnified(org.languagetool.AnalyzedToken, java.util.Map, boolean, boolean)} was used. |
boolean |
getNegation() |
AnalyzedTokenReadings[] |
getUnifiedTokens()
Gets a full sequence of filtered tokens.
|
boolean |
isUnified(AnalyzedToken matchToken,
Map<String,List<String>> uFeatures,
boolean isUniNegated,
boolean lastReading)
Tests if the token sequence is unified.
|
void |
reset()
Resets after use of unification.
|
void |
setEquivalence(String feature,
String type,
Element elem)
Prepares equivalence types for features to be tested.
|
void |
setNegation(boolean neg) |
void |
startNextToken()
Call after every complete token (AnalyzedTokenReadings) checked.
|
void |
startUnify()
Starts testing only those equivalences that were previously matched.
|
public final void setEquivalence(String feature,
String type,
Element elem)
Elements. They create an equivalence set (with
abstraction).feature - Feature to be tested, like gender, grammatical case or number.type - Type of equivalence for the feature, for example plural, first
person, genitive.elem - Element specifying the equivalence.public final void startNextToken()
public final void startUnify()
public final void setNegation(boolean neg)
public final boolean getNegation()
public final void reset()
public final AnalyzedTokenReadings[] getUnifiedTokens()
public final boolean isUnified(AnalyzedToken matchToken, Map<String,List<String>> uFeatures, boolean isUniNegated, boolean lastReading)
matchToken - AnalyzedToken token to unifyisUniNegated - if true, then return negated resultlastReading - true when the matchToken is the last reading in the
AnalyzedReadingspublic final AnalyzedTokenReadings[] getFinalUnified()
isUnified(org.languagetool.AnalyzedToken, java.util.Map, boolean, boolean)} was used.AnalyzedTokenReadingsCopyright © 2005-2011 Daniel Naber