PocketSphinx
5.0.0
A small speech recognizer
|
JSGF parser. More...
#include <pocketsphinx/model.h>
Public Member Functions | |
POCKETSPHINX_EXPORT jsgf_t * | jsgf_parse_file (const char *filename, jsgf_t *parent) |
POCKETSPHINX_EXPORT jsgf_t * | jsgf_parse_string (const char *string, jsgf_t *parent) |
POCKETSPHINX_EXPORT const char * | jsgf_grammar_name (jsgf_t *jsgf) |
POCKETSPHINX_EXPORT void | jsgf_grammar_free (jsgf_t *jsgf) |
POCKETSPHINX_EXPORT jsgf_rule_t * | jsgf_get_rule (jsgf_t *grammar, const char *name) |
POCKETSPHINX_EXPORT jsgf_rule_t * | jsgf_get_public_rule (jsgf_t *grammar) |
POCKETSPHINX_EXPORT jsgf_rule_iter_t * | jsgf_rule_iter (jsgf_t *grammar) |
POCKETSPHINX_EXPORT fsg_model_t * | jsgf_build_fsg (jsgf_t *grammar, jsgf_rule_t *rule, logmath_t *lmath, float32 lw) |
POCKETSPHINX_EXPORT int | jsgf_write_fsg (jsgf_t *grammar, jsgf_rule_t *rule, FILE *outfh) |
JSGF parser.
Parse a JSGF grammar from a file.
filename | the name of the file to parse. |
parent | optional parent grammar for this one (NULL, usually). |
Parse a JSGF grammar from a string.
string | 0-terminated string with grammar. |
parent | optional parent grammar for this one (NULL, usually). |
POCKETSPHINX_EXPORT const char * jsgf_grammar_name | ( | jsgf_t * | jsgf | ) |
Get the grammar name from the file.
POCKETSPHINX_EXPORT void jsgf_grammar_free | ( | jsgf_t * | jsgf | ) |
Free a JSGF grammar.
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_rule | ( | jsgf_t * | grammar, |
const char * | name | ||
) |
Get a rule by name from a grammar. Name should not contain brackets.
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_public_rule | ( | jsgf_t * | grammar | ) |
Returns the first public rule of the grammar
POCKETSPHINX_EXPORT jsgf_rule_iter_t * jsgf_rule_iter | ( | jsgf_t * | grammar | ) |
Get an iterator over all rules in a grammar.
POCKETSPHINX_EXPORT fsg_model_t * jsgf_build_fsg | ( | jsgf_t * | grammar, |
jsgf_rule_t * | rule, | ||
logmath_t * | lmath, | ||
float32 | lw | ||
) |
Build a Sphinx FSG object from a JSGF rule.
POCKETSPHINX_EXPORT int jsgf_write_fsg | ( | jsgf_t * | grammar, |
jsgf_rule_t * | rule, | ||
FILE * | outfh | ||
) |
Convert a JSGF rule to Sphinx FSG text form.
This does a direct conversion without doing transitive closure on null transitions and so forth.