Find words with alternating vowels and consonants: Difference between revisions

m
(→‎AppleScript :: Functional: Refactored to generate two listings – aeiou and also aeiouy)
Line 159:
 
-- alternatingWordQuery :: String -> String
on alternatingWordQuery(regexvowels)
set regex to "^.*([" & vowels & "]{2}|[^" & vowels & "]{2}).*$"
"(9 < self.length) and not (self matches '" & regex & "')"
end alternatingWordQuery
 
 
-- pairRegex :: String -> String
on pairRegex(vowels)
"^.*([" & vowels & "]{2}|[^" & vowels & "]{2}).*$"
end pairRegex
 
 
Line 174 ⟶ 170:
script
on |λ|(vowels)
set query to alternatingWordQuery(pairRegex(vowels))
set matches to filteredLines(query, lexicon)
Line 201 ⟶ 197:
end if
end run
 
 
 
9,655

edits