Levenshtein distance: Difference between revisions
m
→{{header|ALGOL 68}}
m (→{{header|Action!}}: Noted the output appears not to match the program) |
|||
Line 418:
=={{header|ALGOL 68}}==
{{Trans|Action!}}
...largely to highlight the syntactic similarities.
<br>
Non-recursive algorithm - although Algol 68 supports recursion, Action! doesn't.
<lang algol68># Calculate Levenshtein distance between strings - translated from the Action! sample #
BEGIN
PROC
BEGIN
Line 455 ⟶ 457:
word 1 :="kitten"; word 2 := "sitting";
print((word 1," -> ",word 2,": "));
print(("Levenshtein Distance: ",whole(
word 1 := "rosettacode"; word 2 := "raisethysword";
print((word 1," -> ",word 2,": "));
print(("Levenshtein Distance: ",whole(
word 1 := "qwerty"; word 2 := "qweryt";
print((word 1," -> ",word 2,": "));
print(("Levenshtein Distance: ",whole(
word 1 := "Action!"; word 2 := "Algol 68";
print((word 1," -> ",word 2,": "));
print(("Levenshtein Distance: ",whole(
END</lang>
{{out}}
|