Package com.ibm.icu.impl
Class SimpleFilteredSentenceBreakIterator.Builder
- java.lang.Object
-
- com.ibm.icu.text.FilteredBreakIteratorBuilder
-
- com.ibm.icu.impl.SimpleFilteredSentenceBreakIterator.Builder
-
- Enclosing class:
- SimpleFilteredSentenceBreakIterator
public static class SimpleFilteredSentenceBreakIterator.Builder extends FilteredBreakIteratorBuilder
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
AddToForward
private java.util.HashSet<java.lang.CharSequence>
filterSet
filter set to store all exceptions(package private) static int
MATCH
(package private) static int
PARTIAL
(package private) static int
SuppressInReverse
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
suppressBreakAfter(java.lang.CharSequence str)
Suppress a certain string from being the end of a segment.boolean
unsuppressBreakAfter(java.lang.CharSequence str)
Stop suppressing a certain string from being the end of the segment.BreakIterator
wrapIteratorWithFilter(BreakIterator adoptBreakIterator)
Wrap (adopt) an existing break iterator in a new filtered instance.-
Methods inherited from class com.ibm.icu.text.FilteredBreakIteratorBuilder
getEmptyInstance, getInstance, getInstance
-
-
-
-
Field Detail
-
filterSet
private java.util.HashSet<java.lang.CharSequence> filterSet
filter set to store all exceptions
-
PARTIAL
static final int PARTIAL
- See Also:
- Constant Field Values
-
MATCH
static final int MATCH
- See Also:
- Constant Field Values
-
SuppressInReverse
static final int SuppressInReverse
- See Also:
- Constant Field Values
-
AddToForward
static final int AddToForward
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Builder
public Builder(java.util.Locale loc)
-
Builder
public Builder(ULocale loc)
Create SimpleFilteredBreakIteratorBuilder using given locale- Parameters:
loc
- the locale to get filtered iterators
-
Builder
public Builder()
Create SimpleFilteredBreakIteratorBuilder with no exception
-
-
Method Detail
-
suppressBreakAfter
public boolean suppressBreakAfter(java.lang.CharSequence str)
Description copied from class:FilteredBreakIteratorBuilder
Suppress a certain string from being the end of a segment. For example, suppressing "Mr.", then segments ending in "Mr." will not be returned by the iterator.- Specified by:
suppressBreakAfter
in classFilteredBreakIteratorBuilder
- Parameters:
str
- the string to suppress, such as "Mr."- Returns:
- true if the string was not present and now added, false if the call was a no-op because the string was already being suppressed.
-
unsuppressBreakAfter
public boolean unsuppressBreakAfter(java.lang.CharSequence str)
Description copied from class:FilteredBreakIteratorBuilder
Stop suppressing a certain string from being the end of the segment. This function does not create any new segment boundaries, but only serves to un-do the effect of earlier calls to suppressBreakAfter, or to un-do the effect of locale data which may be suppressing certain strings.- Specified by:
unsuppressBreakAfter
in classFilteredBreakIteratorBuilder
- Parameters:
str
- the str the string to unsuppress, such as "Mr."- Returns:
- true if the string was present and now removed, false if the call was a no-op because the string was not being suppressed.
-
wrapIteratorWithFilter
public BreakIterator wrapIteratorWithFilter(BreakIterator adoptBreakIterator)
Description copied from class:FilteredBreakIteratorBuilder
Wrap (adopt) an existing break iterator in a new filtered instance. Note that the wrappedBreakIterator is adopted by the new BreakIterator and should no longer be used by the caller. The FilteredBreakIteratorBuilder may be reused.- Specified by:
wrapIteratorWithFilter
in classFilteredBreakIteratorBuilder
- Parameters:
adoptBreakIterator
- the break iterator to wrap- Returns:
- the new BreakIterator
-
-