| Text-EditTranscript documentation | view source | Contained in the Text-EditTranscript distribution. |
Text::EditTranscript - Perl extension for determining the edit transcript between two strings
use Text::EditTranscript;
print EditTranscript("foo","bar");
The edit transcript is a sequence of operations to transform one string into another string. The operations include 'Insertion', 'Deletion', and Substitution. This module creates a string denoting the list of operations to transfer the second string into the first string where:
No operation required.
The character from second string should be substituted into the first string.
The character in that position from the first string should be deleted.
The character in that position in the second string should be inserted into the first string at that position.
This method uses the Levenshtein distance calculation to create the edit transcript.
$string1 = "bar"; $string2 = "baz"; print EditDistance($string1,$string2),"\n";
$string1 = "This is a test"; $string2 = "This isn't a test"; print EditDistance($string1,$string2),"\n";
Text::Levenshtein, Text::LevenshteinXS
Leigh Metcalf, <leigh@fprime.net>
Copyright (C) 2008 by Leigh Metcalf
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
| Text-EditTranscript documentation | view source | Contained in the Text-EditTranscript distribution. |