Last active
April 25, 2024 16:55
-
-
Save kedarmhaswade/5175834305e54d6540637d0cae32328f to your computer and use it in GitHub Desktop.
a short zsh program to create 3 consonant clusters from /usr/share/dict/words (not very efficient; done in the spirit of McIlroy, and not Knuth)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/zsh | |
vo=(a e i o u y) | |
for u in {a..z} | |
do | |
for v in {a..z} | |
do | |
for w in {a..z} | |
do | |
if ()(( $@[(Ie)$u] )) $vo; then | |
continue | |
fi | |
if ()(( $@[(Ie)$v] )) $vo; then | |
continue | |
fi | |
if ()(( $@[(Ie)$w] )) $vo; then | |
continue | |
fi | |
grep -ih $u$v$w /usr/share/dict/words | |
if [[ $status -eq 0 ]]; then | |
echo "consonant cluster above: $u$v$w" | |
echo "--------" | |
fi | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment