Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
59
Task/Soundex/TMG/soundex.tmg
Normal file
59
Task/Soundex/TMG/soundex.tmg
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
prog: ignore(spaces)
|
||||
let: peek/done
|
||||
[ch = ch>140 ? ch-40 : ch ]
|
||||
( [ch<110?] ( [ch==101?] vow
|
||||
| [ch==102?] r1
|
||||
| [ch==103?] r2
|
||||
| [ch==104?] r3
|
||||
| [ch==105?] vow
|
||||
| [ch==106?] r1
|
||||
| [ch==107?] r2 )
|
||||
| [ch<120?] ( [ch==110?] hw
|
||||
| [ch==111?] vow
|
||||
| [ch==112?] r2
|
||||
| [ch==113?] r2
|
||||
| [ch==114?] r4
|
||||
| [ch==115?] r5
|
||||
| [ch==116?] r5
|
||||
| [ch==117?] vow )
|
||||
| [ch<130?] ( [ch==120?] r1
|
||||
| [ch==121?] r2
|
||||
| [ch==122?] r6
|
||||
| [ch==123?] r2
|
||||
| [ch==124?] r3
|
||||
| [ch==125?] vow
|
||||
| [ch==126?] r1
|
||||
| [ch==127?] hw )
|
||||
| [ch<140?] ( [ch==130?] r2
|
||||
| [ch==131?] vow
|
||||
| [ch==132?] r2 ))
|
||||
[n>0?]\let done;
|
||||
|
||||
vow: [ch=0] out;
|
||||
r1: [ch=1] out;
|
||||
r2: [ch=2] out;
|
||||
r3: [ch=3] out;
|
||||
r4: [ch=4] out;
|
||||
r5: [ch=5] out;
|
||||
r6: [ch=6] out;
|
||||
hw: [ch=7] out;
|
||||
out: [n==4?] [--n] parse(( scopy ))
|
||||
| ( [(l1!=10) & ((ch==l1) | (ch==7) | (!ch)) ?]
|
||||
| [(l1==7) & (ch==l2) ?]
|
||||
| [--n] parse(num) );
|
||||
num: octal(ch);
|
||||
done: [l1=10] [ch=0]
|
||||
loop: [n>0?] out loop | parse((={*}));
|
||||
|
||||
peek: adv ord/read;
|
||||
ord: char(ch) fail;
|
||||
read: smark any(!<<>>);
|
||||
adv: [l2=l1] [l1=ch];
|
||||
|
||||
spaces: <<
|
||||
>>;
|
||||
|
||||
n: 4;
|
||||
ch: 0;
|
||||
l1: 0;
|
||||
l2: 0;
|
||||
Loading…
Add table
Add a link
Reference in a new issue