Apache Lucene open-source search software
LUCENE-5775: deprecate JaspellLookup
Michael McCandless42aaf72f62d7
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 0398c73b8e9..2807bc065c7 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -233,6 +233,8 @@ API Changes* LUCENE-5761: Removed DiskDocValuesFormat, it was very inefficient and saved very littleRAM over the default codec. (Robert Muir)+* LUCENE-5775: Deprecate JaspellLookup. (Mike McCandless)+Optimizations* LUCENE-5603: hunspell stemmer more efficiently strips prefixesdiff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.javaindex 8757d70f7d2..07702c86703 100644--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java@@ -37,7 +37,9 @@ import org.apache.lucene.util.UnicodeUtil;* <a href="http://jaspell.sourceforge.net/">JaSpell</a>.** @see JaspellTernarySearchTrie+ * @deprecated Migrate to one of the newer suggesters which are much more RAM efficient.*/+@Deprecatedpublic class JaspellLookup extends Lookup implements Accountable {JaspellTernarySearchTrie trie = new JaspellTernarySearchTrie();private boolean usePrefix = true;diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.javaindex 41ea3f1454c..728fe12344f 100644--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java@@ -62,7 +62,10 @@ import org.apache.lucene.util.RamUsageEstimator;* Algorithms, January 1997). Algorithms in C, Third Edition, by Robert* Sedgewick (Addison-Wesley, 1998) provides yet another view of ternary search* trees.+ *+ * @deprecated Migrate to one of the newer suggesters which are much more RAM efficient.*/+@Deprecatedpublic class JaspellTernarySearchTrie implements Accountable {/**@@ -98,7 +101,9 @@ public class JaspellTernarySearchTrie implements Accountable {@Overridepublic long ramBytesUsed() {long mem = RamUsageEstimator.shallowSizeOf(this) + RamUsageEstimator.shallowSizeOf(relatives);- for (TSTNode node : relatives) {+ // We don't need to add parent since our parent added itself:+ for (int i=1;i<4;i++) {+ TSTNode node = relatives[i];if (node != null) {mem += node.ramBytesUsed();}