You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Christoph Goller <go...@detego-software.de> on 2003/09/05 11:14:32 UTC

PATCH: FuzzyTermEnum

Though it does not have any serious consequences, I think that the
distance matrix in FuzzyTermEnum is initialized a little bit strange.
I changed it to what the author had probably in mind. (patch attached).

Christoph
-- 
*****************************************************************
* Dr. Christoph Goller       Tel.:   +49 89 203 45734           *
* Detego Software GmbH       Mobile: +49 179 1128469            *
* Keuslinstr. 13             Fax.:   +49 721 151516176          *
* 80798 München, Germany     Email:  goller@detego-software.de  *
*****************************************************************

Re: PATCH: FuzzyTermEnum

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Thanks for the patch, applied.
Unfortunately, we don't have any tests for fuzzy queries, to make sure
this doesn't change anything.

Otis

--- Christoph Goller <go...@detego-software.de> wrote:
> Though it does not have any serious consequences, I think that the
> distance matrix in FuzzyTermEnum is initialized a little bit strange.
> I changed it to what the author had probably in mind. (patch
> attached).
> 
> Christoph
> -- 
> *****************************************************************
> * Dr. Christoph Goller       Tel.:   +49 89 203 45734           *
> * Detego Software GmbH       Mobile: +49 179 1128469            *
> * Keuslinstr. 13             Fax.:   +49 721 151516176          *
> * 80798 M�nchen, Germany     Email:  goller@detego-software.de  *
> *****************************************************************
> > Index: FuzzyTermEnum.java
> ===================================================================
> RCS file:
>
/home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/search/FuzzyTermEnum.java,v
> retrieving revision 1.3
> diff -u -r1.3 FuzzyTermEnum.java
> --- FuzzyTermEnum.java	29 Jan 2003 17:18:54 -0000	1.3
> +++ FuzzyTermEnum.java	5 Sep 2003 08:36:55 -0000
> @@ -124,7 +124,7 @@
>       * This static array saves us from the time required to create a
> new array
>       * everytime editDistance is called.
>       */
> -    private int e[][] = new int[0][0];
> +    private int e[][] = new int[1][1];
>      
>      /**
>       Levenshtein distance also known as edit distance is a measure
> of similiarity
> @@ -137,7 +137,7 @@
>       */ 
>      private final int editDistance(String s, String t, int n, int m)
> {
>          if (e.length <= n || e[0].length <= m) {
> -            e = new int[Math.max(e.length, n+1)][Math.max(e.length,
> m+1)];
> +            e = new int[Math.max(e.length,
> n+1)][Math.max(e[0].length, m+1)];
>          }
>          int d[][] = e; // matrix
>          int i; // iterates through s
> 
> >
---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com