Fix syn error. (#3953)

### What problem does this PR solve?

Close #3696
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-12-10 10:54:54 +08:00 committed by GitHub
parent 5fe0791684
commit 927873bfa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ def remote_call(filename, binary):
resume = step_two.parse(resume)
return resume
except Exception:
logging.exception("Resume parser error")
logging.exception("Resume parser has not been supported yet!")
return {}

View File

@ -86,10 +86,10 @@ class FulltextQueryer:
syn = self.syn.lookup(tk)
syn = rag_tokenizer.tokenize(" ".join(syn)).split()
keywords.extend(syn)
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn]
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn if s]
syns.append(" ".join(syn))
q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk]
q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk and not re.match(r"[.^+\(\)-]", tk)]
for i in range(1, len(tks_w)):
q.append(
'"%s %s"^%.4f'