From: Bruno Haible Date: Mon, 13 Mar 2006 12:28:18 +0000 (+0000) Subject: Comments. X-Git-Tag: v0.15~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66e9d5a60cbcfebe9deab42371bbcf8cc21442d1;p=thirdparty%2Fgettext.git Comments. --- diff --git a/gettext-tools/lib/fstrcmp.c b/gettext-tools/lib/fstrcmp.c index b8a4a4107..6907c054e 100644 --- a/gettext-tools/lib/fstrcmp.c +++ b/gettext-tools/lib/fstrcmp.c @@ -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 @@ -18,6 +18,14 @@ 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)