From: Steven R. Loomis Date: Thu, 6 Mar 2014 18:38:08 +0000 (+0000) Subject: ICU-10286 API docs update (commit missed from yesterday), remove stray printf X-Git-Tag: milestone-59-0-1~2057 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ded9162807a91010e2ecb4909259ab371258ebd2;p=icu ICU-10286 API docs update (commit missed from yesterday), remove stray printf X-SVN-Rev: 35363 --- diff --git a/icu4c/source/i18n/filteredbrk.cpp b/icu4c/source/i18n/filteredbrk.cpp index 33989b901a2..8d6ce28ca15 100644 --- a/icu4c/source/i18n/filteredbrk.cpp +++ b/icu4c/source/i18n/filteredbrk.cpp @@ -358,7 +358,7 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr if(revCount>0) { backwardsTrie.adoptInstead(builder->build(USTRINGTRIE_BUILD_FAST, status)); if(U_FAILURE(status)) { - printf("Error %s building backwards\n", u_errorName(status)); + //printf("Error %s building backwards\n", u_errorName(status)); return NULL; } } @@ -366,7 +366,7 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr if(fwdCount>0) { forwardsPartialTrie.adoptInstead(builder2->build(USTRINGTRIE_BUILD_FAST, status)); if(U_FAILURE(status)) { - printf("Error %s building forwards\n", u_errorName(status)); + //printf("Error %s building forwards\n", u_errorName(status)); return NULL; } } diff --git a/icu4c/source/i18n/unicode/filteredbrk.h b/icu4c/source/i18n/unicode/filteredbrk.h index 761cb6bc309..79430c6b18f 100644 --- a/icu4c/source/i18n/unicode/filteredbrk.h +++ b/icu4c/source/i18n/unicode/filteredbrk.h @@ -21,7 +21,7 @@ U_NAMESPACE_BEGIN /** * 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), @@ -51,38 +51,43 @@ class U_I18N_API FilteredBreakIteratorBuilder : public UObject { 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.