From 4455345c6e00f31479142745761686db5a0dfb0c Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 3 May 2011 00:29:47 +0000 Subject: [PATCH] LUCENE-3063: factor CharTokenizer/CharacterUtils into analyzers module git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1098871 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/MIGRATE.txt | 2 + .../apache/lucene/analysis/MockTokenizer.java | 63 +++++++++++++++++-- .../apache/lucene/index/TestIndexWriter.java | 2 +- .../lucene/index/TestStressIndexing2.java | 9 +-- modules/analysis/CHANGES.txt | 2 + .../analysis/ar/ArabicLetterTokenizer.java | 2 +- .../lucene/analysis/core/LetterTokenizer.java | 2 +- .../lucene/analysis/core/LowerCaseFilter.java | 2 +- .../analysis/core/LowerCaseTokenizer.java | 2 +- .../lucene/analysis/core/SimpleAnalyzer.java | 2 +- .../analysis/core/WhitespaceAnalyzer.java | 2 +- .../analysis/core/WhitespaceTokenizer.java | 2 +- .../analysis/el/GreekLowerCaseFilter.java | 2 +- .../lucene/analysis/in/IndicTokenizer.java | 2 +- .../analysis/ru/RussianLetterTokenizer.java | 2 +- .../lucene/analysis/util/CharArrayMap.java | 2 +- .../lucene/analysis/util}/CharTokenizer.java | 7 ++- .../lucene/analysis}/util/CharacterUtils.java | 4 +- .../analysis/util}/TestCharTokenizers.java | 14 +++-- .../analysis}/util/TestCharacterUtils.java | 6 +- 20 files changed, 95 insertions(+), 36 deletions(-) rename {lucene/src/java/org/apache/lucene/analysis => modules/analysis/common/src/java/org/apache/lucene/analysis/util}/CharTokenizer.java (97%) rename {lucene/src/java/org/apache/lucene => modules/analysis/common/src/java/org/apache/lucene/analysis}/util/CharacterUtils.java (99%) rename {lucene/src/test/org/apache/lucene/analysis => modules/analysis/common/src/test/org/apache/lucene/analysis/util}/TestCharTokenizers.java (82%) rename {lucene/src/test/org/apache/lucene => modules/analysis/common/src/test/org/apache/lucene/analysis}/util/TestCharacterUtils.java (97%) diff --git a/lucene/MIGRATE.txt b/lucene/MIGRATE.txt index 779b6309a44..c2666e06784 100644 --- a/lucene/MIGRATE.txt +++ b/lucene/MIGRATE.txt @@ -312,6 +312,8 @@ LUCENE-1458, LUCENE-2111: Flexible Indexing - o.a.l.analysis.ReusableAnalyzerBase -> o.a.l.analysis.util.ReusableAnalyzerBase - o.a.l.analysis.StopwordAnalyzerBase -> o.a.l.analysis.util.StopwordAnalyzerBase - o.a.l.analysis.WordListLoader -> o.a.l.analysis.util.WordListLoader + - o.a.l.analysis.CharTokenizer -> o.a.l.analysis.util.CharTokenizer + - o.a.l.util.CharacterUtils -> o.a.l.analysis.util.CharacterUtils * LUCENE-2514: The option to use a Collator's order (instead of binary order) for sorting and range queries has been moved to contrib/queries. diff --git a/lucene/src/test-framework/org/apache/lucene/analysis/MockTokenizer.java b/lucene/src/test-framework/org/apache/lucene/analysis/MockTokenizer.java index 6e4f30b3968..f5bc45996a0 100644 --- a/lucene/src/test-framework/org/apache/lucene/analysis/MockTokenizer.java +++ b/lucene/src/test-framework/org/apache/lucene/analysis/MockTokenizer.java @@ -20,14 +20,15 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.io.Reader; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; /** * Automaton-based tokenizer for testing. Optionally lowercases. */ -public class MockTokenizer extends CharTokenizer { +public class MockTokenizer extends Tokenizer { /** Acts Similar to WhitespaceTokenizer */ public static final CharacterRunAutomaton WHITESPACE = new CharacterRunAutomaton(new RegExp("[^ \t\r\n]+").toAutomaton()); @@ -45,21 +46,67 @@ public class MockTokenizer extends CharTokenizer { private final boolean lowerCase; private int state; + private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class); + private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class); + int off = 0; + public MockTokenizer(AttributeFactory factory, Reader input, CharacterRunAutomaton runAutomaton, boolean lowerCase) { - super(LuceneTestCase.TEST_VERSION_CURRENT, factory, input); + super(factory, input); this.runAutomaton = runAutomaton; this.lowerCase = lowerCase; this.state = runAutomaton.getInitialState(); } public MockTokenizer(Reader input, CharacterRunAutomaton runAutomaton, boolean lowerCase) { - super(LuceneTestCase.TEST_VERSION_CURRENT, input); + super(input); this.runAutomaton = runAutomaton; this.lowerCase = lowerCase; this.state = runAutomaton.getInitialState(); } @Override + public final boolean incrementToken() throws IOException { + clearAttributes(); + for (;;) { + int startOffset = off; + int cp = readCodePoint(); + if (cp < 0) { + break; + } else if (isTokenChar(cp)) { + int endOffset; + do { + char chars[] = Character.toChars(normalize(cp)); + for (int i = 0; i < chars.length; i++) + termAtt.append(chars[i]); + endOffset = off; + cp = readCodePoint(); + } while (cp >= 0 && isTokenChar(cp)); + offsetAtt.setOffset(startOffset, endOffset); + return true; + } + } + return false; + } + + protected int readCodePoint() throws IOException { + int ch = input.read(); + if (ch < 0) { + return ch; + } else { + assert !Character.isLowSurrogate((char) ch); + off++; + if (Character.isHighSurrogate((char) ch)) { + int ch2 = input.read(); + if (ch2 >= 0) { + off++; + assert Character.isLowSurrogate((char) ch2); + return Character.toCodePoint((char) ch, (char) ch2); + } + } + return ch; + } + } + protected boolean isTokenChar(int c) { state = runAutomaton.step(state, c); if (state < 0) { @@ -70,7 +117,6 @@ public class MockTokenizer extends CharTokenizer { } } - @Override protected int normalize(int c) { return lowerCase ? Character.toLowerCase(c) : c; } @@ -79,5 +125,12 @@ public class MockTokenizer extends CharTokenizer { public void reset() throws IOException { super.reset(); state = runAutomaton.getInitialState(); + off = 0; + } + + @Override + public void end() throws IOException { + int finalOffset = correctOffset(off); + offsetAtt.setOffset(finalOffset, finalOffset); } } diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java index e6f27030134..90bf1cacc6d 100644 --- a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -1603,7 +1603,7 @@ public class TestIndexWriter extends LuceneTestCase { // LUCENE-510 public void testInvalidUTF16() throws Throwable { Directory dir = newDirectory(); - IndexWriter w = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random))); + IndexWriter w = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new StringSplitAnalyzer())); Document doc = new Document(); final int count = utf8Data.length/2; diff --git a/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java b/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java index a0fbe6d1f55..8eb6224805f 100644 --- a/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java +++ b/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java @@ -616,7 +616,7 @@ public class TestStressIndexing2 extends LuceneTestCase { } for(int i=start;i o.a.l.analysis.util.ReusableAnalyzerBase - o.a.l.analysis.StopwordAnalyzerBase -> o.a.l.analysis.util.StopwordAnalyzerBase - o.a.l.analysis.WordListLoader -> o.a.l.analysis.util.WordListLoader + - o.a.l.analysis.CharTokenizer -> o.a.l.analysis.util.CharTokenizer + - o.a.l.util.CharacterUtils -> o.a.l.analysis.util.CharacterUtils * SOLR-1057: Add PathHierarchyTokenizer that represents file path hierarchies as synonyms of /something, /something/something, /something/something/else. (Ryan McKinley, Koji Sekiguchi) diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/ar/ArabicLetterTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/ar/ArabicLetterTokenizer.java index 26f06d3ffa0..fff6148d19a 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/ar/ArabicLetterTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/ar/ArabicLetterTokenizer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ar; import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; import org.apache.lucene.analysis.core.LetterTokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.analysis.standard.StandardTokenizer; // javadoc @link import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java index a9853386d53..3bf349719d7 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.core; import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java index c10972b701b..0e1c7e616fb 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java @@ -22,7 +22,7 @@ import java.io.IOException; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; -import org.apache.lucene.util.CharacterUtils; +import org.apache.lucene.analysis.util.CharacterUtils; import org.apache.lucene.util.Version; /** diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java index a65d90b4ffa..ecdf550eb85 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.core; import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java index ce2bc6abd7c..31cfa1e00dc 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java @@ -20,7 +20,7 @@ package org.apache.lucene.analysis.core; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CharTokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.analysis.util.ReusableAnalyzerBase; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java index 85ce28efc99..357350cef38 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.core; import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.analysis.util.ReusableAnalyzerBase; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java index 4bf4f049dee..01004c68ca5 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.core; import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java index 1fed10384da..01c537b85cb 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java @@ -21,7 +21,7 @@ import java.io.IOException; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; -import org.apache.lucene.util.CharacterUtils; +import org.apache.lucene.analysis.util.CharacterUtils; import org.apache.lucene.util.Version; /** diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/in/IndicTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/in/IndicTokenizer.java index f89b07a3cbc..2e4c6e43e3f 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/in/IndicTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/in/IndicTokenizer.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.in; import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Version; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLetterTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLetterTokenizer.java index e5426d775b2..088b8025064 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLetterTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLetterTokenizer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ru; */ import java.io.Reader; -import org.apache.lucene.analysis.CharTokenizer; import org.apache.lucene.analysis.Tokenizer; // for javadocs +import org.apache.lucene.analysis.util.CharTokenizer; import org.apache.lucene.analysis.core.LetterTokenizer; import org.apache.lucene.analysis.standard.StandardTokenizer; // for javadocs import org.apache.lucene.util.AttributeSource; diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java index cd52e392070..552ea3fd3dd 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java @@ -24,7 +24,7 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import org.apache.lucene.util.CharacterUtils; +import org.apache.lucene.analysis.util.CharacterUtils; import org.apache.lucene.util.Version; diff --git a/lucene/src/java/org/apache/lucene/analysis/CharTokenizer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java similarity index 97% rename from lucene/src/java/org/apache/lucene/analysis/CharTokenizer.java rename to modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java index 3055d19e5b2..5d91a3a3fe1 100644 --- a/lucene/src/java/org/apache/lucene/analysis/CharTokenizer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java @@ -1,4 +1,4 @@ -package org.apache.lucene.analysis; +package org.apache.lucene.analysis.util; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -20,12 +20,13 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.io.Reader; +import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.util.AttributeSource; -import org.apache.lucene.util.CharacterUtils; +import org.apache.lucene.analysis.util.CharacterUtils; import org.apache.lucene.util.Version; -import org.apache.lucene.util.CharacterUtils.CharacterBuffer; +import org.apache.lucene.analysis.util.CharacterUtils.CharacterBuffer; /** * An abstract base class for simple, character-oriented tokenizers. diff --git a/lucene/src/java/org/apache/lucene/util/CharacterUtils.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java similarity index 99% rename from lucene/src/java/org/apache/lucene/util/CharacterUtils.java rename to modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java index 8f5a8af9ede..fe622788198 100644 --- a/lucene/src/java/org/apache/lucene/util/CharacterUtils.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java @@ -1,8 +1,10 @@ -package org.apache.lucene.util; +package org.apache.lucene.analysis.util; import java.io.IOException; import java.io.Reader; +import org.apache.lucene.util.Version; + /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/lucene/src/test/org/apache/lucene/analysis/TestCharTokenizers.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java similarity index 82% rename from lucene/src/test/org/apache/lucene/analysis/TestCharTokenizers.java rename to modules/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java index adb902d95f6..f129596df92 100644 --- a/lucene/src/test/org/apache/lucene/analysis/TestCharTokenizers.java +++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java @@ -1,4 +1,4 @@ -package org.apache.lucene.analysis; +package org.apache.lucene.analysis.util; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -20,6 +20,10 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.io.StringReader; +import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.analysis.core.LowerCaseTokenizer; + /** * Testcase for {@link CharTokenizer} subclasses @@ -42,7 +46,7 @@ public class TestCharTokenizers extends BaseTokenStreamTestCase { } // internal buffer size is 1024 make sure we have a surrogate pair right at the border builder.insert(1023, "\ud801\udc1c"); - MockTokenizer tokenizer = new MockTokenizer(new StringReader(builder.toString()), MockTokenizer.SIMPLE, true); + Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.toString())); assertTokenStreamContents(tokenizer, builder.toString().toLowerCase().split(" ")); } @@ -59,7 +63,7 @@ public class TestCharTokenizers extends BaseTokenStreamTestCase { builder.append("a"); } builder.append("\ud801\udc1cabc"); - MockTokenizer tokenizer = new MockTokenizer(new StringReader(builder.toString()), MockTokenizer.SIMPLE, true); + Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.toString())); assertTokenStreamContents(tokenizer, new String[] {builder.toString().toLowerCase()}); } } @@ -73,7 +77,7 @@ public class TestCharTokenizers extends BaseTokenStreamTestCase { for (int i = 0; i < 255; i++) { builder.append("A"); } - MockTokenizer tokenizer = new MockTokenizer(new StringReader(builder.toString() + builder.toString()), MockTokenizer.SIMPLE, true); + Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.toString() + builder.toString())); assertTokenStreamContents(tokenizer, new String[] {builder.toString().toLowerCase(), builder.toString().toLowerCase()}); } @@ -87,7 +91,7 @@ public class TestCharTokenizers extends BaseTokenStreamTestCase { builder.append("A"); } builder.append("\ud801\udc1c"); - MockTokenizer tokenizer = new MockTokenizer(new StringReader(builder.toString() + builder.toString()), MockTokenizer.SIMPLE, true); + Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.toString() + builder.toString())); assertTokenStreamContents(tokenizer, new String[] {builder.toString().toLowerCase(), builder.toString().toLowerCase()}); } } diff --git a/lucene/src/test/org/apache/lucene/util/TestCharacterUtils.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java similarity index 97% rename from lucene/src/test/org/apache/lucene/util/TestCharacterUtils.java rename to modules/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java index 69393bca871..4e9fdbf6c24 100644 --- a/lucene/src/test/org/apache/lucene/util/TestCharacterUtils.java +++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java @@ -1,4 +1,4 @@ -package org.apache.lucene.util; +package org.apache.lucene.analysis.util; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -21,7 +21,9 @@ import java.io.IOException; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.util.CharacterUtils.CharacterBuffer; +import org.apache.lucene.analysis.util.CharacterUtils.CharacterBuffer; +import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.util.Version; import org.junit.Test; /**