HFST - Helsinki Finite-State Transducer Technology - C++ API  version 3.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
hfst Namespace Reference

A namespace for HFST functions and datatypes. More...

Namespaces

 implementations
 A namespace for all code that forms a bridge between backend libraries and HFST.
 
 rules
 A namespace for functions that create two-level, replace, restriction and coercion rule transducers.
 
 xeroxRules
 A namespace for HFST xeroxRules functions and data types.
 

Classes

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

Typedefs

typedef std::pair< float,
StringVector
HfstOneLevelPath
 A path of one level of arcs with collected weight. More...
 
typedef std::set
< HfstOneLevelPath
HfstOneLevelPaths
 A set of simple paths. More...
 
typedef std::map< StringPair,
StringPair
HfstSymbolPairSubstitutions
 A map of substitutions used when performing multiple symbol pair-to-symbol pair substitutions. More...
 
typedef std::map< String, StringHfstSymbolSubstitutions
 A map of substitutions used when performing multiple symbol-to-symbol substitutions. More...
 
typedef std::pair
< HfstTransducer,
HfstTransducer
HfstTransducerPair
 A pair of transducers. More...
 
typedef std::vector
< HfstTransducerPair
HfstTransducerPairVector
 A vector of transducer pairs. More...
 
typedef std::vector
< HfstTransducer
HfstTransducerVector
 a vector of transducers for methods applying a cascade of automata More...
 
typedef std::pair< float,
StringPairVector
HfstTwoLevelPath
 A path of two level of arcs with collected weight. More...
 
typedef std::set
< HfstTwoLevelPath
HfstTwoLevelPaths
 A set of two-level weighted paths. More...
 
typedef std::string String
 A UTF-8 symbol in a transition. More...
 
typedef std::pair< String, StringStringPair
 A symbol pair in a transition. More...
 
typedef std::set< StringPairStringPairSet
 A set of symbol pairs used in substituting symbol pairs and in rule functions. More...
 
typedef std::vector< std::pair
< std::string, std::string > > 
StringPairVector
 A vector of string pairs. More...
 
typedef std::vector< std::string > StringVector
 A vector of strings. More...
 

Enumerations

enum  ImplementationType {
  SFST_TYPE,
  TROPICAL_OPENFST_TYPE,
  LOG_OPENFST_TYPE,
  FOMA_TYPE,
  XFSM_TYPE,
  HFST_OL_TYPE,
  HFST_OLW_TYPE,
  HFST2_TYPE,
  UNSPECIFIED_TYPE,
  ERROR_TYPE
}
 The type of an HfstTransducer. More...
 
enum  PushType {
  TO_INITIAL_STATE,
  TO_FINAL_STATE
}
 The type of a push operation. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const HfstTransducer &t)
 Write transducer t in AT&T format to ostream out. More...
 

Detailed Description

A namespace for HFST functions and datatypes.

Typedef Documentation

typedef std::pair< float, StringVector > HfstOneLevelPath

A path of one level of arcs with collected weight.

Used as the source and result data type for lookups and downs. In the first case, the float is ignored. In the latter case, the float represents the weight of the path.

See also
HfstTokenizer::lookup_tokenize
HfstTransducer::lookup

A set of simple paths.

Used as return type of lookup with multiple, unique results.

A map of substitutions used when performing multiple symbol pair-to-symbol pair substitutions.

See also
HfstTransducer::substitute(const HfstSymbolPairSubstitutions&)

A map of substitutions used when performing multiple symbol-to-symbol substitutions.

See also
HfstTransducer::substitute(const HfstSymbolSubstitutions&)

A pair of transducers.

Used by functions in namespace rules

A vector of transducer pairs.

Used by functions in namespace rules

typedef std::vector< HfstTransducer > HfstTransducerVector

a vector of transducers for methods applying a cascade of automata

A vector of transducers.

Used by compose_intersect.

typedef std::pair< float, StringPairVector > HfstTwoLevelPath

A path of two level of arcs with collected weight.

typedef std::set< HfstTwoLevelPath > HfstTwoLevelPaths

A set of two-level weighted paths.

typedef std::string String

A UTF-8 symbol in a transition.

Strings "@_EPSILON_SYMBOL_@", "@_UNKNOWN_SYMBOL_@" and "@_IDENTITY_SYMBOL_@" are reserved.

  • "@_EPSILON_SYMBOL_@" denotes the epsilon (in AT&T formalism [0]).
  • "@_UNKNOWN_SYMBOL_@" denotes an unknown symbol, i.e. any symbol that does not occur or has not occurred in the transducer (in AT&T formalism [?], [?:x], [x:?]).
  • "@_IDENTITY_SYMBOL_@" denotes any unknown symbol that is the same on the input and output side of a transition (in AT&T formalism [?:?]).

    For an example of special symbols, see HFST transducer documentation.

Strings of form @[PNDRCU][.][A-Z]+([.][A-Z]+)?@ are reserved for flag diacritics. For an example of flag diacritics, see hfst::HfstTransducer::extract_paths_fd(hfst::HfstTwoLevelPaths&, int, int, bool) const. For more information on flag diacritics, see Finite State Morphology (Beesley & Karttunen, 2003).

typedef std::pair<String, String> StringPair

A symbol pair in a transition.

See also
HfstTransducer::substitute(const StringPair&, const StringPair&) and other substitute functions
typedef std::set<StringPair> StringPairSet

A set of symbol pairs used in substituting symbol pairs and in rule functions.

See also
HfstTransducer::substitute(const StringPair&, const StringPairSet &) hfst::rules
typedef std::vector< StringPair > StringPairVector

A vector of string pairs.

A vector of transitions that represents a path in a transducer.

Used by typedef HfstTwoLevelPath.

See also
HfstTokenizer
typedef std::vector< std::string > StringVector

A vector of strings.

Used by typedef HfstOneLevelPath.

Enumeration Type Documentation

The type of an HfstTransducer.

Enumerator
SFST_TYPE 

An SFST transducer, unweighted.

TROPICAL_OPENFST_TYPE 

An OpenFst transducer with tropical weights.

LOG_OPENFST_TYPE 

An OpenFst transducer with logarithmic weights.

FOMA_TYPE 

A foma transducer, unweighted.

XFSM_TYPE 

An xfsm transducer, unweighted (mostly for testing purposes).

HFST_OL_TYPE 

An HFST optimized lookup transducer, unweighted

HFST_OLW_TYPE 

An HFST optimized lookup transducer with weights

HFST2_TYPE 

HFST2 header present, conversion required

UNSPECIFIED_TYPE 

Format left open by e.g. default constructor

ERROR_TYPE 

Type not recognised. This type might be returned by a function if an error occurs.

enum PushType

The type of a push operation.

See also
HfstTransducer::push_weights
Enumerator
TO_INITIAL_STATE 

Push weights towards initial state.

TO_FINAL_STATE 

Push weights towards final state(s).

Function Documentation

HFSTDLL std::ostream & operator<< ( std::ostream &  out,
const HfstTransducer &  t 
)

Write transducer t in AT&T format to ostream out.

The same as hfst::HfstTransducer::write_in_att_format(FILE*, bool) const with ostreams. Weights are written if the type of t is weighted.