浏览代码

权重item.count / (item.strlen - value.length + 0.1);

visuddhinanda 2 年之前
父节点
当前提交
4e99de7761
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dashboard/src/components/dict/SearchVocabulary.tsx

+ 1 - 1
dashboard/src/components/dict/SearchVocabulary.tsx

@@ -103,7 +103,7 @@ const SearchVocabularyWidget = ({
       .then((json) => {
         const words: ValueType[] = json.data.rows
           .map((item) => {
-            let weight = item.count / item.strlen;
+            let weight = item.count / (item.strlen - value.length + 0.1);
             if (item.word.length === value.length) {
               weight = 100;
             }