07de9b2aef3b5b9fe1970c8bee348bdf55cef5d9,demo.py,Test,testNearbyWords,#Test#,63

Before Change


    def testNearbyWords(self):
        thu1 = thulac.thulac() //默认模式
        text = thu1.cut("人脸识别", text=True)  //进行一句话分词
        words, tags = [], []
        data = [x.rsplit("_", 1) for x in text.split()]
        for _ in data:
            assert len(_) == 2, "seg len should be 2"
            words.append(_[0])

After Change


        assert synonyms.compare(sen1, sen2) > 0, "the similarity should be bigger then zero"

    def testNearbyWords(self):
        synonyms.display("人脸") // synonyms.display calls synonyms.nearby

def test():
    unittest.main()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: huyingxi/Synonyms
Commit Name: 07de9b2aef3b5b9fe1970c8bee348bdf55cef5d9
Time: 2017-10-20
Author: hailiang.hl.wang@gmail.com
File Name: demo.py
Class Name: Test
Method Name: testNearbyWords


Project Name: nipy/dipy
Commit Name: aa9810a87a4d16383cfb86531854a3cf11c2cca2
Time: 2015-10-13
Author: garyfallidis@gmail.com
File Name: doc/examples/sfm_tracking.py
Class Name:
Method Name:


Project Name: nipy/dipy
Commit Name: 232aeb2c0e06e642b6f0af65d9bddcf6ae16d5ce
Time: 2015-10-13
Author: garyfallidis@gmail.com
File Name: doc/examples/streamline_tools.py
Class Name:
Method Name: