test_text_sim.py 436 B

12345678910111213141516
  1. # -*- coding: utf-8 -*-
  2. """Test for text sim."""
  3. from sim.text_sim import most_similar_items, get_similarity
  4. from sim.words_sim import SimCilin
  5. ci_lin = SimCilin()
  6. if __name__ == '__main__':
  7. str1 = '我喜欢吃苹果'
  8. str2 = ['他喜欢肯地瓜']
  9. str_l = ['我喜欢吃梨', '你喜欢吃苹果', 'unbelievable', 'GT-faf-我和你', '']
  10. print(most_similar_items(str1, str_l, 5))
  11. print(get_similarity('', ''))