interface AffixCondition
Checks the "condition" part of affix definition, as in
PFX flag stripping prefix [condition [morphological_fields...]]
  • Field Details

  • Method Details

    • acceptsStem

      default boolean acceptsStem(String stem)
    • 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

      static String uniqueKey(AffixKind kind, String strip, String condition)
      Returns:
      a key used to deduplicate same condition+strip+kind triples. For trivial conditions that need no check, ALWAYS_TRUE_KEY is returned.
    • compile

      static AffixCondition compile(AffixKind kind, String strip, String condition, String line)
      Analyzes the given affix kind, strip and condition and returns an object able to efficiently check that condition.
    • skipCharPatterns

      private static int skipCharPatterns(String condition, int count)
    • countCharPatterns

      private static int countCharPatterns(String condition)
    • skipCharPattern

      private static int skipCharPattern(String condition, int pos)
    • isRegexp

      private static boolean isRegexp(String condition)
    • substringCondition

      private static AffixCondition substringCondition(AffixKind kind, String stemCondition)
    • regexpCondition

      private static AffixCondition regexpCondition(AffixKind kind, String condition, int charCount)
    • escapeDash

      private static String escapeDash(String re)