Merge pull request #40 from blairg23/master

Added os.getcwd() to example script to make it more OS agnostic. Also…
This commit is contained in:
Nelson 2018-03-14 10:10:23 +00:00 committed by GitHub
commit 843621abc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ english-words
A text file containing 466k English words. A text file containing 466k English words.
While searching for a list of english words (for an auto-complete tutorial) While searching for a list of english words (for an auto-complete tutorial)
I found: http://stackoverflow.com/questions/2213607/how-to-get-english-language-word-database which refers to http://www.infochimps.com/datasets/word-list-350000-simple-english-words-excel-readable I found: http://stackoverflow.com/questions/2213607/how-to-get-english-language-word-database which refers to ~~http://www.infochimps.com/datasets/word-list-350000-simple-english-words-excel-readable~~ (link no longer available).
No idea why infochimps put the word list inside an excel (.xls) file. No idea why infochimps put the word list inside an excel (.xls) file.

View File

@ -3,7 +3,7 @@ import os, sys
def load_words(): def load_words():
try: try:
filename = os.path.dirname(sys.argv[0])+"\\"+"words_dictionary.json" filename = os.path.join(os.getcwd(), "words_dictionary.json")
with open(filename,"r") as english_dictionary: with open(filename,"r") as english_dictionary:
valid_words = json.load(english_dictionary) valid_words = json.load(english_dictionary)
return valid_words return valid_words