Difference: PyniniDocs (19 vs. 20)

Revision 202019-07-15 - KyleGorman

Line: 1 to 1
 
META TOPICPARENT name="Pynini"

Pynini: Grammar compilation in Python

Line: 1787 to 1787
  Returns the current state index.
Changed:
<
<

StringPaths

>
>

StringPathIterator

 
Changed:
<
<
The string paths object is used to iterate through paths of an acyclic FST, in the forms of input and output label sequences, input and output strings, and path weights.
>
>
The string path iterator object is used to iterate through paths of an acyclic FST, in the forms of input and output label sequences, input and output strings, and path weights.
  See also: Paths algorithm.

Constructor
Changed:
<
<
StringPaths(fst, token_type="byte", isymbols=None, osymbols=None)
>
>
StringPathIterator(fst, token_type="byte", isymbols=None, osymbols=None)
  Iterator for string paths in acyclic FST.
Line: 1831 to 1831
  error(self)
Changed:
<
<
Indicates whether the StringPaths has encountered an error.
>
>
Indicates whether the StringPathIterator has encountered an error.
  Returns:
Changed:
<
<
True if the StringPaths is in an errorful state, False otherwise.
>
>
True if the StringPathIterator is in an errorful state, False otherwise.

ilabels(self)

Returns the input labels for the current path.

Returns: A list of input labels for the current path.

  istring(self)
Line: 1846 to 1853
 Returns: The path's input string.
Deleted:
<
<
next(self)

Advances the iterator.

 istrings(self)

Generates all input strings in the FST.

Line: 1860 to 1863
 Yields: All input strings.
Added:
>
>
next(self)

Advances the iterator.

olabels(self)

Returns the output labels for the current path.

Returns: A list of output labels for the current path.

ostring(self)

Returns the current path's output string.

Returns: The path's output string.

 ostrings(self)

Generates all output strings in the FST.

Line: 1870 to 1891
 Yields: All output strings.
Added:
>
>
weight(self)

Returns the current path's total weight.

Returns: The path's Weight.

 weights(self)

Generates all path weights in the FST.

Line: 1878 to 1906
 responsible for resetting the iterator if desired.

Yields:

Changed:
<
<
All weights.

ostring(self)

Returns the current path's output string.

Returns: The path's output string.

weight(self)

Returns the current path's total weight.

Returns: The path's Weight.

>
>
All weights.
 

SymbolTable

Line: 3021 to 3035
  aiter.next() return f
Changed:
<
<
The method paths returns a StringPaths iterator. This provides several ways to access the paths of an acyclic FST. For each
>
>
The method paths returns a StringPathIterator. This provides several ways to access the paths of an acyclic FST. For each
 path, one can access the input and output strings via the istring and ostring methods, and the path weight via the weight method. One can also access all input strings, all output strings, and all path weights using the istrings, ostrings, and weights methods, which return generators; after invoking any one of these methods, the caller must reset the iterator to reuse it.

See in-module documentation strings for more information on iterators.

 
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