LUCENE-5775: deprecate JaspellLookup

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1603542 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-06-18 17:21:10 +00:00
parent 7559b36410
commit 42aaf72f62
3 changed files with 10 additions and 1 deletions

View File

@ -233,6 +233,8 @@ API Changes
* LUCENE-5761: Removed DiskDocValuesFormat, it was very inefficient and saved very little * LUCENE-5761: Removed DiskDocValuesFormat, it was very inefficient and saved very little
RAM over the default codec. (Robert Muir) RAM over the default codec. (Robert Muir)
* LUCENE-5775: Deprecate JaspellLookup. (Mike McCandless)
Optimizations Optimizations
* LUCENE-5603: hunspell stemmer more efficiently strips prefixes * LUCENE-5603: hunspell stemmer more efficiently strips prefixes

View File

@ -37,7 +37,9 @@ import org.apache.lucene.util.UnicodeUtil;
* <a href="http://jaspell.sourceforge.net/">JaSpell</a>. * <a href="http://jaspell.sourceforge.net/">JaSpell</a>.
* *
* @see JaspellTernarySearchTrie * @see JaspellTernarySearchTrie
* @deprecated Migrate to one of the newer suggesters which are much more RAM efficient.
*/ */
@Deprecated
public class JaspellLookup extends Lookup implements Accountable { public class JaspellLookup extends Lookup implements Accountable {
JaspellTernarySearchTrie trie = new JaspellTernarySearchTrie(); JaspellTernarySearchTrie trie = new JaspellTernarySearchTrie();
private boolean usePrefix = true; private boolean usePrefix = true;

View File

@ -62,7 +62,10 @@ import org.apache.lucene.util.RamUsageEstimator;
* Algorithms, January 1997). Algorithms in C, Third Edition, by Robert * Algorithms, January 1997). Algorithms in C, Third Edition, by Robert
* Sedgewick (Addison-Wesley, 1998) provides yet another view of ternary search * Sedgewick (Addison-Wesley, 1998) provides yet another view of ternary search
* trees. * trees.
*
* @deprecated Migrate to one of the newer suggesters which are much more RAM efficient.
*/ */
@Deprecated
public class JaspellTernarySearchTrie implements Accountable { public class JaspellTernarySearchTrie implements Accountable {
/** /**
@ -98,7 +101,9 @@ public class JaspellTernarySearchTrie implements Accountable {
@Override @Override
public long ramBytesUsed() { public long ramBytesUsed() {
long mem = RamUsageEstimator.shallowSizeOf(this) + RamUsageEstimator.shallowSizeOf(relatives); 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) { if (node != null) {
mem += node.ramBytesUsed(); mem += node.ramBytesUsed();
} }