pocketsphinx_internal.h File Reference

Internal implementation of PocketSphinx decoder. More...

`#include <sphinxbase/cmd_ln.h>`
`#include <sphinxbase/fe.h>`
`#include <sphinxbase/feat.h>`
`#include <sphinxbase/hash_table.h>`
`#include <sphinxbase/logmath.h>`
`#include <sphinxbase/profile.h>`
`#include "pocketsphinx.h"`
`#include "acmod.h"`
`#include "dict.h"`
`#include "dict2pid.h"`

Go to the source code of this file.

## Data Structures

struct | ps_searchfuncs_s
| V-table for search algorithm. More...
struct | ps_search_s
| Base structure for search module. More...
struct | ps_segfuncs_s
struct | ps_seg_s
| Base structure for hypothesis segmentation iterator. More...
struct | ps_decoder_s
| Decoder object. More...
struct | ps_search_iter_s

## Macros

#define | PS_DEFAULT_SEARCH "_default"
#define | PS_DEFAULT_PL_SEARCH "_default_pl"
#define | PS_SEARCH_TYPE_KWS "kws"
#define | PS_SEARCH_TYPE_FSG "fsg"
#define | PS_SEARCH_TYPE_NGRAM "ngram"
#define | PS_SEARCH_TYPE_ALLPHONE "allphone"
#define | PS_SEARCH_TYPE_STATE_ALIGN "state_align"
#define | PS_SEARCH_TYPE_PHONE_LOOP "phone_loop"
#define | ps_search_base(s) ((ps_search_t *)s)
#define | ps_search_config(s) ps_search_base(s)->config
#define | ps_search_acmod(s) ps_search_base(s)->acmod
#define | ps_search_dict(s) ps_search_base(s)->dict
#define | ps_search_dict2pid(s) ps_search_base(s)->d2p
#define | ps_search_dag(s) ps_search_base(s)->dag
#define | ps_search_last_link(s) ps_search_base(s)->last_link
#define | ps_search_post(s) ps_search_base(s)->post
#define | ps_search_lookahead(s) ps_search_base(s)->pls
#define | ps_search_n_words(s) ps_search_base(s)->n_words
#define | ps_search_type(s) ps_search_base(s)->type
#define | ps_search_name(s) ps_search_base(s)->name
#define | ps_search_start(s) (*(ps_search_base(s)->vt->start))(s)
#define | ps_search_step(s, i) (*(ps_search_base(s)->vt->step))(s,i)
#define | ps_search_finish(s) (*(ps_search_base(s)->vt->finish))(s)
#define | ps_search_reinit(s, d, d2p) (*(ps_search_base(s)->vt->reinit))(s,d,d2p)
#define | ps_search_free(s) (*(ps_search_base(s)->vt->free))(s)
#define | ps_search_lattice(s) (*(ps_search_base(s)->vt->lattice))(s)
#define | ps_search_hyp(s, sc) (*(ps_search_base(s)->vt->hyp))(s,sc)
#define | ps_search_prob(s) (*(ps_search_base(s)->vt->prob))(s)
#define | ps_search_seg_iter(s) (*(ps_search_base(s)->vt->seg_iter))(s)
#define | ps_search_silence_wid(s) ps_search_base(s)->silence_wid
#define | ps_search_start_wid(s) ps_search_base(s)->start_wid
#define | ps_search_finish_wid(s) ps_search_base(s)->finish_wid
#define | ps_search_seg_next(seg) (*(seg->vt->seg_next))(seg)
#define | ps_search_seg_free(s) (*(seg->vt->seg_free))(seg)

## Typedefs

typedef struct ps_search_s | ps_search_t
| Search algorithm structure.
typedef struct ps_searchfuncs_s | ps_searchfuncs_t
| V-table for search algorithm.
typedef struct ps_segfuncs_s | ps_segfuncs_t

## Functions

void | ps_search_init (ps_search_t *search, ps_searchfuncs_t *vt, const char *type, const char *name, cmd_ln_t *config, acmod_t *acmod, dict_t *dict, dict2pid_t *d2p)
| Initialize base structure.
void | ps_search_base_free (ps_search_t *search)
| Free search.
void | ps_search_base_reinit (ps_search_t *search, dict_t *dict, dict2pid_t *d2p)
| Re-initialize base structure with new dictionary.

