/**
* The BreakIteratorFilter is used to modify the behavior of a BreakIterator
- * by constructing a new BreakIterator which skips certain breaks as "exceptions".
+ * by constructing a new BreakIterator which suppresses certain segment boundaries.
* See http://www.unicode.org/reports/tr35/tr35-general.html#Segmentation_Exceptions .
* For example, a typical English Sentence Break Iterator would break on the space
* in the string "Mr. Smith" (resulting in two segments),
static FilteredBreakIteratorBuilder *createInstance(const Locale& where, UErrorCode& status);
/**
- * Construct an empty FilteredBreakIteratorBuilder. It will have an empty
- * exception list.
+ * Construct an empty FilteredBreakIteratorBuilder.
+ * In this state, it will not suppress any segment boundaries.
* @param status The error code.
* @return the new builder
*/
static FilteredBreakIteratorBuilder *createInstance(UErrorCode &status);
-
/**
- * Add an exception. The break iterator will not break after this string.
- * @param exception the exception string
+ * 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.
+ * @param string the string to suppress, such as "Mr."
* @param status error code
- * @return returns TRUE if the exception was not present and added,
- * FALSE if the call was a no-op because the exception was already present.
+ * @return 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.
*/
- virtual UBool suppressBreakAfter(const UnicodeString& exception, UErrorCode& status) = 0;
+ virtual UBool suppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0;
/**
- * Remove a single exception.
+ * 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.
* @param exception the exception to remove
* @param status error code
- * @return returns TRUE if the exception was present and removed,
- * FALSE if the call was a no-op because the exception was not present.
+ * @return 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.
*/
- virtual UBool unsuppressBreakAfter(const UnicodeString& exception, UErrorCode& status) = 0;
+ virtual UBool unsuppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0;
/**
- * build a BreakIterator from this builder.
+ * 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.
+ * 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.
* @param adoptBreakIterator the break iterator to adopt
* @param status error code
* @return the new BreakIterator, owned by the caller.