public class Sentence extends Object
| Constructor and Description |
|---|
Sentence(char[] characters)
Creates a sentence with the given characters
|
Sentence(String text)
Creates a sentence with the given string
|
| Modifier and Type | Method and Description |
|---|---|
char[] |
getCharacters()
Returns the underlying characters of this Sentence
|
Reading |
getReadingConstraint(int position)
Gets the reading constraint at the given position, if any
|
SentenceIterator |
iterator()
Returns a SentenceIterator that obeys the defined breaking ignore spans,
reading constraints, and skips space characters
|
void |
removeReadingConstraint(int position)
Removes the reading constraint at the given position, if any
|
void |
setBreakingIgnoreSpan(int position,
short length)
Sets a breaking ignore span.
|
void |
setReadingConstraint(Reading constraint)
Sets a reading constraint on the Sentence starting at
position |
SentenceIterator |
unconstrainedIterator(int position)
Returns a SentenceIterator that obeys the defined breaking ignore spans,
skips space characters, but ignores reading constraints
|
public Sentence(char[] characters)
characters - The sentence's characterspublic Sentence(String text)
text - The string containing the sentence's characterspublic void setBreakingIgnoreSpan(int position,
short length)
length characters starting at
position will be ignored during iteration; no iterated
subsequence of characters will cross the ignored span.position - The position of the ignore span to setlength - The length of the ignore span to setpublic void setReadingConstraint(Reading constraint)
position;
any existing constraints that overlap the new constraint will be removed.constraint - The constraint to setpublic Reading getReadingConstraint(int position)
position - The position to get the constraint atnullpublic void removeReadingConstraint(int position)
position - The position to remove the constraint frompublic SentenceIterator iterator()
public SentenceIterator unconstrainedIterator(int position)
position - The position to start iterating frompublic char[] getCharacters()