LUCENE-6435 - applied Adrien Grand's patch to avoid CME on SNBC

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1705850 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tommaso Teofili 2015-09-29 12:49:40 +00:00
parent 7f0ad083cf
commit a8d08f8247
2 changed files with 3 additions and 2 deletions

View File

@ -150,8 +150,10 @@ public class SimpleNaiveBayesClassifier implements Classifier<BytesRef> {
int docsWithClassSize = countDocsWithClass();
while ((next = termsEnum.next()) != null) {
if (next.length > 0) {
// We are passing the term to IndexSearcher so we need to make sure it will not change over time
next = BytesRef.deepCopyOf(next);
double clVal = calculateLogPrior(next, docsWithClassSize) + calculateLogLikelihood(tokenizedDoc, next, docsWithClassSize);
dataList.add(new ClassificationResult<>(BytesRef.deepCopyOf(next), clVal));
dataList.add(new ClassificationResult<>(next, clVal));
}
}

View File

@ -88,7 +88,6 @@ public class SimpleNaiveBayesClassifierTest extends ClassificationTestBase<Bytes
}
}
@Ignore
@Test
public void testPerformance() throws Exception {
MockAnalyzer analyzer = new MockAnalyzer(random());