PocketSphinx  5.0.0
A small speech recognizer
model.h
Go to the documentation of this file.
1 /* -*- c-basic-offset:4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1999-2022 Carnegie Mellon University. All rights
4  * reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
19  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
22  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  * ====================================================================
30  */
40 #ifndef __PS_MODEL_H__
41 #define __PS_MODEL_H__
42 
43 #include <stdio.h>
44 
45 #include <pocketsphinx/prim_type.h>
46 #include <pocketsphinx/logmath.h>
47 #include <pocketsphinx/export.h>
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 #if 0
53 }
54 #endif
55 
56 /* Forward declaration to avoid include loops */
57 typedef struct cmd_ln_s ps_config_t;
58 
63 typedef struct jsgf_s jsgf_t;
64 
69 typedef struct jsgf_rule_s jsgf_rule_t;
70 
80 typedef struct fsg_model_s fsg_model_t;
81 
86 typedef struct ngram_model_s ngram_model_t;
87 
96 POCKETSPHINX_EXPORT
97 jsgf_t *jsgf_parse_file(const char *filename, jsgf_t *parent);
98 
107 POCKETSPHINX_EXPORT
108 jsgf_t *jsgf_parse_string(const char *string, jsgf_t *parent);
109 
114 POCKETSPHINX_EXPORT
115 char const *jsgf_grammar_name(jsgf_t *jsgf);
116 
121 POCKETSPHINX_EXPORT
122 void jsgf_grammar_free(jsgf_t *jsgf);
123 
128 POCKETSPHINX_EXPORT
129 jsgf_rule_t *jsgf_get_rule(jsgf_t *grammar, const char *name);
130 
135 POCKETSPHINX_EXPORT
137 
142 POCKETSPHINX_EXPORT
143 char const *jsgf_rule_name(jsgf_rule_t *rule);
144 
149 POCKETSPHINX_EXPORT
150 int jsgf_rule_public(jsgf_rule_t *rule);
151 
156 typedef struct hash_iter_s jsgf_rule_iter_t;
157 
162 POCKETSPHINX_EXPORT
164 
169 POCKETSPHINX_EXPORT
171 
176 POCKETSPHINX_EXPORT
178 
183 POCKETSPHINX_EXPORT
185 
190 POCKETSPHINX_EXPORT
192  logmath_t *lmath, float32 lw);
193 
200 POCKETSPHINX_EXPORT
201 fsg_model_t *jsgf_read_file(const char *file, logmath_t * lmath, float32 lw);
202 
209 POCKETSPHINX_EXPORT
210 fsg_model_t *jsgf_read_string(const char *string, logmath_t * lmath, float32 lw);
211 
219 POCKETSPHINX_EXPORT
220 int jsgf_write_fsg(jsgf_t *grammar, jsgf_rule_t *rule, FILE *outfh);
221 
228 POCKETSPHINX_EXPORT
230 
237 POCKETSPHINX_EXPORT
238 int fsg_model_free(fsg_model_t *fsg);
239 
280 POCKETSPHINX_EXPORT
281 fsg_model_t *fsg_model_readfile(const char *file, logmath_t *lmath, float32 lw);
282 
287 POCKETSPHINX_EXPORT
288 fsg_model_t *fsg_model_read(FILE *fp, logmath_t *lmath, float32 lw);
289 
297 POCKETSPHINX_EXPORT
298 int fsg_model_accept(fsg_model_t *fsg, char const *words);
299 
304 POCKETSPHINX_EXPORT
305 void fsg_model_write(fsg_model_t *fsg, FILE *fp);
306 
311 POCKETSPHINX_EXPORT
312 void fsg_model_writefile(fsg_model_t *fsg, char const *file);
313 
318 POCKETSPHINX_EXPORT
319 void fsg_model_write_fsm(fsg_model_t *fsg, FILE *fp);
320 
325 POCKETSPHINX_EXPORT
326 void fsg_model_writefile_fsm(fsg_model_t *fsg, char const *file);
327 
332 POCKETSPHINX_EXPORT
333 void fsg_model_write_symtab(fsg_model_t *fsg, FILE *file);
334 
339 POCKETSPHINX_EXPORT
340 void fsg_model_writefile_symtab(fsg_model_t *fsg, char const *file);
341 
346 typedef struct ngram_class_s ngram_class_t;
347 
352 typedef enum ngram_file_type_e {
357 } ngram_file_type_t;
358 
359 #define NGRAM_INVALID_WID -1
381 POCKETSPHINX_EXPORT
383  const char *file_name,
384  ngram_file_type_t file_type,
385  logmath_t *lmath);
386 
393 POCKETSPHINX_EXPORT
394 int ngram_model_write(ngram_model_t *model, const char *file_name,
395  ngram_file_type_t format);
396 
403 POCKETSPHINX_EXPORT
404 ngram_file_type_t ngram_file_name_to_type(const char *file_name);
405 
412 POCKETSPHINX_EXPORT
413 ngram_file_type_t ngram_str_to_type(const char *str_name);
414 
422 POCKETSPHINX_EXPORT
423 char const *ngram_type_to_str(int type);
424 
431 POCKETSPHINX_EXPORT
433 
440 POCKETSPHINX_EXPORT
441 int ngram_model_free(ngram_model_t *model);
442 
447 typedef enum ngram_case_e {
450 } ngram_case_t;
451 
460 POCKETSPHINX_EXPORT
461 int ngram_model_casefold(ngram_model_t *model, int kase);
462 
476 POCKETSPHINX_EXPORT
478  float32 lw, float32 wip);
479 
488 POCKETSPHINX_EXPORT
489 float32 ngram_model_get_weights(ngram_model_t *model, int32 *out_log_wip);
490 
525 POCKETSPHINX_EXPORT
526 int32 ngram_score(ngram_model_t *model, const char *word, ...);
527 
533 POCKETSPHINX_EXPORT
534 int32 ngram_tg_score(ngram_model_t *model,
535  int32 w3, int32 w2, int32 w1,
536  int32 *n_used);
537 
543 POCKETSPHINX_EXPORT
544 int32 ngram_bg_score(ngram_model_t *model,
545  int32 w2, int32 w1,
546  int32 *n_used);
547 
553 POCKETSPHINX_EXPORT
554 int32 ngram_ng_score(ngram_model_t *model, int32 wid, int32 *history,
555  int32 n_hist, int32 *n_used);
556 
568 POCKETSPHINX_EXPORT
569 int32 ngram_probv(ngram_model_t *model, const char *word, ...);
570 
582 POCKETSPHINX_EXPORT
583 int32 ngram_prob(ngram_model_t *model, const char* const *words, int32 n);
584 
593 POCKETSPHINX_EXPORT
594 int32 ngram_ng_prob(ngram_model_t *model, int32 wid, int32 *history,
595  int32 n_hist, int32 *n_used);
596 
609 POCKETSPHINX_EXPORT
610 int32 ngram_score_to_prob(ngram_model_t *model, int32 score);
611 
617 POCKETSPHINX_EXPORT
618 int32 ngram_wid(ngram_model_t *model, const char *word);
619 
625 POCKETSPHINX_EXPORT
626 const char *ngram_word(ngram_model_t *model, int32 wid);
627 
642 POCKETSPHINX_EXPORT
643 int32 ngram_unknown_wid(ngram_model_t *model);
644 
650 POCKETSPHINX_EXPORT
651 int32 ngram_zero(ngram_model_t *model);
652 
658 POCKETSPHINX_EXPORT
659 int32 ngram_model_get_size(ngram_model_t *model);
660 
666 POCKETSPHINX_EXPORT
667 uint32 const *ngram_model_get_counts(ngram_model_t *model);
668 
676 typedef struct ngram_iter_s ngram_iter_t;
677 
687 POCKETSPHINX_EXPORT
689 
695 POCKETSPHINX_EXPORT
696 ngram_iter_t *ngram_iter(ngram_model_t *model, const char *word, ...);
697 
703 POCKETSPHINX_EXPORT
704 ngram_iter_t *ngram_ng_iter(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist);
705 
715 POCKETSPHINX_EXPORT
716 int32 const *ngram_iter_get(ngram_iter_t *itor,
717  int32 *out_score,
718  int32 *out_bowt);
719 
726 POCKETSPHINX_EXPORT
728 
733 POCKETSPHINX_EXPORT
735 
740 POCKETSPHINX_EXPORT
741 void ngram_iter_free(ngram_iter_t *itor);
742 
756 POCKETSPHINX_EXPORT
758  const char *word, float32 weight);
759 
774 POCKETSPHINX_EXPORT
776  const char *file_name);
777 
787 POCKETSPHINX_EXPORT
789  const char *classname,
790  float32 classweight,
791  char **words,
792  const float32 *weights,
793  int32 n_words);
794 
805 POCKETSPHINX_EXPORT
807  const char *classname,
808  const char *word,
809  float32 weight);
810 
836 POCKETSPHINX_EXPORT
838  ngram_model_t **models,
839  char **names,
840  const float32 *weights,
841  int32 n_models);
842 
874 POCKETSPHINX_EXPORT
876  const char *lmctlfile,
877  logmath_t *lmath);
878 
883 POCKETSPHINX_EXPORT
885 
890 typedef struct ngram_model_set_iter_s ngram_model_set_iter_t;
891 
898 POCKETSPHINX_EXPORT
900 
907 POCKETSPHINX_EXPORT
909 
914 POCKETSPHINX_EXPORT
916 
925 POCKETSPHINX_EXPORT
927  char const **lmname);
928 
936 POCKETSPHINX_EXPORT
938  const char *name);
939 
947 POCKETSPHINX_EXPORT
949  const char *name);
950 
955 POCKETSPHINX_EXPORT
956 const char *ngram_model_set_current(ngram_model_t *set);
957 
967 POCKETSPHINX_EXPORT
969  const char **names,
970  const float32 *weights);
971 
985 POCKETSPHINX_EXPORT
987  ngram_model_t *model,
988  const char *name,
989  float32 weight,
990  int reuse_widmap);
991 
1001 POCKETSPHINX_EXPORT
1003  const char *name,
1004  int reuse_widmap);
1005 
1010 POCKETSPHINX_EXPORT
1012  const char **words,
1013  int32 n_words);
1014 
1023 POCKETSPHINX_EXPORT
1025  int32 set_wid);
1026 
1037 POCKETSPHINX_EXPORT
1038 int32 ngram_model_set_known_wid(ngram_model_t *set, int32 set_wid);
1039 
1044 POCKETSPHINX_EXPORT
1046 
1047 #endif /* __PS_MODEL_H__ */
ngram_model_t::ngram_score
POCKETSPHINX_EXPORT int32 ngram_score(ngram_model_t *model, const char *word,...)
ngram_model_t::ngram_model_casefold
POCKETSPHINX_EXPORT int ngram_model_casefold(ngram_model_t *model, int kase)
jsgf_rule_iter_t::jsgf_rule_iter_free
POCKETSPHINX_EXPORT void jsgf_rule_iter_free(jsgf_rule_iter_t *itor)
ngram_model_t::ngram_model_set_interp
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_interp(ngram_model_t *set, const char **names, const float32 *weights)
ngram_model_t::ngram_model_set_select
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_select(ngram_model_t *set, const char *name)
ngram_model_t::ngram_model_add_class
POCKETSPHINX_EXPORT int32 ngram_model_add_class(ngram_model_t *model, const char *classname, float32 classweight, char **words, const float32 *weights, int32 n_words)
ngram_model_t::ngram_model_write
POCKETSPHINX_EXPORT int ngram_model_write(ngram_model_t *model, const char *file_name, ngram_file_type_t format)
fsg_model_t::fsg_model_write_fsm
POCKETSPHINX_EXPORT void fsg_model_write_fsm(fsg_model_t *fsg, FILE *fp)
NGRAM_BIN
@ NGRAM_BIN
Definition: model.h:356
ngram_model_t::ngram_probv
POCKETSPHINX_EXPORT int32 ngram_probv(ngram_model_t *model, const char *word,...)
ngram_model_t::ngram_model_set_init
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)
ngram_model_t::ngram_model_get_weights
POCKETSPHINX_EXPORT float32 ngram_model_get_weights(ngram_model_t *model, int32 *out_log_wip)
prim_type.h
Basic type definitions used in Sphinx.
ngram_model_t::ngram_model_set_remove
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_remove(ngram_model_t *set, const char *name, int reuse_widmap)
fsg_model_t::fsg_model_read
POCKETSPHINX_EXPORT fsg_model_t * fsg_model_read(FILE *fp, logmath_t *lmath, float32 lw)
fsg_model_t::fsg_model_writefile_symtab
POCKETSPHINX_EXPORT void fsg_model_writefile_symtab(fsg_model_t *fsg, char const *file)
ngram_model_set_iter_t::ngram_model_set_iter_model
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_iter_model(ngram_model_set_iter_t *itor, char const **lmname)
jsgf_t::jsgf_grammar_free
POCKETSPHINX_EXPORT void jsgf_grammar_free(jsgf_t *jsgf)
ngram_iter_t::ngram_iter_next
POCKETSPHINX_EXPORT ngram_iter_t * ngram_iter_next(ngram_iter_t *itor)
jsgf_rule_t
Rule in a parsed JSGF grammar.
NGRAM_INVALID
@ NGRAM_INVALID
Definition: model.h:353
fsg_model_t::fsg_model_retain
POCKETSPHINX_EXPORT fsg_model_t * fsg_model_retain(fsg_model_t *fsg)
ngram_iter_t
M-gram (yes, M-gram) iterator object.
ngram_model_t::ngram_model_add_class_word
POCKETSPHINX_EXPORT int32 ngram_model_add_class_word(ngram_model_t *model, const char *classname, const char *word, float32 weight)
jsgf_rule_iter_t
Iterator over rules in a grammar.
fsg_model_t::fsg_model_free
POCKETSPHINX_EXPORT int fsg_model_free(fsg_model_t *fsg)
ngram_model_t::ngram_model_set_lookup
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_lookup(ngram_model_t *set, const char *name)
ngram_model_t::ngram_tg_score
POCKETSPHINX_EXPORT int32 ngram_tg_score(ngram_model_t *model, int32 w3, int32 w2, int32 w1, int32 *n_used)
ngram_iter_t::ngram_iter_get
POCKETSPHINX_EXPORT const int32 * ngram_iter_get(ngram_iter_t *itor, int32 *out_score, int32 *out_bowt)
ngram_iter_t::ngram_iter_free
POCKETSPHINX_EXPORT void ngram_iter_free(ngram_iter_t *itor)
ngram_model_t::ngram_model_flush
POCKETSPHINX_EXPORT void ngram_model_flush(ngram_model_t *lm)
jsgf_t::jsgf_get_public_rule
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_public_rule(jsgf_t *grammar)
jsgf_rule_t::jsgf_rule_name
POCKETSPHINX_EXPORT const char * jsgf_rule_name(jsgf_rule_t *rule)
ngram_model_t::ngram_model_read_classdef
POCKETSPHINX_EXPORT int32 ngram_model_read_classdef(ngram_model_t *model, const char *file_name)
ngram_model_t::ngram_file_name_to_type
POCKETSPHINX_EXPORT ngram_file_type_t ngram_file_name_to_type(const char *file_name)
fsg_model_t::fsg_model_write_symtab
POCKETSPHINX_EXPORT void fsg_model_write_symtab(fsg_model_t *fsg, FILE *file)
logmath.h
Fast integer logarithmic addition operations.
fsg_model_t::jsgf_read_string
POCKETSPHINX_EXPORT fsg_model_t * jsgf_read_string(const char *string, logmath_t *lmath, float32 lw)
fsg_model_t::jsgf_read_file
POCKETSPHINX_EXPORT fsg_model_t * jsgf_read_file(const char *file, logmath_t *lmath, float32 lw)
ngram_model_t::ngram_bg_score
POCKETSPHINX_EXPORT int32 ngram_bg_score(ngram_model_t *model, int32 w2, int32 w1, int32 *n_used)
ngram_model_t::ngram_model_set_current
const POCKETSPHINX_EXPORT char * ngram_model_set_current(ngram_model_t *set)
ngram_model_t::ngram_ng_score
POCKETSPHINX_EXPORT int32 ngram_ng_score(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)
fsg_model_t::fsg_model_readfile
POCKETSPHINX_EXPORT fsg_model_t * fsg_model_readfile(const char *file, logmath_t *lmath, float32 lw)
jsgf_t::jsgf_build_fsg
POCKETSPHINX_EXPORT fsg_model_t * jsgf_build_fsg(jsgf_t *grammar, jsgf_rule_t *rule, logmath_t *lmath, float32 lw)
ngram_model_t::ngram_model_get_size
POCKETSPHINX_EXPORT int32 ngram_model_get_size(ngram_model_t *model)
NGRAM_AUTO
@ NGRAM_AUTO
Definition: model.h:354
jsgf_t::jsgf_get_rule
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_get_rule(jsgf_t *grammar, const char *name)
ngram_file_type_e
ngram_file_type_e
File types for N-Gram files.
Definition: model.h:352
ps_config_t
configuration object.
ngram_model_t::ngram_model_mgrams
POCKETSPHINX_EXPORT ngram_iter_t * ngram_model_mgrams(ngram_model_t *model, int m)
ngram_model_t::ngram_type_to_str
POCKETSPHINX_EXPORT const char * ngram_type_to_str(int type)
jsgf_t::jsgf_grammar_name
POCKETSPHINX_EXPORT const char * jsgf_grammar_name(jsgf_t *jsgf)
ngram_iter_t::ngram_iter_successors
POCKETSPHINX_EXPORT ngram_iter_t * ngram_iter_successors(ngram_iter_t *itor)
jsgf_rule_iter_t::jsgf_rule_iter_rule
POCKETSPHINX_EXPORT jsgf_rule_t * jsgf_rule_iter_rule(jsgf_rule_iter_t *itor)
ngram_model_set_iter_t
Iterator over language models in a set.
ngram_model_t::ngram_ng_iter
POCKETSPHINX_EXPORT ngram_iter_t * ngram_ng_iter(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist)
ngram_model_t::ngram_model_retain
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_retain(ngram_model_t *model)
NGRAM_ARPA
@ NGRAM_ARPA
Definition: model.h:355
NGRAM_LOWER
@ NGRAM_LOWER
Definition: model.h:449
ngram_model_set_iter_t::ngram_model_set_iter_free
POCKETSPHINX_EXPORT void ngram_model_set_iter_free(ngram_model_set_iter_t *itor)
fsg_model_t::fsg_model_writefile_fsm
POCKETSPHINX_EXPORT void fsg_model_writefile_fsm(fsg_model_t *fsg, char const *file)
ngram_model_t::ngram_prob
POCKETSPHINX_EXPORT int32 ngram_prob(ngram_model_t *model, const char *const *words, int32 n)
fsg_model_t::fsg_model_write
POCKETSPHINX_EXPORT void fsg_model_write(fsg_model_t *fsg, FILE *fp)
jsgf_t::jsgf_parse_file
POCKETSPHINX_EXPORT jsgf_t * jsgf_parse_file(const char *filename, jsgf_t *parent)
ngram_model_t::ngram_iter
POCKETSPHINX_EXPORT ngram_iter_t * ngram_iter(ngram_model_t *model, const char *word,...)
logmath_t
Integer log math computation class.
ngram_model_t::ngram_model_read
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)
ngram_model_t::ngram_unknown_wid
POCKETSPHINX_EXPORT int32 ngram_unknown_wid(ngram_model_t *model)
ngram_case_e
ngram_case_e
Constants for case folding.
Definition: model.h:447
jsgf_t::jsgf_parse_string
POCKETSPHINX_EXPORT jsgf_t * jsgf_parse_string(const char *string, jsgf_t *parent)
ngram_model_t::ngram_model_set_add
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)
ngram_model_set_iter_t::ngram_model_set_iter_next
POCKETSPHINX_EXPORT ngram_model_set_iter_t * ngram_model_set_iter_next(ngram_model_set_iter_t *itor)
ngram_model_t::ngram_model_set_known_wid
POCKETSPHINX_EXPORT int32 ngram_model_set_known_wid(ngram_model_t *set, int32 set_wid)
ngram_model_t::ngram_model_set_map_words
POCKETSPHINX_EXPORT void ngram_model_set_map_words(ngram_model_t *set, const char **words, int32 n_words)
jsgf_rule_iter_t::jsgf_rule_iter_next
POCKETSPHINX_EXPORT jsgf_rule_iter_t * jsgf_rule_iter_next(jsgf_rule_iter_t *itor)
ngram_model_t::ngram_word
const POCKETSPHINX_EXPORT char * ngram_word(ngram_model_t *model, int32 wid)
ngram_model_t
N-Gram based language model.
jsgf_t
JSGF parser.
jsgf_t::jsgf_write_fsg
POCKETSPHINX_EXPORT int jsgf_write_fsg(jsgf_t *grammar, jsgf_rule_t *rule, FILE *outfh)
ngram_model_t::ngram_model_set_iter
POCKETSPHINX_EXPORT ngram_model_set_iter_t * ngram_model_set_iter(ngram_model_t *set)
jsgf_rule_t::jsgf_rule_public
POCKETSPHINX_EXPORT int jsgf_rule_public(jsgf_rule_t *rule)
ngram_model_t::ngram_model_free
POCKETSPHINX_EXPORT int ngram_model_free(ngram_model_t *model)
fsg_model_t
Finite-state grammar.
ngram_model_t::ngram_model_set_current_wid
POCKETSPHINX_EXPORT int32 ngram_model_set_current_wid(ngram_model_t *set, int32 set_wid)
fsg_model_t::fsg_model_accept
POCKETSPHINX_EXPORT int fsg_model_accept(fsg_model_t *fsg, char const *words)
ngram_model_t::ngram_model_add_word
POCKETSPHINX_EXPORT int32 ngram_model_add_word(ngram_model_t *model, const char *word, float32 weight)
ngram_model_t::ngram_model_apply_weights
POCKETSPHINX_EXPORT int ngram_model_apply_weights(ngram_model_t *model, float32 lw, float32 wip)
ngram_model_t::ngram_wid
POCKETSPHINX_EXPORT int32 ngram_wid(ngram_model_t *model, const char *word)
ngram_model_t::ngram_str_to_type
POCKETSPHINX_EXPORT ngram_file_type_t ngram_str_to_type(const char *str_name)
fsg_model_t::fsg_model_writefile
POCKETSPHINX_EXPORT void fsg_model_writefile(fsg_model_t *fsg, char const *file)
ngram_model_t::ngram_model_set_count
POCKETSPHINX_EXPORT int32 ngram_model_set_count(ngram_model_t *set)
ngram_model_t::ngram_model_set_read
POCKETSPHINX_EXPORT ngram_model_t * ngram_model_set_read(ps_config_t *config, const char *lmctlfile, logmath_t *lmath)
ngram_model_t::ngram_ng_prob
POCKETSPHINX_EXPORT int32 ngram_ng_prob(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)
ngram_model_t::ngram_score_to_prob
POCKETSPHINX_EXPORT int32 ngram_score_to_prob(ngram_model_t *model, int32 score)
ngram_model_t::ngram_zero
POCKETSPHINX_EXPORT int32 ngram_zero(ngram_model_t *model)
NGRAM_UPPER
@ NGRAM_UPPER
Definition: model.h:448
ngram_model_t::ngram_model_get_counts
POCKETSPHINX_EXPORT const uint32 * ngram_model_get_counts(ngram_model_t *model)
ngram_class_t
Word class in an N-Gram model.
jsgf_t::jsgf_rule_iter
POCKETSPHINX_EXPORT jsgf_rule_iter_t * jsgf_rule_iter(jsgf_t *grammar)