-
Notifications
You must be signed in to change notification settings - Fork 3
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
Check if the word exists in English language #1
Comments
It may be a good idea to collect all possible words from dataset and filter words by them. And default check is filter words by NLTK's words corpus ( |
Good point, @naidenovaleksei! |
Found this in logs. May it be connected with wordnet not recognizing some words? 2021-07-03 13:16:10,361 - the_hat_game.loggers - INFO - EXPLAINING PLAYER (Make Hat Game Again) to HOST: my wordlist is ['opengl', 'compatibility', 'rearchitecting', 'upgrading', 'backporting', 'reimplemented', 'gtk', 'toolkits', 'rewriting', 'directx'] 2021-07-03 13:16:14,925 - the_hat_game.loggers - INFO - HOST to EXPLAINING PLAYER (LAZY ILON): the word is "usenet" |
Looks like it is related. You can see below that both from nltk.corpus import wordnet
from nltk.corpus import words as nltk_words
wordlist = ['compatibility', 'rewriting', 'upgrading', 'backporting']
print("word" + " " * 4, "synsets", "wordnet", "nltk_words", sep="\t")
for word in wordlist:
word_in_wordnet = word in wordnet.words()
word_in_synsets = len(wordnet.synsets(word)) > 0
word_in_nltk_words = word in nltk_words.words()
print(word, word_in_synsets, word_in_wordnet, word_in_nltk_words, sep="\t")
So I think this will fix it. |
Stop using
wordnet.synsets
to filter words in guessing. This is a workaround to remove non-existing words (otherwise, for example, you can explain "hatter" by "hattter".One option to solve this is to use some huge English dictionary. Other suggestions are welcomed.
The code line where this happens:
https://gitlab.com/production-ml/the-hat-game/-/blob/master/the_hat_game/game.py#L59
The text was updated successfully, but these errors were encountered: