Package opennlp.tools.stemmer.hunspell
Class HunspellStemmer.Analysis
java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellStemmer.Analysis
- Enclosing class:
HunspellStemmer
One case-variant analysis with request-local result storage.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAnalysis(String surface, String variant, HunspellStemmer.Results stems, boolean allCaps) Creates an analysis context. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidadd(String root, int[] flags, HunspellDictionary.Affix... affixes) Adds morphology-aware stems after case and warning checks.private List<int[]> Looks up a spelling, including hidden capitalized forms for all-uppercase input.private voidnoteForbidden(int[] flags, int flag) Records that an affix analysis reached a forbidden homonym.private voidnoteForbidden(List<int[]> flagSets, int flag) Records that an affix analysis reached a forbidden entry.
-
Field Details
-
surface
-
variant
-
stems
-
allCaps
private final boolean allCapsWhether the input is all uppercase, in which case the hidden capitalized forms of mixed-case entries also match.
-
-
Constructor Details
-
Analysis
Creates an analysis context.- Parameters:
surface- The input after conversion.variant- The current case variant.stems- The destination for recognized stems.allCaps- Whether the input is all uppercase.
-
-
Method Details
-
lookup
Looks up a spelling, including hidden capitalized forms for all-uppercase input.- Parameters:
word- The spelling to look up.- Returns:
- The flag sets, or
nullwhen absent.
-
add
Adds morphology-aware stems after case and warning checks.- Parameters:
root- The entry spelling.flags- The selected flags.affixes- The rules in application order.
-
noteForbidden
Records that an affix analysis reached a forbidden entry.- Parameters:
flagSets- The stem's flag sets.flag- The removed affix's flag.
-
noteForbidden
private void noteForbidden(int[] flags, int flag) Records that an affix analysis reached a forbidden homonym.- Parameters:
flags- One entry's flag set.flag- The removed affix's flag.
-