mirror of https://github.com/apache/lucene.git
Fix token offsets.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@151040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
70e1848949
commit
59969d788a
|
@ -117,7 +117,7 @@ public final class BrazilianStemFilter extends TokenFilter {
|
||||||
String s = stemmer.stem(token.termText());
|
String s = stemmer.stem(token.termText());
|
||||||
// If not stemmed, dont waste the time creating a new token.
|
// If not stemmed, dont waste the time creating a new token.
|
||||||
if ((s != null) && !s.equals(token.termText())) {
|
if ((s != null) && !s.equals(token.termText())) {
|
||||||
return new Token(s, 0, s.length(), token.type());
|
return new Token(s, token.startOffset(), token.endOffset(), token.type());
|
||||||
}
|
}
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue