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
901 B
EmacsLisp
25 lines
901 B
EmacsLisp
// command.el - Realize "Go home."
|
|
//
|
|
// SemanticForm: command, predicate=go, location=home.
|
|
|
|
fn run_test() -> String {
|
|
let form: [String] = native_list_empty()
|
|
let form = native_list_append(form, "intent")
|
|
let form = native_list_append(form, "command")
|
|
let form = native_list_append(form, "agent")
|
|
let form = native_list_append(form, "")
|
|
let form = native_list_append(form, "predicate")
|
|
let form = native_list_append(form, "go")
|
|
let form = native_list_append(form, "patient")
|
|
let form = native_list_append(form, "")
|
|
let form = native_list_append(form, "location")
|
|
let form = native_list_append(form, "home")
|
|
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())
|