mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
Compaction/Safeguard: add summary quality audit retries (#25556)
Merged via squash.
Prepared head SHA: be473efd16
Co-authored-by: rodrigouroz <384037+rodrigouroz@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -630,6 +630,18 @@ const STOP_WORDS_ZH = new Set([
|
||||
"告诉",
|
||||
]);
|
||||
|
||||
export function isQueryStopWordToken(token: string): boolean {
|
||||
return (
|
||||
STOP_WORDS_EN.has(token) ||
|
||||
STOP_WORDS_ES.has(token) ||
|
||||
STOP_WORDS_PT.has(token) ||
|
||||
STOP_WORDS_AR.has(token) ||
|
||||
STOP_WORDS_ZH.has(token) ||
|
||||
STOP_WORDS_KO.has(token) ||
|
||||
STOP_WORDS_JA.has(token)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a token looks like a meaningful keyword.
|
||||
* Returns false for short tokens, numbers-only, etc.
|
||||
@@ -727,15 +739,7 @@ export function extractKeywords(query: string): string[] {
|
||||
|
||||
for (const token of tokens) {
|
||||
// Skip stop words
|
||||
if (
|
||||
STOP_WORDS_EN.has(token) ||
|
||||
STOP_WORDS_ES.has(token) ||
|
||||
STOP_WORDS_PT.has(token) ||
|
||||
STOP_WORDS_AR.has(token) ||
|
||||
STOP_WORDS_ZH.has(token) ||
|
||||
STOP_WORDS_KO.has(token) ||
|
||||
STOP_WORDS_JA.has(token)
|
||||
) {
|
||||
if (isQueryStopWordToken(token)) {
|
||||
continue;
|
||||
}
|
||||
// Skip invalid keywords
|
||||
|
||||
Reference in New Issue
Block a user