Browse Source

add packe settings

chenhaiyang 4 years ago
parent
commit
cace0e3b8c
3 changed files with 21 additions and 1 deletions
  1. 1 0
      MANIFEST.in
  2. 18 0
      setup.py
  3. 2 1
      tests/test_text_sim.py

+ 1 - 0
MANIFEST.in

@@ -0,0 +1 @@
+include sim/*.txt

+ 18 - 0
setup.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+
+import pathlib
+from setuptools import setup
+
+HERE = pathlib.Path(__file__).parent
+
+README = (HERE / 'README.md').read_text()
+
+setup(
+    name='short-text-sim',
+    version='1.0.0',
+    author='Chen haiyang',
+    license='MIT',
+    packages=['sim'],
+    include_package_data=True,
+    install_rerquires=['jieba', 'numpy'],
+)

+ 2 - 1
tests/test_text_sim.py

@@ -6,5 +6,6 @@ from sim.text_sim import most_similar_items
 
 if __name__ == '__main__':
     str1 = '我喜欢吃苹果'
-    str_l = ['我喜欢吃梨', '你喜欢吃苹果', 'unbelievable']
+    str2 = ['他喜欢肯地瓜']
+    str_l = ['我喜欢吃梨', '你喜欢吃苹果', 'unbelievable', 'GT-faf-我和你']
     print(most_similar_items(str1, str_l, 5))