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:
@@ -0,0 +1,16 @@
|
||||
// plural-noun.el - Test noun pluralization.
|
||||
//
|
||||
// Expected: "cats|children|boxes|cities|fish|leaves"
|
||||
|
||||
fn run_test() -> String {
|
||||
let r: [String] = native_list_empty()
|
||||
let r = native_list_append(r, pluralize("cat"))
|
||||
let r = native_list_append(r, pluralize("child"))
|
||||
let r = native_list_append(r, pluralize("box"))
|
||||
let r = native_list_append(r, pluralize("city"))
|
||||
let r = native_list_append(r, pluralize("fish"))
|
||||
let r = native_list_append(r, pluralize("leaf"))
|
||||
return str_join(r, "|")
|
||||
}
|
||||
|
||||
println(run_test())
|
||||
Reference in New Issue
Block a user