Tutorial?

The first application

Create Recognizer:

We will use the static boost::python library (libboost_python.a) and the dynamic version of the Python library (libpython.so). We will change the path in the Makefile to point to your boost installation directory.

Let’s get some code running. You’ll need to include the correct headers, as you might imagine.

highlight(): the language, C++, is not supported.

These header files are added in the beginning of the program as usual.

Then move to the member function onInit()and add the following lines.

Note that you must initialize the Python interpreter directly (line 1). After initializing, the __main__ module is imported and the namespace is extracted. This results in a blank canvas upon which we can then call Python code, adding modules and variables.

Note: The initialization of interpreter, import of __main__ module and namespace is independent of the member functions that are first used in. Thus you can do this in some other member function like onAction() which is a loop function in Sigverse. The only requirement is that they should be used before using any python functionality. Also, you dont have to use loop/loop functions to initialize the interpreter.

Thus, its recommended to initialize the interpreter inside onInit() member function.

Add event handler:

Create Grammar:

Set input source for Recognizer:

Start recognize:

Send result text to an Agent in SIGverse

Import sigverse.dll

Follow this tutorial import DLL

Send result text to SIGverse


Front page   New List of pages Search Recent changes   Help   RSS of recent changes