Add native El NLG system: morphology, vocabulary, grammar, realizer

Implements a complete natural language generation stack in El:
- morphology.el: English pluralization, verb conjugation (40+ irregulars), determiner agreement
- vocabulary.el: inline seed lexicon (~100 entries: pronouns, nouns, verbs, adjectives, etc.)
- grammar.el: CFG rules (S/NP/VP/PP), slot-map driven tree generator, s-expression renderer
- realizer.el: semantic form -> English text with tense/aspect/agreement, do-support for questions
- nlg.el: JSON-driven public API tying all modules together
- tests/run.sh: acceptance corpus runner (6 tests, all passing)
This commit is contained in:
Will Anderson
2026-05-02 14:16:23 -05:00
commit 2a6d70b959
13 changed files with 1956 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// basic-sentence.el - Realize "I see the cat."
//
// SemanticForm: assert, agent=I, predicate=see, patient=the cat, present simple.
fn run_test() -> String {
let form: [String] = native_list_empty()
let form = native_list_append(form, "intent")
let form = native_list_append(form, "assert")
let form = native_list_append(form, "agent")
let form = native_list_append(form, "I")
let form = native_list_append(form, "predicate")
let form = native_list_append(form, "see")
let form = native_list_append(form, "patient")
let form = native_list_append(form, "the cat")
let form = native_list_append(form, "location")
let form = native_list_append(form, "")
let form = native_list_append(form, "tense")
let form = native_list_append(form, "present")
let form = native_list_append(form, "aspect")
let form = native_list_append(form, "simple")
return realize(form)
}
println(run_test())