|
||||||||
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
public class RuleBasedBreakIterator
A subclass of BreakIterator whose behavior is specified using a list of rules.
Field Summary | |
---|---|
static int |
WORD_IDEO
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_IDEO_LIMIT
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_KANA
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_KANA_LIMIT
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_LETTER
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_LETTER_LIMIT
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_NONE
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_NONE_LIMIT
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_NUMBER
Deprecated. This is a draft API and might change in a future release of ICU. |
static int |
WORD_NUMBER_LIMIT
Deprecated. This is a draft API and might change in a future release of ICU. |
Fields inherited from class com.ibm.icu.text.BreakIterator |
---|
DONE, KIND_CHARACTER, KIND_LINE, KIND_SENTENCE, KIND_TITLE, KIND_WORD |
Constructor Summary | |
---|---|
protected |
RuleBasedBreakIterator()
This default constructor is used when creating derived classes of RulesBasedBreakIterator. |
|
RuleBasedBreakIterator(String description)
Constructs a RuleBasedBreakIterator_Old according to the description provided. |
Method Summary | |
---|---|
Object |
clone()
Clones this iterator. |
int |
current()
Returns the current iteration position. |
boolean |
equals(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(InputStream is)
Deprecated. This is a draft API and might change in a future release of ICU. |
int |
getRuleStatus()
Deprecated. This is a draft API and might change in a future release of ICU. |
int |
getRuleStatusVec(int[] fillInArray)
Deprecated. This is a draft API and might change in a future release of ICU. |
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()
Advances the iterator backwards, to the last boundary preceding this one. |
void |
setText(CharacterIterator newText)
Set the iterator to analyze a new piece of text. |
String |
toString()
Returns the description used to create this iterator |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int WORD_NONE
public static final int WORD_NONE_LIMIT
public static final int WORD_NUMBER
public static final int WORD_NUMBER_LIMIT
public static final int WORD_LETTER
public static final int WORD_LETTER_LIMIT
public static final int WORD_KANA
public static final int WORD_KANA_LIMIT
public static final int WORD_IDEO
public static final int WORD_IDEO_LIMIT
Constructor Detail |
---|
public RuleBasedBreakIterator(String description)
protected RuleBasedBreakIterator()
Method Detail |
---|
public static RuleBasedBreakIterator getInstanceFromCompiledRules(InputStream is) throws IOException
is
- An input stream that supplies the compiled rule data. The
format of the rule data on the stream is that of a rule data file
produced by the ICU4C tool "genbrk".
IOException
public Object clone()
clone
in class BreakIterator
public boolean equals(Object that)
equals
in class Object
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public int first()
first
in class BreakIterator
public int last()
last
in class BreakIterator
public int next(int n)
next
in class BreakIterator
n
- The number of steps to move. The sign indicates the direction
(negative is backwards, and positive is forwards).
public int next()
next
in class BreakIterator
public int previous()
previous
in class BreakIterator
public int following(int offset)
following
in class BreakIterator
offset
- The position from which to begin searching for a break position.
public int preceding(int offset)
preceding
in class BreakIterator
offset
- The position to begin searching for a break from.
public boolean isBoundary(int offset)
isBoundary
in class BreakIterator
offset
- the offset to check.
public int current()
current
in class BreakIterator
public int getRuleStatus()
The values used by the standard ICU break rules are defined as
constants in this class, 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.
public int getRuleStatusVec(int[] fillInArray)
The values used by the standard ICU rules are defined as contants in this class.
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.
fillInArray
- an array to be filled in with the status values.
public CharacterIterator getText()
getText
in class BreakIterator
public void setText(CharacterIterator newText)
setText
in class BreakIterator
newText
- An iterator over the text to analyze.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |