Interface AffixCondition
interface AffixCondition
Checks the "condition" part of affix definition, as in
PFX flag stripping prefix [condition [morphological_fields...]]
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AffixConditionstatic final AffixConditionstatic final String -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsStem(char[] word, int offset, int length) default booleanacceptsStem(String stem) static AffixConditionAnalyzes the given affix kind, strip and condition and returns an object able to efficiently check that condition.private static intcountCharPatterns(String condition) private static StringescapeDash(String re) private static booleanprivate static AffixConditionregexpCondition(AffixKind kind, String condition, int charCount) private static intskipCharPattern(String condition, int pos) private static intskipCharPatterns(String condition, int count) private static AffixConditionsubstringCondition(AffixKind kind, String stemCondition) static String
-
Field Details
-
ALWAYS_TRUE_KEY
- See Also:
-
ALWAYS_TRUE
-
ALWAYS_FALSE
-
-
Method Details
-
acceptsStem
-
acceptsStem
boolean acceptsStem(char[] word, int offset, int length) - Returns:
- whether the given word matches this condition as a stem with both "strip" and "affix" removed
-
uniqueKey
- Returns:
- a key used to deduplicate same condition+strip+kind triples. For trivial conditions
that need no check,
ALWAYS_TRUE_KEYis returned.
-
compile
Analyzes the given affix kind, strip and condition and returns an object able to efficiently check that condition. -
skipCharPatterns
-
countCharPatterns
-
skipCharPattern
-
isRegexp
-
substringCondition
-
regexpCondition
-
escapeDash
-