PocketSphinx 5prealpha
ps_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 */
68#ifndef __PS_SEARCH_H__
69#define __PS_SEARCH_H__
70
71#include <sphinxbase/fsg_model.h>
72#include <sphinxbase/ngram_model.h>
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77#if 0
78}
79#endif
80
85
86
95POCKETSPHINX_EXPORT
96int ps_set_search(ps_decoder_t *ps, const char *name);
97
103POCKETSPHINX_EXPORT
104const char* ps_get_search(ps_decoder_t *ps);
105
116POCKETSPHINX_EXPORT
117int ps_unset_search(ps_decoder_t *ps, const char *name);
118
124POCKETSPHINX_EXPORT
126
134POCKETSPHINX_EXPORT
136
142POCKETSPHINX_EXPORT
143const char* ps_search_iter_val(ps_search_iter_t *itor);
144
150POCKETSPHINX_EXPORT
152
160POCKETSPHINX_EXPORT
161const char* ps_search_iter_val(ps_search_iter_t *itor);
162
163
175POCKETSPHINX_EXPORT
176ngram_model_t *ps_get_lm(ps_decoder_t *ps, const char *name);
177
186POCKETSPHINX_EXPORT
187int ps_set_lm(ps_decoder_t *ps, const char *name, ngram_model_t *lm);
188
196POCKETSPHINX_EXPORT
197int ps_set_lm_file(ps_decoder_t *ps, const char *name, const char *path);
198
208POCKETSPHINX_EXPORT
209fsg_model_t *ps_get_fsg(ps_decoder_t *ps, const char *name);
210
219POCKETSPHINX_EXPORT
220int ps_set_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg);
221
229POCKETSPHINX_EXPORT
230int ps_set_jsgf_file(ps_decoder_t *ps, const char *name, const char *path);
231
239POCKETSPHINX_EXPORT
240int ps_set_jsgf_string(ps_decoder_t *ps, const char *name, const char *jsgf_string);
241
250POCKETSPHINX_EXPORT
251const char* ps_get_kws(ps_decoder_t *ps, const char *name);
252
261POCKETSPHINX_EXPORT
262int ps_set_kws(ps_decoder_t *ps, const char *name, const char *keyfile);
263
272POCKETSPHINX_EXPORT
273int ps_set_keyphrase(ps_decoder_t *ps, const char *name, const char *keyphrase);
274
283POCKETSPHINX_EXPORT
284int ps_set_allphone(ps_decoder_t *ps, const char *name, ngram_model_t *lm);
285
293POCKETSPHINX_EXPORT
294int ps_set_allphone_file(ps_decoder_t *ps, const char *name, const char *path);
295
296#ifdef __cplusplus
297}
298#endif
299
300#endif /* __PS_SEARCH_H__ */
POCKETSPHINX_EXPORT int ps_set_kws(ps_decoder_t *ps, const char *name, const char *keyfile)
Adds keyphrases from a file to spotting.
POCKETSPHINX_EXPORT int ps_unset_search(ps_decoder_t *ps, const char *name)
Unsets the search and releases related resources.
POCKETSPHINX_EXPORT int ps_set_jsgf_string(ps_decoder_t *ps, const char *name, const char *jsgf_string)
Adds new search using JSGF model.
POCKETSPHINX_EXPORT ps_search_iter_t * ps_search_iter(ps_decoder_t *ps)
Returns iterator over current searches.
POCKETSPHINX_EXPORT int ps_set_search(ps_decoder_t *ps, const char *name)
Actives search with the provided name.
POCKETSPHINX_EXPORT void ps_search_iter_free(ps_search_iter_t *itor)
Delete an unfinished search iterator.
POCKETSPHINX_EXPORT int ps_set_allphone_file(ps_decoder_t *ps, const char *name, const char *path)
Adds new search based on phone N-gram language model.
POCKETSPHINX_EXPORT const char * ps_get_search(ps_decoder_t *ps)
Returns name of curent search in decoder.
POCKETSPHINX_EXPORT const char * ps_get_kws(ps_decoder_t *ps, const char *name)
Get the current Key phrase to spot.
POCKETSPHINX_EXPORT fsg_model_t * ps_get_fsg(ps_decoder_t *ps, const char *name)
Get the finite-state grammar set object for this decoder.
POCKETSPHINX_EXPORT int ps_set_lm_file(ps_decoder_t *ps, const char *name, const char *path)
Adds new search based on N-gram language model.
POCKETSPHINX_EXPORT int ps_set_keyphrase(ps_decoder_t *ps, const char *name, const char *keyphrase)
Adds new keyphrase to spot.
POCKETSPHINX_EXPORT const char * ps_search_iter_val(ps_search_iter_t *itor)
Retrieves the name of the search the iterator points to.
POCKETSPHINX_EXPORT int ps_set_allphone(ps_decoder_t *ps, const char *name, ngram_model_t *lm)
Adds new search based on phone N-gram language model.
POCKETSPHINX_EXPORT int ps_set_lm(ps_decoder_t *ps, const char *name, ngram_model_t *lm)
Adds new search based on N-gram language model.
POCKETSPHINX_EXPORT ngram_model_t * ps_get_lm(ps_decoder_t *ps, const char *name)
Get the language model set object for this decoder.
POCKETSPHINX_EXPORT ps_search_iter_t * ps_search_iter_next(ps_search_iter_t *itor)
Updates search iterator to point to the next position.
POCKETSPHINX_EXPORT int ps_set_jsgf_file(ps_decoder_t *ps, const char *name, const char *path)
Adds new search using JSGF model.
POCKETSPHINX_EXPORT int ps_set_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg)
Adds new search based on finite state grammar.
Decoder object.