]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/unicode/stsearch.h
ICU-400.37.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / stsearch.h
index 565f1e6a39c9c2bda95e73161eaa30c29550fa53..8499752e6d0d6ca9cc7052b9c862a7c64eda9f29 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 2001-2004 IBM and others. All rights reserved.
+*   Copyright (C) 2001-2008 IBM and others. All rights reserved.
 **********************************************************************
 *   Date        Name        Description
 *  03/22/2000   helena      Creation.
 
 #include "unicode/utypes.h"
 
-#if !UCONFIG_NO_COLLATION
+/**
+ * \file 
+ * \brief C++ API: Service for searching text based on RuleBasedCollator.
+ */
+#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
 
 #include "unicode/tblcoll.h"
 #include "unicode/coleitr.h"
 
 U_NAMESPACE_BEGIN
 
-/**
+/** 
+ *
  * <tt>StringSearch</tt> is a <tt>SearchIterator</tt> that provides
  * language-sensitive text searching based on the comparison rules defined
  * in a {@link RuleBasedCollator} object.
  * StringSearch ensures that language eccentricity can be 
- * handled, e.g. for the German collator, characters ß and SS will be matched 
+ * handled, e.g. for the German collator, characters &szlig; and SS will be matched 
  * if case is chosen to be ignored.
- * See the <a href="http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm">
+ * See the <a href="http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm">
  * "ICU Collation Design Document"</a> for more information.
  * <p> 
  * The algorithm implemented is a modified form of the Boyer Moore's search.
  * For more information  see 
- * <a href=http://oss.software.ibm.com/icu/docs/papers/efficient_text_searching_in_java.html>
+ * <a href="http://icu-project.org/docs/papers/efficient_text_searching_in_java.html">
  * "Efficient Text Searching in Java"</a>, published in <i>Java Report</i> 
  * in February, 1999, for further information on the algorithm.
  * <p>
@@ -49,7 +55,7 @@ U_NAMESPACE_BEGIN
  *           there exists no non-ignorable combining mark before or after S? 
  *           in S respectively. 
  * </pre>
- * Option 2. will be the default·
+ * Option 2. will be the default.
  * <p>
  * This search has APIs similar to that of other text iteration mechanisms 
  * such as the break iterators in <tt>BreakIterator</tt>. Using these 
@@ -108,13 +114,15 @@ U_NAMESPACE_BEGIN
  * and examples of how to use instances of this class to implement text
  * searching.
  * <pre><code>
- * UnicodeString target("The quick brown fox jumped over the lazy fox");
+ * UnicodeString target("The quick brown fox jumps over the lazy dog.");
  * UnicodeString pattern("fox");
  *
- * SearchIterator *iter  = new StringSearch(pattern, target);
  * UErrorCode      error = U_ZERO_ERROR;
- * for (int pos = iter->first(error); pos != USEARCH_DONE; 
- *                               pos = iter->next(error)) {
+ * StringSearch iter(pattern, target, Locale::getUS(), NULL, status);
+ * for (int pos = iter.first(error);
+ *      pos != USEARCH_DONE; 
+ *      pos = iter.next(error))
+ * {
  *     printf("Found match at %d pos, length is %d\n", pos, 
  *                                             iter.getMatchLength());
  * }
@@ -270,7 +278,7 @@ public:
      * @return a clone of this object
      *
      * @see getDynamicClassID
-     * @draft ICU 2.8
+     * @stable ICU 2.8
      */
     StringSearch *clone() const;
 
@@ -495,11 +503,6 @@ private :
     */
     UnicodeString      m_pattern_;
     /**
-    * Corresponding collation rules
-    * @stable ICU 2.0
-    */
-    UnicodeString      m_collation_rules_;
-    /**
     * String search struct data
     * @stable ICU 2.0
     */