bd plays a sound but bd:2 does not play anything. You can investigate the issue by printing part of the tree as an expression is being evaluated by the mini-notation:
def visit_word_with_index(self, _node, children):
word, index = children
print(word, index)
index = 0 if isinstance(index, Node) else index[0]
return dict(type="word", value=word, index=index)
And then you'll see:
>>> s('bd')
bd <Node matching "">
~[((0, 1), (0, 1), {'s': 'bd'})] ...~
>>> s('bd:2')
bd [2]
bd <Node matching "">
~[((0, 1), (0, 1), {'s': {'n': 2, 's': 'bd'}})] ...~
Any ideas? I'm learning parsimonious to try to fix the issue.