Interface LanguageBreakEngine
- All Known Implementing Classes:
BurmeseBreakEngine, CjkBreakEngine, DictionaryBreakEngine, KhmerBreakEngine, LaoBreakEngine, LSTMBreakEngine, ThaiBreakEngine, UnhandledBreakEngine
public interface LanguageBreakEngine
The LanguageBreakEngine interface is to be used to implement any
language-specific logic for break iteration.
-
Method Summary
Modifier and TypeMethodDescriptionintfindBreaks(CharacterIterator text, int startPos, int endPos, DictionaryBreakEngine.DequeI foundBreaks, boolean isPhraseBreaking) Implements the actual breaking logic.booleanhandles(int c)
-
Method Details
-
handles
boolean handles(int c) - Parameters:
c- A Unicode codepoint value- Returns:
- true if the engine can handle this character, false otherwise
-
findBreaks
int findBreaks(CharacterIterator text, int startPos, int endPos, DictionaryBreakEngine.DequeI foundBreaks, boolean isPhraseBreaking) Implements the actual breaking logic. Find any breaks within a run in the supplied text.- 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
-