Sha256: 93a92a9bee4f5a1b91acdb5e42a61c2998e19bcba6cd5d0ea3e75dd644c74ea0
Contents?: true
Size: 776 Bytes
Versions: 121
Compression:
Stored size: 776 Bytes
Contents
fun isVowelCluster #"a" _ = true | isVowelCluster #"e" _ = true | isVowelCluster #"i" _ = true | isVowelCluster #"o" _ = true | isVowelCluster #"u" _ = true | isVowelCluster #"y" #"t" = true | isVowelCluster #"x" #"r" = true | isVowelCluster _ _ = false fun isCluster #"q" #"u" = true | isCluster _ _ = false fun translate' [] = "" | translate' [x] = Char.toString x ^ "ay" | translate' [#"m", #"y"] = "ymay" | translate' (word as (a::b::cs)) = if isVowelCluster a b then implode word ^ "ay" else if isCluster a b then translate' (cs @ [a, b]) else translate' (b :: cs @ [a]) fun translate words = String.concatWith " " (map (translate' o explode) (String.tokens Char.isSpace words))
Version data entries
121 entries across 121 versions & 1 rubygems