Created
January 18, 2019 16:41
-
-
Save alexgolec/6c3479980ff0d6194b7334ed1a65c706 to your computer and use it in GitHub Desktop.
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
synonyms = defaultdict(set) | |
for w1, w2 in synonym_words: | |
for w in synonyms[w1]: | |
synonyms[w].add(w2) | |
synonyms[w1].add(w2) | |
for w in synonyms[w2]: | |
synonyms[w].add(w1) | |
synonyms[w2].add(w1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment