Skip to content

Instantly share code, notes, and snippets.

@adamochayon
Forked from alexgolec/two_way.py
Last active June 4, 2019 10:54
Show Gist options
  • Save adamochayon/51a17b95dd3d73aa6572d67a02b33f90 to your computer and use it in GitHub Desktop.
Save adamochayon/51a17b95dd3d73aa6572d67a02b33f90 to your computer and use it in GitHub Desktop.
...
synonyms = defaultdict(set)
for w1, w2 in synonym_words:
synonyms[w1].add(w2)
...
elif (w2 in synonyms.get(w1, tuple()) or
w1 in synonyms.get(w2, tuple())):
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment