lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r936726 - /lucene/dev/trunk/lucene/contrib/icu/src/java/overview.html
Date Thu, 22 Apr 2010 10:14:09 GMT
Author: rmuir
Date: Thu Apr 22 10:14:09 2010
New Revision: 936726

URL: http://svn.apache.org/viewvc?rev=936726&view=rev
Log:
modify example to be more performant

Modified:
    lucene/dev/trunk/lucene/contrib/icu/src/java/overview.html

Modified: lucene/dev/trunk/lucene/contrib/icu/src/java/overview.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/icu/src/java/overview.html?rev=936726&r1=936725&r2=936726&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/icu/src/java/overview.html (original)
+++ lucene/dev/trunk/lucene/contrib/icu/src/java/overview.html Thu Apr 22 10:14:09 2010
@@ -303,7 +303,10 @@ a specific Unicode Version by using a {@
    * of Unicode, this is an easy way to force normalization to a specific version.
    */
     Normalizer2 normalizer = Normalizer2.getInstance(null, "nfc", Normalizer2.Mode.COMPOSE);
-    FilteredNormalizer2 unicode50 = new FilteredNormalizer2(normalizer, new UnicodeSet("[:age=5.0:]"));
+    UnicodeSet set = new UnicodeSet("[:age=5.0:]");
+    // see FilteredNormalizer2 docs, the set should be frozen or performance will suffer
+    set.freeze(); 
+    FilteredNormalizer2 unicode50 = new FilteredNormalizer2(normalizer, set);
     TokenStream tokenstream = new ICUNormalizer2Filter(tokenizer, unicode50);
 </pre></code>
 </body>



Mime
View raw message