Last active
August 29, 2015 14:13
-
-
Save gedsic/7544e28f6659a8c7dcf4 to your computer and use it in GitHub Desktop.
For a given sequence of letters, retrieve one random dictionary word starting with each letter
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
| for letter in {h,o,r,s,t}; do grep -i "^$letter.*[^e|en|em|er|et|est|ging]$" /usr/share/dict/ngerman | perl -e '@lines = <>; print $lines [ rand @lines ]'; done | |
| Example output (german): | |
| hinauszögernd | |
| ostafrikanisch | |
| rundend | |
| Scheidewand | |
| Textmaterial | |
| Remove the -i from grep to use a case sensitive search. In german, that leads to nouns being excluded and you end up with mostly adjectives and participles. Example: | |
| haltend | |
| obwaltend | |
| rau | |
| schmeichelnd | |
| tagesaktuell | |
| English example: | |
| > for letter in {h,o,r,s,t}; do grep -e "^$letter.*[^'s]$" /usr/share/dict/american-english | perl -e '@lines = <>; print $lines [ rand @lines ]'; done | |
| handicraft | |
| oath | |
| reliability | |
| schmuck | |
| testified |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment