update setkeywords

This commit is contained in:
Chill
2023-03-29 16:45:42 +08:00
parent 9a9dff135a
commit 7ea3632e32
3 changed files with 14560 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import requests,json
import requests, json
import openai
from odoo import api, fields, models, _
from odoo.exceptions import UserError

View File

@@ -7,6 +7,8 @@
# 2020.04.06 第一次提交
# 2020.05.16 修改支持大于0xffff的字符
import os
__all__ = ['WordsSearch']
__author__ = 'Lin Zhijun'
__date__ = '2020.05.16'
@@ -77,7 +79,10 @@ class WordsSearch():
self._indexs = []
def SetKeywords(self, keywords):
self._keywords = keywords
keyword_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'sensi_words.txt')
s = open(keyword_path, 'r+', encoding='utf-8').read().split('\n')
self._keywords = s + keywords
# self._keywords = keywords
self._indexs = []
for i in range(len(keywords)):
self._indexs.append(i)

File diff suppressed because it is too large Load Diff