Created
January 25, 2013 19:18
-
-
Save vyder/4637034 to your computer and use it in GitHub Desktop.
Returns a dictionary hash built from the system dictionary.
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
| def build_dictionary | |
| # from http://stackoverflow.com/a/3480849/834459 | |
| dictionary = {} | |
| File.open("/usr/share/dict/words") do |file| | |
| file.each do |line| | |
| dictionary[line.strip] = true | |
| end | |
| end | |
| return dictionary | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment