From e48349b757cdd11e90630f8a25b11738da775d27 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 22 Apr 2010 10:14:09 +0000 Subject: [PATCH] modify example to be more performant git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@936726 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/contrib/icu/src/java/overview.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lucene/contrib/icu/src/java/overview.html b/lucene/contrib/icu/src/java/overview.html index e96618ef9c3..56685dd95ac 100644 --- a/lucene/contrib/icu/src/java/overview.html +++ b/lucene/contrib/icu/src/java/overview.html @@ -303,7 +303,10 @@ a specific Unicode Version by using a {@link com.ibm.icu.text.FilteredNormalizer * 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);