src/libpocketsphinx/ngram_search.c File Reference

N-Gram based multi-pass search ("FBS"). More...

#include <string.h>
#include <assert.h>
#include <ckd_alloc.h>
#include <listelem_alloc.h>
#include "pocketsphinx_internal.h"
#include "ps_lattice_internal.h"
#include "ngram_search.h"
#include "ngram_search_fwdtree.h"
#include "ngram_search_fwdflat.h"

Go to the source code of this file.

Functions

ps_search_tngram_search_init (cmd_ln_t *config, acmod_t *acmod, dict_t *dict)
 Initialize the N-Gram search module.
void ngram_search_free (ps_search_t *search)
 Finalize the N-Gram search module.
int ngram_search_mark_bptable (ngram_search_t *ngs, int frame_idx)
 Record the current frame's index in the backpointer table.
void ngram_search_save_bp (ngram_search_t *ngs, int frame_idx, int32 w, int32 score, int32 path, int32 rc)
 Enter a word in the backpointer table.
int ngram_search_find_exit (ngram_search_t *ngs, int frame_idx, int32 *out_best_score)
 Find the best word exit for the current frame in the backpointer table.
char const * ngram_search_bp_hyp (ngram_search_t *ngs, int bpidx)
 Backtrace from a given backpointer index to obtain a word hypothesis.
void ngram_search_alloc_all_rc (ngram_search_t *ngs, int32 w)
 Allocate last phone channels for all possible right contexts for word w.
void ngram_search_free_all_rc (ngram_search_t *ngs, int32 w)
 Allocate last phone channels for all possible right contexts for word w.
void ngram_compute_seg_scores (ngram_search_t *ngs, float32 lwf)
 Compute language and acoustic scores for backpointer table entries.
ps_lattice_tngram_search_lattice (ps_search_t *search)
 Construct a word lattice from the current hypothesis.

Detailed Description

N-Gram based multi-pass search ("FBS").

Definition in file ngram_search.c.


Function Documentation

char const* ngram_search_bp_hyp ( ngram_search_t ngs,
int  bpidx 
)

Backtrace from a given backpointer index to obtain a word hypothesis.

Returns:
a read-only string with the best hypothesis.

Definition at line 451 of file ngram_search.c.

References bptbl_s::bp, ps_search_s::hyp_str, and bptbl_s::wid.

int ngram_search_find_exit ( ngram_search_t ngs,
int  frame_idx,
int32 *  out_best_score 
)

Find the best word exit for the current frame in the backpointer table.

Returns:
the backpointer index of the best word exit.

Definition at line 408 of file ngram_search.c.

References ngram_search_s::n_frame, bptbl_s::score, bptbl_s::wid, and WORST_SCORE.

int ngram_search_mark_bptable ( ngram_search_t ngs,
int  frame_idx 
)

Record the current frame's index in the backpointer table.

Returns:
the current backpointer index.

Definition at line 298 of file ngram_search.c.

References ngram_search_s::frm_wordlist, and ngram_search_s::n_frame_alloc.

Referenced by ngram_fwdflat_finish(), ngram_fwdflat_search(), ngram_fwdtree_finish(), and ngram_fwdtree_search().


Generated on 26 Aug 2009 for PocketSphinx by  doxygen 1.6.1