Add semantics layer bridging intent frames to grammar realization

Introduces semantics.el with SemFrame (sem_frame/sem_frame_simple/sem_frame_obj
constructors), sem_to_spec to convert intent frames into realizer slot maps,
and sem_realize/sem_realize_full as end-to-end frame→text entry points.
Supports intents: assert, query, describe, greet.

Wires generate_frame() into nlg.el and adds 4 new passing tests
(sem-assert, sem-query, sem-describe, sem-greet). All 10 tests pass.
This commit is contained in:
Will Anderson
2026-05-02 14:45:54 -05:00
parent 1432c56cf7
commit cbb27b8d87
7 changed files with 362 additions and 12 deletions
+5
View File
@@ -33,6 +33,7 @@ NLG_MODULES=(
"${SRC_DIR}/vocabulary.el"
"${SRC_DIR}/grammar.el"
"${SRC_DIR}/realizer.el"
"${SRC_DIR}/semantics.el"
"${SRC_DIR}/nlg.el"
)
@@ -102,6 +103,10 @@ run_nlg_case "question" examples/question.el "Do you see the d
run_nlg_case "command" examples/command.el "Go home."
run_nlg_case "plural-noun" examples/plural-noun.el "cats|children|boxes|cities|fish|leaves"
run_nlg_case "verb-conjugation" examples/verb-conjugation.el "ran|walked|is|am|sleeping"
run_nlg_case "sem-assert" examples/sem-assert.el "She sleeps."
run_nlg_case "sem-query" examples/sem-query.el "Do you see?"
run_nlg_case "sem-describe" examples/sem-describe.el "The cat is big."
run_nlg_case "sem-greet" examples/sem-greet.el "Hello, Alice."
echo
echo "${PASS} passed, ${FAIL} failed"