|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectUnifier
public class Unifier
Implements unification of features over tokens.
| Constructor Summary | |
|---|---|
Unifier()
Instantiates the unifier. |
|
| Method Summary | |
|---|---|
AnalyzedTokenReadings[] |
getFinalUnified()
Used for getting a unified sequence in case when simple test method isUnified(de.danielnaber.languagetool.AnalyzedToken, java.lang.String, java.lang.String, boolean, boolean) was used. |
boolean |
getNegation()
|
AnalyzedTokenReadings[] |
getUnifiedTokens()
Gets a full sequence of filtered tokens. |
boolean |
isSatisfied(AnalyzedToken aToken,
String feature,
String type)
Tests if a token has shared features with other tokens. |
boolean |
isUnified(AnalyzedToken matchToken,
String feature,
String type,
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. |
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Unifier()
| Method Detail |
|---|
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 boolean isSatisfied(AnalyzedToken aToken,
String feature,
String type)
aToken - - token to be testedfeature - - feature to be testedtype - - type of equivalence relation for the feature
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,
String feature,
String type,
boolean isUniNegated,
boolean lastReading)
matchToken - AnalyzedToken token to unifyfeature - String: feature to unify overtype - String: value types of the featureisUniNegated - if true, then return negated resultlastReading - true when the matchToken is the last reading in the
AnalyzedReadings
public final AnalyzedTokenReadings[] getFinalUnified()
isUnified(de.danielnaber.languagetool.AnalyzedToken, java.lang.String, java.lang.String, boolean, boolean) was used.
AnalyzedTokenReadings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||