# Path: chat/semantic2.py
# def similarity(s1, s2):
#     """Similarity score between two sentences.
#     计算两个句子的相似度，得分区间为[0, 1]。
#     """
#     assert s1 != '', "sentence can not be empty"
#     assert s2 != '', "sentence can not be empty"
#     if s1 == s2:
#         return 1.0
#     return jaccard(segment(s1), segment(s2))


import sys
from unittest import TestCase, main
from chat.semantic2 import similarity

# -*- coding: utf-8 -*-
sys.path.append("../")

class TestMe(TestCase):
    def setUp(self):
        pass

    def test_similarity(self):
        data = [
            ('小民', '小民'),
            ("电脑", "打印机"),
            ("电脑", "笔记本"),
            ("怎么了？，。。。。", "怎么了?..,#$"),
            ("我喜欢你", "你喜欢我"),
            ("我要取票", "我要取票"),
            ("存钱", "取钱"),
            ("中国", "中华人民共和国"),
            ("喧闹的大街上人山人海", "热闹的街道上人来人往"),
            ("专心致志", "全神贯注"),
            ("爷爷爱吃土豆", "祖父喜欢吃马铃薯"),
            ("联想电脑多少钱", "联想笔记本价格"),
            ("今天天气怎么样", "我想去上海")

# Path: chat/semantic2.py
# def similarity(s1, s2):
#     """Similarity score between two sentences.
#     计算两个句子的相似度，得分区间为[0, 1]。
#     """
#     assert s1 != '', "sentence can not be empty"
#     assert s2 != '', "sentence can not be empty"
#     if s1 == s2:
#         return 1.0
#     return jaccard(segment(s1), segment(s2))


# Path: tests/test_semantic2.py
import sys
from unittest import TestCase, main
from chat.semantic2 import similarity

# -*- coding: utf-8 -*-
sys.path.append("../")

class TestMe(TestCase):
    def setUp(self):
        pass

    def test_similarity(self):
        data = [
            ('小民', '小民'),
            ("电脑", "打印机"),
            ("电脑", "笔记本"),
            ("怎么了？，。。。。", "怎么了?..,#$"),
            ("我喜欢你", "你喜欢我"),
            ("我要取票", "我要取票"),
            ("存钱", "取钱"),
            ("中国", "中华人民共和国"),
            ("喧闹的大街上人山人海", "热闹的街道上人来人往"),
            ("专心致志", "全神贯注"),
            ("爷爷爱吃土豆", "祖父喜欢吃马铃薯"),
            ("联想电脑多少钱", "联想笔记本价格"),
            ("今天天气怎么样", "我想去上海")

        ]
