Commit 189914a
fix: make post-check scalable with word-boundary matching and locale awareness
The programmatic post-check had two scalability issues:
1. Substring false positives: "at" matched inside "Nature", "10" matched
inside "100". Fix: use regex word tokenization instead of string `in`
operator. Both user words and enhanced title are tokenized into word
sets before comparison.
2. Localization breakage: English user words were prepended to translated
titles (e.g. "healthcare Aceite de Pescado..."). Fix: only apply the
post-check for English locales (locale.startswith("en")). For
non-English locales, the LLM translates user intent into the target
language — English word matching doesn't apply.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c37f228 commit 189914a
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
346 | | - | |
347 | | - | |
348 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
349 | 351 | | |
350 | | - | |
351 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
352 | 356 | | |
353 | 357 | | |
354 | 358 | | |
| |||
0 commit comments