Ignore spacing beside a Regular's outer punctuation in a mention
CI / ci (push) Successful in 2m53s
CI / ci (pull_request) Successful in 2m26s

A mention took in a stored name's leading or trailing punctuation only
where the text repeated the stored spacing exactly, although the rule
says spacing is ignored. With Regulars "Beef Chili !" and "Chili!", the
reason "Like your Beef Chili!" left the first mention at "Beef Chili",
so a citation of "Chili!" passed. Match the punctuation with any spacing
beside it, then apply the same border check to the extended mention.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 22:50:36 -04:00
co-authored by Claude Opus 5.5
parent e0e934d8a8
commit 70a4e540aa
2 changed files with 38 additions and 6 deletions
@@ -254,6 +254,10 @@ func TestSuggestSideQuestsReasonMentionRule(t *testing.T) {
"spelled alike by both": {[]string{"Beef Chili!"}, "Corn chips under your Beef Chili.", "Beef Chili", none},
"punctuation then a letter": {[]string{"Beef Chili!"}, "Your Beef Chili!X is our inspiration.", "Beef Chili!", none},
"letter before punctuation": {[]string{"¡Beef Chili"}, "Your X¡Beef Chili is our inspiration.", "¡Beef Chili", none},
"spacing before punctuation": {[]string{"Beef Chili!"}, "Your Beef Chili ! over corn chips.", "Beef Chili!", ""},
"spacing after punctuation": {[]string{"¡Beef Chili"}, "Your ¡ Beef Chili is our inspiration.", "¡Beef Chili", ""},
"stored spacing left off": {[]string{"Beef Chili !", "Chili!"}, "Like your Beef Chili!", "Beef Chili !", ""},
"inside unspaced punctuation": {[]string{"Beef Chili !", "Chili!"}, "Like your Beef Chili!", "Chili!", none},
"stored symbol left off": {[]string{"Green Chili 🌶"}, "Like your Green Chili, gone green.", "Green Chili 🌶", none},
"stored accent left off": {[]string{"Chicken Cafe\u0301"}, "Like your Chicken Cafe, gone green.", "Chicken Cafe\u0301", none},
"accent written after name": {[]string{"Chicken Cafe"}, "Like your Chicken Cafe\u0301, gone green.", "Chicken Cafe", none},