Package opennlp.tools.stemmer.hunspell
Class HunspellDictionary.BoundaryIndex
java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellDictionary.BoundaryIndex
- Enclosing class:
HunspellDictionary
An immutable index of affix rules keyed by the boundary code point of their affix
material, answering each lookup by binary search so the per-word scans in
HunspellStemmer allocate nothing.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]The boundary code points, sorted ascending.private final List<List<HunspellDictionary.Affix>> The rule bucket for each boundary, aligned withboundaries. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBoundaryIndex(Map<Integer, List<HunspellDictionary.Affix>> byBoundary) Initializes the index from mutable buckets, freezing each one. -
Method Summary
Modifier and TypeMethodDescription(package private) List<HunspellDictionary.Affix> bucket(int codePoint) The rules bucketed under a boundary code point.
-
Field Details
-
boundaries
private final int[] boundariesThe boundary code points, sorted ascending. -
buckets
The rule bucket for each boundary, aligned withboundaries.
-
-
Constructor Details
-
BoundaryIndex
Initializes the index from mutable buckets, freezing each one.- Parameters:
byBoundary- The rule buckets keyed by boundary code point.
-
-
Method Details
-
bucket
The rules bucketed under a boundary code point.- Parameters:
codePoint- The boundary code point to look up.- Returns:
- The bucket, possibly empty. Never
null.
-