Skip to content
eaxelson edited this page Aug 29, 2017 · 5 revisions

hfst.xerox_rules.Rule

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.

init(self, mapping)

Rule that performs mappings defined in \a mapping in every context.

  • mapping HfstTransducerPairVector

init(self, mapping, context, type)

Rule that performs mappings defined in \a mapping in contexts \a context. \a type defines how contexts are matched.

  • mapping HfstTransducerPairVector
  • context HfstTransducerPairVector
  • type ReplType

init(self, rule)

Copy Rule.

  • rule Rule

init(self)

Default constructor needed for python.

get_mapping(self)

Get mappings defined in Rule.

Return: HfstTransducerPairVector

get_context()

Get contexts defined in Rule.

Return: HfstTransducerPairVector

get_replType()

Get replace type defined in Rule.

Return: ReplaceType

encodeFlags()

Encode flag diacritics.

Clone this wiki locally