vancegroup / lua-voce

Lua binding to Voce
Boost Software License 1.0
2 stars 0 forks source link

Improve "init" #2

Open rpavlik opened 12 years ago

rpavlik commented 12 years ago

There should be a wrapper function for init so that I can do the following

voce.init{synthesis = true, recognition = true, grammar = "/home/rpavlik/mygrammar.gram"}

(A c++ function can take in a luabind::object to accept a table)

Leaving out any of those arguments would result in defaults: synthesis and recognition default to false grammar, if not specified, disables recognition. (pass empty strings) If recognition was explicitly asked for, throw a lua error. If grammar is specified, split it up: path to file goes as the grammar path, just the filename alone has .gram extension removed (throw error if doesn't end in .gram) and then used as grammar name. JAR files should be found in a sibling directory voce of the plugin - use SearchPath to look through lua's package.cpath for it.

rpavlik commented 12 years ago

OK, so there's a slight change here in how this is interpreted.

Jar path: This is a colon (on non-Windows)/semicolon(elsewhere) delimited list of directories to search for the jars. Still probably should auto-detect.

Grammar: Grammar path: This is actually a search path just like the jar path. Name: This is actually the name of a grammar within any .gram files found in the grammar path. Turns out the java documentation is much, much better. http://voce.sourceforge.net/api/java/classvoce_1_1_speech_interface.html#e0