You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2016/12/22 10:33:10 UTC

[2/2] lucene-solr:branch_6x: Remove unused private AnalyzingComparator class from FreeTextSuggester.

Remove unused private AnalyzingComparator class from FreeTextSuggester.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6c1f0850
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6c1f0850
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6c1f0850

Branch: refs/heads/branch_6x
Commit: 6c1f085073ec8541b73885de09c864fb1866ced4
Parents: 62d342a
Author: Christine Poerschke <cp...@apache.org>
Authored: Thu Dec 22 09:37:09 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Thu Dec 22 10:08:45 2016 +0000

----------------------------------------------------------------------
 .../suggest/analyzing/FreeTextSuggester.java    | 45 --------------------
 1 file changed, 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6c1f0850/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/FreeTextSuggester.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/FreeTextSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/FreeTextSuggester.java
index cc4ed4b..3e4845b 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/FreeTextSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/FreeTextSuggester.java
@@ -54,7 +54,6 @@ import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.search.suggest.InputIterator;
 import org.apache.lucene.search.suggest.Lookup;
-import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.DataInput;
 import org.apache.lucene.store.DataOutput;
 import org.apache.lucene.store.Directory;
@@ -221,50 +220,6 @@ public class FreeTextSuggester extends Lookup implements Accountable {
     }
   }
 
-  private static class AnalyzingComparator implements Comparator<BytesRef> {
-
-    private final ByteArrayDataInput readerA = new ByteArrayDataInput();
-    private final ByteArrayDataInput readerB = new ByteArrayDataInput();
-    private final BytesRef scratchA = new BytesRef();
-    private final BytesRef scratchB = new BytesRef();
-
-    @Override
-    public int compare(BytesRef a, BytesRef b) {
-      readerA.reset(a.bytes, a.offset, a.length);
-      readerB.reset(b.bytes, b.offset, b.length);
-
-      // By token:
-      scratchA.length = readerA.readShort();
-      scratchA.bytes = a.bytes;
-      scratchA.offset = readerA.getPosition();
-
-      scratchB.bytes = b.bytes;
-      scratchB.length = readerB.readShort();
-      scratchB.offset = readerB.getPosition();
-
-      int cmp = scratchA.compareTo(scratchB);
-      if (cmp != 0) {
-        return cmp;
-      }
-      readerA.skipBytes(scratchA.length);
-      readerB.skipBytes(scratchB.length);
-
-      // By length (smaller surface forms sorted first):
-      cmp = a.length - b.length;
-      if (cmp != 0) {
-        return cmp;
-      }
-
-      // By surface form:
-      scratchA.offset = readerA.getPosition();
-      scratchA.length = a.length - scratchA.offset;
-      scratchB.offset = readerB.getPosition();
-      scratchB.length = b.length - scratchB.offset;
-
-      return scratchA.compareTo(scratchB);
-    }
-  }
-
   private Analyzer addShingles(final Analyzer other) {
     if (grams == 1) {
       return other;