Archived
2a6d70b959
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)
25 lines
945 B
EmacsLisp
25 lines
945 B
EmacsLisp
// 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())
|