diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java index 3afe13d40c1..9eebed604b6 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java @@ -105,7 +105,7 @@ public class BlockTermsReader extends FieldsProducer { return field.hashCode() * 31 + term.hashCode(); } } - + // private String segment; public BlockTermsReader(TermsIndexReaderBase indexReader, Directory dir, FieldInfos fieldInfos, SegmentInfo info, PostingsReaderBase postingsReader, IOContext context, @@ -364,7 +364,7 @@ public class BlockTermsReader extends FieldsProducer { throw new IllegalStateException("terms index was not loaded"); } - //System.out.println("BTR.seek seg=" + segment + " target=" + fieldInfo.name + ":" + target.utf8ToString() + " " + target + " current=" + term().utf8ToString() + " " + term() + " indexIsCurrent=" + indexIsCurrent + " didIndexNext=" + didIndexNext + " seekPending=" + seekPending + " this=" + this); + //System.out.println("BTR.seek seg=" + segment + " target=" + fieldInfo.name + ":" + target.utf8ToString() + " " + target + " current=" + term().utf8ToString() + " " + term() + " indexIsCurrent=" + indexIsCurrent + " didIndexNext=" + didIndexNext + " seekPending=" + seekPending + " divisor=" + indexReader.getDivisor() + " this=" + this); if (didIndexNext) { if (nextIndexTerm == null) { //System.out.println(" nextIndexTerm=null"); @@ -450,7 +450,6 @@ public class BlockTermsReader extends FieldsProducer { // do we then copy the bytes into the term. while(true) { - //System.out.println("cycle common=" + common + " termBlockPrefix=" + termBlockPrefix + " term=" + term + " target=" + target); // First, see if target term matches common prefix // in this block: diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java index 806939ddc53..60bf88c30fb 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java @@ -46,7 +46,6 @@ import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.RamUsageEstimator; import org.apache.lucene.util.automaton.CompiledAutomaton; -import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.RunAutomaton; import org.apache.lucene.util.automaton.Transition; diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 1067add2e98..982025c0907 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -981,9 +981,8 @@ - - + + diff --git a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java index 35e7a5a3fdd..91d2abe66d8 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java @@ -18,42 +18,25 @@ package org.apache.lucene.codecs.blocktree; */ import java.io.IOException; -import java.io.PrintStream; import java.util.Collections; import java.util.Iterator; import java.util.TreeMap; -import org.apache.lucene.codecs.BlockTermState; import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsReaderBase; import org.apache.lucene.index.CorruptIndexException; -import org.apache.lucene.index.DocsAndPositionsEnum; -import org.apache.lucene.index.DocsEnum; import org.apache.lucene.index.FieldInfo.IndexOptions; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.index.TermState; import org.apache.lucene.index.Terms; -import org.apache.lucene.index.TermsEnum; -import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.RamUsageEstimator; -import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.automaton.CompiledAutomaton; -import org.apache.lucene.util.automaton.RunAutomaton; -import org.apache.lucene.util.fst.ByteSequenceOutputs; -import org.apache.lucene.util.fst.FST; -import org.apache.lucene.util.fst.Outputs; -import org.apache.lucene.util.fst.Util; /** A block-based terms index and dictionary that assigns * terms to variable length blocks according to how they diff --git a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java index dcdc78c9e2a..e676228135c 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java @@ -24,7 +24,6 @@ import org.apache.lucene.index.FieldInfo.IndexOptions; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.Transition; import org.apache.lucene.util.fst.FST; diff --git a/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java b/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java index 080810d44f5..c6b95272495 100644 --- a/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java +++ b/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java @@ -24,8 +24,8 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.ToStringUtils; -import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.Automaton; +import org.apache.lucene.util.automaton.CompiledAutomaton; /** * A {@link Query} that will match terms against a finite-state machine. @@ -116,7 +116,7 @@ public class AutomatonQuery extends MultiTermQuery { return buffer.toString(); } - /** Returns the light automaton used to create this query */ + /** Returns the automaton used to create this query */ public Automaton getAutomaton() { return automaton; } diff --git a/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java b/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java index 30e7e1a160e..7aeb52058d8 100644 --- a/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java +++ b/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java @@ -35,10 +35,10 @@ import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.UnicodeUtil; +import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.ByteRunAutomaton; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.LevenshteinAutomata; -import org.apache.lucene.util.automaton.Automaton; /** Subclass of TermsEnum for enumerating all terms that are similar * to the specified filter term. diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java index 5ecd9908cfa..7c216321d4f 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java @@ -122,28 +122,20 @@ public abstract class RunAutomaton { */ public RunAutomaton(Automaton a, int maxInterval, boolean tableize) { this.maxInterval = maxInterval; - //System.out.println("before det a=" + a.getNumStates()); a = Operations.determinize(a); this.automaton = a; - //System.out.println("AFTER DET tableize= " + tableize + ": "); - //System.out.println(a.toDot()); points = a.getStartPoints(); - //System.out.println(" points=" + Arrays.toString(points)); initial = 0; size = Math.max(1,a.getNumStates()); accept = new boolean[size]; transitions = new int[size * points.length]; Arrays.fill(transitions, -1); - //System.out.println("RA: size=" + size + " points.length=" + points.length + " total=" + (size * points.length)); for (int n=0;n " + dest); assert dest == -1 || dest < size; transitions[n * points.length + c] = dest; - //System.out.println(" trans label=" + points[c] + " dest=" + transitions[n * points.length + c]); } } @@ -158,9 +150,7 @@ public abstract class RunAutomaton { i++; } classmap[j] = i; - //System.out.println("classmap[" + (char) j + "]=" + i); } - //System.out.println(" after classmap i=" + i + " maxInterval=" + maxInterval); } else { classmap = null; } @@ -174,11 +164,9 @@ public abstract class RunAutomaton { * transition function.) */ public final int step(int state, int c) { - //System.out.println(" step state=" + state + " c=" + c + " points.length=" + points.length + " transitions.len=" + transitions.length); if (classmap == null) { return transitions[state * points.length + getCharClass(c)]; } else { - //System.out.println(" classmap[c]=" + classmap[c]); return transitions[state * points.length + classmap[c]]; } } diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java index 95c7c85c54a..fc5b6589a9b 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java @@ -17,8 +17,10 @@ package org.apache.lucene.util.automaton; * limitations under the License. */ -/** Used temporarily when iterating through transitions from a {@link Automaton} +/** Holds one transition from an {@link Automaton}. This is typically + * used temporarily when iterating through transitions by invoking * {@link Automaton#initTransition} and {@link Automaton#getNextTransition}. */ + public class Transition { /** Sole constructor. */ diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java b/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java index c730fcce151..059ee09b4bb 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java @@ -134,8 +134,6 @@ public final class UTF32ToUTF8 { void convertOneEdge(int start, int end, int startCodePoint, int endCodePoint) { startUTF8.set(startCodePoint); endUTF8.set(endCodePoint); - //System.out.println("start = " + startUTF8); - //System.out.println(" end = " + endUTF8); build(start, end, startUTF8, endUTF8, 0); } @@ -294,15 +292,12 @@ public final class UTF32ToUTF8 { int numTransitions = utf32.getNumTransitions(utf32State); utf32.initTransition(utf32State, scratch); - //System.out.println(" convert state=" + utf32State + " numTransitions=" + numTransitions); for(int i=0;i