Package com.ibm.icu.segmenter
Interface Segmenter
-
- All Known Implementing Classes:
LocalizedSegmenter
,RuleBasedSegmenter
public interface Segmenter
An 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
.Segmenter
is designed to be a followup to theBreakIterator
in providing segmentation functionality.Segmenter
provides immutable iteration, higher level constructs likeSegment
s andCharSequence
s as return types, and Java programmer conveniences likeStream
s in its APIs.Iteration over the input sequences is made immutable by separating the design into two parts, each represented by an interface. The
Segmenter
interface represents the construction of the object that encapsulates the segmentation logic. TheSegments
interface represents the result of segmentation being performed for a specific given inputCharSequence
.Segments
APIs also provideStream
s 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 Segments
segment(CharSequence s)
Returns aSegments
object that encapsulates the segmentation of the inputCharSequence
.
-
-
-
Method Detail
-
segment
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.- 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.
-
-