mirror of https://github.com/apache/lucene.git
SOLR-1342: CapitalizationFilterFactory uses incorrect term length calculations.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@801845 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ce84cfc655
commit
1b2549e92f
|
@ -456,6 +456,10 @@ Bug Fixes
|
|||
54. SOLR-1317: Fix CapitalizationFilterFactory to work when keep parameter is not specified.
|
||||
(ehatcher)
|
||||
|
||||
55. SOLR-1342: CapitalizationFilterFactory uses incorrect term length calculations.
|
||||
(Robert Muir via Mark Miller)
|
||||
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
1. Upgraded to Lucene 2.4.0 (yonik)
|
||||
|
|
|
@ -209,7 +209,7 @@ class CapitalizationFilter extends TokenFilter {
|
|||
//make a backup in case we exceed the word count
|
||||
System.arraycopy(termBuffer, 0, backup, 0, termBufferLength);
|
||||
}
|
||||
if (termBuffer.length < factory.maxTokenLength) {
|
||||
if (termBufferLength < factory.maxTokenLength) {
|
||||
int wordCount = 0;
|
||||
|
||||
int lastWordStart = 0;
|
||||
|
@ -226,8 +226,8 @@ class CapitalizationFilter extends TokenFilter {
|
|||
}
|
||||
|
||||
// process the last word
|
||||
if (lastWordStart < termBuffer.length) {
|
||||
factory.processWord(termBuffer, lastWordStart, termBuffer.length - lastWordStart, wordCount++);
|
||||
if (lastWordStart < termBufferLength) {
|
||||
factory.processWord(termBuffer, lastWordStart, termBufferLength - lastWordStart, wordCount++);
|
||||
}
|
||||
|
||||
if (wordCount > factory.maxWordCount) {
|
||||
|
|
Loading…
Reference in New Issue