Levenshtein distance/Alignment: Difference between revisions

Content added Content deleted
m (→‎{{header|Sidef}}: modified the code to work with Sidef 2.30)
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header.)
Line 5: Line 5:
An alignment is a notation used to describe the operations used to turn a string into an other. At some point in the strings, the minus character ('-') is placed in order to signify that a character must be added at this very place. For instance, an alignment between the words 'place' and 'palace' is:
An alignment is a notation used to describe the operations used to turn a string into an other. At some point in the strings, the minus character ('-') is placed in order to signify that a character must be added at this very place. For instance, an alignment between the words 'place' and 'palace' is:


<pre>P-LACE
<pre>
P-LACE
PALACE</pre>
PALACE
</pre>



For this task, write a function that shows the alignment of two strings for the corresponding levenshtein distance. As an example, use the words "rosettacode" and "raisethysword".
;Task:
Write a function that shows the alignment of two strings for the corresponding levenshtein distance.

As an example, use the words "rosettacode" and "raisethysword".


You can either implement an algorithm, or use a dedicated library (thus showing us how it is named in your language).
You can either implement an algorithm, or use a dedicated library (thus showing us how it is named in your language).
<br><br>


=={{header|C}}==
=={{header|C}}==