r/ProgrammerTIL • • Sep 19 '17
Other TIL Unix-based systems provide a dictionary of 235k+ newline-separated words in /usr/share/dict/words
This list can be copied between projects and used for everything from Scrabble board-playing AIs to spellcheckers to regex golfing playgrounds!
119
Upvotes
10
u/o11c Sep 20 '17
Note that you can use
look(1)to do a binary search if you know the prefix you want.But of course, everyone will forget that and just use
grep(1).12
u/onyxleopard Sep 19 '17 edited Sep 20 '17
Just be aware there are lots of proper nouns and non-words in there:
4
u/ZenEngineer Sep 20 '17
Debian / Ubuntu (and probably everyone else) have more in depth packages. For example:
Package: scowl
Description-en: Spell-Checker Oriented Word Lists
The SCOWL is a collection of word lists organized by word popularity, language, word class, and other factors. These lists can be combined in various ways (or used individually) for spell checking and similar purposes.
The Debian wamerican*, wbritish*, and wcanadian* wordlist packages are built from (appropriate collections of) these same lists. Install one (or more) of those packages if you want a comprehensive word list; install scowl if you (also) want to pick and choose the pieces that comprise those lists.
You can learn more about SCOWL (and other English word lists) at http://wordlist.sourceforge.net/
2
u/Jahames1 Sep 20 '17
I found a bunch of words with
'in them2
u/pagefault0x16 Oct 12 '17
My Arch machine has a word list at
/usr/share/dict/cracklib-small1
u/CirkuitBreaker Sep 20 '17
when I navigate to /usr/share/dict/, the words directory is written in red, and when I try to cd into it, bash tells me the directory doesn't exist. What's going on?
5
u/[deleted] Sep 19 '17
[removed] — view removed comment