Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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")