## Detailed Description

Internal implementation of PocketSphinx decoder.

Author
  David Huggins-Daines dhugg.nosp@m.ins@.nosp@m.cs.cm.nosp@m.u.ed.nosp@m.u

Definition in file pocketsphinx_internal.h.

## Macro Definition Documentation

## PS_DEFAULT_PL_SEARCH

#define PS_DEFAULT_PL_SEARCH "_default_pl"

Definition at line 69 of file pocketsphinx_internal.h.

## PS_DEFAULT_SEARCH

#define PS_DEFAULT_SEARCH "_default"

Definition at line 68 of file pocketsphinx_internal.h.

## ps_search_acmod

#define ps_search_acmod | ( |  | s | ) | ps_search_base(s)->acmod

Definition at line 124 of file pocketsphinx_internal.h.

## ps_search_base

#define ps_search_base | ( |  | s | ) | ((ps_search_t *)s)

Definition at line 122 of file pocketsphinx_internal.h.

## ps_search_config

#define ps_search_config | ( |  | s | ) | ps_search_base(s)->config

Definition at line 123 of file pocketsphinx_internal.h.

## ps_search_dag

#define ps_search_dag | ( |  | s | ) | ps_search_base(s)->dag

Definition at line 127 of file pocketsphinx_internal.h.

## ps_search_dict

#define ps_search_dict | ( |  | s | ) | ps_search_base(s)->dict

Definition at line 125 of file pocketsphinx_internal.h.

## ps_search_dict2pid

#define ps_search_dict2pid | ( |  | s | ) | ps_search_base(s)->d2p

Definition at line 126 of file pocketsphinx_internal.h.

## ps_search_finish

#define ps_search_finish | ( |  | s | ) | (*(ps_search_base(s)->vt->finish))(s)

Definition at line 137 of file pocketsphinx_internal.h.

## ps_search_finish_wid

#define ps_search_finish_wid | ( |  | s | ) | ps_search_base(s)->finish_wid

Definition at line 148 of file pocketsphinx_internal.h.

## ps_search_free

#define ps_search_free | ( |  | s | ) | (*(ps_search_base(s)->vt->free))(s)

Definition at line 139 of file pocketsphinx_internal.h.

## ps_search_hyp

#define ps_search_hyp | ( |  | s,
|  |  | sc
| ) |  | (*(ps_search_base(s)->vt->hyp))(s,sc)

Definition at line 141 of file pocketsphinx_internal.h.

## ps_search_last_link

#define ps_search_last_link | ( |  | s | ) | ps_search_base(s)->last_link

Definition at line 128 of file pocketsphinx_internal.h.

## ps_search_lattice

#define ps_search_lattice | ( |  | s | ) | (*(ps_search_base(s)->vt->lattice))(s)

Definition at line 140 of file pocketsphinx_internal.h.

## ps_search_lookahead

#define ps_search_lookahead | ( |  | s | ) | ps_search_base(s)->pls

Definition at line 130 of file pocketsphinx_internal.h.

## ps_search_n_words

#define ps_search_n_words | ( |  | s | ) | ps_search_base(s)->n_words

Definition at line 131 of file pocketsphinx_internal.h.

## ps_search_name

#define ps_search_name | ( |  | s | ) | ps_search_base(s)->name

Definition at line 134 of file pocketsphinx_internal.h.

## ps_search_post

#define ps_search_post | ( |  | s | ) | ps_search_base(s)->post

Definition at line 129 of file pocketsphinx_internal.h.

## ps_search_prob

#define ps_search_prob | ( |  | s | ) | (*(ps_search_base(s)->vt->prob))(s)

Definition at line 142 of file pocketsphinx_internal.h.

## ps_search_reinit

#define ps_search_reinit | ( |  | s,
|  |  | d,
|  |  | d2p
| ) |  | (*(ps_search_base(s)->vt->reinit))(s,d,d2p)

Definition at line 138 of file pocketsphinx_internal.h.

## ps_search_seg_free

#define ps_search_seg_free | ( |  | s | ) | (*(seg->vt->seg_free))(seg)

Definition at line 195 of file pocketsphinx_internal.h.

