Просмотр исходного кода

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

visuddhinanda 2 лет назад
Родитель
Сommit
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) => {
       .then((json) => {
         const words: ValueType[] = json.data.rows
         const words: ValueType[] = json.data.rows
           .map((item) => {
           .map((item) => {
-            let weight = item.count / item.strlen;
+            let weight = item.count / (item.strlen - value.length + 0.1);
             if (item.word.length === value.length) {
             if (item.word.length === value.length) {
               weight = 100;
               weight = 100;
             }
             }