Esempio n. 1
0
 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)))
Esempio n. 2
0
 def assertIsFsa(self, fsa: pynini.Fst) -> None:
     if fsa.properties(pynini.ACCEPTOR, True) != pynini.ACCEPTOR:
         raise AssertionError(f"Expected {fsa} to be an acceptor")