HFST - Helsinki Finite-State Transducer Technology - Python API  version 3.12.0
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Rule Class Reference

A rule that contains mapping and context and replace type (if any). More...

Public Member Functions

def __init__
 Rule that performs mappings defined in mapping in every context. More...
 
def __init__
 Rule that performs mappings defined in mapping in contexts context. More...
 
def __init__
 Copy Rule. More...
 
def __init__
 Default constructor needed for SWIG. More...
 
def encodeFlags
 Encode flag diacritics. More...
 
def get_context
 Get contexts defined in Rule. More...
 
def get_mapping
 Get mappings defined in Rule. More...
 
def get_replType
 Get replace type defined in Rule. More...
 

Detailed Description

A rule that contains mapping and context and replace type (if any).

If rule is A -> B || L _ R , than mapping is cross product of transducers A and B, context is pair of transducers L and R, and replType is enum REPL_UP.

Constructor & Destructor Documentation

def __init__ (   self,
  mapping 
)

Rule that performs mappings defined in mapping in every context.

Parameters
mappingHfstTransducerPairVector
def __init__ (   self,
  mapping,
  context,
  type 
)

Rule that performs mappings defined in mapping in contexts context.

type defines how contexts are matched.

Parameters
mappingHfstTransducerPairVector
contextHfstTransducerPairVector
typeReplType
def __init__ (   self,
  rule 
)

Copy Rule.

Parameters
ruleRule
def __init__ (   self)

Default constructor needed for SWIG.

Member Function Documentation

def encodeFlags ( )

Encode flag diacritics.

def get_context ( )

Get contexts defined in Rule.

Returns
HfstTransducerPairVector
def get_mapping (   self)

Get mappings defined in Rule.

Returns
HfstTransducerPairVector
def get_replType ( )

Get replace type defined in Rule.

Returns
ReplaceType

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