Package com.ibm.icu.text
Class RuleBasedBreakIterator.DictionaryCache
java.lang.Object
com.ibm.icu.text.RuleBasedBreakIterator.DictionaryCache
- Enclosing class:
RuleBasedBreakIterator
DictionaryCache stores the boundaries obtained from a run of dictionary characters.
Dictionary boundaries are moved first to this cache, then from here
to the main BreakCache, where they may inter-leave with non-dictionary
boundaries. The public BreakIterator API always fetches directly
from the main BreakCache, not from here.
In common situations, the number of boundaries in a single dictionary run
should be quite small, it will be terminated by punctuation, spaces,
or any other non-dictionary characters. The main BreakCache may end
up with boundaries from multiple dictionary based runs.
The boundaries are stored in a simple ArrayList (vector), with the
assumption that they will be accessed sequentially.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) DictionaryBreakEngine.DequeI(package private) int(package private) int(package private) int(package private) int(package private) int(package private) int -
Constructor Summary
ConstructorsConstructorDescriptioncopy constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) booleanfollowing(int fromPos) (package private) voidpopulateDictionary(int startPos, int endPos, int firstRuleStatus, int otherRuleStatus) Populate the cache with the dictionary based boundaries within a region of text.(package private) booleanpreceding(int fromPos) (package private) voidreset()
-
Field Details
-
fBreaks
DictionaryBreakEngine.DequeI fBreaks -
fPositionInCache
int fPositionInCache -
fStart
int fStart -
fLimit
int fLimit -
fFirstRuleStatusIndex
int fFirstRuleStatusIndex -
fOtherRuleStatusIndex
int fOtherRuleStatusIndex -
fBoundary
int fBoundary -
fStatusIndex
int fStatusIndex
-
-
Constructor Details
-
DictionaryCache
DictionaryCache() -
DictionaryCache
DictionaryCache(RuleBasedBreakIterator.DictionaryCache src) copy constructor. Used by RuleBasedBreakIterator.clone().- Parameters:
src- the source object to be copied.
-
-
Method Details
-
reset
void reset() -
following
boolean following(int fromPos) -
preceding
boolean preceding(int fromPos) -
populateDictionary
void populateDictionary(int startPos, int endPos, int firstRuleStatus, int otherRuleStatus) Populate the cache with the dictionary based boundaries within a region of text.- Parameters:
startPos- The start position of a range of textendPos- The end position of a range of textfirstRuleStatus- The rule status index that applies to the break at startPosotherRuleStatus- The rule status index that applies to boundaries other than startPos
-