Difference: PyniniPathsDoc (1 vs. 5)

Revision 52018-10-16 - KyleGorman

Line: 1 to 1
 

Path iteration

This describes classes for iterating over paths in an FST.

Line: 56 to 56
  This class provides the normal iterator methods (next(), done(), reset(), and error()), the accessor methods (ilabels(), istring(), olabels(),
Changed:
<
<
ostring, weight()), and speciality iterators (istrings(), ostrings(), and
>
>
ostring(), weight()), and speciality iterators (istrings(), ostrings(), and
 weights(); items() returns triples of input string, output string, and weight).

Revision 42018-10-08 - KyleGorman

Line: 1 to 1
 

Path iteration

This describes classes for iterating over paths in an FST.

Line: 6 to 6
 

fst::PathIterator

This template class provides a basic iterator over paths. It is constructed from

Changed:
<
<
a const Fst & and an optional argument that specifies whether or not the
>
>
a const Fst & and an optional argument that specifies whether or not the
 FST should be checked for acyclicity during construction.

The ILabels() and OLabels() methods return vectors of input and output

Line: 55 to 55
 the SYMBOL token type, simply provide a pynini.SymbolTable argument.

This class provides the normal iterator methods (next(), done(), reset(),

Changed:
<
<
and error()).
>
>
and error()), the accessor methods (ilabels(), istring(), olabels(), ostring, weight()), and speciality iterators (istrings(), ostrings(), and weights(); items() returns triples of input string, output string, and weight).

Revision 32018-06-29 - KyleGorman

Line: 1 to 1
 

Path iteration

This describes classes for iterating over paths in an FST.

Line: 24 to 24
 iteration (e.g., by knowing the FST is acyclic, or limiting the number of iterated paths).
Changed:
<
<

fst::StringPaths

>
>

fst::StringPathIterator

  This template class is a thin wrapper around fst::PathIterator which adds IString() and OString() methods returning input and output strings. These
Line: 32 to 32
 printing mode is controlled by the enum fst::StringTokenType (see here for more information).

At construction time, users specify printing modes and/or symbol tables for the

Changed:
<
<
input and output sides of the FST, whether or not epsilon labels should be ignored when printing the string, and whether or not the FST should be checked
>
>
input and output sides of the FST, and whether or not the FST should be checked
 for acyclity.

This iterator:

Line: 47 to 46
 iteration (e.g., by knowing the FST is acyclic, or limiting the number of iterated paths).
Changed:
<
<

pynini.StringPaths

>
>

pynini.StringPathIterator

 
Changed:
<
<
Pynini wraps fst::script::StringPathsClass with the Python class StringPaths. As in C++, this object can be constructed directly from an FST argument, or it can be constructed using the paths() method of an (acyclic)
>
>
Pynini wraps fst::script::StringPathIteratorClass with the Python class StringPathIterator. As in C++, this object can be constructed directly from an FST argument, or it can be constructed using the paths() method of an (acyclic)
 pynini.Fst instance.

Both construction methods take token types for both input- and output sides; for

Revision 22017-07-27 - KyleGorman

Line: 1 to 1
 

Path iteration

This describes classes for iterating over paths in an FST.

Line: 58 to 58
 the SYMBOL token type, simply provide a pynini.SymbolTable argument.

This class provides the normal iterator methods (next(), done(), reset(),

Changed:
<
<
and error()), but it also can be used as a Python-style iterator (i.e., in a =for=-loop).
>
>
and error()).

Revision 12017-06-29 - KyleGorman

Line: 1 to 1
Added:
>
>

Path iteration

This describes classes for iterating over paths in an FST.

fst::PathIterator

This template class provides a basic iterator over paths. It is constructed from a const Fst & and an optional argument that specifies whether or not the FST should be checked for acyclicity during construction.

The ILabels() and OLabels() methods return vectors of input and output labels (respectively) of the current path, and the Weight() method returns the weight of the current path.

This iterator:

  • is advanced using the Next() method,
  • is exhausted once the Done() returns true,
  • is reset using the Reset() method, and
  • signals an error using the Error() method.

The acyclity check should only be disabled when the caller can ensure finite iteration (e.g., by knowing the FST is acyclic, or limiting the number of iterated paths).

fst::StringPaths

This template class is a thin wrapper around fst::PathIterator which adds IString() and OString() methods returning input and output strings. These methods use the same string printing methods as fst::PrintString and the printing mode is controlled by the enum fst::StringTokenType (see here for more information).

At construction time, users specify printing modes and/or symbol tables for the input and output sides of the FST, whether or not epsilon labels should be ignored when printing the string, and whether or not the FST should be checked for acyclity.

This iterator:

  • is advanced using the Next() method,
  • is exhausted once the Done() returns true,
  • is reset using the Reset() method, and
  • signals an error using the Error() method.

The acyclity check should only be disabled when the caller can ensure finite iteration (e.g., by knowing the FST is acyclic, or limiting the number of iterated paths).

pynini.StringPaths

Pynini wraps fst::script::StringPathsClass with the Python class StringPaths. As in C++, this object can be constructed directly from an FST argument, or it can be constructed using the paths() method of an (acyclic) pynini.Fst instance.

Both construction methods take token types for both input- and output sides; for the SYMBOL token type, simply provide a pynini.SymbolTable argument.

This class provides the normal iterator methods (next(), done(), reset(), and error()), but it also can be used as a Python-style iterator (i.e., in a =for=-loop).

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback