Skip to content

XreCompiler

eaxelson edited this page Aug 29, 2017 · 11 revisions

class XreCompiler

A regular expression compiler.

init(self)

Construct compiler for OpenFst format (the default) transducers.

init(self, impl)

Create compiler for impl format transducers.

define_xre(self, name, xre)

Add a definition macro. Compiler will replace arcs labeled name with a transducer defined by regular expression xre in later phases of compilation (if set_expand_definitions(True) has been called).

define_transducer(self, name, transducer)

Add a definition macro. Compiler will replace arcs labeled name with a transducer transducer in later phases of compilation (if set_expand_definitions(True) has been called).

define_list(self, name, symbol_list)

todo

define_function(self, name, arguments, xre)

todo

undefine(self, name)

todo

compile(self, xre)

Compile a transducer defined by @a xre. May return a pointer to @e empty transducer on non-fatal error. A None pointer is returned on fatal error, if abort is not called. Return: An HfstTransducer pointer.

is_definition(self, name)

Whether name is a definition.

is_function_definition(self, name)

Whether name is a function definition.

set_verbosity(self, v)

Set the verbosity of the compiler. @arg v True or False

setOutputToConsole(self, v)

(Windows-specific) Whether output is printed to console instead of standard output. @arg v True or False

getOutputToConsole(self, )

(Windows-specific) Whether output is printed to console instead of standard output.

set_expand_definitions(self, v)

Whether definitions are expanded. @arg v True or False