mirror of https://github.com/apache/lucene.git
don't create strings, not needed with lucene trunk
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/branches/solr@924142 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5d9b7b2089
commit
b44d8b0763
|
@ -122,10 +122,14 @@ class SnowballPorterFilter extends TokenFilter {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
stemmer.setCurrent(new String(termBuffer, 0, len));//ugh, wish the Stemmer took a char array
|
stemmer.setCurrent(termBuffer, len);
|
||||||
stemmer.stem();
|
stemmer.stem();
|
||||||
String newstr = stemmer.getCurrent();
|
final char finalTerm[] = stemmer.getCurrentBuffer();
|
||||||
termAtt.setTermBuffer(newstr.toCharArray(), 0, newstr.length());
|
final int newLength = stemmer.getCurrentBufferLength();
|
||||||
|
if (finalTerm != termBuffer)
|
||||||
|
termAtt.setTermBuffer(finalTerm, 0, newLength);
|
||||||
|
else
|
||||||
|
termAtt.setTermLength(newLength);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue