Skip to content

Instantly share code, notes, and snippets.

@chssch
Created February 3, 2022 02:00
Show Gist options
  • Save chssch/a7761f3f566d747d725afd0c5e6d1529 to your computer and use it in GitHub Desktop.
Save chssch/a7761f3f566d747d725afd0c5e6d1529 to your computer and use it in GitHub Desktop.
Get wordle cheating clues from spacy
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