diff --git a/doc/np_diff.pdf b/doc/np_diff.pdf new file mode 100644 index 0000000..1cf512b Binary files /dev/null and b/doc/np_diff.pdf differ diff --git a/src/clj/clj_diff/core.clj b/src/clj/clj_diff/core.clj index 65612e9..b876b49 100644 --- a/src/clj/clj_diff/core.clj +++ b/src/clj/clj_diff/core.clj @@ -45,7 +45,7 @@ (defmulti ^{:arglists '([s edit-script])} patch "Use the instructions in the edit script to transform the sequence s into - a new sequence. If the edit script was created by using diff on a and b then + a new sequence. If the edit script was created by using diff on a and b, then patch will use the edit script to transform a into b. (diff a b) -> x, (patch a x) -> b." @@ -84,14 +84,14 @@ needed to transform one string into the other, with the allowable edit operations being insertion, deletion and substitution of a single character. - This function works not only with strings but with any Clojure sequence. + This function works, not only with strings, but with any Clojure sequence. - Warning! Technically this function is estimating the Levenshtein distance + Warning! Technically, this function is estimating the Levenshtein distance from a computed diff. Most of the time, it is the same as the real Levenshtein - distance but in same cases it may be larger. The reason for this is that - there may be multiple paths through an edit graph with the same edit - distance but with differing Levenshtein distance. A future improvement to - the diff algorithm whould be to find all paths and prefer the one with the + distance, but in same cases it may be larger. The reason for this is that + there may be multiple paths through an edit graph, with the same edit + distance, but with differing Levenshtein distance. A future improvement to + the diff algorithm would be to find all paths, and prefer the one with the minimum Levenshtein distance." ([a b] (levenshtein-distance (diff a b)))