lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search FuzzyTermEnum.java
Date Thu, 11 Sep 2003 10:02:26 GMT
otis        2003/09/11 03:02:26

  Modified:    src/java/org/apache/lucene/search FuzzyTermEnum.java
  Log:
  - Small distance matrix initialization change.
  Submitted by: Christoph Goller
  Reviewed by: Otis
  
  Revision  Changes    Path
  1.4       +2 -2      jakarta-lucene/src/java/org/apache/lucene/search/FuzzyTermEnum.java
  
  Index: FuzzyTermEnum.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/FuzzyTermEnum.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FuzzyTermEnum.java	29 Jan 2003 17:18:54 -0000	1.3
  +++ FuzzyTermEnum.java	11 Sep 2003 10:02:26 -0000	1.4
  @@ -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
  
  
  

Mime
View raw message