fix(reversal): extend punctuation handling

Add !, ;, and , to splitTrailingPunct and matchPunctuation.
Previously only ..., ?, and : were recognised.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-16 23:53:29 +00:00
parent 9474edde6d
commit c3b96a4ce1
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -539,7 +539,7 @@ func splitTrailingPunct(s string) (string, string) {
// Check single-char trailing punctuation. // Check single-char trailing punctuation.
if len(s) > 1 { if len(s) > 1 {
last := s[len(s)-1] last := s[len(s)-1]
if last == '?' || last == ':' { if last == '?' || last == ':' || last == '!' || last == ';' || last == ',' {
return s[:len(s)-1], string(last) return s[:len(s)-1], string(last)
} }
} }
@ -554,8 +554,14 @@ func matchPunctuation(punct string) (string, bool) {
return "progress", true return "progress", true
case "?": case "?":
return "question", true return "question", true
case "!":
return "exclamation", true
case ":": case ":":
return "label", true return "label", true
case ";":
return "separator", true
case ",":
return "comma", true
} }
return "", false return "", false
} }