From ea92e8f68f771fda8765d1fb9289ae4477421dc3 Mon Sep 17 00:00:00 2001 From: Hai Liang Wang Date: Mon, 21 Sep 2020 14:27:19 +0800 Subject: [PATCH] https://github.com/chatopera/Synonyms/issues/112 Update README.md --- README.md | 6 +++--- Requirements.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b609052..5a0b420 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ synonyms.seg("中文近义词工具包") ``` import synonyms -print("人脸: %s" % (synonyms.nearby("人脸"))) -print("识别: %s" % (synonyms.nearby("识别"))) -print("NOT_EXIST: %s" % (synonyms.nearby("NOT_EXIST"))) +print("人脸: ", synonyms.nearby("人脸")) +print("识别: ", synonyms.nearby("识别")) +print("NOT_EXIST: ", synonyms.nearby("NOT_EXIST")) ``` `synonyms.nearby(WORD [,SIZE])`返回一个元组,元组中包含两项:`([nearby_words], [nearby_words_score])`,`nearby_words`是 WORD 的近义词们,也以 list 的方式存储,并且按照距离的长度由近及远排列,`nearby_words_score`是`nearby_words`中**对应位置**的词的距离的分数,分数在(0-1)区间内,越接近于 1,代表越相近;`SIZE` 是返回词汇数量,默认 10。比如: diff --git a/Requirements.txt b/Requirements.txt index b22cf6d..d5541ff 100644 --- a/Requirements.txt +++ b/Requirements.txt @@ -1 +1 @@ -synonyms>=3.10 \ No newline at end of file +synonyms>=3.12 \ No newline at end of file