Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I added a few punctuation marks, and fixed a typo in the levenshtein-distance docstring. #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/np_diff.pdf
Binary file not shown.
14 changes: 7 additions & 7 deletions src/clj/clj_diff/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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)))
Expand Down