Summary
Follow-up to #784. The book-boundary scan matcher compares a normalized author directory name against the audiobook's expected author tokens. When a professional or generational post-nominal appears on only one side — metadata Jane Doe, PhD vs a Jane Doe folder, or a Martin King Jr folder vs Martin King metadata — the author context previously failed to match.
Change
BuildExpectedAuthorTokensnow also emits a post-nominal-stripped variant of each author.HasAuthorContextstrips post-nominals from the directory token before comparing.
Together these make the match symmetric in either direction. The change is additive — no previously-produced token is removed, so nothing that matched before stops matching.
Deliberately narrow (per @m4bard's over-matching concern on #784)
- Post-nominals only. Initials are not expanded —
L. M.stays distinct fromLucy Maud, avoiding the genuine widening that initials matching would introduce. - The suffix set excludes short degree abbreviations that collide with real name words (e.g.
maas in Yo-Yo Ma,do,ba,bs), so a surname is never silently dropped. - Stripping always leaves at least one word.
Suffix set: phd md dds dvm dpt edd psyd jd esq mba cpa llm llb mfa jr sr ii iii iv.
Scope boundary — what this intentionally does not cover
This is deliberately the narrow, trailing-post-nominal shape, not a general credential/name normalizer. Out of scope by design:
- Leading-position credentials — e.g. a
Dr. Jane DoeorM.Ed. Karla McLarenfolder against a clean record. Stripping only walks backward from the end and stops at the first non-post-nominal word, so a credential in front of the name is never reached. - Initials / middle-initial collapse — e.g.
John M. GottmanvsJohn Gottman, orL. M.vsLucy Maud. These are a genuine widening (any author whose initials collide gets accepted) and stay out for the same ...
Automated Canary build