elp(translate): normalize EN irregular pasts before the lemma bridge

comprehend lemmatizes some irregulars (fought->fight) but not all (broke);
tr_norm_verb covers the poem's remainder so affirmative content verbs route
(ES 'Yo broo' -> 'Yo rompo'). Negation lines unchanged and still correct.
This commit is contained in:
Neuron
2026-08-14 17:38:13 -05:00
parent 9b63a2a23b
commit 640e8799e5
+20 -1
View File
@@ -182,6 +182,25 @@ fn tr_neg_word(neg_word: String, lang: String) -> String {
return ""
}
// normalize an English irregular past/participle surface to its lemma, so the
// content bridge can find it. comprehend lemmatizes regulars and some irregulars
// ("fought"->"fight") but not all ("broke"); cover the poem's remainder here.
fn tr_norm_verb(w: String) -> String {
if str_eq(w, "broke") { return "break" }
if str_eq(w, "broken") { return "break" }
if str_eq(w, "saw") { return "see" }
if str_eq(w, "took") { return "take" }
if str_eq(w, "ran") { return "run" }
if str_eq(w, "fought") { return "fight" }
if str_eq(w, "waited") { return "wait" }
if str_eq(w, "touched") { return "touch" }
if str_eq(w, "called") { return "call" }
if str_eq(w, "stayed") { return "stay" }
if str_eq(w, "chased") { return "chase" }
if str_eq(w, "carried") { return "carry" }
return w
}
// the faculty: EN text -> target surface
// Parses EN (mature path), swaps content lemmas via the wired bridge, carries
// SACRED polarity/neg_word untouched, and hands a target-lang spec to realize().
@@ -192,7 +211,7 @@ fn translate_spec(text: String, tgt: String) -> [String] {
let agent: String = slots_get(spec, "agent")
let negw: String = slots_get(spec, "neg_word")
let spec = slots_set(spec, "predicate", tr_pred(pred, tgt))
let spec = slots_set(spec, "predicate", tr_pred(tr_norm_verb(pred), tgt))
let spec = slots_set(spec, "patient", tr_np(pat, tgt))
let spec = slots_set(spec, "agent", tr_pronoun(agent, tgt))
// SACRED: neg_word localized to a negator, polarity left exactly as parsed.