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 for RuleBasedBreakIterator(String).
  • Field Details

    • breakIterPrototype

      private final BreakIterator breakIterPrototype
  • Constructor Details

    • RuleBasedSegmenter

      private RuleBasedSegmenter(BreakIterator breakIter)
  • Method Details

    • segment

      public Segments segment(CharSequence s)
      Returns a Segments object that encapsulates the segmentation of the input CharSequence. The Segments object, in turn, provides the main APIs to support traversal over the resulting segments and boundaries via the Java Stream abstraction.
      Specified by:
      segment in interface Segmenter
      Parameters:
      s - input CharSequence on which segmentation is performed. The input must not be modified while using the resulting Segments object.
      Returns:
      A Segments object with APIs to access the results of segmentation, including APIs that return Streams of the segments and boundaries.
    • builder

      public static RuleBasedSegmenter.Builder builder()
      Returns:
      a builder for constructing RuleBasedSegmenter