-
Notifications
You must be signed in to change notification settings - Fork 87
/
test.py
27 lines (25 loc) · 790 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python3
# coding: utf-8
# File: test.py
# Author: lhy<[email protected],https://huangyong.github.io>
# Date: 18-4-27
from sim_cilin import *
from sim_hownet import *
from sim_simhash import *
from sim_tokenvector import *
from sim_vsm import *
def test():
cilin = SimCilin()
hownet = SimHownet()
simhash = SimHaming()
simtoken = SimTokenVec()
simvsm = SimVsm()
while 1:
text1 = input('enter sent1:').strip()
text2 = input('enter sent2:').strip()
print('cilin', cilin.distance(text1, text2))
print('hownet', hownet.distance(text1, text2))
print('simhash', simhash.distance(text1, text2))
print('simtoken', simtoken.distance(text1, text2))
print('simvsm', simvsm.distance(text1, text2))
test()