lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Rowe <sar...@syr.edu>
Subject Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/analysis StopFilter.java
Date Mon, 01 Dec 2003 18:42:36 GMT
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


Mime
View raw message