PocketSphinx
5.0.0
A small speech recognizer
|
Go to the documentation of this file.
40 #ifndef __PS_MODEL_H__
41 #define __PS_MODEL_H__
47 #include <pocketsphinx/export.h>
63 typedef struct jsgf_s
jsgf_t;
359 #define NGRAM_INVALID_WID -1
383 const char *file_name,
384 ngram_file_type_t file_type,
395 ngram_file_type_t format);
478 float32 lw, float32 wip);
535 int32 w3, int32 w2, int32 w1,
555 int32 n_hist, int32 *n_used);
595 int32 n_hist, int32 *n_used);
758 const char *word, float32 weight);
776 const char *file_name);
789 const char *classname,
792 const float32 *weights,
807 const char *classname,
840 const float32 *weights,
876 const char *lmctlfile,
927 char const **lmname);
970 const float32 *weights);
POCKETSPHINX_EXPORT int32 ngram_score(ngram_model_t *model, const char *word,...)
POCKETSPHINX_EXPORT int ngram_model_casefold(ngram_model_t *model, int kase)
POCKETSPHINX_EXPORT void jsgf_rule_iter_free(jsgf_rule_iter_t *itor)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_interp(ngram_model_t *set, const char **names, const float32 *weights)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_select(ngram_model_t *set, const char *name)
POCKETSPHINX_EXPORT int32 ngram_model_add_class(ngram_model_t *model, const char *classname, float32 classweight, char **words, const float32 *weights, int32 n_words)
POCKETSPHINX_EXPORT int ngram_model_write(ngram_model_t *model, const char *file_name, ngram_file_type_t format)
POCKETSPHINX_EXPORT void fsg_model_write_fsm(fsg_model_t *fsg, FILE *fp)
@ NGRAM_BIN
Definition: model.h:356
POCKETSPHINX_EXPORT int32 ngram_probv(ngram_model_t *model, const char *word,...)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_init(ps_config_t *config, ngram_model_t **models, char **names, const float32 *weights, int32 n_models)
POCKETSPHINX_EXPORT float32 ngram_model_get_weights(ngram_model_t *model, int32 *out_log_wip)
Basic type definitions used in Sphinx.
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_remove(ngram_model_t *set, const char *name, int reuse_widmap)
POCKETSPHINX_EXPORT fsg_model_t * fsg_model_read(FILE *fp, logmath_t *lmath, float32 lw)
POCKETSPHINX_EXPORT void fsg_model_writefile_symtab(fsg_model_t *fsg, char const *file)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_iter_model(ngram_model_set_iter_t *itor, char const **lmname)
POCKETSPHINX_EXPORT void jsgf_grammar_free(jsgf_t *jsgf)
POCKETSPHINX_EXPORT ngram_iter_t * ngram_iter_next(ngram_iter_t *itor)
Rule in a parsed JSGF grammar.
@ NGRAM_INVALID
Definition: model.h:353
POCKETSPHINX_EXPORT fsg_model_t * fsg_model_retain(fsg_model_t *fsg)
M-gram (yes, M-gram) iterator object.
POCKETSPHINX_EXPORT int32 ngram_model_add_class_word(ngram_model_t *model, const char *classname, const char *word, float32 weight)
Iterator over rules in a grammar.
POCKETSPHINX_EXPORT int fsg_model_free(fsg_model_t *fsg)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_lookup(ngram_model_t *set, const char *name)
POCKETSPHINX_EXPORT int32 ngram_tg_score(ngram_model_t *model, int32 w3, int32 w2, int32 w1, int32 *n_used)
POCKETSPHINX_EXPORT const int32 * ngram_iter_get(ngram_iter_t *itor, int32 *out_score, int32 *out_bowt)
POCKETSPHINX_EXPORT void ngram_iter_free(ngram_iter_t *itor)
POCKETSPHINX_EXPORT void ngram_model_flush(ngram_model_t *lm)
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_public_rule(jsgf_t *grammar)
POCKETSPHINX_EXPORT const char * jsgf_rule_name(jsgf_rule_t *rule)
POCKETSPHINX_EXPORT int32 ngram_model_read_classdef(ngram_model_t *model, const char *file_name)
POCKETSPHINX_EXPORT ngram_file_type_t ngram_file_name_to_type(const char *file_name)
POCKETSPHINX_EXPORT void fsg_model_write_symtab(fsg_model_t *fsg, FILE *file)
Fast integer logarithmic addition operations.
POCKETSPHINX_EXPORT fsg_model_t * jsgf_read_string(const char *string, logmath_t *lmath, float32 lw)
POCKETSPHINX_EXPORT fsg_model_t * jsgf_read_file(const char *file, logmath_t *lmath, float32 lw)
POCKETSPHINX_EXPORT int32 ngram_bg_score(ngram_model_t *model, int32 w2, int32 w1, int32 *n_used)
const POCKETSPHINX_EXPORT char * ngram_model_set_current(ngram_model_t *set)
POCKETSPHINX_EXPORT int32 ngram_ng_score(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)
POCKETSPHINX_EXPORT fsg_model_t * fsg_model_readfile(const char *file, logmath_t *lmath, float32 lw)
POCKETSPHINX_EXPORT fsg_model_t * jsgf_build_fsg(jsgf_t *grammar, jsgf_rule_t *rule, logmath_t *lmath, float32 lw)
POCKETSPHINX_EXPORT int32 ngram_model_get_size(ngram_model_t *model)
@ NGRAM_AUTO
Definition: model.h:354
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_rule(jsgf_t *grammar, const char *name)
ngram_file_type_e
File types for N-Gram files.
Definition: model.h:352
POCKETSPHINX_EXPORT ngram_iter_t * ngram_model_mgrams(ngram_model_t *model, int m)
POCKETSPHINX_EXPORT const char * ngram_type_to_str(int type)
POCKETSPHINX_EXPORT const char * jsgf_grammar_name(jsgf_t *jsgf)
POCKETSPHINX_EXPORT ngram_iter_t * ngram_iter_successors(ngram_iter_t *itor)
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_rule_iter_rule(jsgf_rule_iter_t *itor)
Iterator over language models in a set.
POCKETSPHINX_EXPORT ngram_iter_t * ngram_ng_iter(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_retain(ngram_model_t *model)
@ NGRAM_ARPA
Definition: model.h:355
@ NGRAM_LOWER
Definition: model.h:449
POCKETSPHINX_EXPORT void ngram_model_set_iter_free(ngram_model_set_iter_t *itor)
POCKETSPHINX_EXPORT void fsg_model_writefile_fsm(fsg_model_t *fsg, char const *file)
POCKETSPHINX_EXPORT int32 ngram_prob(ngram_model_t *model, const char *const *words, int32 n)
POCKETSPHINX_EXPORT void fsg_model_write(fsg_model_t *fsg, FILE *fp)
POCKETSPHINX_EXPORT jsgf_t * jsgf_parse_file(const char *filename, jsgf_t *parent)
POCKETSPHINX_EXPORT ngram_iter_t * ngram_iter(ngram_model_t *model, const char *word,...)
Integer log math computation class.
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_read(ps_config_t *config, const char *file_name, ngram_file_type_t file_type, logmath_t *lmath)
POCKETSPHINX_EXPORT int32 ngram_unknown_wid(ngram_model_t *model)
ngram_case_e
Constants for case folding.
Definition: model.h:447
POCKETSPHINX_EXPORT jsgf_t * jsgf_parse_string(const char *string, jsgf_t *parent)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_add(ngram_model_t *set, ngram_model_t *model, const char *name, float32 weight, int reuse_widmap)
POCKETSPHINX_EXPORT ngram_model_set_iter_t * ngram_model_set_iter_next(ngram_model_set_iter_t *itor)
POCKETSPHINX_EXPORT int32 ngram_model_set_known_wid(ngram_model_t *set, int32 set_wid)
POCKETSPHINX_EXPORT void ngram_model_set_map_words(ngram_model_t *set, const char **words, int32 n_words)
POCKETSPHINX_EXPORT jsgf_rule_iter_t * jsgf_rule_iter_next(jsgf_rule_iter_t *itor)
const POCKETSPHINX_EXPORT char * ngram_word(ngram_model_t *model, int32 wid)
N-Gram based language model.
POCKETSPHINX_EXPORT int jsgf_write_fsg(jsgf_t *grammar, jsgf_rule_t *rule, FILE *outfh)
POCKETSPHINX_EXPORT ngram_model_set_iter_t * ngram_model_set_iter(ngram_model_t *set)
POCKETSPHINX_EXPORT int jsgf_rule_public(jsgf_rule_t *rule)
POCKETSPHINX_EXPORT int ngram_model_free(ngram_model_t *model)
POCKETSPHINX_EXPORT int32 ngram_model_set_current_wid(ngram_model_t *set, int32 set_wid)
POCKETSPHINX_EXPORT int fsg_model_accept(fsg_model_t *fsg, char const *words)
POCKETSPHINX_EXPORT int32 ngram_model_add_word(ngram_model_t *model, const char *word, float32 weight)
POCKETSPHINX_EXPORT int ngram_model_apply_weights(ngram_model_t *model, float32 lw, float32 wip)
POCKETSPHINX_EXPORT int32 ngram_wid(ngram_model_t *model, const char *word)
POCKETSPHINX_EXPORT ngram_file_type_t ngram_str_to_type(const char *str_name)
POCKETSPHINX_EXPORT void fsg_model_writefile(fsg_model_t *fsg, char const *file)
POCKETSPHINX_EXPORT int32 ngram_model_set_count(ngram_model_t *set)
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_read(ps_config_t *config, const char *lmctlfile, logmath_t *lmath)
POCKETSPHINX_EXPORT int32 ngram_ng_prob(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)
POCKETSPHINX_EXPORT int32 ngram_score_to_prob(ngram_model_t *model, int32 score)
POCKETSPHINX_EXPORT int32 ngram_zero(ngram_model_t *model)
@ NGRAM_UPPER
Definition: model.h:448
POCKETSPHINX_EXPORT const uint32 * ngram_model_get_counts(ngram_model_t *model)
Word class in an N-Gram model.
POCKETSPHINX_EXPORT jsgf_rule_iter_t * jsgf_rule_iter(jsgf_t *grammar)