def assertFstCompliesWithProperties( self, fst: pynini.Fst, expected_props: pynini.FstProperties) -> None: if fst.properties(expected_props, True) != expected_props: raise AssertionError( "Expected {actual} to contain the property {expected}".format( expected=expected_props, actual=fst.properties(pynini.FST_PROPERTIES, True)))
def assertIsFsa(self, fsa: pynini.Fst) -> None: if fsa.properties(pynini.ACCEPTOR, True) != pynini.ACCEPTOR: raise AssertionError(f"Expected {fsa} to be an acceptor")