HFST - Helsinki Finite-State Transducer Technology - Python API  version 3.9.0
Classes | Namespaces | Functions | Variables
libhfst.py File Reference

Classes

class  ContextTransducersAreNotAutomataException
 Transducers given as rule context are not automata. More...
 
class  EmptySetOfContextsException
 The set of transducer pairs is empty. More...
 
class  EmptyStringException
 An argument string is an empty string. More...
 
class  EndOfStreamException
 The stream is at end. More...
 
class  FlagDiacriticsAreNotIdentitiesException
 Flag diacritics encountered on one but not the other side of a transition. More...
 
class  FunctionNotImplementedException
 Function has not been implemented (yet). More...
 
class  HfstBasicTransducer
 A simple transducer class with tropical weights. More...
 
class  HfstBasicTransition
 A transition class that consists of a target state, input and output symbols and a a tropical weight. More...
 
class  HfstException
 Base class for HfstExceptions. More...
 
class  HfstFatalException
 An error happened probably due to a bug in the HFST code. More...
 
class  HfstFile
 A wrapper class for file operations. More...
 
class  HfstInputStream
 A stream for reading HFST binary transducers. More...
 
class  HfstOutputStream
 A stream for writing binary transducers. More...
 
class  HfstTokenizer
 A tokenizer for creating transducers from UTF-8 strings. More...
 
class  HfstTransducer
 A synchronous finite-state transducer. More...
 
class  HfstTransducerTypeMismatchException
 Two or more HfstTransducers are not of the same type. More...
 
class  ImplementationTypeNotAvailableException
 The library required by the implementation type requested is not linked to HFST. More...
 
class  IncorrectUtf8CodingException
 String is not valid utf-8. More...
 
class  LexcCompiler
 A compiler holding information contained in lexc style lexicons. More...
 
class  MetadataException
 A piece of metadata in an HFST header is not supported. More...
 
class  MissingOpenFstInputSymbolTableException
 An OpenFst transducer does not have an input symbol table. More...
 
class  MultiCharSymbolTrie
 TODO: documentation ??? More...
 
class  NotTransducerStreamException
 The stream does not contain transducers. More...
 
class  NotValidAttFormatException
 The stream is not in valid AT&T format. More...
 
class  NotValidLexcFormatException
 The input is not in valid LexC format. More...
 
class  NotValidPrologFormatException
 The input is not in valid prolog format. More...
 
class  SpecifiedTypeRequiredException
 The type of a transducer is not specified. More...
 
class  StateIndexOutOfBoundsException
 The state number argument is not valid. More...
 
class  StateIsNotFinalException
 State is not final (and cannot have a final weight). More...
 
class  StreamCannotBeWrittenException
 Stream cannot be written. More...
 
class  StreamIsClosedException
 Stream is closed. More...
 
class  StreamNotReadableException
 Stream cannot be read. More...
 
class  SymbolNotFoundException
 A bug in the HFST code. More...
 
class  TransducerHasWrongTypeException
 Transducer has wrong type. More...
 
class  TransducerHeaderException
 Transducer has a malformed HFST header. More...
 
class  TransducerIsCyclicException
 Transducer is cyclic. More...
 
class  TransducersAreNotAutomataException
 Transducers are not automata. More...
 
class  TransducerTypeMismatchException
 Two or more transducers do not have the same type. More...
 
class  XreCompiler
 A compiler holding information needed to compile XREs. More...
 

Namespaces

 libhfst
 HFST API for Python3.
 

Functions

def coercion
 A transducer that requires that one of the mappings defined by mapping must occur in each context in contexts. More...
 
def compile_lexc_file
 Compile lexc file filename into a transducer. More...
 
def compile_xfst_file
 Compile (is 'run' a better term?) xfst file filename. More...
 
def deep_coercion
 A transducer that specifies that a string from the output language of the transducer mapping always has to be mapped to one of its input strings (according to transducer mappings) if it appears in any of the contexts in contexts. More...
 
def deep_restriction
 A transducer that specifies that a string from the output language of the transducer mapping may only be mapped to one of its input strings (according to transducer mappings) if it appears in any of the contexts in contexts.Symbols outside of the matching substrings are mapped to any symbol allowed by alphabet. More...
 
def deep_restriction_and_coercion
 A transducer that is equivalent to the intersection of deep_restriction and deep_coercion. More...
 
def empty_fst
 Get an empty transducer. More...
 
def epsilon_fst
 Get an epsilon transducer. More...
 
def fst
 Get a transducer that recognizes one or more paths. More...
 
def fst_type_to_string
 Get a string representation of transducer implementation type type. More...
 
def get_default_fst_type
 Get default transducer implementation type. More...
 
def hfst_open
 Open file named filename in mode mode. More...
 
def hfst_stderr
 Get file that points to standard error stream. More...
 
def hfst_stdin
 Get file that points to standard input. More...
 
def hfst_stdout
 Get file that points to standard output. More...
 
