]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Comments.
authorBruno Haible <bruno@clisp.org>
Mon, 13 Mar 2006 12:28:18 +0000 (12:28 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:01 +0000 (12:13 +0200)
gettext-tools/lib/fstrcmp.c

index b8a4a41070a85a2cc4782c59cf9816b702756cea..6907c054e0370312e6049f6fef25d7941756fe6a 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions to make fuzzy comparisons between strings
-   Copyright (C) 1988-1989, 1992-1993, 1995, 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 1988-1989, 1992-1993, 1995, 2001-2003, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    Derived from GNU diff 2.7, analyze.c et al.
 
+   The basic idea is to consider two strings as similar if, when
+   transforming the first string into the second string through a
+   sequence of edits (inserts and deletes of one character each),
+   this sequence is short - or equivalently, if the ordered list
+   of characters that are untouched by these edits is long.  For a
+   good introduction to the subject, read about the "Levenshtein
+   distance" in Wikipedia.
+
    The basic algorithm is described in:
    "An O(ND) Difference Algorithm and its Variations", Eugene Myers,
    Algorithmica Vol. 1 No. 2, 1986, pp. 251-266;
@@ -113,7 +121,7 @@ struct partition
 
    SYNOPSIS
        int diag(int xoff, int xlim, int yoff, int ylim, int minimal,
-               struct partition *part);
+                struct partition *part);
 
    DESCRIPTION
        Find the midpoint of the shortest edit script for a specified
@@ -172,9 +180,9 @@ diag (int xoff, int xlim, int yoff, int ylim, int minimal,
   int odd = (fmid - bmid) & 1;
 
   /*
-        * True if southeast corner is on an odd diagonal with respect
-        * to the northwest.
-        */
+   * True if southeast corner is on an odd diagonal with respect
+   * to the northwest.
+   */
   fd[fmid] = xoff;
   bd[bmid] = xlim;
   for (c = 1;; ++c)