Talk:Damerau–Levenshtein distance

message: Please someone check these edits
: http://en.wikipedia.org/w/index.php?title=Damerau%E2%80%93Levenshtein_distance&diff=285208890&oldid=284007942
--CiaPan (talk) 18:16, 23 April 2009 (UTC)
replies: text: I don't think that's what Wikipedia is for, is it? The part I deleted is pasted here for posterity. If it's original research, it doesn't belong in the article, but I'm struggling even to see the relevance of an allegedly superior algorithm, except perhaps as a link in the 'See Also' section. SeanCollins (talk) 05:26, 11 December 2009 (UTC)
thread_title:  Original research 

message: Unsourced text is disallowed in wikipedia. There is no way to prove that the code is correct. And it is not a job of wikipedia to do that. Proofs of correctness of any wikipedia statements are only through references. Please don't restore the deleted text without providing references. Last Lost (talk) 23:36, 25 October 2010 (UTC)
replies: text:  I do have citations for both pieces of code. So I'm still trying to figure out why they were removed :) Hopefully will get it back up soon. You can check the history in the mean time (the one last edited by me) Gabiteodoru (talk) 02:35, 27 October 2010 (UTC)
replies: text: Sorry. I didn't notice the citations, since they were well above the code itself. Last Lost (talk) 22:45, 3 November 2010 (UTC)

text: I know what you mean. I'm currently trying to implement it in C#, i.e. not even translating it to some other language. The problem is, I don't want to just copy the code, but actually understand it. I'll report back after figuring out what the various parts do and what the variables represent. --Wormbo 18:41, 6 January 2012 (UTC)
thread_title:  Code 

message: Who can help me with this specific piece of (pseudo-)code?
DA[a[i-1]] = i;
What I understand:
* a is an array of characters.
* a[i-1] is the character at position i-1.
* that is, DA is indexed by characters? But a few lines above, DA is initialized with integer indices:
for(var d:uint = 0; d<C; ++d) DA[d]=0;  — Preceding unsigned comment added by 188.154.155.131 (talk) 10:04, 4 June 2011 (UTC)
replies: text: uh it's a really confusing algorithm; characters are represented by integers; read the paper if you want to understand itGabi Teodoru 22:11, 23 June 2011 (UTC)
thread_title:  Pseudo-code of function damerauLevenshteinDistance 

message: The definition has clearly specified that Damerau Levenshtein Distance allows transpose, whereas the pseudocode in the next section presents more restricted version of the same. The definition and the pseudo code both should point to same thing. This is conflicting.  — Preceding unsigned comment added by 2620:10D:C082:1054:2ACF:E9FF:FE1E:7E97 (talk) 21:35, 7 May 2015 (UTC)
thread_title:  Definition vs Pseudo Code (Conflict) 

message: What source is "" at the bottom of the "Algorithm" section referring to? That note doesn't exist in the "References" section. - dcljr (talk) 23:59, 8 February 2012 (UTC)
replies: text: Yes, the note exists at the very end of "External links" as 'Site devoted to fuzzy searching and information retrieval'. When browsing the article's source, look for . --CiaPan (talk) 21:06, 11 February 2012 (UTC)
thread_title:  Missing ref? 

message: I wonder whether the terms optimal string alignment and restricted edit distance originate from scientific literature. Both terms are used in the Wikipedia article for describing the first algorithm since the first version of the article from 2005, but I cannot find older literature which uses these terms. In particular, I cannot find a hint on this terminology in the cited paper of Oommen and Loke, which uses this algorithm for handling generalized transpositions. Only some publications from recent years adopted the unverified terminology from Wikipedia.
Moreover, the concept of alignment does not use transpositions at all in my understanding. In fact, optimal string alignment redirects to Levenshtein distance, and the article on sequence alignment does not consider transpositions.
The terms optimal string alignment and restricted edit distance should be removed (and maybe replace by an original name from scientific literature), if they cannot be verified. A more general question is whether the according algorithm has some purpose where it is more suitable than the “true” Damerau–Levenshtein distance or whether it is just a wrong algorithm for the the Damerau–Levenshtein distance.
-- Chwinter (talk) 20:05, 1 May 2013 (UTC)
thread_title:  The terms ''optimal string alignment'' and ''restricted edit distance'' 

message: Any objection to converting the reference style to a more conventional ....? That way arbitrary tags do not need to be assigned. Glrx (talk) 04:48, 5 June 2013 (UTC)
thread_title:  Inline references 

