Record Class HunspellDictionary.CompoundPattern

java.lang.Object
java.lang.Record
opennlp.tools.stemmer.hunspell.HunspellDictionary.CompoundPattern
Record Components:
end - The left-side ending.
endFlag - The required left flag or zero.
begin - The right-side beginning.
beginFlag - The required right flag or zero.
unaffixed - Whether the left side must have no nonzero affix.
replacement - The simplified junction, or null.
Enclosing class:
HunspellDictionary

static record HunspellDictionary.CompoundPattern(String end, int endFlag, String begin, int beginFlag, boolean unaffixed, String replacement) extends Record
A compound-boundary restriction and optional spelling replacement.
  • Field Details

    • end

      private final String end
      The field for the end record component.
    • endFlag

      private final int endFlag
      The field for the endFlag record component.
    • begin

      private final String begin
      The field for the begin record component.
    • beginFlag

      private final int beginFlag
      The field for the beginFlag record component.
    • unaffixed

      private final boolean unaffixed
      The field for the unaffixed record component.
    • replacement

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

    • CompoundPattern

      CompoundPattern(String end, int endFlag, String begin, int beginFlag, boolean unaffixed, String replacement)
      Creates an instance of a CompoundPattern record class.
      Parameters:
      end - the value for the end record component
      endFlag - the value for the endFlag record component
      begin - the value for the begin record component
      beginFlag - the value for the beginFlag record component
      unaffixed - the value for the unaffixed record component
      replacement - the value for the replacement record component
  • Method Details

    • matches

      boolean matches(String left, int[] leftFlags, String right, int[] rightFlags, List<HunspellDictionary.Affix> leftAffixes, List<HunspellDictionary.Affix> rightAffixes)
      Checks the selected readings at a junction.
      Parameters:
      left - The left part spelling.
      leftFlags - The left entry flags.
      right - The right part spelling.
      rightFlags - The right entry flags.
      leftAffixes - The left part's affixes.
      rightAffixes - The right part's affixes.
      Returns:
      Whether this pattern applies.
    • hasBoundaryFlag

      private boolean hasBoundaryFlag(int[] flags, List<HunspellDictionary.Affix> affixes, int required)
      Tests entry and continuation flags for a boundary condition.
      Parameters:
      flags - The entry flags.
      affixes - The component's rules.
      required - The required flag, or zero for an unrestricted condition.
      Returns:
      Whether the selected reading satisfies the condition.
    • 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.
    • end

      public String end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • endFlag

      public int endFlag()
      Returns the value of the endFlag record component.
      Returns:
      the value of the endFlag record component
    • begin

      public String begin()
      Returns the value of the begin record component.
      Returns:
      the value of the begin record component
    • beginFlag

      public int beginFlag()
      Returns the value of the beginFlag record component.
      Returns:
      the value of the beginFlag record component
    • unaffixed

      public boolean unaffixed()
      Returns the value of the unaffixed record component.
      Returns:
      the value of the unaffixed record component
    • replacement

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