You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2016/06/21 11:44:43 UTC
lucene-solr:master: Let CachingNBClassifier be constructed from
IndexReaders
Repository: lucene-solr
Updated Branches:
refs/heads/master fcf4389d8 -> daa26090a
Let CachingNBClassifier be constructed from IndexReaders
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/daa26090
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/daa26090
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/daa26090
Branch: refs/heads/master
Commit: daa26090a3764e9ffd247d2a3394713d0e568f0c
Parents: fcf4389
Author: Tommaso Teofili <to...@apache.org>
Authored: Tue Jun 21 13:43:54 2016 +0200
Committer: Tommaso Teofili <to...@apache.org>
Committed: Tue Jun 21 13:43:54 2016 +0200
----------------------------------------------------------------------
.../classification/CachingNaiveBayesClassifier.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/daa26090/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
index b87b8d8..6fe6835 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiFields;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
@@ -36,8 +36,6 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TotalHitCountCollector;
import org.apache.lucene.util.BytesRef;
-
-
/**
* A simplistic Lucene based NaiveBayes classifier, with caching feature, see
* <code>http://en.wikipedia.org/wiki/Naive_Bayes_classifier</code>
@@ -61,15 +59,15 @@ public class CachingNaiveBayesClassifier extends SimpleNaiveBayesClassifier {
* Creates a new NaiveBayes classifier with inside caching. If you want less memory usage you could call
* {@link #reInitCache(int, boolean) reInitCache()}.
*
- * @param leafReader the reader on the index to be used for classification
+ * @param indexReader the reader on the index to be used for classification
* @param analyzer an {@link Analyzer} used to analyze unseen text
* @param query a {@link Query} to eventually filter the docs used for training the classifier, or {@code null}
* if all the indexed docs should be used
* @param classFieldName the name of the field used as the output for the classifier
* @param textFieldNames the name of the fields used as the inputs for the classifier
*/
- public CachingNaiveBayesClassifier(LeafReader leafReader, Analyzer analyzer, Query query, String classFieldName, String... textFieldNames) {
- super(leafReader, analyzer, query, classFieldName, textFieldNames);
+ public CachingNaiveBayesClassifier(IndexReader indexReader, Analyzer analyzer, Query query, String classFieldName, String... textFieldNames) {
+ super(indexReader, analyzer, query, classFieldName, textFieldNames);
// building the cache
try {
reInitCache(0, true);