How to use the pynini.NO_STATE_ID function in pynini

To help you get started, we’ve selected a few pynini examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kylebgorman / EditTransducer / edit_transducer / edit_transducer.py View on Github external
def check_wellformed_lattice(lattice):
    """Raises an error if the lattice is empty.

    Args:
      lattice: A lattice FST.

    Raises:
      Error: Lattice is empty.
    """
    if lattice.start() == NO_STATE_ID:
      raise Error("Lattice is empty")

pynini

Finite-state grammar compilation

MIT
Latest version published 5 months ago

Package Health Score

82 / 100
Full package analysis