Talk:Levenshtein distance: Difference between revisions

m
(verbose details for J)
Line 92:
In other words, each instance of this operation is computing the new insert and substitute costs based on the previous values. (That said, note that "insert" and "delete" are arbitrary designations -- an "insert" on the string 'kitten' will be a delete on the string 'sitting', and vice versa.)
 
The downside, of these kinds of dynamic algorithms is that while the individual operations can be easy or trivial to picture, the cascading dependencies make comprehending the data as a whole rather difficultslippery. But perhaps viewing the data as a whole, with significant intermediate results, can help:
 
<lang j> 'kitten' {."1@((1&{ ,~ {. + <./@}.)@,/\.)@,./\.@levD 'sitting'
6,962

edits