We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00cb9eb commit 0d3c0d9Copy full SHA for 0d3c0d9
apps/common/util/ts_vecto_util.py
@@ -54,9 +54,10 @@ def replace_word(word_dict, text: str):
54
55
56
def get_word_key(text: str, use_word_list):
57
- for j_word in jieba_word_list_cache:
58
- if not text.__contains__(j_word) and not use_word_list.__contains__(j_word):
59
- return j_word
+ j_word = next((j for j in jieba_word_list_cache if j not in text and all(j not in used for used in use_word_list)),
+ None)
+ if j_word:
60
+ return j_word
61
j_word = str(uuid.uuid1())
62
jieba.add_word(j_word)
63
return j_word
0 commit comments