Package com.ibm.icu.segmenter
Class RuleBasedSegmenter
- java.lang.Object
-
- com.ibm.icu.segmenter.RuleBasedSegmenter
-
- All Implemented Interfaces:
Segmenter
public class RuleBasedSegmenter extends Object implements Segmenter
Performs segmentation according to the provided rule string. The rule string must follow the same guidelines as forRuleBasedBreakIterator(String)
.- Status:
- Draft ICU 78.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuleBasedSegmenter.Builder
Builder forRuleBasedSegmenter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RuleBasedSegmenter.Builder
builder()
Segments
segment(CharSequence s)
Returns aSegments
object that encapsulates the segmentation of the inputCharSequence
.
-
-
-
Method Detail
-
segment
public Segments segment(CharSequence s)
Returns aSegments
object that encapsulates the segmentation of the inputCharSequence
. TheSegments
object, in turn, provides the main APIs to support traversal over the resulting segments and boundaries via the JavaStream
abstraction.- Specified by:
segment
in interfaceSegmenter
- Parameters:
s
- inputCharSequence
on which segmentation is performed. The input must not be modified while using the resultingSegments
object.- Returns:
- A
Segments
object with APIs to access the results of segmentation, including APIs that returnStream
s of the segments and boundaries. - Status:
- Draft ICU 78.
-
builder
public static RuleBasedSegmenter.Builder builder()
- Returns:
- a builder for constructing
RuleBasedSegmenter
- Status:
- Draft ICU 78.
-
-