Skip to content

Apache Lucene open-source search software

LUCENE-6045 - fixed javadocs

Tommaso Teofili11c4a88e23a9
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java
index 9448bb1fbf4..6c9aff9c208 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java
@@ -64,6 +64,20 @@ public class BooleanPerceptronClassifier implements Classifier<Boolean> {
private final String textFieldName;
private FST<Long> fst;
+ /**
+ * Creates a {@link BooleanPerceptronClassifier}
+ *
+ * @param leafReader the reader on the index to be used for classification
+ * @param textFieldName the name of the field used as input for the classifier
+ * @param classFieldName the name of the field used as the output for the classifier
+ * @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 batchSize the size of the batch of docs to use for updating the perceptron weights
+ * @param threshold the threshold used for class separation
+ * @throws IOException if the building of the underlying {@link FST} fails and / or {@link TermsEnum} for the text field
+ * cannot be found
+ */
public BooleanPerceptronClassifier(LeafReader leafReader, String textFieldName, String classFieldName, Analyzer analyzer,
Query query, Integer batchSize, Double threshold) throws IOException {
this.textTerms = MultiFields.getTerms(leafReader, textFieldName);
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 3f69011a455..89a060cd69f 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
@@ -59,8 +59,15 @@ public class CachingNaiveBayesClassifier extends SimpleNaiveBayesClassifier {
private int docsWithClassSize;
/**
- * Creates a new NaiveBayes classifier with inside caching. If you want less memory usage you could
- * call {@link #reInitCache(int, boolean) reInitCache()}.
+ * 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 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);
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
index 27597952d24..9d2c68326c1 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
@@ -53,6 +53,19 @@ public class KNearestNeighborClassifier implements Classifier<BytesRef> {
private final int k;
private final Query query;
+ /**
+ * Creates a {@link KNearestNeighborClassifier}.
+ *
+ * @param leafReader 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 k the no. of docs to select in the MLT results to find the nearest neighbor
+ * @param minDocsFreq {@link MoreLikeThis#minDocFreq} parameter
+ * @param minTermFreq {@link MoreLikeThis#minTermFreq} parameter
+ * @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 KNearestNeighborClassifier(LeafReader leafReader, Analyzer analyzer, Query query, int k, int minDocsFreq,
int minTermFreq, String classFieldName, String... textFieldNames) {
this.textFieldNames = textFieldNames;
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
index b44a86178f6..cbbb77782f7 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
@@ -80,7 +80,13 @@ public class SimpleNaiveBayesClassifier implements Classifier<BytesRef> {
/**
* Creates a new NaiveBayes classifier.
- * classify any documents.
+ *
+ * @param leafReader 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 SimpleNaiveBayesClassifier(LeafReader leafReader, Analyzer analyzer, Query query, String classFieldName, String... textFieldNames) {
this.leafReader = leafReader;
@@ -183,7 +189,7 @@ public class SimpleNaiveBayesClassifier implements Classifier<BytesRef> {
q.add(query, BooleanClause.Occur.MUST);
}
indexSearcher.search(q,
- totalHitCountCollector);
+ totalHitCountCollector);
docCount = totalHitCountCollector.getTotalHits();
}
return docCount;