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/queryParser QueryParser.java QueryParser.jj
Date Fri, 15 Oct 2004 19:47:43 GMT
dnaber      2004/10/15 12:47:43

  Modified:    src/java/org/apache/lucene/queryParser QueryParser.java
                        QueryParser.jj
  Log:
  several small documentation fixes --  no functional change except a "Usage" message in the
main() method
  
  Revision  Changes    Path
  1.20      +24 -12    jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.java
  
  Index: QueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- QueryParser.java	12 Oct 2004 09:36:12 -0000	1.19
  +++ QueryParser.java	15 Oct 2004 19:47:43 -0000	1.20
  @@ -12,7 +12,7 @@
   
   /**
    * This class is generated by JavaCC.  The only method that clients should need
  - * to call is <a href="#parse">parse()</a>.
  + * to call is {@link #parse(String)} or {@link #parse(String, String, Analyzer)}.
    *
    * The syntax for query strings is as follows:
    * A Query is a series of clauses.
  @@ -40,7 +40,8 @@
    *
    * <p>
    * Examples of appropriately formatted queries can be found in the <a
  - * href="http://jakarta.apache.org/lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java">test
cases</a>.
  + * href="http://jakarta.apache.org/lucene/docs/queryparsersyntax.html">query syntax
  + * documentation</a>.
    * </p>
    *
    * @author Brian Goetz
  @@ -64,10 +65,6 @@
     /** The actual operator that parser uses to combine query terms */
     private int operator = DEFAULT_OPERATOR_OR;
   
  -  /**
  -   * Whether terms of wildcard and prefix queries are to be automatically
  -   * lower-cased or not.  Default is <code>true</code>.
  -   */
     boolean lowercaseWildcardTerms = true;
   
     Analyzer analyzer;
  @@ -99,8 +96,7 @@
       field = f;
     }
   
  -  /** Parses a query string, returning a
  -   * <a href="lucene.search.Query.html">Query</a>.
  +  /** Parses a query string, returning a {@link org.apache.lucene.search.Query}.
      *  @param query  the query string to be parsed.
      *  @throws ParseException if the parsing fails
      */
  @@ -155,7 +151,7 @@
     }
   
     /**
  -   * Set the prefix length for fuzzy queries. Default is 2.
  +   * Set the prefix length for fuzzy queries. Default is 0.
      * @param fuzzyPrefixLength The fuzzyPrefixLength to set.
      */
     public void setFuzzyPrefixLength(int fuzzyPrefixLength) {
  @@ -179,7 +175,7 @@
   
     /**
      * Sets the boolean operator of the QueryParser.
  -   * In classic mode (<code>DEFAULT_OPERATOR_OR</code>) terms without any modifiers
  +   * In default mode (<code>DEFAULT_OPERATOR_OR</code>) terms without any modifiers
      * are considered optional: for example <code>capital of Hungary</code> is
equal to
      * <code>capital OR of OR Hungary</code>.<br/>
      * In <code>DEFAULT_OPERATOR_AND</code> terms are considered to be in conjuction:
the
  @@ -197,10 +193,17 @@
       return operator;
     }
   
  +  /**
  +   * Whether terms of wildcard and prefix queries are to be automatically
  +   * lower-cased or not.  Default is <code>true</code>.
  +   */
     public void setLowercaseWildcardTerms(boolean lowercaseWildcardTerms) {
       this.lowercaseWildcardTerms = lowercaseWildcardTerms;
     }
   
  +  /**
  +   * @see #setLowercaseWildcardTerms(boolean)
  +   */
     public boolean getLowercaseWildcardTerms() {
       return lowercaseWildcardTerms;
     }
  @@ -450,7 +453,7 @@
   
     /**
      * Factory method for generating a query (similar to
  -   * ({@link #getWildcardQuery}). Called when parser parses an input term
  +   * {@link #getWildcardQuery}). Called when parser parses an input term
      * token that uses prefix notation; that is, contains a single '*' wildcard
      * character as its last character. Since this is a special case
      * of generic wildcard term, and such a query can be optimized easily,
  @@ -489,7 +492,7 @@
   
      /**
      * Factory method for generating a query (similar to
  -   * ({@link #getWildcardQuery}). Called when parser parses
  +   * {@link #getWildcardQuery}). Called when parser parses
      * an input term token that has the fuzzy suffix (~) appended.
      *
      * @param field Name of the field query will use.
  @@ -539,7 +542,16 @@
       return sb.toString();
     }
   
  +  /**
  +   * Command line tool to test QueryParser, using {@link org.apache.lucene.analysis.SimpleAnalyzer}.
  +   * Usage:<br>
  +   * <code>java org.apache.lucene.queryParser.QueryParser &lt;input&gt;</code>
  +   */
     public static void main(String[] args) throws Exception {
  +    if (args.length == 0) {
  +      System.out.println("Usage: java org.apache.lucene.queryParser.QueryParser <input>");
  +      System.exit(0);
  +    }
       QueryParser qp = new QueryParser("field",
                              new org.apache.lucene.analysis.SimpleAnalyzer());
       Query q = qp.parse(args[0]);
  
  
  
  1.54      +24 -12    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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- QueryParser.jj	12 Oct 2004 09:36:12 -0000	1.53
  +++ QueryParser.jj	15 Oct 2004 19:47:43 -0000	1.54
  @@ -35,7 +35,7 @@
   
   /**
    * This class is generated by JavaCC.  The only method that clients should need
  - * to call is <a href="#parse">parse()</a>.
  + * to call is {@link #parse(String)} or {@link #parse(String, String, Analyzer)}.
    *
    * The syntax for query strings is as follows:
    * A Query is a series of clauses.
  @@ -63,7 +63,8 @@
    *
    * <p>
    * Examples of appropriately formatted queries can be found in the <a
  - * href="http://jakarta.apache.org/lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java">test
cases</a>.
  + * href="http://jakarta.apache.org/lucene/docs/queryparsersyntax.html">query syntax
  + * documentation</a>.
    * </p>
    *
    * @author Brian Goetz
  @@ -87,10 +88,6 @@
     /** The actual operator that parser uses to combine query terms */
     private int operator = DEFAULT_OPERATOR_OR;
   
  -  /**
  -   * Whether terms of wildcard and prefix queries are to be automatically
  -   * lower-cased or not.  Default is <code>true</code>.
  -   */
     boolean lowercaseWildcardTerms = true;
   
     Analyzer analyzer;
  @@ -122,8 +119,7 @@
       field = f;
     }
   
  -  /** Parses a query string, returning a
  -   * <a href="lucene.search.Query.html">Query</a>.
  +  /** Parses a query string, returning a {@link org.apache.lucene.search.Query}.
      *  @param query  the query string to be parsed.
      *  @throws ParseException if the parsing fails
      */
  @@ -178,7 +174,7 @@
     }
     
     /**
  -   * Set the prefix length for fuzzy queries. Default is 2.
  +   * Set the prefix length for fuzzy queries. Default is 0.
      * @param fuzzyPrefixLength The fuzzyPrefixLength to set.
      */
     public void setFuzzyPrefixLength(int fuzzyPrefixLength) {
  @@ -202,7 +198,7 @@
   
     /**
      * Sets the boolean operator of the QueryParser.
  -   * In classic mode (<code>DEFAULT_OPERATOR_OR</code>) terms without any modifiers
  +   * In default mode (<code>DEFAULT_OPERATOR_OR</code>) terms without any modifiers
      * are considered optional: for example <code>capital of Hungary</code> is
equal to
      * <code>capital OR of OR Hungary</code>.<br/>
      * In <code>DEFAULT_OPERATOR_AND</code> terms are considered to be in conjuction:
the
  @@ -220,10 +216,17 @@
       return operator;
     }
   
  +  /**
  +   * Whether terms of wildcard and prefix queries are to be automatically
  +   * lower-cased or not.  Default is <code>true</code>.
  +   */
     public void setLowercaseWildcardTerms(boolean lowercaseWildcardTerms) {
       this.lowercaseWildcardTerms = lowercaseWildcardTerms;
     }
   
  +  /**
  +   * @see #setLowercaseWildcardTerms(boolean)
  +   */
     public boolean getLowercaseWildcardTerms() {
       return lowercaseWildcardTerms;
     }
  @@ -473,7 +476,7 @@
   
     /**
      * Factory method for generating a query (similar to
  -   * ({@link #getWildcardQuery}). Called when parser parses an input term
  +   * {@link #getWildcardQuery}). Called when parser parses an input term
      * token that uses prefix notation; that is, contains a single '*' wildcard
      * character as its last character. Since this is a special case
      * of generic wildcard term, and such a query can be optimized easily,
  @@ -512,7 +515,7 @@
     
      /**
      * Factory method for generating a query (similar to
  -   * ({@link #getWildcardQuery}). Called when parser parses
  +   * {@link #getWildcardQuery}). Called when parser parses
      * an input term token that has the fuzzy suffix (~) appended.
      *
      * @param field Name of the field query will use.
  @@ -562,7 +565,16 @@
       return sb.toString();
     }
   
  +  /**
  +   * Command line tool to test QueryParser, using {@link org.apache.lucene.analysis.SimpleAnalyzer}.
  +   * Usage:<br>
  +   * <code>java org.apache.lucene.queryParser.QueryParser &lt;input&gt;</code>
  +   */
     public static void main(String[] args) throws Exception {
  +    if (args.length == 0) {
  +      System.out.println("Usage: java org.apache.lucene.queryParser.QueryParser <input>");
  +      System.exit(0);
  +    }
       QueryParser qp = new QueryParser("field",
                              new org.apache.lucene.analysis.SimpleAnalyzer());
       Query q = qp.parse(args[0]);
  
  
  

---------------------------------------------------------------------
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