alex.components.nlg.tectotpl.block.read package

Submodules

alex.components.nlg.tectotpl.block.read.tectotemplates module

class alex.components.nlg.tectotpl.block.read.tectotemplates.TectoTemplates(scenario, args)[source]

Bases: alex.components.nlg.tectotpl.core.block.Block

Reader for partial t-tree dialog system templates, where treelets can be intermixed with linear text.

Example template:

Vlak přijede v [[7|adj:attr] hodina|n:4|gender:fem].

All linear text is inserted into t-lemmas of atomic nodes, while treelets have their formeme and grammateme values filled in.

parse_line(text, troot)[source]

Parse a template to a t-tree.

parse_treelet(text, tnode)[source]

Parse a treelet in the template, filling the required values. Returns the position in the text after the treelet.

process_document(filename)[source]

Read a Tecto-Template file and return its contents as a Document object.

alex.components.nlg.tectotpl.block.read.yaml module

class alex.components.nlg.tectotpl.block.read.yaml.YAML(scenario, args)[source]

Bases: alex.components.nlg.tectotpl.core.block.Block

process_document(filename)[source]

Read a YAML file and return its contents as a Document object

Module contents