whmm.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1995-2004 Carnegie Mellon University. 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  * This work was supported in part by funding from the Defense Advanced
19  * Research Projects Agency and the National Science Foundation of the
20  * United States of America, and the CMU Sphinx Speech Consortium.
21  *
22  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
26  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * ====================================================================
35  *
36  */
37 
38 /*
39  * whmm.h -- hmm structure that is used by sphinx 3.0 decode_anytopo (and perhaps
40  * the fsg search as well)
41  *
42  * **********************************************
43  * CMU ARPA Speech Project
44  *
45  * Copyright (c) 1995 Carnegie Mellon University.
46  * ALL RIGHTS RESERVED.
47  * **********************************************
48  * 14-Jul-05 ARCHAN (archan@cs.cmu.edu) at Carnegie Mellon Unversity
49  * First created it.
50  *
51  * $Log$
52  * Revision 1.1 2006/04/05 20:27:30 dhdfu
53  * A Great Reorganzation of header files and executables
54  *
55  * Revision 1.2 2006/02/23 05:07:53 arthchan2003
56  * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: split whmm's routine.
57  *
58  * Revision 1.1.2.4 2005/09/07 23:40:06 arthchan2003
59  * Several Bug Fixes and Enhancements to the flat-lexicon
60  * 1, Fixed Dox-doc.
61  * 2, Add -worddumpef and -hmmdumpef in parrallel to -worddumpsf and
62  * -hmmdumpsf. Usage is trivial. a structure called fwd_dbg_t now wrapped
63  * up all these loose parameters. Methods of fwd_dbg are implemented.
64  * 3, word_ugprob is now initialized by init_word_ugprob
65  * 4, Full-triphone expansion is implemented. User can change this
66  * behavior by specifying -multiplex_multi and -multiplex_single. The
67  * former turn on multiplex triphone for word-begin for multi-phone word.
68  * The latter do that for single-phone word. Turning off both could
69  * tremendously increase computation.
70  * 5, Word expansions of possible right contexts now records independent
71  * history. The behavior in the past was to use only one history for a
72  * word.
73  *
74  * Revision 1.1.2.3 2005/07/24 01:42:58 arthchan2003
75  * Added whmm_alloc_light, that will by-pass and not use any internal list inside whmm.c
76  *
77  * Revision 1.1.2.2 2005/07/17 05:57:25 arthchan2003
78  * 1, Removed wid from the argument list of eval_*_whmm, 2, Allow allocation of whmm_alloc to be more flexible.
79  *
80  * Revision 1.1.2.1 2005/07/15 07:48:32 arthchan2003
81  * split the hmm (whmm_t) and context building process (ctxt_table_t) from the the flat_fwd.c
82  *
83  *
84  */
85 
86 #ifndef _S3_WHMM_H_
87 #define _S3_WHMM_H_
88 
89 
90 #include "prim_type.h"
91 #include "s3types.h"
92 #include "tmat.h"
93 #include "dict.h"
94 #include "mdef.h"
95 #include "hmm.h"
96 
97 
98 #ifdef __cplusplus
99 extern "C" {
100 #endif
101 #if 0
102 /* Fool Emacs. */
103 }
104 #endif
105 
123 typedef struct whmm_s {
126  int16 pos;
131  struct whmm_s *next;
132 } whmm_t;
133 
134 
136 void whmm_free (whmm_t *h
137  );
138 
140 whmm_t *whmm_alloc(hmm_context_t *ctx, int32 pos, int mpx,
141  s3ssid_t ssid, s3tmatid_t tmatid);
142 
143 
146 void dump_whmm (s3wid_t w,
147  whmm_t *h,
148  int32 *senscr,
149  tmat_t *tmat,
150  int32 n_frame,
151  dict_t *dict,
152  mdef_t *mdef
153  );
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 
160 #endif /* _S3_WHMM_H_ */