PocketSphinx  0.6
fsg_set.h File Reference

Public functions for FSG decoding. More...

#include <sphinxbase/fsg_model.h>
#include <sphinxbase/hash_table.h>
#include <sphinxbase/jsgf.h>
#include <pocketsphinx_export.h>

Go to the source code of this file.

Typedefs

typedef struct fsg_search_s fsg_set_t
 Set of finite-state grammars used in decoding.
 
typedef hash_iter_t fsg_set_iter_t
 Iterator over finite-state grammars.
 

Functions

POCKETSPHINX_EXPORT fsg_set_iter_tfsg_set_iter (fsg_set_t *fsgs)
 Get an iterator over all finite-state grammars in a set.
 
POCKETSPHINX_EXPORT fsg_set_iter_tfsg_set_iter_next (fsg_set_iter_t *itor)
 Advance an iterator to the next grammar in the set.
 
POCKETSPHINX_EXPORT fsg_model_t * fsg_set_iter_fsg (fsg_set_iter_t *itor)
 Get the current rule in an FSG iterator.
 
POCKETSPHINX_EXPORT void fsg_set_iter_free (fsg_set_iter_t *itor)
 Free an FSG iterator (if the end hasn't been reached).
 
POCKETSPHINX_EXPORT fsg_model_t * fsg_set_get_fsg (fsg_set_t *fsgs, char const *name)
 Lookup the FSG associated with the given name. More...
 
POCKETSPHINX_EXPORT fsg_model_t * fsg_set_add (fsg_set_t *fsgs, char const *name, fsg_model_t *wfsg)
 Add the given FSG to the collection of FSGs known to this search object. More...
 
POCKETSPHINX_EXPORT fsg_model_t * fsg_set_remove (fsg_set_t *fsgs, fsg_model_t *wfsg)
 Delete the given FSG from the known collection.
 
POCKETSPHINX_EXPORT fsg_model_t * fsg_set_remove_byname (fsg_set_t *fsgs, char const *name)
 Like fsg_set_del_fsg(), but identifies the FSG by its name.
 
POCKETSPHINX_EXPORT fsg_model_t * fsg_set_select (fsg_set_t *fsgs, const char *name)
 Switch to a new FSG (identified by its string name). More...
 

Detailed Description

Public functions for FSG decoding.

Definition in file fsg_set.h.

Function Documentation

◆ fsg_set_add()

POCKETSPHINX_EXPORT fsg_model_t* fsg_set_add ( fsg_set_t fsgs,
char const *  name,
fsg_model_t *  wfsg 
)

Add the given FSG to the collection of FSGs known to this search object.

The given fsg is simply added to the collection. It is not automatically made the currently active one.

Parameters
nameName to associate with this FSG. If NULL, this will be taken from the FSG structure.
Returns
A pointer to the FSG associated with name, or NULL on failure. If this pointer is not equal to wfsg, then there was a name conflict, and wfsg was not added.

Definition at line 381 of file fsg_search.c.

◆ fsg_set_get_fsg()

POCKETSPHINX_EXPORT fsg_model_t* fsg_set_get_fsg ( fsg_set_t fsgs,
char const *  name 
)

Lookup the FSG associated with the given name.

Returns
The FSG associated with name, or NULL if no match found.

Definition at line 371 of file fsg_search.c.

References fsg_search_s::fsgs.

Referenced by fsg_set_select().

◆ fsg_set_select()

POCKETSPHINX_EXPORT fsg_model_t* fsg_set_select ( fsg_set_t fsgs,
const char *  name 
)

Switch to a new FSG (identified by its string name).

Returns
Pointer to new FSG, or NULL on failure.

Definition at line 455 of file fsg_search.c.

References fsg_search_s::fsg, and fsg_set_get_fsg().