PocketSphinx  5.0.0
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  */
77 #ifndef __PS_SEARCH_H__
78 #define __PS_SEARCH_H__
79 
80 #include <pocketsphinx/model.h>
81 #include <pocketsphinx/alignment.h>
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 #if 0
87 }
88 #endif
89 
94 typedef struct ps_search_iter_s ps_search_iter_t;
95 
96 /* Forward-declare this because header files are an atrocity. */
97 typedef struct ps_decoder_s ps_decoder_t;
98 
109 POCKETSPHINX_EXPORT
110 int ps_activate_search(ps_decoder_t *ps, const char *name);
111 
118 POCKETSPHINX_EXPORT
119 const char* ps_current_search(ps_decoder_t *ps);
120 
132 POCKETSPHINX_EXPORT
133 int ps_remove_search(ps_decoder_t *ps, const char *name);
134 
141 POCKETSPHINX_EXPORT
143 
152 POCKETSPHINX_EXPORT
154 
161 POCKETSPHINX_EXPORT
162 const char* ps_search_iter_val(ps_search_iter_t *itor);
163 
170 POCKETSPHINX_EXPORT
172 
181 POCKETSPHINX_EXPORT
182 const char* ps_search_iter_val(ps_search_iter_t *itor);
183 
194 POCKETSPHINX_EXPORT
195 ngram_model_t *ps_get_lm(ps_decoder_t *ps, const char *name);
196 
206 POCKETSPHINX_EXPORT
207 int ps_add_lm(ps_decoder_t *ps, const char *name, ngram_model_t *lm);
208 
217 POCKETSPHINX_EXPORT
218 int ps_add_lm_file(ps_decoder_t *ps, const char *name, const char *path);
219 
228 POCKETSPHINX_EXPORT
229 fsg_model_t *ps_get_fsg(ps_decoder_t *ps, const char *name);
230 
240 POCKETSPHINX_EXPORT
241 int ps_add_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg);
242 
251 POCKETSPHINX_EXPORT
252 int ps_add_jsgf_file(ps_decoder_t *ps, const char *name, const char *path);
253 
262 POCKETSPHINX_EXPORT
263 int ps_add_jsgf_string(ps_decoder_t *ps, const char *name, const char *jsgf_string);
264 
273 POCKETSPHINX_EXPORT
274 const char* ps_get_kws(ps_decoder_t *ps, const char *name);
275 
285 POCKETSPHINX_EXPORT
286 int ps_add_kws(ps_decoder_t *ps, const char *name, const char *keyfile);
287 
297 POCKETSPHINX_EXPORT
298 int ps_add_keyphrase(ps_decoder_t *ps, const char *name, const char *keyphrase);
299 
309 POCKETSPHINX_EXPORT
310 int ps_add_allphone(ps_decoder_t *ps, const char *name, ngram_model_t *lm);
311 
320 POCKETSPHINX_EXPORT
321 int ps_add_allphone_file(ps_decoder_t *ps, const char *name, const char *path);
322 
343 POCKETSPHINX_EXPORT
344 int ps_set_align_text(ps_decoder_t *ps, const char *words);
345 
372 POCKETSPHINX_EXPORT
374 
388 POCKETSPHINX_EXPORT
390 
391 #ifdef __cplusplus
392 }
393 #endif
394 
395 #endif /* __PS_SEARCH_H__ */
ps_decoder_t::ps_get_lm
POCKETSPHINX_EXPORT ngram_model_t * ps_get_lm(ps_decoder_t *ps, const char *name)
ps_decoder_t::ps_current_search
const POCKETSPHINX_EXPORT char * ps_current_search(ps_decoder_t *ps)
ps_decoder_t::ps_add_keyphrase
POCKETSPHINX_EXPORT int ps_add_keyphrase(ps_decoder_t *ps, const char *name, const char *keyphrase)
model.h
Public API for language models.
alignment.h
Multi-level alignment structure.
ps_search_iter_t
Iterator over search modules.
ps_decoder_t::ps_remove_search
POCKETSPHINX_EXPORT int ps_remove_search(ps_decoder_t *ps, const char *name)
ps_decoder_t::ps_add_allphone
POCKETSPHINX_EXPORT int ps_add_allphone(ps_decoder_t *ps, const char *name, ngram_model_t *lm)
ps_decoder_t::ps_set_alignment
POCKETSPHINX_EXPORT int ps_set_alignment(ps_decoder_t *ps, ps_alignment_t *al)
ps_decoder_t::ps_activate_search
POCKETSPHINX_EXPORT int ps_activate_search(ps_decoder_t *ps, const char *name)
ps_search_iter_t::ps_search_iter_val
const POCKETSPHINX_EXPORT char * ps_search_iter_val(ps_search_iter_t *itor)
ps_decoder_t::ps_get_alignment
POCKETSPHINX_EXPORT ps_alignment_t * ps_get_alignment(ps_decoder_t *ps)
ps_search_iter_t::ps_search_iter_free
POCKETSPHINX_EXPORT void ps_search_iter_free(ps_search_iter_t *itor)
ps_decoder_t::ps_add_allphone_file
POCKETSPHINX_EXPORT int ps_add_allphone_file(ps_decoder_t *ps, const char *name, const char *path)
ps_decoder_t::ps_add_jsgf_string
POCKETSPHINX_EXPORT int ps_add_jsgf_string(ps_decoder_t *ps, const char *name, const char *jsgf_string)
ps_decoder_t::ps_search_iter
POCKETSPHINX_EXPORT ps_search_iter_t * ps_search_iter(ps_decoder_t *ps)
ngram_model_t
N-Gram based language model.
ps_decoder_t::ps_add_lm
POCKETSPHINX_EXPORT int ps_add_lm(ps_decoder_t *ps, const char *name, ngram_model_t *lm)
ps_decoder_t::ps_add_lm_file
POCKETSPHINX_EXPORT int ps_add_lm_file(ps_decoder_t *ps, const char *name, const char *path)
ps_search_iter_t::ps_search_iter_next
POCKETSPHINX_EXPORT ps_search_iter_t * ps_search_iter_next(ps_search_iter_t *itor)
fsg_model_t
Finite-state grammar.
ps_decoder_t
Speech recognizer object.
ps_decoder_t::ps_add_jsgf_file
POCKETSPHINX_EXPORT int ps_add_jsgf_file(ps_decoder_t *ps, const char *name, const char *path)
ps_decoder_t::ps_add_fsg
POCKETSPHINX_EXPORT int ps_add_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg)
ps_decoder_t::ps_set_align_text
POCKETSPHINX_EXPORT int ps_set_align_text(ps_decoder_t *ps, const char *words)
ps_alignment_t
Multi-level alignment (words, phones, states) over an utterance.
ps_decoder_t::ps_get_kws
const POCKETSPHINX_EXPORT char * ps_get_kws(ps_decoder_t *ps, const char *name)
ps_decoder_t::ps_get_fsg
POCKETSPHINX_EXPORT fsg_model_t * ps_get_fsg(ps_decoder_t *ps, const char *name)
ps_decoder_t::ps_add_kws
POCKETSPHINX_EXPORT int ps_add_kws(ps_decoder_t *ps, const char *name, const char *keyfile)