Interface AffixCondition


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

      • acceptsStem

        default boolean acceptsStem​(java.lang.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 java.lang.String uniqueKey​(AffixKind kind,
                                          java.lang.String strip,
                                          java.lang.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,
                                      java.lang.String strip,
                                      java.lang.String condition,
                                      java.lang.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​(java.lang.String condition,
                                            int count)
      • countCharPatterns

        private static int countCharPatterns​(java.lang.String condition)
      • skipCharPattern

        private static int skipCharPattern​(java.lang.String condition,
                                           int pos)
      • isRegexp

        private static boolean isRegexp​(java.lang.String condition)
      • substringCondition

        private static AffixCondition substringCondition​(AffixKind kind,
                                                         java.lang.String stemCondition)
      • regexpCondition

        private static AffixCondition regexpCondition​(AffixKind kind,
                                                      java.lang.String condition,
                                                      int charCount)
      • escapeDash

        private static java.lang.String escapeDash​(java.lang.String re)