mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
9357190dcd
commit
0aa6cd860c
3 changed files with 13 additions and 8 deletions
1
searx/static/themes/magi/stop_words.js
Normal file
1
searx/static/themes/magi/stop_words.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -1174,7 +1174,7 @@ button.btn_more {
|
|||
<script src="/static/themes/magi/Readability-readerable.js"></script>
|
||||
<script src="/static/themes/magi/Readability.js"></script>
|
||||
<script src="/static/themes/magi/markdown.js"></script>
|
||||
|
||||
<script src="/static/themes/magi/stop_words.js"></script>
|
||||
<script>
|
||||
const original_search_query = "''' + original_search_query.replace('"',"") + r'''"
|
||||
const search_queryquery = "''' + search_query.query.replace('"',"") + r'''"
|
||||
|
@ -1212,8 +1212,10 @@ const _load_wasm_jieba = async ()=> {
|
|||
_load_wasm_jieba();
|
||||
function cosineSimilarity(keyword, sentence) {
|
||||
// 将关键词和句子转换成单词列表
|
||||
const keywordList = cut(keyword.toLowerCase(), true);
|
||||
const sentenceList = cut(sentence.toLowerCase(), true);
|
||||
keywordList = cut(keyword.toLowerCase(), true);
|
||||
keywordList = keywordList.filter((item) => !stop_words.includes(item));
|
||||
sentenceList = cut(sentence.toLowerCase(), true);
|
||||
sentenceList = sentenceList.filter((item) => !stop_words.includes(item));
|
||||
|
||||
// 创建一个包含所有单词的列表
|
||||
const words = new Set(keywordList.concat(sentenceList));
|
||||
|
|
|
@ -1174,7 +1174,7 @@ button.btn_more {
|
|||
<script src="/static/themes/magi/Readability-readerable.js"></script>
|
||||
<script src="/static/themes/magi/Readability.js"></script>
|
||||
<script src="/static/themes/magi/markdown.js"></script>
|
||||
|
||||
<script src="/static/themes/magi/stop_words.js"></script>
|
||||
<script>
|
||||
const original_search_query = "''' + original_search_query.replace('"',"") + r'''"
|
||||
const search_queryquery = "''' + search_query.query.replace('"',"") + r'''"
|
||||
|
@ -1212,8 +1212,10 @@ const _load_wasm_jieba = async ()=> {
|
|||
_load_wasm_jieba();
|
||||
function cosineSimilarity(keyword, sentence) {
|
||||
// 将关键词和句子转换成单词列表
|
||||
const keywordList = cut(keyword.toLowerCase(), true);
|
||||
const sentenceList = cut(sentence.toLowerCase(), true);
|
||||
keywordList = cut(keyword.toLowerCase(), true);
|
||||
keywordList = keywordList.filter((item) => !stop_words.includes(item));
|
||||
sentenceList = cut(sentence.toLowerCase(), true);
|
||||
sentenceList = sentenceList.filter((item) => !stop_words.includes(item));
|
||||
|
||||
// 创建一个包含所有单词的列表
|
||||
const words = new Set(keywordList.concat(sentenceList));
|
||||
|
|
Loading…
Add table
Reference in a new issue