Package com.ibm.icu.impl.breakiter
Class DictionaryBreakEngine
- java.lang.Object
-
- com.ibm.icu.impl.breakiter.DictionaryBreakEngine
-
- All Implemented Interfaces:
LanguageBreakEngine
- Direct Known Subclasses:
BurmeseBreakEngine
,CjkBreakEngine
,KhmerBreakEngine
,LaoBreakEngine
,LSTMBreakEngine
,ThaiBreakEngine
public abstract class DictionaryBreakEngine extends java.lang.Object implements LanguageBreakEngine
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DictionaryBreakEngine.DequeI
A deque-like structure holding raw ints.(package private) static class
DictionaryBreakEngine.PossibleWord
-
Field Summary
Fields Modifier and Type Field Description (package private) UnicodeSet
fSet
-
Constructor Summary
Constructors Constructor Description DictionaryBreakEngine()
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract int
divideUpDictionaryRange(java.text.CharacterIterator text, int rangeStart, int rangeEnd, DictionaryBreakEngine.DequeI foundBreaks, boolean isPhraseBreaking)
Divide up a range of known dictionary characters handled by this break engine.int
findBreaks(java.text.CharacterIterator text, int startPos, int endPos, DictionaryBreakEngine.DequeI foundBreaks, boolean isPhraseBreaking)
Implements the actual breaking logic.boolean
handles(int c)
(package private) void
setCharacters(UnicodeSet set)
-
-
-
Field Detail
-
fSet
UnicodeSet fSet
-
-
Method Detail
-
handles
public boolean handles(int c)
- Specified by:
handles
in interfaceLanguageBreakEngine
- Parameters:
c
- A Unicode codepoint value- Returns:
- true if the engine can handle this character, false otherwise
-
findBreaks
public int findBreaks(java.text.CharacterIterator text, int startPos, int endPos, DictionaryBreakEngine.DequeI foundBreaks, boolean isPhraseBreaking)
Description copied from interface:LanguageBreakEngine
Implements the actual breaking logic. Find any breaks within a run in the supplied text.- Specified by:
findBreaks
in interfaceLanguageBreakEngine
- Parameters:
text
- The text to break over. The iterator is left at the end of the run of characters which the engine has handled.startPos
- The index of the beginning of the rangeendPos
- The index of the possible end of our range. It is possible, however, that the range ends earlierfoundBreaks
- A data structure to receive the break positions.- Returns:
- the number of breaks found
-
setCharacters
void setCharacters(UnicodeSet set)
-
divideUpDictionaryRange
abstract int divideUpDictionaryRange(java.text.CharacterIterator text, int rangeStart, int rangeEnd, DictionaryBreakEngine.DequeI foundBreaks, boolean isPhraseBreaking)
Divide up a range of known dictionary characters handled by this break engine.
- Parameters:
text
- A UText representing the textrangeStart
- The start of the range of dictionary charactersrangeEnd
- The end of the range of dictionary charactersfoundBreaks
- Output of break positions. Positions are pushed. Pre-existing contents of the output stack are unaltered.- Returns:
- The number of breaks found
-
-