11.3. twol.fs module

fs.py: A wrapper module for basic finite-state operations

The HFST engine used for accomplishing the operations but all functions make copies of their arguments when it is necessary to avoid side-effects.

© Kimmo Koskenniemi, 2018. This is free code under the GPL 3 license.

twol.fs.compose(f, g)[source]

Return the composition of two FSTs

twol.fs.concat(f, g)[source]

Return the concatenation of two FSTs

twol.fs.crossprod(f, g)[source]

Return the cross-product of two FSAs

twol.fs.expr(e)[source]

Return an FST corresponding to a XFST regular expression

twol.fs.intersect(f, g)[source]

Return the intersection of two FSTs

Both arguments are assumed to be length preserving mappings.

twol.fs.lower(f)[source]

Return the output projection of an FST

twol.fs.plus(f)[source]

Return the Kleene plus iteration of an FST

twol.fs.star(f)[source]

Return the Kleene star iteration of an FST

twol.fs.string_to_fsa(grapheme_string)[source]

Return a FSA which accepts the sequence of graphemes in the string

twol.fs.symbol_pair_to_fst(insym, outsym)[source]

“Return a FST which accepts one the pair string ‘insym:outsym’

twol.fs.symbol_to_fsa(sym)[source]

Return a FSA which accepts the one letter string ‘sym’

The symbol ‘sym’ may be e.g. a composed Unicode grapheme, i.e. a string of two or more Unicode characters.

twol.fs.union(f, g)[source]

Return the union of two FSTs

twol.fs.upper(f)[source]

Return the input projection of an FST