Code refactor (#5371)

### What problem does this PR solve?

#5173

### Type of change

- [x] Refactoring
This commit is contained in:
Kevin Hu
2025-02-26 15:40:52 +08:00
committed by GitHub
parent ffb4cda475
commit 4f40f685d9
18 changed files with 638 additions and 591 deletions

View File

@ -88,7 +88,7 @@ class FulltextQueryer:
tks_w = [(re.sub(r"^[\+-]", "", tk), w) for tk, w in tks_w if tk]
tks_w = [(tk.strip(), w) for tk, w in tks_w if tk.strip()]
syns = []
for tk, w in tks_w:
for tk, w in tks_w[:256]:
syn = self.syn.lookup(tk)
syn = rag_tokenizer.tokenize(" ".join(syn)).split()
keywords.extend(syn)