Class HunspellStemmer.Analysis

java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellStemmer.Analysis
Enclosing class:
HunspellStemmer

private final class HunspellStemmer.Analysis extends Object
One case-variant analysis with request-local result storage.
  • Field Details

    • surface

      private final String surface
    • variant

      private final String variant
    • stems

      private final HunspellStemmer.Results stems
    • allCaps

      private final boolean allCaps
      Whether the input is all uppercase, in which case the hidden capitalized forms of mixed-case entries also match.
  • Constructor Details

    • Analysis

      private Analysis(String surface, String variant, HunspellStemmer.Results stems, boolean allCaps)
      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

      private List<int[]> lookup(String word)
      Looks up a spelling, including hidden capitalized forms for all-uppercase input.
      Parameters:
      word - The spelling to look up.
      Returns:
      The flag sets, or null when absent.
    • add

      private void add(String root, int[] flags, HunspellDictionary.Affix... affixes)
      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

      private void noteForbidden(List<int[]> flagSets, int flag)
      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.