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