in reply to Levenstein distance transcription
I've got to wonder why you want this?
I normally try to resist asking this question, because I personally dislike having to explain my reasoning to others... but.
There are so many different possibilities for each pair of strings, to want any given one seems nonsensical.
For example: Given the length (in words) of any two strings, you can generate an "edit transcript" thus:
my $shorter = min( $lenString1, $lenString2 ); my $longer = max( $lenString1, $lenString2 ); ## longer to shorter my $et = 'DI' x $shorter . 'D' x ( $longer - $shorter ); ## or shorter to longer my $et = 'DI' x $shorter . 'I' x ( $longer - $shorter );
Or:
## longer to shorter my $et = 'D' x $longer . 'I' x $shorter; ## shorter to longer my $et = 'D' x $shorter . 'I' x $longer;
As best I can tell, the only actually useful information you might glean from this, (done the full, laborious Levenstein way), is where the two sentences happen to contain the same word in the same position.
But given that if you had two identical sentences with the exception that one of the had an extra word at the start, eg:
'the quick brown fox' 'before the quick brown fox'
The Levenstein algorithm would fail to detect any 'same word in same place' and produce a "edit transcript" of (something like) 'DIDIDIDII'; I'm failing to see a good use?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Levenstein distance transcription
by wollmers (Scribe) on Dec 05, 2014 at 21:07 UTC |