compile grammars using remote pc (with windows OS) - socrob/mbot_documentation GitHub Wiki

Generate .fcf grammar files remotely with a server connected to the net

All our systems have Ubuntu, therefore switching between Windows and Ubuntu might be time consuming. To avoid this, we borrowed code from HOMER team to setup a remote server installed on a laptop running Windows and which is connected at all time to the net.

Requests can be send then by using the script

    speech_recognition/vocon_speech_recognizer/scripts/make_grammar.sh

Step by step method for compiling grammars from ubuntu using a remote pc (running windows)

  1. connect both PCs to the same network by lan cable

  2. make a folder named grammar_compilation_linux in WINDOWS desktop

  3. copy "compile_grammars.py" and "neustart" to the above created folder in WINDOWS

  4. go to "C:Nuance" and edit the Vocon Hybrid folder name to "Vocon_Hybrid"

  5. go to "C:Vocon_Hybrid -> SDK(your version) -> tools". Right click on grmcpl.pyc and open properties. Copy the Location address.

  6. open the "compile_grammars.py" (which you had previously copied) in your favorite editor (IDE preferd)

  7. find the line which starts with command = '"C: and replace the command with the above copied address starting from '"C:

  8. connect the windows PC to network and find the ip4 from cmdline with ipconfig

  9. copy this to server = ThreadedHTTPServer line of compole_grammar.py and SERVER=http:// line of make_grammar.sh

  10. run the "neustart" and "compile_grammars.py" in Windows

  11. In linux change the permission of the bash file (make_grammar.sh) and run it with desired grammar file (.bnf) as an argument eg: ./make_grammar.sh file.bnf

  12. The output will be in the same folder as the source.