public class LengthGoalBreakIterator extends BreakIterator
BreakIterator
to skip past breaks that would result in passages that are too
short. It's still possible to get a short passage but only at the very end of the input text.
Important: This is not a general purpose BreakIterator
; it's only designed to work in a way
compatible with the UnifiedHighlighter
. Some assumptions are checked with Java assertions.
DONE
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
static LengthGoalBreakIterator |
createClosestToLength(BreakIterator baseIter,
int targetLength)
Breaks will be on average
targetLength apart; the closest break to this target (before or after)
is chosen. |
static LengthGoalBreakIterator |
createMinLength(BreakIterator baseIter,
int minLength)
Breaks will be at least
minLength apart (to the extent possible). |
int |
current() |
int |
first() |
int |
following(int followingIdx) |
CharacterIterator |
getText() |
boolean |
isBoundary(int offset) |
int |
last() |
int |
next() |
int |
next(int n) |
int |
preceding(int offset) |
int |
previous() |
void |
setText(CharacterIterator newText) |
void |
setText(String newText) |
String |
toString() |
getAvailableLocales, getCharacterInstance, getCharacterInstance, getLineInstance, getLineInstance, getSentenceInstance, getSentenceInstance, getWordInstance, getWordInstance
public static LengthGoalBreakIterator createMinLength(BreakIterator baseIter, int minLength)
minLength
apart (to the extent possible).public static LengthGoalBreakIterator createClosestToLength(BreakIterator baseIter, int targetLength)
targetLength
apart; the closest break to this target (before or after)
is chosen.public Object clone()
clone
in class BreakIterator
public CharacterIterator getText()
getText
in class BreakIterator
public void setText(String newText)
setText
in class BreakIterator
public void setText(CharacterIterator newText)
setText
in class BreakIterator
public int current()
current
in class BreakIterator
public int first()
first
in class BreakIterator
public int last()
last
in class BreakIterator
public int next(int n)
next
in class BreakIterator
public int next()
next
in class BreakIterator
public int previous()
previous
in class BreakIterator
public int following(int followingIdx)
following
in class BreakIterator
public int preceding(int offset)
preceding
in class BreakIterator
public boolean isBoundary(int offset)
isBoundary
in class BreakIterator
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.