Levenshtein distance: Difference between revisions
Content added Content deleted
m (→{{header|RPL}}: typo) |
m (→Iterative implementation (Wagner-Fischer algorithm): other typos) |
||
Line 5,680: | Line 5,680: | ||
DUP2 { } + + ≪ SIZE ≫ DOLIST 1 ADD 0 CON → a b d |
DUP2 { } + + ≪ SIZE ≫ DOLIST 1 ADD 0 CON → a b d |
||
≪ 1 a SIZE '''FOR''' h |
≪ 1 a SIZE '''FOR''' h |
||
h 1 + 1 2 →LIST h PUT '''NEXT''' |
'd' h 1 + 1 2 →LIST h PUT '''NEXT''' |
||
1 b SIZE '''FOR''' j |
1 b SIZE '''FOR''' j |
||
1 j 1 + 2 →LIST j PUT '''NEXT''' |
'd' 1 j 1 + 2 →LIST j PUT '''NEXT''' |
||
'd' STO |
|||
1 b SIZE '''FOR''' j |
1 b SIZE '''FOR''' j |
||
1 a SIZE '''FOR''' h |
1 a SIZE '''FOR''' h |
||
Line 5,701: | Line 5,700: | ||
for j from 1 to n: |
for j from 1 to n: |
||
d[0, j] := j |
d[0, j] := j |
||
<span style="color:grey>// transfer d from stack to a variable to speed up execution</span> |
|||
for j from 1 to n: |
for j from 1 to n: |
||
for h from 1 to m: |
for h from 1 to m: |