Better error reporting in parsing syntactic structures

Tento commit je obsažen v:
Ozbolt Menegatti 2019-07-01 17:22:30 +02:00
rodič 48795c6227
revize 577983427e

Zobrazit soubor

@ -86,7 +86,10 @@ class SyntacticStructure:
for c in self.components:
if c.idx == idx:
return c
raise RuntimeError("Unknown component id: {}".format(idx))
cs = [c.idx for c in self.components]
msg = "Structure id={} has components: {}, but no component: {}".format(self.id, cs, (idx,))
raise RuntimeError(msg)
def match(self, word):
matches = self.components[0].match(word)