PocketSphinx  5.0.0rc5
A small speech recognizer
search.h
Go to the documentation of this file.
1 /* -*- c-basic-offset:4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 2014 Alpha Cephei Inc.. 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  *
19  * THIS SOFTWARE IS PROVIDED BY ALPHA CEPHEI INC. ``AS IS'' AND
20  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
23  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  * ====================================================================
32  *
33  */
74 #ifndef __PS_SEARCH_H__
75 #define __PS_SEARCH_H__
76 
77 #include <pocketsphinx/model.h>
78 #include <pocketsphinx/alignment.h>
79 
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83 #if 0
84 }
85 #endif
86 
90 typedef struct ps_search_iter_s ps_search_iter_t;
91 
92 /* Forward-declare this because header files are an atrocity. */
93 typedef struct ps_decoder_s ps_decoder_t;
94 
104 POCKETSPHINX_EXPORT
105 int ps_activate_search(ps_decoder_t *ps, const char *name);
106 
112 POCKETSPHINX_EXPORT
113 const char* ps_current_search(ps_decoder_t *ps);
114 
125 POCKETSPHINX_EXPORT
126 int ps_remove_search(ps_decoder_t *ps, const char *name);
127 
133 POCKETSPHINX_EXPORT
135 
143 POCKETSPHINX_EXPORT
145 
151 POCKETSPHINX_EXPORT
152 const char* ps_search_iter_val(ps_search_iter_t *itor);
153 
159 POCKETSPHINX_EXPORT
161 
169 POCKETSPHINX_EXPORT
170 const char* ps_search_iter_val(ps_search_iter_t *itor);
171 
181 POCKETSPHINX_EXPORT
182 ngram_model_t *ps_get_lm(ps_decoder_t *ps, const char *name);
183 
192 POCKETSPHINX_EXPORT
193 int ps_add_lm(ps_decoder_t *ps, const char *name, ngram_model_t *lm);
194 
202 POCKETSPHINX_EXPORT
203 int ps_add_lm_file(ps_decoder_t *ps, const char *name, const char *path);
204 
212 POCKETSPHINX_EXPORT
213 fsg_model_t *ps_get_fsg(ps_decoder_t *ps, const char *name);
214 
223 POCKETSPHINX_EXPORT
224 int ps_add_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg);
225 
233 POCKETSPHINX_EXPORT
234 int ps_add_jsgf_file(ps_decoder_t *ps, const char *name, const char *path);
235 
243 POCKETSPHINX_EXPORT
244 int ps_add_jsgf_string(ps_decoder_t *ps, const char *name, const char *jsgf_string);
245 
253 POCKETSPHINX_EXPORT
254 const char* ps_get_kws(ps_decoder_t *ps, const char *name);
255 
264 POCKETSPHINX_EXPORT
265 int ps_add_kws(ps_decoder_t *ps, const char *name, const char *keyfile);
266 
275 POCKETSPHINX_EXPORT
276 int ps_add_keyphrase(ps_decoder_t *ps, const char *name, const char *keyphrase);
277 
286 POCKETSPHINX_EXPORT
287 int ps_add_allphone(ps_decoder_t *ps, const char *name, ngram_model_t *lm);
288 
296 POCKETSPHINX_EXPORT
297 int ps_add_allphone_file(ps_decoder_t *ps, const char *name, const char *path);
298 
318 POCKETSPHINX_EXPORT
319 int ps_set_align_text(ps_decoder_t *ps, const char *words);
320 
346 POCKETSPHINX_EXPORT
348 
361 POCKETSPHINX_EXPORT
363 
364 #ifdef __cplusplus
365 }
366 #endif
367 
368 #endif /* __PS_SEARCH_H__ */
ps_search_iter_t
struct ps_search_iter_s ps_search_iter_t
Definition: search.h:90
ps_search_iter
POCKETSPHINX_EXPORT ps_search_iter_t * ps_search_iter(ps_decoder_t *ps)
ps_add_allphone
POCKETSPHINX_EXPORT int ps_add_allphone(ps_decoder_t *ps, const char *name, ngram_model_t *lm)
model.h
Public API for language models.
ps_current_search
const POCKETSPHINX_EXPORT char * ps_current_search(ps_decoder_t *ps)
ps_add_jsgf_string
POCKETSPHINX_EXPORT int ps_add_jsgf_string(ps_decoder_t *ps, const char *name, const char *jsgf_string)
ps_get_fsg
POCKETSPHINX_EXPORT fsg_model_t * ps_get_fsg(ps_decoder_t *ps, const char *name)
ps_set_alignment
POCKETSPHINX_EXPORT int ps_set_alignment(ps_decoder_t *ps, ps_alignment_t *al)
ps_add_lm_file
POCKETSPHINX_EXPORT int ps_add_lm_file(ps_decoder_t *ps, const char *name, const char *path)
ps_activate_search
POCKETSPHINX_EXPORT int ps_activate_search(ps_decoder_t *ps, const char *name)
ps_add_keyphrase
POCKETSPHINX_EXPORT int ps_add_keyphrase(ps_decoder_t *ps, const char *name, const char *keyphrase)
ps_get_kws
const POCKETSPHINX_EXPORT char * ps_get_kws(ps_decoder_t *ps, const char *name)
ps_get_lm
POCKETSPHINX_EXPORT ngram_model_t * ps_get_lm(ps_decoder_t *ps, const char *name)
ps_add_fsg
POCKETSPHINX_EXPORT int ps_add_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg)
ps_search_iter_free
POCKETSPHINX_EXPORT void ps_search_iter_free(ps_search_iter_t *itor)
ps_search_iter_val
const POCKETSPHINX_EXPORT char * ps_search_iter_val(ps_search_iter_t *itor)
ps_remove_search
POCKETSPHINX_EXPORT int ps_remove_search(ps_decoder_t *ps, const char *name)
ps_get_alignment
POCKETSPHINX_EXPORT ps_alignment_t * ps_get_alignment(ps_decoder_t *ps)
ps_search_iter_next
POCKETSPHINX_EXPORT ps_search_iter_t * ps_search_iter_next(ps_search_iter_t *itor)
ps_add_jsgf_file
POCKETSPHINX_EXPORT int ps_add_jsgf_file(ps_decoder_t *ps, const char *name, const char *path)
ps_add_allphone_file
POCKETSPHINX_EXPORT int ps_add_allphone_file(ps_decoder_t *ps, const char *name, const char *path)
ngram_model_t
N-Gram based language model.
fsg_model_t
Finite-state grammar.
ps_add_lm
POCKETSPHINX_EXPORT int ps_add_lm(ps_decoder_t *ps, const char *name, ngram_model_t *lm)
ps_set_align_text
POCKETSPHINX_EXPORT int ps_set_align_text(ps_decoder_t *ps, const char *words)
ps_decoder_t
ps_alignment_t
Multi-level alignment (words, phones, states) over an utterance.
ps_add_kws
POCKETSPHINX_EXPORT int ps_add_kws(ps_decoder_t *ps, const char *name, const char *keyfile)