Edinburgh Speech Tools 2.4-release
 
Loading...
Searching...
No Matches
EST_UtteranceFile.h
1 /************************************************************************/
2 /* */
3 /* Centre for Speech Technology Research */
4 /* University of Edinburgh, UK */
5 /* Copyright (c) 1996,1997 */
6 /* All Rights Reserved. */
7 /* */
8 /* Permission is hereby granted, free of charge, to use and distribute */
9 /* this software and its documentation without restriction, including */
10 /* without limitation the rights to use, copy, modify, merge, publish, */
11 /* distribute, sublicense, and/or sell copies of this work, and to */
12 /* permit persons to whom this work is furnished to do so, subject to */
13 /* the following conditions: */
14 /* 1. The code must retain the above copyright notice, this list of */
15 /* conditions and the following disclaimer. */
16 /* 2. Any modifications must be clearly marked as such. */
17 /* 3. Original authors' names are not deleted. */
18 /* 4. The authors' names are not used to endorse or promote products */
19 /* derived from this software without specific prior written */
20 /* permission. */
21 /* */
22 /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23 /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24 /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25 /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28 /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29 /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
30 /* THIS SOFTWARE. */
31 /* */
32 /*************************************************************************/
33
34
35#ifndef __EST_UTTERANCEFILE_H__
36#define __EST_UTTERANCEFILE_H__
37
38#include "EST_TNamedEnum.h"
39#include "ling_class/EST_Utterance.h"
40#include "EST_string_aux.h"
41#include "EST_FileType.h"
42#include "EST_Token.h"
43
44/** Table of different file formats for loading an saving utterances.
45 *
46 * @author Richard Caley <rjc@cstr.ed.ac.uk>
47 * @version $Id: EST_UtteranceFile.h,v 1.3 2003/01/15 11:13:50 robert Exp $
48 */
49
50typedef enum EST_UtteranceFileType{
51 uff_none,
52 uff_est,
53 uff_est_ascii=uff_est,
54 uff_xlabel,
55 uff_genxml,
56 uff_apml,
57} EST_UtteranceFileType;
58
59
60
62public:
63
64 // We have to use #defines for what should be done with just
65 // typedefs because Sun CC thinks you shouldn't be allowed to
66 // declare a member function via a typedef.
67
68#define LoadUtterance_TokenStreamArgs EST_TokenStream &ts, \
69 EST_Utterance &u, \
70 int &max_id
71
72#define SaveUtterance_TokenStreamArgs ostream &outf,const \
73 EST_Utterance &utt
74
75 typedef EST_read_status Load_TokenStream(LoadUtterance_TokenStreamArgs);
76
77 typedef EST_write_status Save_TokenStream(SaveUtterance_TokenStreamArgs);
78
79 typedef struct Info {
80 bool recognise;
81 Load_TokenStream *load;
82 Save_TokenStream *save;
83 const char *description;
84 } Info;
85
86 static EST_write_status save_est_ascii(SaveUtterance_TokenStreamArgs);
87 static EST_read_status load_est_ascii(LoadUtterance_TokenStreamArgs);
88
89 static EST_write_status save_xlabel(SaveUtterance_TokenStreamArgs);
90 static EST_read_status load_xlabel(LoadUtterance_TokenStreamArgs);
91
92 static EST_write_status save_genxml(SaveUtterance_TokenStreamArgs);
93 static EST_read_status load_genxml(LoadUtterance_TokenStreamArgs);
94
95 static EST_read_status load_apml(LoadUtterance_TokenStreamArgs);
96
98
99 static EST_String options_supported(void);
100 static EST_String options_short(void);
101};
102
103#endif
104