mirror of https://github.com/apache/lucene.git
LUCENE-4857: Don't unnecessarily copy stem override map in StemmerOverrideFilter
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1458848 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bac0ad9d1c
commit
2f8c2cff03
|
@ -154,6 +154,9 @@ Optimizations
|
|||
* LUCENE-4854: Speed up TermsEnum of FieldCache.getDocTermOrds.
|
||||
(Robert Muir)
|
||||
|
||||
* LUCENE-4857: Don't unnecessarily copy stem override map in
|
||||
StemmerOverrideFilter. (Simon Willnauer)
|
||||
|
||||
======================= Lucene 4.2.0 =======================
|
||||
|
||||
Changes in backwards compatibility policy
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.apache.lucene.analysis.TokenStream;
|
|||
import org.apache.lucene.analysis.tokenattributes.KeywordAttribute;
|
||||
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
|
||||
import org.apache.lucene.analysis.util.CharArrayMap;
|
||||
import org.apache.lucene.util.Version;
|
||||
|
||||
/**
|
||||
* Provides the ability to override any {@link KeywordAttribute} aware stemmer
|
||||
|
@ -44,10 +43,10 @@ public final class StemmerOverrideFilter extends TokenFilter {
|
|||
* so that they will not be stemmed with stemmers down the chain.
|
||||
* </p>
|
||||
*/
|
||||
public StemmerOverrideFilter(Version matchVersion, TokenStream input,
|
||||
public StemmerOverrideFilter(TokenStream input,
|
||||
CharArrayMap<String> dictionary) {
|
||||
super(input);
|
||||
this.dictionary = CharArrayMap.copy(matchVersion, dictionary);
|
||||
this.dictionary = dictionary;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,6 +66,6 @@ public class StemmerOverrideFilterFactory extends TokenFilterFactory implements
|
|||
|
||||
@Override
|
||||
public TokenStream create(TokenStream input) {
|
||||
return dictionary == null ? input : new StemmerOverrideFilter(luceneMatchVersion, input, dictionary);
|
||||
return dictionary == null ? input : new StemmerOverrideFilter(input, dictionary);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue