|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
def testParser(self):
print 'do test'
t = tagset.Tagset(os.path.join(os.path.dirname(__file__), 'polimorf.tagset'))
parser = rulesParser.RulesParser(t)
rulesManager = parser.parse(os.path.join(os.path.dirname(__file__), 'segmenty.dat'))
fsa = rulesManager.getDFA({'aggl': 'permissive', 'praet': 'split'})
for s in fsa.dfs():
s.debug()
print 'states:', len(list(fsa.dfs()))
print 'transitions:', fsa.getTransitionsNum()
visualizer.Visualizer().visualize(fsa, charLabels=False)
print 'size:', len(serializer.SimpleSerializer(fsa).fsa2bytearray(bytearray()))
print 'done'
|