message: Having read quite a bit of string algorithms literature, I've got the idea that the name "Damerau–Levenshtein distance" is a Wikipedia invention. The idea of amending Levenshtein distance by allowing transpositions appears (without reference to Damerau, or any reference for that matter) in, e.g., Ukkonen 1983, but I've never seen the particular name used by this article in any peer-reviewed article. QVVERTYVS (hm?) 21:17, 25 November 2013 (UTC)
replies: text: I don't know, but Wolfram seems to have adopted the term. http://reference.wolfram.com/mathematica/ref/DamerauLevenshteinDistance.html It may not have an academic source, but it may be the common name. Glrx (talk) 01:36, 27 November 2013 (UTC)
thread_title:  Where does the name "Damerau–Levenshtein distance" originate? 

message: The OSA pseudocode has one issue in that it will carry out superfluous transpositions when the source and destination contain two identical characters next to each other such as "Kitten" and "Sitting" which the algorithm as written will return a distance of 4, when the actual distance is 3.  Amending the code line 
   if(i > 1 and j > 1 and str1[i] = str2[j-1] and str1[i-1] = str2[j]) then
to
   if(i > 1 and j > 1 and str1[i] = str2[j-1] and str1[i-1] = str2[j] and str1[i-1] <> str1[i]) then
prevents such superfluous transpositions at the cost of an additional comparison.  — Preceding unsigned comment added by PaulBBSRC (talk • contribs) 23:59, 3 November 2014 (UTC)
replies: text: Algortihm computes the cost of the transposition but then takes the min. The change is not needed. Glrx (talk) 16:58, 8 November 2014 (UTC)
thread_title:  OSA psuedocode superfluous transpositions 

message: I would just want to stress that there exists in the literature a real distance for sequences of symbols called OSA (for Optimal Symbol Alignment). It is a true metric (satisfying the triangular inequality), in contrast to the OSA measure that is described in this Wikipedia entry. 
The reference to this paper is: 
: J. Herranz, J. Nin and M. Solé. Optimal Symbol Alignment distance: a new distance for sequences of symbols. IEEE Transactions on Knowledge and Data Engineering, Volume 23, Issue 10, pp. 1541-1554, 2011. ( see: http://www.computer.org/portal/web/csdl/doi/10.1109/TKDE.2010.190 )
Maybe it would be a good idea to add this reference and some related sentence to this Wikipedia entry. Who can do this, and how ?147.83.104.30 (talk) 13:34, 24 March 2015 (UTC)
replies: text: Is this reference about Damerau–Levenshtein distance, or some other distance? Because if it's not about the same distance, then it's not clear to me why it should be mentioned. And as a somewhat obscure topic (a primary source only cited 11 times according to Google scholar) it's also not clear that it warrants a separate article. —David Eppstein (talk) 05:41, 25 March 2015 (UTC)

text: Just use : . QVVERTYVS (hm?) 14:45, 25 March 2015 (UTC)
thread_title:  A real distance called OSA 

message: The two variables i and j are not explained in the article text. From the source code I conclude that they are the string length, but this should be already explained under Definition. --87.139.233.163 (talk) 07:00, 30 November 2015 (UTC)
replies: text: It's right there: "The Damerau–Levenshtein distance between two strings a and b is given by d_{a,b}(|a|,|b|)". Then  is defined for arbitrary , . QVVERTYVS (hm?) 09:36, 30 November 2015 (UTC)
replies: text:  Hope this edit  clarifies the function (and it parameters) meaning. --CiaPan (talk) 10:00, 30 November 2015 (UTC)
thread_title:  i and j are not defined in the article text 

message: I have implemented the algorithm and found that line 7 should be da[i] := 0, not da[i] := i to give plausible results. As I have not proven the correctness otherwise, I'm requesting a verification here. Moreover I would add the comment transposition to the fourth parameter of minimum(). MasterFaS (talk) 01:54, 4 February 2016 (UTC)
replies: text: I added your changes. Glrx (talk) 21:11, 6 February 2016 (UTC)
thread_title:  Code for distance with adjacent transpositions 

message: Hello fellow Wikipedians,
I have just modified  on Damerau–Levenshtein distance. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20121221172057/http://acl.ldc.upenn.edu/P/P00/P00-1037.pdf to http://acl.ldc.upenn.edu/P/P00/P00-1037.pdf
*Added archive https://web.archive.org/web/20100401081500/http://acl.ldc.upenn.edu:80/P/P06/P06-1129.pdf to http://acl.ldc.upenn.edu/P/P06/P06-1129.pdf
When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).
Cheers.—InternetArchiveBot (Report bug) 13:27, 5 December 2016 (UTC)
thread_title:  External links modified 

message: Under the Algorithm section, it currently says: 
"The Damerau–Levenshtein distance LD(CA,ABC) = 2 because CA → AC → ABC" 
But I'm not sure how this 2nd step can actually be done using this distance: AC -> ABC? 
Hungh3 (talk) 02:25, 27 April 2021 (UTC)
replies: text: Insert a B. —David Eppstein (talk) 04:45, 27 April 2021 (UTC)
thread_title:  Wondering if this is correct