Thank you for your help. I read the article (again), and his code looks generally like mine. The most interesting thing for me was he said it was almost impossible to train words from code.
Quote:
This question is asked frequently in comments: how to train your speech recognition engine? From code, it is impossible, unfortunately.
I was hoping to train specific phrases for my grammar, but he reinforced the idea that users can train the entire Windows Speech Recognition system using the default Windows-supplied training mechanism. I will try that instead; maybe it will work well enough for my purposes.