Package com.ibm.icu.segmenter
Interface Segmenter
-
- All Known Implementing Classes:
LocalizedSegmenter,RuleBasedSegmenter
public interface SegmenterAn interface that defines APIs for segmentation in terms of segments and boundaries, and enforces immutable stateless iteration over the segmentation result yielded from an inputCharSequence.Segmenteris designed to be a followup to theBreakIteratorin providing segmentation functionality.Segmenterprovides immutable iteration, higher level constructs likeSegments andCharSequences as return types, and Java programmer conveniences likeStreams in its APIs.Iteration over the input sequences is made immutable by separating the design into two parts, each represented by an interface. The
Segmenterinterface represents the construction of the object that encapsulates the segmentation logic. TheSegmentsinterface represents the result of segmentation being performed for a specific given inputCharSequence.SegmentsAPIs also provideStreams to support iteration over the segmentation results in a stateless manner.- See Also:
Segments,BreakIterator- Status:
- Draft ICU 78.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Segmentssegment(CharSequence s)Returns aSegmentsobject that encapsulates the segmentation of the inputCharSequence.
-
-
-
Method Detail
-
segment
Segments segment(CharSequence s)
Returns aSegmentsobject that encapsulates the segmentation of the inputCharSequence. TheSegmentsobject, in turn, provides the main APIs to support traversal over the resulting segments and boundaries via the JavaStreamabstraction.- Parameters:
s- inputCharSequenceon which segmentation is performed. The input must not be modified while using the resultingSegmentsobject.- Returns:
- A
Segmentsobject with APIs to access the results of segmentation, including APIs that returnStreams of the segments and boundaries. - Status:
- Draft ICU 78.
-
-