Author Topic: Loading a game specific recognition Grammer with new inline VB code feature ?  (Read 533 times)

Nico Flows

  • Newbie
  • *
  • Posts: 1
Problem:
Elite Dangerous has literally billions of star systems, with really weird names.
There is a smallish subset of star systems called the Human bubble(or even a subset of those https://eddb.io/api) that I want to be able to say the name and have VA recognize it properly.

while looking for a way to bulk upload "new words" to the windows speech recognition dictionary I ran across this:

https://msdn.microsoft.com/en-us/library/ee125183(v=vs.85).aspx


This seemed pretty close with a couple of possible issues:

1: Seems to indicate that this would limit the recognition grammar to ONLY these words because its a "command an control grammar" and I don't want that. I just want to system names to be ADDED TO the existing stuff.
2: Will VA' s VB sandbox load XML an file from disk?
 



I can do code to grab and convert the JSON from EDDB.io to the below XML format that the VB code needs. However I am not a VB guy so I am probably missing something.  Any tips,suggestion example code would be greatly appreciated   

<GRAMMAR LANGID="409">
    <DEFINE>
   <ID NAME="RID_NewGame" VAL="101"/>
    </DEFINE>
   
   <RULE NAME="newgame" ID="RID_NewGame" TOPLEVEL="ACTIVE">
      <P>new +game</P>
   </RULE>
</GRAMMAR>

In cases when a second grammar file is needed, copy the following XML code into a new file named sol2.xml.

<GRAMMAR LANGID="409">
    <DEFINE>
   <ID NAME="RID_FileGame" VAL="200"/>
    </DEFINE>
   
   <RULE NAME="filegame" ID="RID_FileGame" TOPLEVEL="ACTIVE">
      <P>file +game</P>
   </RULE>
</GRAMMAR>