mirror of https://github.com/apache/lucene.git
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:
parent
7f0ad083cf
commit
a8d08f8247
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ public class SimpleNaiveBayesClassifierTest extends ClassificationTestBase<Bytes
|
|||
}
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testPerformance() throws Exception {
|
||||
MockAnalyzer analyzer = new MockAnalyzer(random());
|
||||
|
|
Loading…
Reference in New Issue