in reply to Re^2: word based levenstein distance path
in thread word based levenstein distance path

c:\@Work\Perl>perl -wMstrict -le "use constant PATH_ELEMENT => 0; ;; my @out = ( [ '+', '', 'before' ], [ 'u', 'the', 'the' ], [ 'u', 'quick', 'quick' ], [ 'c', 'brown', 'green' ], [ 'u', 'fox', 'fox' ], ); my $path = join '', map $_->[PATH_ELEMENT], @out; ;; $path eq '+uucu' or die qq{bad path: '$path'}; ;; print qq{proper path: '$path'}; " proper path: '+uucu'
Update: Please see the constant pragma, and the join, map and die built-ins. (Update: See also the tutorial Map: The Basics and the subsidiary discussion of map in Complex sorting.)


Give a man a fish:  <%-(-(-(-<

Replies are listed 'Best First'.
Re^4: word based levenstein distance path
by Anonymous Monk on May 21, 2015 at 10:37 UTC

    Thanks, I have modified my code and it works!

    Once again thank you for your time and consideration