Change e letters to i in words: Difference between revisions

Content added Content deleted
Line 1,063: Line 1,063:
ieTwins s =
ieTwins s =
[ (w, twin)
[ (w, twin)
| w <- [x | x <- allWords, 5 < length x, 'e' `elem` x],
| w <- [x | x <- longWords, 'e' `elem` x],
let twin = iForE w,
let twin = iForE w,
S.member twin lexicon
S.member twin lexicon
]
]
where
where
allWords = lines s
longWords = filter ((5 <) . length) (lines s)
lexicon = S.fromList allWords
lexicon = S.fromList $ filter ('i' `elem`) longWords


iForE :: String -> String
iForE :: String -> String