lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/document Field.java
Date Sun, 10 Oct 2004 18:43:18 GMT
dnaber      2004/10/10 11:43:18

  Modified:    src/java/org/apache/lucene/search Scorer.java
                        Similarity.java FuzzyQuery.java Weight.java
               src/java/org/apache/lucene/queryParser QueryParser.jj
               src/java/org/apache/lucene/document Field.java
  Log:
  some javadoc comment improvements
  
  PR: 31350
  Submitted by: Paul Elschot
  
  Revision  Changes    Path
  1.8       +9 -7      jakarta-lucene/src/java/org/apache/lucene/search/Scorer.java
  
  Index: Scorer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Scorer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Scorer.java	22 Sep 2004 17:56:00 -0000	1.7
  +++ Scorer.java	10 Oct 2004 18:43:18 -0000	1.8
  @@ -19,9 +19,9 @@
   import java.io.IOException;
   
   /** Expert: Common scoring functionality for different types of queries.
  - * <br>A <code>Scorer</code> iterates over all documents matching a query,
  + * <br>A <code>Scorer</code> either iterates over documents matching
a query,
    * or provides an explanation of the score for a query for a given document.
  - * <br>Scores are computed using a given <code>Similarity</code> implementation.
  + * <br>Document scores are computed using a given <code>Similarity</code>
implementation.
    */
   public abstract class Scorer {
     private Similarity similarity;
  @@ -41,6 +41,7 @@
     /** Scores and collects all matching documents.
      * @param hc The collector to which all matching documents are passed through
      * {@link HitCollector#collect(int, float)}.
  +   * <br>When this method is used the {@link #explain(int)} method should not be
used.
      */
     public void score(HitCollector hc) throws IOException {
       while (next()) {
  @@ -67,6 +68,7 @@
   
     /** Advances to the next document matching the query.
      * @return true iff there is another document matching the query.
  +   * <br>When this method is used the {@link #explain(int)} method should not be
used.
      */
     public abstract boolean next() throws IOException;
   
  @@ -81,7 +83,8 @@
     public abstract float score() throws IOException;
   
     /** Skips to the first match beyond the current whose document number is
  -   * greater than or equal to a given target. 
  +   * greater than or equal to a given target.
  +   * <br>When this method is used the {@link #explain(int)} method should not be
used.
      * @param target The target document number.
      * @return true iff there is such a match.
      * <p>Behaves as if written: <pre>
  @@ -92,14 +95,13 @@
      *     } while (target > doc());
      *     return true;
      *   }
  -   * </pre>
  -   * Most implementations are considerably more efficient than that.
  +   * </pre>Most implementations are considerably more efficient than that.
      */
     public abstract boolean skipTo(int target) throws IOException;
   
     /** Returns an explanation of the score for a document.
  -   * <br>When this method is used, the {@link #next()} method
  -   * and the {@link #score(HitCollector)} method should not be used.
  +   * <br>When this method is used, the {@link #next()}, {@link #skipTo(int)} and
  +   * {@link #score(HitCollector)} methods should not be used.
      * @param doc The document number for the explanation.
      */
     public abstract Explanation explain(int doc) throws IOException;
  
  
  
  1.15      +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/Similarity.java
  
  Index: Similarity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Similarity.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Similarity.java	22 Sep 2004 18:18:27 -0000	1.14
  +++ Similarity.java	10 Oct 2004 18:43:18 -0000	1.15
  @@ -99,7 +99,7 @@
      * @see #encodeNorm(float)
      */
     public static float decodeNorm(byte b) {
  -    return NORM_TABLE[b & 0xFF];
  +    return NORM_TABLE[b & 0xFF];  // & 0xFF maps negative bytes to positive above
127
     }
   
     /** Returns a table for decoding normalization bytes.
  
  
  
  1.9       +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/FuzzyQuery.java
  
  Index: FuzzyQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/FuzzyQuery.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FuzzyQuery.java	6 Oct 2004 16:19:51 -0000	1.8
  +++ FuzzyQuery.java	10 Oct 2004 18:43:18 -0000	1.9
  @@ -86,7 +86,7 @@
     }
       
     /**
  -   * Returns the prefix length, i.e. the number of characters at the start
  +   * Returns the non-fuzzy prefix length. This is the number of characters at the start
      * of a term that must be identical (not fuzzy) to the query term if the query
      * is to match that term. 
      */
  
  
  
  1.5       +12 -7     jakarta-lucene/src/java/org/apache/lucene/search/Weight.java
  
  Index: Weight.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Weight.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Weight.java	17 Aug 2004 20:38:45 -0000	1.4
  +++ Weight.java	10 Oct 2004 18:43:18 -0000	1.5
  @@ -21,13 +21,18 @@
   import org.apache.lucene.index.IndexReader;
   
   /** Expert: Calculate query weights and build query scorers.
  - *
  - * <p>A Weight is constructed by a query, given a Searcher ({@link
  - * Query#createWeight(Searcher)}).  The {@link #sumOfSquaredWeights()} method
  - * is then called on the top-level query to compute the query normalization
  - * factor {@link Similarity#queryNorm(float)}.  This factor is then passed to
  - * {@link #normalize(float)}.  At this point the weighting is complete and a
  - * scorer may be constructed by calling {@link #scorer(IndexReader)}.
  + * <br>A <code>Weight</code> is used in the following way:
  + * <ol>
  + * <li>A <code>Weight</code> is constructed by a top-level query,
  + *     given a <code>Searcher</code> ({@link Query#createWeight(Searcher)}).
  + * <li>The {@link #sumOfSquaredWeights()} method is called
  + *     on the <code>Weight</code> to compute
  + *     the query normalization factor {@link Similarity#queryNorm(float)}
  + *     of the query clauses contained in the query.
  + * <li>The query normalization factor is passed to {@link #normalize(float)}.
  + *     At this point the weighting is complete.
  + * <li>A <code>Scorer</code> is constructed by {@link #scorer(IndexReader)}.
  + * </ol>
    */
   public interface Weight extends java.io.Serializable {
     /** The query that this concerns. */
  
  
  
  1.52      +1 -1      jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj
  
  Index: QueryParser.jj
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- QueryParser.jj	6 Oct 2004 16:19:51 -0000	1.51
  +++ QueryParser.jj	10 Oct 2004 18:43:18 -0000	1.52
  @@ -496,7 +496,7 @@
   
     /**
      * Returns a String where those characters that QueryParser
  -   * expects to be escaped are escaped, i.e. preceded by a <code>\</code>.
  +   * expects to be escaped are escaped by a preceding <code>\</code>.
      */
     public static String escape(String s) {
       StringBuffer sb = new StringBuffer();
  
  
  
  1.29      +3 -2      jakarta-lucene/src/java/org/apache/lucene/document/Field.java
  
  Index: Field.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/document/Field.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Field.java	6 Oct 2004 20:03:25 -0000	1.28
  +++ Field.java	10 Oct 2004 18:43:18 -0000	1.29
  @@ -246,8 +246,9 @@
       return f;
     }
     
  -  /** The name of the field (e.g., "date", "title", "body", ...)
  -    as an interned string. */
  +  /** Returns the name of the field as an interned string.
  +   * For example "date", "title", "body", ...
  +   */
     public String name()    { return name; }
   
     /** The value of the field as a String, or null.  If null, the Reader value
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message