Change e letters to i in words: Difference between revisions
m
→AppleScript :: Functional
Line 327:
set longWords to filteredLines("5 < length", s)
set eWords to longWords's ¬
filteredArrayUsingPredicate:(
set lexicon to ca's NSSet's ¬
setWithArray:(longWords's ¬
filteredArrayUsingPredicate:(
set possibles to (allReplaced("e", "i", ¬
Line 341:
-- Dictionary of possible words and their sources
set dict to
dictionaryWithObjects:eWords forKeys:possibles▼
-- Listing of candidate words which are found in the dictionary
Line 379 ⟶ 378:
end allReplaced
--
on containsString(s)
tell current application
its (NSPredicate's ¬
predicateWithFormat:("self contains '" &
end tell
end containsString
-- dictFromZip :: NSArray -> NSArray -> NSDictionary
on dictFromZip(xs, ys)
tell current application
its (NSDictionary's ¬
end tell
end
-- filteredLines :: String ->
on filteredLines(predicateString, s)
-- A list of lines filtered by an NSPredicate string
|