PocketSphinx
0.6
|
00001 /* ==================================================================== 00002 * Copyright (c) 1999-2004 Carnegie Mellon University. All rights 00003 * reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * 1. Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in 00014 * the documentation and/or other materials provided with the 00015 * distribution. 00016 * 00017 * This work was supported in part by funding from the Defense Advanced 00018 * Research Projects Agency and the National Science Foundation of the 00019 * United States of America, and the CMU Sphinx Speech Consortium. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 00022 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00023 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00024 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY 00025 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00026 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00027 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00028 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00029 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00030 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 * ==================================================================== 00034 * 00035 */ 00036 /* 00037 * tmat.h 00038 * 00039 * ********************************************** 00040 * CMU ARPA Speech Project 00041 * 00042 * Copyright (c) 1997 Carnegie Mellon University. 00043 * ALL RIGHTS RESERVED. 00044 * ********************************************** 00045 * 00046 * HISTORY 00047 * $Log: tmat.h,v $ 00048 * Revision 1.1.1.1 2006/05/23 18:45:03 dhuggins 00049 * re-importation 00050 * 00051 * Revision 1.1 2005/09/29 21:51:19 dhuggins 00052 * Add support for Sphinx3 tmat files. Amazingly enough, it Just Works 00053 * (but it isn't terribly robust) 00054 * 00055 * Revision 1.9 2005/06/21 19:23:35 arthchan2003 00056 * 1, Fixed doxygen documentation. 2, Added $ keyword. 00057 * 00058 * Revision 1.6 2005/06/13 04:02:56 archan 00059 * Fixed most doxygen-style documentation under libs3decoder. 00060 * 00061 * Revision 1.5 2005/05/03 04:09:09 archan 00062 * Implemented the heart of word copy search. For every ci-phone, every word end, a tree will be allocated to preserve its pathscore. This is different from 3.5 or below, only the best score for a particular ci-phone, regardless of the word-ends will be preserved at every frame. The graph propagation will not collect unused word tree at this point. srch_WST_propagate_wd_lv2 is also as the most stupid in the century. But well, after all, everything needs a start. I will then really get the results from the search and see how it looks. 00063 * 00064 * Revision 1.4 2005/04/21 23:50:26 archan 00065 * Some more refactoring on the how reporting of structures inside kbcore_t is done, it is now 50% nice. Also added class-based LM test case into test-decode.sh.in. At this moment, everything in search mode 5 is already done. It is time to test the idea whether the search can really be used. 00066 * 00067 * Revision 1.3 2005/03/30 01:22:47 archan 00068 * Fixed mistakes in last updates. Add 00069 * 00070 * 00071 * 20.Apr.2001 RAH (rhoughton@mediasite.com, ricky.houghton@cs.cmu.edu) 00072 * Added tmat_free to free allocated memory 00073 * 00074 * 29-Feb-2000 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University. 00075 * Added tmat_chk_1skip(), and made tmat_chk_uppertri() public. 00076 * 00077 * 10-Dec-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University. 00078 * Added tmat_dump(). 00079 * 00080 * 11-Mar-97 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University. 00081 * Started based on original S3 implementation. 00082 */ 00083 00084 00085 #ifndef _S3_TMAT_H_ 00086 #define _S3_TMAT_H_ 00087 00088 /* System headers. */ 00089 #include <stdio.h> 00090 00091 /* SphinxBase headers. */ 00092 #include <sphinxbase/logmath.h> 00093 00097 #ifdef __cplusplus 00098 extern "C" { 00099 #endif 00100 #if 0 00101 } /* Fool Emacs into not indenting things. */ 00102 #endif 00103 00109 typedef struct { 00110 uint8 ***tp; 00112 int16 n_tmat; 00113 int16 n_state; 00115 } tmat_t; 00116 00117 00120 tmat_t *tmat_init (char const *tmatfile, 00121 logmath_t *lmath, 00122 float64 tpfloor, 00123 int32 breport 00124 ); 00125 00126 00127 00130 void tmat_dump (tmat_t *tmat, 00131 FILE *fp 00132 ); 00133 00134 00139 void tmat_free (tmat_t *t 00140 ); 00141 00145 void tmat_report(tmat_t *t 00146 ); 00147 00148 #if 0 00149 { /* Stop indent from complaining */ 00150 #endif 00151 #ifdef __cplusplus 00152 } 00153 #endif 00154 00155 #endif