Class SimpleFilteredSentenceBreakIterator.Builder

    • Constructor Detail

      • 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​(String 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 class FilteredBreakIteratorBuilder
        Parameters:
        str - the string to suppress, such as "Mr."
        Returns:
        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​(String 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 class FilteredBreakIteratorBuilder
        Parameters:
        str - the str the string to unsuppress, such as "Mr."
        Returns:
        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.
      • build

        public BreakIterator build​(BreakIterator adoptBreakIterator)
        Description copied from class: FilteredBreakIteratorBuilder
        Wrap (adopt) an existing break iterator in a new filtered instance. The resulting BreakIterator is owned by the caller. The BreakIteratorFilter may be destroyed before the BreakIterator is destroyed. Note that the adoptBreakIterator is adopted by the new BreakIterator and should no longer be used by the caller. The FilteredBreakIteratorBuilder may be reused.
        Specified by:
        build in class FilteredBreakIteratorBuilder
        Parameters:
        adoptBreakIterator - the break iterator to adopt
        Returns:
        the new BreakIterator, owned by the caller.