Guest User

Untitled

a guest
Jan 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def synonym_queries(synonym_words, queries):
  2. output = []
  3. for q1, q2 in queries:
  4. q1, q2 = q1.split(), q2.split()
  5. if len(q1) != len(q2):
  6. output.append(False)
  7. continue
  8. result = True
  9. for i in range(len(q1)):
  10. w1, w2 = q1[i], q2[i]
  11. if w1 == w2:
  12. continue
  13. elif words_are_synonyms(w1, w2):
  14. continue
  15. result = False
  16. break
  17. output.append(result)
  18. return output
Add Comment
Please, Sign In to add comment