-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible answers not being a strict subset of the dictionary (#11)
- Loading branch information
Showing
3 changed files
with
22 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Tool to validate that the list of possible answers (words.txt) is a | ||
strict subset of the dictionary of acceptable words (dictionary.txt). | ||
This script should be run any time a change is made to either file. | ||
""" | ||
|
||
with open('data/words.txt') as words: | ||
possible_answers = words.readlines() | ||
possible_answers = [line.rstrip() for line in possible_answers] | ||
|
||
with open('data/dictionary.txt') as dictionary: | ||
dictionary_words = dictionary.readlines() | ||
dictionary_words = [line.rstrip() for line in dictionary_words] | ||
|
||
for possible_answer in possible_answers: | ||
if possible_answer not in dictionary_words: | ||
print(possible_answer, end='\n') |