def is_diacritic
 Whether symbol symbol is a flag diacritic. More...
 
def left_replace_down
 Inversion of the replace_up and the result needs to be composed on the upper side of the input language. More...
 
def left_replace_down_karttunen
 Inversion of the replace_up and the result needs to be composed on the upper side of the input language. More...
 
def left_replace_left
 Inversion of the replace_up and the result needs to be composed on the upper side of the input language. More...
 
def left_replace_right
 Inversion of the replace_up and the result needs to be composed on the upper side of the input language. More...
 
def left_replace_up
 Inversion of the replace_up and the result needs to be composed on the upper side of the input language. More...
 
def left_replace_up
 Inversion of the replace_up and the result needs to be composed on the upper side of the input language. More...
 
def read_att
 Read next transducer from AT&T file pointed by f. More...
 
def read_att_input
 Read AT&T input from the user and return a transducer. More...
 
def read_att_string
 Read a multiline string att and return a transducer. More...
 
def read_prolog
 Read next transducer from prolog file pointed by f. More...
 
def regex
 Get a transducer as defined by regular expression regexp. More...
 
def replace_down
 The same as replace_up, but matching is done on the output side of mapping. More...
 
def replace_down
 The same as replace_down(context, mapping, optional, alphabet) but mapping is performed in every context. More...
 
def replace_down_karttunen
 TODO: document. More...
 
def replace_left
 The same as replace_up, but left context matching is done on the output side of mapping and right context on the input side of mapping. More...
 
def replace_right
 The same as replace_up, but left context matching is done on the input side of mapping and right context on the output side of mapping. More...
 
def replace_up
 A transducer that performs an upward mapping mapping in the context context when the alphabet is alphabet. More...
 
def replace_up
 The same as replace_up but mapping is performed in every context. More...
 
def restriction
 A transducer that allows any (substring) mapping defined by mapping only if it occurs in any of the contexts in contexts. More...
 
def restriction_and_coercion
 A transducer that is equivalent to the intersection of restriction and coercion and requires that the mappings defined by mapping occur always and only in the given contexts in contexts. More...
 
def set_default_fst_type
 Set the default implementation type. More...
 
def start_xfst
 Start interactive xfst compiler. More...
 
def surface_coercion
 A transducer that specifies that a string from the input language of the transducer mapping always has to the mapped to one of its output strings according to transducer mapping if it appears in any of the contexts in contexts. More...
 
def surface_restriction
 A transducer that specifies that a string from the input language of the transducer mapping may only be mapped to one of its output strings (according to transducer mapping) if it appears in any of the contexts in contexts. More...
 
def surface_restriction_and_coercion
 A transducer that is equivalent to the intersection of surface_restriction and surface_coercion. More...
 
def tokenized_fst
 Get a transducer that recognizes the concatenation of symbols or symbol pairs in arg. More...
 
def two_level_if
 A transducer that obligatorily performs the mappings defined by mappings in the context context when the alphabet is alphabet. More...
 
def two_level_if_and_only_if
 A transducer that always performs the mappings defined by mappings in the context context and only in that context, when the alphabet is alphabet. More...
 
def two_level_only_if
 A transducer that allows the mappings defined by mappings only in the context context, when the alphabet is alphabet. More...
 

Variables

string EPSILON = '@_EPSILON_SYMBOL_@'
 The string for epsilon symbol. More...
 
 ERROR_TYPE = _libhfst.ERROR_TYPE
 Type not recognised. More...
 
 FOMA_TYPE = _libhfst.FOMA_TYPE
 A foma transducer, unweighted. More...
 
 HFST2_TYPE = _libhfst.HFST2_TYPE
 HFST2 header present, conversion required. More...
 
 HFST_OL_TYPE = _libhfst.HFST_OL_TYPE
 An HFST optimized lookup transducer, unweighted. More...
 
 HFST_OLW_TYPE = _libhfst.HFST_OLW_TYPE
 An HFST optimized lookup transducer with weights. More...
 
string IDENTITY = '@_IDENTITY_SYMBOL_@'
 The string for identity symbol. More...
 
 LOG_OPENFST_TYPE = _libhfst.LOG_OPENFST_TYPE
 An OpenFst transducer with logarithmic weights (limited support). More...
 
 SFST_TYPE = _libhfst.SFST_TYPE
 An SFST transducer, unweighted. More...
 
 TO_FINAL_STATE = _libhfst.TO_FINAL_STATE
 Push weights toward final state(s). More...
 
 TO_INITIAL_STATE = _libhfst.TO_INITIAL_STATE
 Push weights toward initial state. More...
 
 TROPICAL_OPENFST_TYPE = _libhfst.TROPICAL_OPENFST_TYPE
 An OpenFst transducer with tropical weights. More...
 
string UNKNOWN = '@_UNKNOWN_SYMBOL_@'
 The string for unknown symbol. More...
 
 UNSPECIFIED_TYPE = _libhfst.UNSPECIFIED_TYPE
 Format left open by e.g. More...