diff --git a/src/syntactic_structure.py b/src/syntactic_structure.py index b90d7a9..b7b9dd5 100644 --- a/src/syntactic_structure.py +++ b/src/syntactic_structure.py @@ -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)