## ps_search_seg_iter

#define ps_search_seg_iter | ( |  | s | ) | (*(ps_search_base(s)->vt->seg_iter))(s)

Definition at line 143 of file pocketsphinx_internal.h.

## ps_search_seg_next

#define ps_search_seg_next | ( |  | seg | ) | (*(seg->vt->seg_next))(seg)

Definition at line 194 of file pocketsphinx_internal.h.

## ps_search_silence_wid

#define ps_search_silence_wid | ( |  | s | ) | ps_search_base(s)->silence_wid

Definition at line 146 of file pocketsphinx_internal.h.

## ps_search_start

#define ps_search_start | ( |  | s | ) | (*(ps_search_base(s)->vt->start))(s)

Definition at line 135 of file pocketsphinx_internal.h.

## ps_search_start_wid

#define ps_search_start_wid | ( |  | s | ) | ps_search_base(s)->start_wid

Definition at line 147 of file pocketsphinx_internal.h.

## ps_search_step

#define ps_search_step | ( |  | s,
|  |  | i
| ) |  | (*(ps_search_base(s)->vt->step))(s,i)

Definition at line 136 of file pocketsphinx_internal.h.

## ps_search_type

#define ps_search_type | ( |  | s | ) | ps_search_base(s)->type

Definition at line 133 of file pocketsphinx_internal.h.

## PS_SEARCH_TYPE_ALLPHONE

#define PS_SEARCH_TYPE_ALLPHONE "allphone"

Definition at line 75 of file pocketsphinx_internal.h.

## PS_SEARCH_TYPE_FSG

#define PS_SEARCH_TYPE_FSG "fsg"

Definition at line 73 of file pocketsphinx_internal.h.

## PS_SEARCH_TYPE_KWS

#define PS_SEARCH_TYPE_KWS "kws"

Definition at line 72 of file pocketsphinx_internal.h.

## PS_SEARCH_TYPE_NGRAM

#define PS_SEARCH_TYPE_NGRAM "ngram"

Definition at line 74 of file pocketsphinx_internal.h.

## PS_SEARCH_TYPE_PHONE_LOOP

#define PS_SEARCH_TYPE_PHONE_LOOP "phone_loop"

Definition at line 77 of file pocketsphinx_internal.h.

## PS_SEARCH_TYPE_STATE_ALIGN

#define PS_SEARCH_TYPE_STATE_ALIGN "state_align"

Definition at line 76 of file pocketsphinx_internal.h.

## Typedef Documentation

## ps_search_t

typedef struct ps_search_s ps_search_t

Search algorithm structure.

Definition at line 64 of file pocketsphinx_internal.h.

## Function Documentation

## ps_search_base_free()

void ps_search_base_free | ( | ps_search_t * | search | ) |

Free search.

Definition at line 1402 of file pocketsphinx.c.

References ps_search_s::d2p, ps_search_s::dag, ps_search_s::dict, dict2pid_free(), ps_search_s::hyp_str, and ps_lattice_free().

## ps_search_base_reinit()

void ps_search_base_reinit | ( | ps_search_t * | search,
|  | dict_t * | dict,
|  | dict2pid_t * | d2p
| ) |  |

Re-initialize base structure with new dictionary.

Definition at line 1415 of file pocketsphinx.c.

References ps_search_s::d2p, ps_search_s::dict, dict2pid_free(), dict2pid_retain(), dict_size, ps_search_s::finish_wid, ps_search_s::n_words, ps_search_s::silence_wid, and ps_search_s::start_wid.

## ps_search_init()

void ps_search_init | ( | ps_search_t * | search,
|  | ps_searchfuncs_t * | vt,
|  | const char * | type,
|  | const char * | name,
|  | cmd_ln_t * | config,
|  | acmod_t * | acmod,
|  | dict_t * | dict,
|  | dict2pid_t * | d2p
| ) |  |

Initialize base structure.

Definition at line 1371 of file pocketsphinx.c.

References ps_search_s::acmod, ps_search_s::config, ps_search_s::d2p, ps_search_s::dict, dict2pid_retain(), dict_size, ps_search_s::finish_wid, ps_search_s::n_words, ps_search_s::silence_wid, ps_search_s::start_wid, and ps_search_s::vt.