fix(salary): stop dropping the dotted A.M.B.A. suffix in company-name matching (#356)

The A.M.B.A. STRIP_PATTERNS regex ended in a literal dot followed by
\b, but \b can't fire right after a non-word character when the next
char is also non-word (space/end-of-string) - so it never matched any
realistic company name. The sibling undotted 'amba' suffix stripped
fine, so 'Arla Foods A.M.B.A.' and 'Arla Foods amba' normalized to
different strings and scored 86 vs 100 against the same query.

Made the trailing dot optional so the boundary resolves correctly.
This commit is contained in:
Ritik Yadav
2026-08-23 09:26:21 +02:00
committed by GitHub
parent ff3e2d00b6
commit 7d00ec7925
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ SPELLING_VARIANTS = {
# Legal suffixes and noise to strip when matching company names
STRIP_PATTERNS = [
r"\ba/s\b", r"\baps\b", r"\bi/s\b", r"\bp/s\b", r"\bk/s\b",
r"\bivs\b", r"\bamba\b", r"\ba\.m\.b\.a\.\b",
r"\bivs\b", r"\bamba\b", r"\ba\.m\.b\.a\.?\b",
r"\(vg\)", r"\(.*?\)", # (VG) and other parentheticals
r"\bdanmark\b", r"\bdenmark\b", r"\bscandinavia\b", r"\bnordic\b",
r"\bgroup\b", r"\bholding\b",