I've been using the Microsoft Speech API (SAPI, 5.3) to add speech recognition support to my application (Windows, obviously, C++, Win8 SDK) and aside from a few hoop-jumps relating to loading grammar files it's working quite well.
However, I'm having trouble figuring out how to enumerate rules from a grammar that was loaded from file (or if that's even possible). Obviously, when you build the grammar manually/dynamically, you are creating the rules yourself. However, there doesn't appear to be a way to enumerate the rules from a grammar that was loaded from file. IspRecoGrammar::GetRule() seems to be the closest thing I could find to being able to query for a rule, but it is intended for retrieving a single, known rule (it requires either a rule name or id).
For the time being I'm simply parsing the XML myself and plucking out the rule names, but that's not really a complete solution; I need to support both XML and binary grammar config files, the latter of which sidesteps my current work-around.
Anyone with SAPI experience know how I might accomplish this?