Package opennlp.tools.stemmer.hunspell
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thebeginrecord component.private final intThe field for thebeginFlagrecord component.private final StringThe field for theendrecord component.private final intThe field for theendFlagrecord component.private final StringThe field for thereplacementrecord component.private final booleanThe field for theunaffixedrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCompoundPattern(String end, int endFlag, String begin, int beginFlag, boolean unaffixed, String replacement) Creates an instance of aCompoundPatternrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbegin()Returns the value of thebeginrecord component.intReturns the value of thebeginFlagrecord component.end()Returns the value of theendrecord component.intendFlag()Returns the value of theendFlagrecord component.final booleanIndicates whether some other object is "equal to" this one.private booleanhasBoundaryFlag(int[] flags, List<HunspellDictionary.Affix> affixes, int required) Tests entry and continuation flags for a boundary condition.final inthashCode()Returns a hash code value for this object.(package private) booleanmatches(String left, int[] leftFlags, String right, int[] rightFlags, List<HunspellDictionary.Affix> leftAffixes, List<HunspellDictionary.Affix> rightAffixes) Checks the selected readings at a junction.Returns the value of thereplacementrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theunaffixedrecord component.
-
Field Details
-
end
The field for theendrecord component. -
endFlag
private final int endFlagThe field for theendFlagrecord component. -
begin
The field for thebeginrecord component. -
beginFlag
private final int beginFlagThe field for thebeginFlagrecord component. -
unaffixed
private final boolean unaffixedThe field for theunaffixedrecord component. -
replacement
The field for thereplacementrecord component.
-
-
Constructor Details
-
CompoundPattern
CompoundPattern(String end, int endFlag, String begin, int beginFlag, boolean unaffixed, String replacement) Creates an instance of aCompoundPatternrecord class.- Parameters:
end- the value for theendrecord componentendFlag- the value for theendFlagrecord componentbegin- the value for thebeginrecord componentbeginFlag- the value for thebeginFlagrecord componentunaffixed- the value for theunaffixedrecord componentreplacement- the value for thereplacementrecord 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
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
endFlag
public int endFlag()Returns the value of theendFlagrecord component.- Returns:
- the value of the
endFlagrecord component
-
begin
Returns the value of thebeginrecord component.- Returns:
- the value of the
beginrecord component
-
beginFlag
public int beginFlag()Returns the value of thebeginFlagrecord component.- Returns:
- the value of the
beginFlagrecord component
-
unaffixed
public boolean unaffixed()Returns the value of theunaffixedrecord component.- Returns:
- the value of the
unaffixedrecord component
-
replacement
Returns the value of thereplacementrecord component.- Returns:
- the value of the
replacementrecord component
-