Example #1
0
def test_level_parser_save_load():
    level = Parser(state_sizes=[2, 3])
    parser = LevelParser(levels=3, parsers=[level, Parser()])
    saved = parser.save()
    loaded = Parser.load(saved)
    assert parser == loaded
Example #2
0
 def test_save_load(self):
     parser = Parser(state_sizes=[1, 2, 3],
                     reset_on_sentence_end=False)
     saved = parser.save()
     loaded = Parser.load(saved)
     self.assertEqual(parser, loaded)
Example #3
0
def test_parser_save_load(test):
    parser = Parser(*test)
    saved = parser.save()
    loaded = Parser.load(saved)
    assert parser == loaded
Example #4
0
 def test_save_load(self):
     level = Parser(state_sizes=[2, 3])
     parser = LevelParser(levels=3, parsers=[level, Parser()])
     saved = parser.save()
     loaded = Parser.load(saved)
     self.assertEqual(parser, loaded)