Cuttlepress

Blogging about Hacker School?

Day 19

Regex time! Today I implemented the simplified Metaphone rules given on the Wikipedia page It definitely has some ordering issues (why would we check for “gg” after we’ve removed all duplicate letters except “cc”?), but it was a good way to learn about regexes. Code’s on github.

I present some poetry:

t b or nt t b 0t is 0 ksksn w0r ts nblr in 0 mnt t sfr 0 slnks ant arws of otrjs frtn or t tk arms aknst a s of trbls ant b opsnk ent 0m t t t slp n mr ant b a slp t s w ent 0 hrt aksh ant 0 0snt ntrl shkks 0t flksh is hr t ts a knsmksn tftl t b wksht t t t slp t slp prkshns t trm a 0rs 0 rb fr in 0t slp of t0 wt trms m km wn w hf shflt of 0s mrtl kl mst jf us ps 0rs 0 rspkt 0t mks klmt of s lnk lf fr w wlt br 0 wps ant skrns of tm 0 oprsrs rnk 0 prt mns kntml 0 pnks of tspst lf 0 lws tl 0 inslns of ofs ant 0 sprns 0t ptnt mrt of 0 unwr0 tks wn h hmslf mt hs kts mk w0 a br btkn w wlt frtls br t krnt ant swt untr a wr lf bt 0t 0 trt of sm0nk aftr t0 0 untskfrt kntr frm ws brn n trflr rtrns psls 0 wl ant mks us r0r br 0s ils w hf 0n fl t o0rs 0t w nw nt of 0s knssns ts mk kwrts of us al ant 0s 0 ntf h of rslksn is skklt or w0 0 pl kst of 0t ant entrprss of krt p0 ant mmnt w0 0s rkrt 0r krnts trn awr ant ls 0 nm of akksn sft y nw 0 fr ofl nmf in 0 orsns b al m sns rmmbrt

(Note that “0” approximates a theta.)

Also, in the morning, I finished and shipped my entry for Ectocomp.