You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by cu...@apache.org on 2003/12/01 19:23:47 UTC

cvs commit: jakarta-lucene/src/java/org/apache/lucene/analysis StopFilter.java

cutting     2003/12/01 10:23:47

  Modified:    src/java/org/apache/lucene/analysis StopFilter.java
  Log:
  Removed a line of dead code.
  
  Revision  Changes    Path
  1.5       +0 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java
  
  Index: StopFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StopFilter.java	28 Nov 2003 02:03:14 -0000	1.4
  +++ StopFilter.java	1 Dec 2003 18:23:47 -0000	1.5
  @@ -99,7 +99,6 @@
       for (Token token = input.next(); token != null; token = input.next()) {
         if (table.get(token.termText) == null) {
           token.setPositionIncrement(position);
  -        position = 1;
           return token;
         }
   
  
  
  

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


Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/analysis StopFilter.java

Posted by Steve Rowe <sa...@syr.edu>.
You're right--sorry for the noise. - Steve

Doug Cutting wrote:
> Steve Rowe wrote:
>> The line you removed is not dead code; the "position" variable (which 
>> IMNSHO should be named "positionIncrement" or something like it) needs 
>> to be reset to the default value.
> 
> The 'position' variable is local to the method, not a field as in your 
> original patch.  So it is automatically "reset" each time the method is 
> called, and need not be explicitly reset.
> 
> Doug



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


Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/analysis StopFilter.java

Posted by Doug Cutting <cu...@lucene.com>.
Steve Rowe wrote:
> The line you removed is not dead code; the "position" variable (which 
> IMNSHO should be named "positionIncrement" or something like it) needs 
> to be reset to the default value.

The 'position' variable is local to the method, not a field as in your 
original patch.  So it is automatically "reset" each time the method is 
called, and need not be explicitly reset.

Doug


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


Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/analysis StopFilter.java

Posted by Steve Rowe <sa...@syr.edu>.
Doug,

The line you removed is not dead code; the "position" variable (which 
IMNSHO should be named "positionIncrement" or something like it) needs 
to be reset to the default value.  Otherwise, its value will increase 
without bound with every stopword, and sloppy phrases won't properly 
match across stopwords, because the position increment applied will be 
out of proportion with the original text.

Don't know if it makes any difference, but the patch I independently 
developed and submitted for this problem (Bug #23730: 
<URL:http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23730>) contains 
exactly the same code.

Steve

cutting@apache.org wrote:
> cutting     2003/12/01 10:23:47
> 
>   Modified:    src/java/org/apache/lucene/analysis StopFilter.java
>   Log:
>   Removed a line of dead code.
>   
>   Revision  Changes    Path
>   1.5       +0 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java
>   
>   Index: StopFilter.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- StopFilter.java	28 Nov 2003 02:03:14 -0000	1.4
>   +++ StopFilter.java	1 Dec 2003 18:23:47 -0000	1.5
>   @@ -99,7 +99,6 @@
>        for (Token token = input.next(); token != null; token = input.next()) {
>          if (table.get(token.termText) == null) {
>            token.setPositionIncrement(position);
>   -        position = 1;
>            return token;
>          }
>    
>   
>   
>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 



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