This repository has been archived on 2026-05-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-05-02 22:15:25 -05:00

59 lines
2.5 KiB
EmacsLisp

// 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())