Soundex: Difference between revisions

m
(added RPL)
m (→‎{{header|Wren}}: Minor tidy)
 
(One intermediate revision by one other user not shown)
Line 1,727:
T522
</pre>
 
=={{header|EasyLang}}==
{{trans|Java}}
<syntaxhighlight>
trans$ = "01230120022455012623010202"
func$ code c$ .
c = strcode c$ - 64
if c > 26
c -= 32
.
return substr trans$ c 1
.
func$ soundex s$ .
code$ = substr s$ 1 1
prev$ = code code$
for i = 2 to len s$
cur$ = code substr s$ i 1
if cur$ <> "" and cur$ <> "0" and cur$ <> prev$
code$ &= cur$
.
prev$ = cur$
.
return substr code$ & "0000" 1 4
.
for v$ in [ "Soundex" "Example" "Sownteks" "Ekzampul" ]
print soundex v$
.
</syntaxhighlight>
 
 
=={{header|Elixir}}==
Line 5,708 ⟶ 5,737:
{{libheader|Wren-str}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./str" for Char
import "./fmt" for Fmt
 
var getCode = Fn.new { |c|
9,476

edits