You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2016/12/30 15:56:43 UTC
[07/50] [abbrv] lucene-solr:jira/solr-9854: 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/b7331499
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b7331499
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b7331499
Branch: refs/heads/jira/solr-9854
Commit: b73314998ebf2cd67e9c952413c13804b049e267
Parents: 3366724
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 09:37:09 2016 +0000
----------------------------------------------------------------------
.../suggest/analyzing/FreeTextSuggester.java | 45 --------------------
1 file changed, 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b7331499/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;