otis        2002/07/14 10:21:57

  Modified:    src/java/org/apache/lucene/queryParser QueryParser.jj
  Log:
  - Renamed a few recently added variables and methods for consistency.
  
  Revision  Changes    Path
  1.20      +12 -11    
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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- QueryParser.jj    14 Jul 2002 17:16:21 -0000      1.19
  +++ QueryParser.jj    14 Jul 2002 17:21:57 -0000      1.20
  @@ -159,25 +159,26 @@
   
       // CODE ADDED BY PETER HALACSY
   
  -    /** The actual mode that parses uses to parse queries */
       public static final int DEFAULT_OPERATOR_OR  = 0;
       public static final int DEFAULT_OPERATOR_AND = 1;
   
  -    private int mode = DEFAULT_OPERATOR_OR;
  +    /** The actual operator that parser uses to combine query terms */
  +    private int operator = DEFAULT_OPERATOR_OR;
   
       /**
  -     * Set the mode of the QueryParser. In classic mode 
(<code>DEFAULT_OPERATOR_OR</mode>)
  -     * term without any modifiers are considered optional: for example <code>
  -     * capital of Hungary</code> is equal to <code>capital OR of OR 
Hungary</code>.<br/>
  +     * Set the boolean operator of the QueryParser.
  +     * In classic mode (<code>DEFAULT_OPERATOR_OR</mode>) 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
        * above mentioned query is parsed as <code>capital AND of AND Hungary</code>
        */
  -    public void setMode(int mode) {
  -     this.mode = mode;
  +    public void setOperator(int operaror) {
  +     this.operator = operator;
       }
   
  -    public int getMode() {
  -     return this.mode;
  +    public int getOperator() {
  +     return this.operator;
       }
   
     private void addClause(Vector clauses, int conj, int mods, Query q) {
  @@ -191,7 +192,7 @@
           c.required = true;
       }
       // THIS CODE ADDED PETER HALACSY
  -    if(mode == DEFAULT_OPERATOR_AND && conj == CONJ_OR) {
  +    if (operator == DEFAULT_OPERATOR_AND && conj == CONJ_OR) {
        // If this term is introduced by OR, make the preceding term optional,
        // unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b)
        // notice if the input is a OR b, first term is parsed as required; without
  @@ -207,7 +208,7 @@
       if (q == null)
         return;
   
  -    if(mode == DEFAULT_OPERATOR_OR) {
  +    if (operator == DEFAULT_OPERATOR_OR) {
        // THIS IS THE ORIGINAL CODE
           // We set REQUIRED if we're introduced by AND or +; PROHIBITED if
           // introduced by NOT or -; make sure not to set both.
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to