Пример #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)))
Пример #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")