router: add MatchText to NormalizedInput and NormalizeMatchText function (slice 9a)
Add MatchText field to NormalizedInput — a lossy lexical matching view derived from ingress text: TrimSpace → NFKC → lowercase → collapse Unicode whitespace. Does NOT fold ё→е, strip punctuation, strip wake words, rewrite numbers, or invoke morphology. Both ingress sites (voice + text) construct MatchText at entry. No existing consumer reads MatchText yet — it is dark data for future opt-in migration. Vikunja: #725
This commit is contained in:
@@ -92,10 +92,12 @@ const (
|
||||
)
|
||||
|
||||
// NormalizedInput — the typed ingress boundary for a turn. Text is the raw
|
||||
// utterance after STT (voice) or as typed (text). Source identifies the
|
||||
// channel. This slice performs no new linguistic normalization: text and voice
|
||||
// paths continue to converge onto the same turn path as they did before.
|
||||
// utterance after STT (voice) or as typed (text). MatchText is a lossy
|
||||
// lexical matching view derived from Text: whitespace-collapsed, NFKC-
|
||||
// normalized, lowercased. Consumers must opt into MatchText individually;
|
||||
// nothing reads it by default in this slice. Source identifies the channel.
|
||||
type NormalizedInput struct {
|
||||
Text string
|
||||
Source InputSource
|
||||
Text string // original ingress text — byte-for-byte the value current consumers receive
|
||||
MatchText string // derived lossy representation for case-insensitive lexical matching
|
||||
Source InputSource
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user