From 640e8799e5d5f5b52f37b39fb16ef03e46108a56 Mon Sep 17 00:00:00 2001 From: Neuron Date: Fri, 14 Aug 2026 17:38:13 -0500 Subject: [PATCH] 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. --- elp/src/translate.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/elp/src/translate.el b/elp/src/translate.el index 3346834..8e3feb7 100644 --- a/elp/src/translate.el +++ b/elp/src/translate.el @@ -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.