mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
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:
+1
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user