Rename: nlg → elp (Engram Language Protocol)
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
// lang-zh.el - Mandarin Chinese NLG tests: assertion, question with 吗.
|
||||
//
|
||||
// Mandarin is SVO, isolating (no morphological inflection). The verb surface
|
||||
// form is always the base form — morph_conjugate returns base for isolating
|
||||
// languages. Questions use the intonation strategy with "?" punctuation.
|
||||
//
|
||||
// Expected outputs (approximate):
|
||||
// assert: "猫 吃 鱼." (SVO, no inflection on verb 吃)
|
||||
// question: "猫 吃 鱼?" (intonation question — same order, ? instead of .)
|
||||
|
||||
fn test_assert() -> String {
|
||||
// Subject: 猫 (cat), verb: 吃 (eat), object: 鱼 (fish)
|
||||
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, "猫")
|
||||
let form = native_list_append(form, "predicate")
|
||||
let form = native_list_append(form, "吃")
|
||||
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, "")
|
||||
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")
|
||||
let form = native_list_append(form, "lang")
|
||||
let form = native_list_append(form, "zh")
|
||||
return realize(form)
|
||||
}
|
||||
|
||||
fn test_question() -> String {
|
||||
// Intonation question: same SVO order, ? punctuation
|
||||
// Note: 吗 (ma) is not appended by the engine in this version —
|
||||
// the intonation strategy simply adds "?" without a particle.
|
||||
let form: [String] = native_list_empty()
|
||||
let form = native_list_append(form, "intent")
|
||||
let form = native_list_append(form, "question")
|
||||
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, "吃")
|
||||
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, "")
|
||||
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")
|
||||
let form = native_list_append(form, "lang")
|
||||
let form = native_list_append(form, "zh")
|
||||
return realize(form)
|
||||
}
|
||||
|
||||
println(test_assert())
|
||||
println(test_question())
|
||||
Reference in New Issue
Block a user