Record Class HunspellDictionary.Affix

java.lang.Object
java.lang.Record
opennlp.tools.stemmer.hunspell.HunspellDictionary.Affix
Record Components:
flag - The flag naming the rule's block, which an entry carries to accept it.
crossProduct - Whether the rule may combine with an affix of the opposite kind.
strip - The stem material the rule replaces, restored during analysis.
affix - The surface material the rule adds to the stem.
condition - The condition the stem must satisfy for the rule to apply.
continuation - The flags of the further affixes that may stack on this one.
suffix - Whether the rule adds a suffix.
morphology - The expanded morphological fields, empty when the rule declares none.
flagText - The flag as written in the rule, reported as the fl: field of a rule without morphological fields.
Enclosing class:
HunspellDictionary

static record HunspellDictionary.Affix(int flag, boolean crossProduct, String strip, String affix, AffixCondition condition, int[] continuation, boolean suffix, List<String> morphology, String flagText) extends Record
One parsed affix rule of a PFX or SFX block.
  • Field Details

    • flag

      private final int flag
      The field for the flag record component.
    • crossProduct

      private final boolean crossProduct
      The field for the crossProduct record component.
    • strip

      private final String strip
      The field for the strip record component.
    • affix

      private final String affix
      The field for the affix record component.
    • condition

      private final AffixCondition condition
      The field for the condition record component.
    • continuation

      private final int[] continuation
      The field for the continuation record component.
    • suffix

      private final boolean suffix
      The field for the suffix record component.
    • morphology

      private final List<String> morphology
      The field for the morphology record component.
    • flagText

      private final String flagText
      The field for the flagText record component.
  • Constructor Details

    • Affix

      Affix(int flag, boolean crossProduct, String strip, String affix, AffixCondition condition, int[] continuation, boolean suffix, List<String> morphology, String flagText)
      Creates an instance of a Affix record class.
      Parameters:
      flag - the value for the flag record component
      crossProduct - the value for the crossProduct record component
      strip - the value for the strip record component
      affix - the value for the affix record component
      condition - the value for the condition record component
      continuation - the value for the continuation record component
      suffix - the value for the suffix record component
      morphology - the value for the morphology record component
      flagText - the value for the flagText record component
  • Method Details

    • analysisFields

      List<String> analysisFields()
      Returns the morphological fields, or the fl: flag field when none are declared.
      Returns:
      the morphological fields, or the fl: flag field when none are declared
    • allowsContinuation

      boolean allowsContinuation(int otherFlag)
      Checks whether a further affix may stack on this one.
      Parameters:
      otherFlag - The stacking affix's flag.
      Returns:
      true if this affix's continuation classes allow it.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • flag

      public int flag()
      Returns the value of the flag record component.
      Returns:
      the value of the flag record component
    • crossProduct

      public boolean crossProduct()
      Returns the value of the crossProduct record component.
      Returns:
      the value of the crossProduct record component
    • strip

      public String strip()
      Returns the value of the strip record component.
      Returns:
      the value of the strip record component
    • affix

      public String affix()
      Returns the value of the affix record component.
      Returns:
      the value of the affix record component
    • condition

      public AffixCondition condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component
    • continuation

      public int[] continuation()
      Returns the value of the continuation record component.
      Returns:
      the value of the continuation record component
    • suffix

      public boolean suffix()
      Returns the value of the suffix record component.
      Returns:
      the value of the suffix record component
    • morphology

      public List<String> morphology()
      Returns the value of the morphology record component.
      Returns:
      the value of the morphology record component
    • flagText

      public String flagText()
      Returns the value of the flagText record component.
      Returns:
      the value of the flagText record component