From: Peter Edberg Date: Tue, 18 Mar 2014 21:50:11 +0000 (+0000) Subject: ICU-10507 Better API documentation for asymmetric search (C) X-Git-Tag: milestone-59-0-1~1985 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4696fb6ee5573a63f854d31031a84b8a0d2737e5;p=icu ICU-10507 Better API documentation for asymmetric search (C) X-SVN-Rev: 35502 --- diff --git a/icu4c/source/i18n/unicode/usearch.h b/icu4c/source/i18n/unicode/usearch.h index 362f234a211..a64e9190c92 100644 --- a/icu4c/source/i18n/unicode/usearch.h +++ b/icu4c/source/i18n/unicode/usearch.h @@ -30,11 +30,11 @@ * See the * "ICU Collation Design Document" for more information. *

- * The algorithm implemented is a modified form of the Boyer Moore's search. - * For more information see + * The implementation may use a linear search or a modified form of the Boyer-Moore + * search; for more information on the latter see * * "Efficient Text Searching in Java", published in Java Report - * in February, 1999, for further information on the algorithm. + * in February, 1999. *

* There are 2 match options for selection:
* Let S' be the sub-string of a text string S between the offsets start and @@ -91,6 +91,15 @@ * for the pattern "abab" in the text "ababab", where else mutually * exclusive matches only produce the result of 0. *

+ * Options are also provided to implement "asymmetric search" as described in + * + * UTS #10 Unicode Collation Algorithm, specifically the USearchAttribute + * USEARCH_ELEMENT_COMPARISON and its values. + *

+ * E.g. In English, overlapping matches produces the result 0 and 2 + * for the pattern "abab" in the text "ababab", where else mutually + * exclusive matches only produce the result of 0. + *

* Though collator attributes will be taken into consideration while * performing matches, there are no APIs here for setting and getting the * attributes. These attributes can be set by getting the collator @@ -227,6 +236,11 @@ typedef enum { * the pattern will match a plain e or an e with any diacritic in the * searched text, but an e with diacritic in the pattern will only * match an e with the same diacritic in the searched text. + * + * This supports "asymmetric search" as described in + * + * UTS #10 Unicode Collation Algorithm. + * * @stable ICU 4.4 */ USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD, @@ -241,6 +255,13 @@ typedef enum { * in the pattern will match a plain e or an e with any diacritic in the * searched text, but an e with diacritic in the pattern will only * match an e with the same diacritic or a plain e in the searched text. + * + * This option is similar to "asymmetric search" as described in + * + * UTS #10 Unicode Collation Algorithm