]> granicus.if.org Git - icu/commitdiff
ICU-10286 API docs update (commit missed from yesterday), remove stray printf
authorSteven R. Loomis <srl@icu-project.org>
Thu, 6 Mar 2014 18:38:08 +0000 (18:38 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Thu, 6 Mar 2014 18:38:08 +0000 (18:38 +0000)
X-SVN-Rev: 35363

icu4c/source/i18n/filteredbrk.cpp
icu4c/source/i18n/unicode/filteredbrk.h

index 33989b901a2d6a4b78f427b374b44e126620ed63..8d6ce28ca15884b58c4f6ab3125a578add7be2f1 100644 (file)
@@ -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;
     }
   }
index 761cb6bc309aea234781f2fd5e37b6dc5262e9a0..79430c6b18fb0f9f07461b4a84796600e36147a5 100644 (file)
@@ -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.