Created
February 3, 2022 02:00
-
-
Save chssch/a7761f3f566d747d725afd0c5e6d1529 to your computer and use it in GitHub Desktop.
Get wordle cheating clues from spacy
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
import spacy, re | |
nlp = spacy.load("en_core_web_lg") | |
green = "spa??" # position like spa?? | |
yellow = "y" # just list | |
grey = "xg" # just list, exclude green | |
print([k for k in nlp.vocab.strings if | |
re.match(green.replace("?", "[a-z]"), k) | |
and len(k) == 5 | |
and set(yellow).issubset(set(k)) | |
and not set(grey) & set(k) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment