Fix identity subject extraction to handle punctuation in questions

This commit is contained in:
nmemmert
2026-04-14 12:55:04 -04:00
parent 87967bf149
commit e6080349af
+1 -1
View File
@@ -347,7 +347,7 @@ function sanitizeSubject(value: string): string {
}
function extractIdentitySubject(normalizedQuery: string): string {
const match = normalizedQuery.match(/\b(?:who\s+(?:is|was)|tell me about)\s+([a-z][a-z\s'-]{1,40})$/i)
const match = normalizedQuery.match(/\b(?:who\s+(?:is|was)|tell me about)\s+([a-z][a-z\s'-]{1,40})\b/i)
if (!match) return ''
const cleaned = sanitizeSubject(match[1])
const withoutArticles = cleaned.replace(/^(a|an|the)\s+/, '').trim()