in reply to Re^2: Comparing Lines within a Word List
in thread Comparing Lines within a Word List
Thank you both for the replies! I hope everyone in the thread can see this, and not just the author of the note on which I hit the reply button.
Okay, so if I'm getting this right, it looks like in this example, you're taking the word 'fool' and comparing its characters to each of the five words in the array, and since 'fool' matches itself exactly, the return on that one is all zeros. Any place there is not a zero is a place where the words differ. (I'm not immediately sure why the "difference" between the character 'l' and 't' would be 30 but I'm sure it's easily explained.) So I see how this works in principle, to compare two given words and look for word pairings that yield a one-character difference. But then how might I use this to solve the problem that I have, which is to find -- from let's say a massive dictionary of English language words -- all pairs of words that are the same except for one letter, and in particular, for that character difference to be that one has an R while the other has an S? Again, many thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Comparing Lines within a Word List
by AnomalousMonk (Archbishop) on Apr 27, 2016 at 16:22 UTC | |
by dominick_t (Acolyte) on Apr 27, 2016 at 16:39 UTC |
In Section
Seekers of Perl Wisdom