~ubuntu-branches/ubuntu/vivid/sphinxtrain/vivid

« back to all changes in this revision

Viewing changes to include/s3/corpus.h

  • Committer: Package Import Robot
  • Author(s): Samuel Thibault
  • Date: 2013-01-02 04:10:21 UTC
  • Revision ID: package-import@ubuntu.com-20130102041021-ynsizmz33fx02hea
Tags: upstream-1.0.8
ImportĀ upstreamĀ versionĀ 1.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ====================================================================
 
2
 * Copyright (c) 1995-2000 Carnegie Mellon University.  All rights 
 
3
 * reserved.
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 *
 
9
 * 1. Redistributions of source code must retain the above copyright
 
10
 *    notice, this list of conditions and the following disclaimer. 
 
11
 *
 
12
 * 2. Redistributions in binary form must reproduce the above copyright
 
13
 *    notice, this list of conditions and the following disclaimer in
 
14
 *    the documentation and/or other materials provided with the
 
15
 *    distribution.
 
16
 *
 
17
 * This work was supported in part by funding from the Defense Advanced 
 
18
 * Research Projects Agency and the National Science Foundation of the 
 
19
 * United States of America, and the CMU Sphinx Speech Consortium.
 
20
 *
 
21
 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
 
22
 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 
23
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
24
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
 
25
 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
26
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 
27
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 
28
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 
29
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 
30
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 
31
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
32
 *
 
33
 * ====================================================================
 
34
 *
 
35
 */
 
36
/*********************************************************************
 
37
 *
 
38
 * File: corpus.h
 
39
 * 
 
40
 * Description: 
 
41
 * 
 
42
 * Author: 
 
43
 *      $Author: nshmyrev $
 
44
 *********************************************************************/
 
45
 
 
46
#ifndef CORPUS_H
 
47
#define CORPUS_H
 
48
 
 
49
 
 
50
#ifdef __cplusplus
 
51
extern "C" {
 
52
#endif
 
53
#if 0
 
54
}
 
55
#endif
 
56
 
 
57
#include <sphinxbase/prim_type.h>
 
58
#include <s3/vector.h>
 
59
#include <s3/acmod_set.h>
 
60
#include <s3/s3phseg_io.h>
 
61
 
 
62
#include <stdio.h>
 
63
#include <stddef.h>
 
64
 
 
65
/* MFCC directory/extension configuration
 
66
   functions */
 
67
int
 
68
corpus_set_mfcc_dir(const char *root);
 
69
 
 
70
int
 
71
corpus_set_mfcc_ext(const char *ext);
 
72
 
 
73
/* seg file configuration functions */
 
74
int
 
75
corpus_set_seg_dir(const char *root);
 
76
 
 
77
int
 
78
corpus_set_seg_ext(const char *ext);
 
79
 
 
80
/* phone seg configuration functions */
 
81
int
 
82
corpus_set_phseg_dir(const char *dir);
 
83
 
 
84
int
 
85
corpus_set_phseg_ext(const char *ext);
 
86
 
 
87
/* sent file configuration functions */
 
88
int
 
89
corpus_set_sent_dir(const char *root);
 
90
 
 
91
int
 
92
corpus_set_sent_ext(const char *ext);
 
93
 
 
94
/* Vector quantized feature functions */
 
95
int
 
96
corpus_set_ccode_dir(const char *root);
 
97
 
 
98
int
 
99
corpus_set_ccode_ext(const char *ext);
 
100
 
 
101
int
 
102
corpus_set_dcode_dir(const char *root);
 
103
 
 
104
int
 
105
corpus_set_dcode_ext(const char *ext);
 
106
 
 
107
int
 
108
corpus_set_pcode_dir(const char *root);
 
109
 
 
110
int
 
111
corpus_set_pcode_ext(const char *ext);
 
112
 
 
113
int
 
114
corpus_set_ddcode_dir(const char *root);
 
115
 
 
116
int
 
117
corpus_set_ddcode_ext(const char *ext);
 
118
 
 
119
void
 
120
corpus_set_full_suffix_match(uint32 state);
 
121
 
 
122
/* Corpus LSN file configuration functions */
 
123
int
 
124
corpus_set_lsn_filename(const char *fn);
 
125
 
 
126
/* Per utterance MLLR transforms */
 
127
int
 
128
corpus_set_mllr_filename(const char *fn);
 
129
int
 
130
corpus_set_mllr_dir(const char *fn);
 
131
 
 
132
/* checkpoint the corpus module
 
133
   (i.e. write out offset and remaining run length) */
 
134
int
 
135
corpus_ckpt(const char *fn);
 
136
 
 
137
 
 
138
int
 
139
corpus_set_ctl_host(char *host_port_spec);
 
140
 
 
141
/* Control file configuration functions */
 
142
int
 
143
corpus_set_ctl_filename(const char *filename);
 
144
 
 
145
int
 
146
corpus_set_interval(uint32 n_skip,
 
147
                    uint32 run_len);
 
148
 
 
149
/* set the offset and run length from a checkpoint file */
 
150
int
 
151
corpus_ckpt_set_interval(const char *fn);
 
152
 
 
153
int
 
154
corpus_set_partition(uint32 r,
 
155
                     uint32 of_s);
 
156
 
 
157
uint32
 
158
corpus_get_begin(void);
 
159
 
 
160
/* Initialization function to be called after
 
161
   configuration functions */
 
162
 
 
163
int
 
164
corpus_init(void);
 
165
 
 
166
/* After reaching the end of a (sub)corpus.  This
 
167
 * call sets things up as they were after corpus_init() */
 
168
int
 
169
corpus_reset(void);
 
170
 
 
171
/* data access/info functions */
 
172
int
 
173
corpus_next_utt(void);
 
174
char *
 
175
corpus_utt_full_name(void);
 
176
char *
 
177
corpus_utt_brief_name(void);
 
178
char *
 
179
corpus_utt(void);
 
180
 
 
181
int32
 
182
corpus_provides_sent(void);
 
183
int
 
184
corpus_get_sent(char **trans);
 
185
 
 
186
int
 
187
corpus_has_xfrm(void);
 
188
int
 
189
corpus_get_xfrm(float32 *****out_a,
 
190
                float32 ****out_b,
 
191
                uint32 **out_veclen,
 
192
                uint32 *out_n_mllrcls,
 
193
                uint32 *out_n_stream);
 
194
 
 
195
int32
 
196
corpus_provides_mfcc(void);
 
197
int
 
198
corpus_get_mfcc(vector_t **mfc,
 
199
                uint32 *n_frame,
 
200
                uint32 *veclen);
 
201
 
 
202
int
 
203
corpus_get_generic_featurevec(vector_t **mfc,
 
204
                              int32 *n_frame,
 
205
                              uint32 veclen);
 
206
 
 
207
int
 
208
corpus_get_sildel(uint32 **sf,
 
209
                  uint32 **ef,
 
210
                  uint32 *n_seg);
 
211
 
 
212
int32
 
213
corpus_provides_seg(void);
 
214
int
 
215
corpus_get_seg(uint16 **seg, int32 *n_frame);
 
216
 
 
217
int32 corpus_provides_phseg(void);
 
218
int corpus_get_phseg(acmod_set_t *acmod_set,
 
219
                     s3phseg_t **out_phseg);
 
220
 
 
221
int
 
222
corpus_load_lattice(s3lattice_t **out_lattice, const char *lat_dir, const char *lat_ext);
 
223
 
 
224
#ifdef __cplusplus
 
225
}
 
226
#endif
 
227
#endif /* CORPUS_H */