Name: Anonymous 2008-04-15 9:09
Can someone post picturse of the late Haskell? Also, what type of dog was she?
cleanChars s@(c:cs) = case find (flip isPrefixOf s.fst) rep of
Just (p,r) -> r : (cleanChars.drop (length p)) s
Nothing -> cleanChar c : cleanChars cs
where cleanChar c | c >= ' ' && c <= '~' = (chr.(+0xFEE0).ord) c
cleanChar c = c
rep = [("...",'\x2026'),("?!",'\x203D'),("??",'\x2047'),
("!?",'\x2049'),("!!",'\x203C'),
("``",'\x275D'),("''",'\x275E'),
(" ",'\x3000'),("`",'\x275B'),("'",'\x275C')]
cleanChars _ = ""