Consider the following question. I have a long selection of files (some 5,000), arranged linearly, and I want to view to what degree the files have changed between each other. For a small example, here are some (nonsensical) strings:
string1 = "i am a cheese ball";
string2 = "i am a cheese bull";
string3 = "i am a cheese frog";
string4 = "i am a cheesy frog";
string5 = "i am a cheesy frog";
string6 = "i am a cheesy curd";
stringlist = {string1, string2, string3, string4, string5, string6};
Here is how to manually get my answer, which is {1,4,1,0,4}:
list = {EditDistance[string1, string2],
EditDistance[string2, string3], EditDistance[string3, string4],
EditDistance[string4, string5], EditDistance[string5, string6]}
There must be an automated solution, however, that moves through the list and gets the EditDistance[] between each set of things (i.e. 1 to 2, then 2 to 3, then 3 to 4, then 5 to 6, etc.). Outside of a convoluted set of Do[] loops, however, I can't find the proper command. I suspect the issue is that I'm having trouble expressing mathematically what I want to do here.



EditDistance[Sequence @@ #] & /@ Transpose[{Most[stringlist], Rest[stringlist]}]– b.gatessucks Jul 9 '12 at 15:08