lts.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*************************************************************************/
3 /* */
4 /* Language Technologies Institute */
5 /* Carnegie Mellon University */
6 /* Copyright (c) 1999 */
7 /* All Rights Reserved. */
8 /* */
9 /* Permission is hereby granted, free of charge, to use and distribute */
10 /* this software and its documentation without restriction, including */
11 /* without limitation the rights to use, copy, modify, merge, publish, */
12 /* distribute, sublicense, and/or sell copies of this work, and to */
13 /* permit persons to whom this work is furnished to do so, subject to */
14 /* the following conditions: */
15 /* 1. The code must retain the above copyright notice, this list of */
16 /* conditions and the following disclaimer. */
17 /* 2. Any modifications must be clearly marked as such. */
18 /* 3. Original authors' names are not deleted. */
19 /* 4. The authors' names are not used to endorse or promote products */
20 /* derived from this software without specific prior written */
21 /* permission. */
22 /* */
23 /* CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK */
24 /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
25 /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
26 /* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */
27 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
28 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
29 /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
30 /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
31 /* THIS SOFTWARE. */
32 /* */
33 /*************************************************************************/
34 /* Author: Alan W Black (awb@cs.cmu.edu) */
35 /* Date: December 1999 */
36 /*************************************************************************/
37 /* */
38 /* Letter to sound rules */
39 /* */
40 /*************************************************************************/
41 
42 /*
43  * lts.h -- Letter to sound rule support
44  *
45  * $Log$
46  * Revision 1.1 2006/04/05 20:27:30 dhdfu
47  * A Great Reorganzation of header files and executables
48  *
49  * Revision 1.2 2006/02/22 20:44:17 arthchan2003
50  * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: As we have done in SphinxTrain and with the permission of flite developer. check in the routines for using LTS. In dict.c, one will see detail comment on how it was used and how we avoid problematic conditions.
51  *
52  * Revision 1.1.2.1 2005/09/25 19:07:52 arthchan2003
53  * Added LTS rules and the module to use it.
54  *
55  *
56  */
57 
58 #ifndef _CST_LTS_H__
59 #define _CST_LTS_H__
60 
61 #include <s3types.h>
62 
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 #if 0
68 /* Fool Emacs. */
69 }
70 #endif
71 
72 typedef unsigned short cst_lts_addr;
73 typedef int cst_lts_phone;
74 typedef unsigned char cst_lts_feat;
75 typedef unsigned char cst_lts_letter;
76 typedef unsigned char cst_lts_model;
77 
78 /* end of rule value */
79 #define CST_LTS_EOR 255
80 
81 /*
82  */
83 typedef uint32 acmod_id_t;
84 typedef uint32 word_id_t;
85 
86 typedef struct lex_entry_str {
87  char *ortho;
89  char **phone;
91  uint32 phone_cnt;
92 
94 } lex_entry_t;
95 
96 typedef struct cst_lts_rules_struct {
97  char *name;
100  const char * const * phone_table;
103  const char * const * letter_table;
104 } cst_lts_rules;
105 /* For Sphinx naming conventions. */
107 
108 /* \struct cst_lts_rule
109 
110 */
111 typedef struct cst_lts_rule_struct {
116 } cst_lts_rule;
118 
119 struct lex_entry_str; /* This is actually lex_entry_t */
121 int lts_apply(const char *word,const char *feats,
122  const cst_lts_rules *r, struct lex_entry_str *out_phones);
123 
127 void lex_print(lex_entry_t *ent
128  );
129 
130 extern const cst_lts_rules cmu6_lts_rules;
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 
137 #endif
138