Change e letters to i in words: Difference between revisions

m
Line 333:
filteredArrayUsingPredicate:(containsChar("i")))
set possibles to (allReplaced(eWords's"e", "i", ¬
(eWords's componentsJoinedByString:(linefeed))))'s ¬
stringByReplacingOccurrencesOfString:("e") ¬
withString:("i"))'s ¬
componentsSeparatedByString:(linefeed)
set possibleSet to ca's NSMutableSet's setWithArray:(possibles)
Line 371 ⟶ 369:
ieTwins(readFile("~/Desktop/unixdict.txt"))))
end run
 
 
 
------------------------- GENERIC ------------------------
 
-- allRplaced :: String -> String -> NSString -> NSString
on allReplaced(needle, replacement, haystack)
haystack's stringByReplacingOccurrencesOfString:("e"needle) ¬
withString:("i"replacement))'s ¬
end allReplaced
 
-- containsChar :: Char -> NSPredicate
9,655

edits