Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_english_dictionary.py not working #161

Open
micksulley opened this issue Jan 5, 2023 · 1 comment
Open

read_english_dictionary.py not working #161

micksulley opened this issue Jan 5, 2023 · 1 comment

Comments

@micksulley
Copy link

I have copied read_english_dictionary.py and words_alpha.txt. When I run the code it just returns 'false'
If I add print(english_words) it prints what looks like the file contents, but not a recognisable list of English words
Am I missing something here?
Mick

@nelsonic
Copy link
Member

nelsonic commented Jan 8, 2023

Hi @micksulley, 👋
thanks for opening this issue to report your pain with read_english_dictionary.py ... 😢

As it stands the file is considered "sample code":

def load_words():
with open('words_alpha.txt') as word_file:
valid_words = set(word_file.read().split())
return valid_words
if __name__ == '__main__':
english_words = load_words()
# demo print
print('fate' in english_words)

Not really something we are actively using in any of our projects.
Perhaps we should write a test and run it on GitHub Actions CI to verify that it works. 💭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants