HFST - Helsinki Finite-State Transducer Technology - Python API  version 3.12.3 (under development)
Public Member Functions | List of all members
XreCompiler Class Reference

A regular expression compiler. More...

Public Member Functions

def __init__ (self)
 Construct compiler for OpenFst format (the default) transducers. More...
 
def __init__ (self, impl)
 Create compiler for impl format transducers. More...
 
def compile (self, xre)
 Compile a transducer defined by xre. More...
 
def define_function (self, name, arguments, xre)
 todo More...
 
def define_list (self, name, symbol_list)
 todo More...
 
def define_transducer (self, name, transducer)
 Add a definition macro. More...
 
def define_xre (self, name, xre)
 Add a definition macro. More...
 
def getOutputToConsole (self)
 (Windows-specific) Whether output is printed to console instead of standard output. More...
 
def is_definition (self, name)
 Whether name is a definition. More...
 
def is_function_definition (self, name)
 Whether name is a function definition. More...
 
def set_expand_definitions (self, v)
 Whether definitions are expanded. More...
 
def set_verbosity (self, v)
 Set the verbosity of the compiler. More...
 
def setOutputToConsole (self, v)
 (Windows-specific) Whether output is printed to console instead of standard output. More...
 
def undefine (self, name)
 todo More...
 

Detailed Description

A regular expression compiler.

Constructor & Destructor Documentation

def __init__ (   self)

Construct compiler for OpenFst format (the default) transducers.

def __init__ (   self,
  impl 
)

Create compiler for impl format transducers.

Member Function Documentation

def compile (   self,
  xre 
)

Compile a transducer defined by xre.

May return a pointer to empty transducer on non-fatal error. A None pointer is returned on fatal error, if abort is not called.

Returns
An HfstTransducer pointer.
def define_function (   self,
  name,
  arguments,
  xre 
)

todo

def define_list (   self,
  name,
  symbol_list 
)

todo

def 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).

def 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).

def getOutputToConsole (   self)

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

def is_definition (   self,
  name 
)

Whether name is a definition.

def is_function_definition (   self,
  name 
)

Whether name is a function definition.

def set_expand_definitions (   self,
  v 
)

Whether definitions are expanded.

  • v True or False
def set_verbosity (   self,
  v 
)

Set the verbosity of the compiler.

  • v True or False
def setOutputToConsole (   self,
  v 
)

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

  • v True or False
def undefine (   self,
  name 
)

todo


The documentation for this class was generated from the following file: