From 165ee0d2c00edd48fb90789b3d5caa528fed4fca Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Sat, 13 Sep 2003 23:44:48 +0000 Subject: [PATCH] correct spelling mistake, removed unused import, fixed two javadoc @param mismatches git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150024 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/search/Similarity.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/java/org/apache/lucene/search/Similarity.java b/src/java/org/apache/lucene/search/Similarity.java index b5eedce5e3b..59bf0a39183 100644 --- a/src/java/org/apache/lucene/search/Similarity.java +++ b/src/java/org/apache/lucene/search/Similarity.java @@ -60,7 +60,6 @@ import java.util.Vector; import org.apache.lucene.index.Term; import org.apache.lucene.index.IndexWriter; // for javadoc -import org.apache.lucene.index.IndexReader; // for javadoc import org.apache.lucene.document.Field; // for javadoc @@ -86,7 +85,7 @@ import org.apache.lucene.document.Field; // for javadoc * {@link #queryNorm(float) queryNorm}(q) * * - * + * * * t in q * @@ -173,7 +172,7 @@ public abstract class Similarity { */ public abstract float queryNorm(float sumOfSquaredWeights); - /** Encodes a normalization factor for storage in an index. + /** Encodes a normalization factor for storage in an index. * *

The encoding uses a five-bit exponent and three-bit mantissa, thus * representing values from around 7x10^9 to 2x10^-9 with about one @@ -197,7 +196,7 @@ public abstract class Similarity { int bits = ((exponent+(63-15)) << 24) | (mantissa << 21); return Float.intBitsToFloat(bits); } - + private static byte floatToByte(float f) { if (f < 0.0f) // round negatives up to zero f = 0.0f; @@ -229,13 +228,13 @@ public abstract class Similarity { * form the initial score for a document. * *

Terms and phrases repeated in a document indicate the topic of the - * document, so implemenations of this method usually return larger values + * document, so implementations of this method usually return larger values * when freq is large, and smaller values when freq * is small. * *

The default implementation calls {@link #tf(float)}. * - * @param tf the frequency of a term within a document + * @param freq the frequency of a term within a document * @return a score factor based on a term's within-document frequency */ public float tf(int freq) { @@ -247,7 +246,7 @@ public abstract class Similarity { * the frequency that is passed to {@link #tf(float)}. * *

A phrase match with a small edit distance to a document passage more - * closely matches the document, so implemenations of this method usually + * closely matches the document, so implementations of this method usually * return larger values when the edit distance is small and smaller values * when it is large. * @@ -267,11 +266,11 @@ public abstract class Similarity { * when freq is large, and smaller values when freq * is small. * - * @param tf the frequency of a term within a document + * @param freq the frequency of a term within a document * @return a score factor based on a term's within-document frequency */ public abstract float tf(float freq); - + /** Computes a score factor for a simple term. * *

The default implementation is:

@@ -322,7 +321,7 @@ public abstract class Similarity {
    * @return a score factor based on the term's document frequency
    */
   protected abstract float idf(int docFreq, int numDocs);
-    
+
   /** Computes a score factor based on the fraction of all query terms that a
    * document contains.  This value is multiplied into scores.
    *