PocketSphinx  5.0.0
A small speech recognizer
Public Member Functions | List of all members
jsgf_t Struct Reference

JSGF parser. More...

#include <pocketsphinx/model.h>

Public Member Functions

POCKETSPHINX_EXPORT jsgf_tjsgf_parse_file (const char *filename, jsgf_t *parent)
 
POCKETSPHINX_EXPORT jsgf_tjsgf_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_tjsgf_get_rule (jsgf_t *grammar, const char *name)
 
POCKETSPHINX_EXPORT jsgf_rule_tjsgf_get_public_rule (jsgf_t *grammar)
 
POCKETSPHINX_EXPORT jsgf_rule_iter_tjsgf_rule_iter (jsgf_t *grammar)
 
POCKETSPHINX_EXPORT fsg_model_tjsgf_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)
 

Detailed Description

JSGF parser.

Member Function Documentation

◆ jsgf_parse_file()

POCKETSPHINX_EXPORT jsgf_t * jsgf_parse_file ( const char *  filename,
jsgf_t parent 
)

Parse a JSGF grammar from a file.

Parameters
filenamethe name of the file to parse.
parentoptional parent grammar for this one (NULL, usually).
Returns
new JSGF grammar object, or NULL on failure.

◆ jsgf_parse_string()

POCKETSPHINX_EXPORT jsgf_t * jsgf_parse_string ( const char *  string,
jsgf_t parent 
)

Parse a JSGF grammar from a string.

Parameters
string0-terminated string with grammar.
parentoptional parent grammar for this one (NULL, usually).
Returns
new JSGF grammar object, or NULL on failure.

◆ jsgf_grammar_name()

POCKETSPHINX_EXPORT const char * jsgf_grammar_name ( jsgf_t jsgf)

Get the grammar name from the file.

◆ jsgf_grammar_free()

POCKETSPHINX_EXPORT void jsgf_grammar_free ( jsgf_t jsgf)

Free a JSGF grammar.

◆ jsgf_get_rule()

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.

◆ jsgf_get_public_rule()

POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_public_rule ( jsgf_t grammar)

Returns the first public rule of the grammar

◆ jsgf_rule_iter()

POCKETSPHINX_EXPORT jsgf_rule_iter_t * jsgf_rule_iter ( jsgf_t grammar)

Get an iterator over all rules in a grammar.

◆ jsgf_build_fsg()

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.

◆ jsgf_write_fsg()

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.


The documentation for this struct was generated from the following file: