|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.icu.text.BreakIterator
com.ibm.icu.text.RuleBasedBreakIterator
com.ibm.icu.text.RuleBasedBreakIterator_New
Rule Based Break Iterator implementation. This is a port of the C++ class RuleBasedBreakIterator from ICU4C. A note on future plans: Once a new DictionaryBasedBreakIterator implementation is completed, the archaic implementation class RuleBasedBreakIterator_Old can be completely removed, and this class can be renamed to be simply RuleBasedBreakIterator.
| Field Summary | |
static boolean |
fTrace
Debugging flag. |
| Fields inherited from class com.ibm.icu.text.RuleBasedBreakIterator |
WORD_IDEO, WORD_IDEO_LIMIT, WORD_KANA, WORD_KANA_LIMIT, WORD_LETTER, WORD_LETTER_LIMIT, WORD_NONE, WORD_NONE_LIMIT, WORD_NUMBER, WORD_NUMBER_LIMIT |
| Fields inherited from class com.ibm.icu.text.BreakIterator |
DONE, KIND_CHARACTER, KIND_LINE, KIND_SENTENCE, KIND_TITLE, KIND_WORD |
| Method Summary | |
protected static void |
checkOffset(int offset,
java.text.CharacterIterator text)
Throw IllegalArgumentException unless begin <= offset < end. |
java.lang.Object |
clone()
Clones this iterator. |
int |
current()
Returns the current iteration position. |
void |
dump()
Dump the contents of the state table and character classes for this break iterator. |
boolean |
equals(java.lang.Object that)
Returns true if both BreakIterators are of the same class, have the same rules, and iterate over the same text. |
int |
first()
Sets the current iteration position to the beginning of the text. |
int |
following(int offset)
Sets the iterator to refer to the first boundary position following the specified position. |
static RuleBasedBreakIterator |
getInstanceFromCompiledRules(java.io.InputStream is)
Create a break iterator from a precompiled set of rules. |
int |
getRuleStatus()
Return the status tag from the break rule that determined the most recently returned break position. |
int |
getRuleStatusVec(int[] fillInArray)
Get the status (tag) values from the break rule(s) that determined the most recently returned break position. |
java.text.CharacterIterator |
getText()
Return a CharacterIterator over the text being analyzed. |
int |
hashCode()
Compute a hashcode for this BreakIterator |
boolean |
isBoundary(int offset)
Returns true if the specfied position is a boundary position. |
int |
last()
Sets the current iteration position to the end of the text. |
int |
next()
Advances the iterator to the next boundary position. |
int |
next(int n)
Advances the iterator either forward or backward the specified number of steps. |
int |
preceding(int offset)
Sets the iterator to refer to the last boundary position before the specified position. |
int |
previous()
Moves the iterator backwards, to the last boundary preceding this one. |
void |
setText(java.text.CharacterIterator newText)
Set the iterator to analyze a new piece of text. |
java.lang.String |
toString()
Returns the description (rules) used to create this iterator. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static boolean fTrace
| Method Detail |
public void dump()
public java.lang.Object clone()
clone in class RuleBasedBreakIteratorpublic boolean equals(java.lang.Object that)
equals in class RuleBasedBreakIteratorpublic java.lang.String toString()
toString in class RuleBasedBreakIteratorpublic int hashCode()
hashCode in class RuleBasedBreakIterator
public static RuleBasedBreakIterator getInstanceFromCompiledRules(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic int first()
first in class RuleBasedBreakIteratorpublic int last()
last in class RuleBasedBreakIteratorpublic int next(int n)
next in class RuleBasedBreakIteratorn - The number of steps to move. The sign indicates the direction
(negative is backwards, and positive is forwards).
public int next()
next in class RuleBasedBreakIteratorpublic int previous()
previous in class RuleBasedBreakIteratorpublic int following(int offset)
following in class RuleBasedBreakIteratoroffset - The position from which to begin searching for a break position.
public int preceding(int offset)
preceding in class RuleBasedBreakIteratoroffset - The position to begin searching for a break from.
protected static final void checkOffset(int offset,
java.text.CharacterIterator text)
public boolean isBoundary(int offset)
isBoundary in class RuleBasedBreakIteratoroffset - the offset to check.
public int current()
current in class RuleBasedBreakIteratorpublic int getRuleStatus()
Of the standard types of ICU break iterators, only the word break
iterator provides status values. The values are defined in
class RuleBasedBreakIterator, and allow distinguishing between words
that contain alphabetic letters, "words" that appear to be numbers,
punctuation and spaces, words containing ideographic characters, and
more. Call
getRuleStatus after obtaining a boundary
position from next(), previous(), or
any other break iterator functions that returns a boundary position.
getRuleStatus in class RuleBasedBreakIterator
public int getRuleStatusVec(int[] fillInArray)
The status values used by the standard ICU break rules are defined as public constants in class RuleBasedBreakIterator.
If the size of the output array is insufficient to hold the data, the output will be truncated to the available length. No exception will be thrown.
getRuleStatusVec in class RuleBasedBreakIteratorfillInArray - an array to be filled in with the status values.
public java.text.CharacterIterator getText()
getText in class RuleBasedBreakIteratorpublic void setText(java.text.CharacterIterator newText)
setText in class RuleBasedBreakIteratornewText - An iterator over the text to analyze.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||