40#include "EST_FileType.h"
41#include "EST_TNamedEnum.h"
43#include "EST_Option.h"
44#include "EST_Features.h"
49 { est_file_none, {
"None" }},
50 { est_file_track, {
"Track",
"track" }},
51 { est_file_wave, {
"wave" }},
52 { est_file_label, {
"label" }},
53 { est_file_utterance, {
"utterance" }},
54 { est_file_fmatrix, {
"fmatrix" }},
55 { est_file_fvector, {
"fvector" }},
56 { est_file_dmatrix, {
"dmatrix" }},
57 { est_file_dvector, {
"dvector" }},
58 { est_file_feature_data, {
"feature_data" }},
59 { est_file_fst, {
"fst" }},
60 { est_file_ngram, {
"ngram" }},
61 { est_file_index, {
"index" }},
62 { est_file_f_catalogue, {
"f_catalogue" }},
63 { est_file_unknown, {
"unknown" }},
64 { est_file_none, {
"None" }},
69#if defined(INSTANTIATE_TEMPLATES)
71#include "../base_class/EST_TNamedEnum.cc"
83 bool &
ascii, EST_EstFileType &t)
100 v =
ts.get().string();
101 t = EstFileEnums.token(v);
103 if (t == est_file_none)
107 t = est_file_unknown;
108 hinfo.set(
"FileType", v);
111 while ((!
ts.eof()) && (
ts.peek().string() !=
"EST_Header_End"))
113 k =
ts.get().string();
114 v =
ts.get_upto_eoln().string();
117 v = v.
after(RXwhite);
124 cerr <<
"Unexpected end of EST_File" <<
endl;
125 return misc_read_error;
130 if (
hinfo.S(
"DataType") ==
"binary")
139 bool &
ascii, EST_EstFileType &t)
156 v =
ts.get().string();
157 t = EstFileEnums.token(v);
159 if (t == est_file_none)
163 t = est_file_unknown;
164 hinfo.add_item(
"FileType",v);
167 while ((!
ts.eof()) && (
ts.peek().string() !=
"EST_Header_End"))
169 k =
ts.get().string();
170 v =
ts.get_upto_eoln().string();
173 v = v.
after(RXwhite);
175 hinfo.add_item(k, v);
180 cerr <<
"Unexpected end of EST_File" <<
endl;
181 return misc_read_error;
186 if (
hinfo.sval(
"DataType",0) ==
"binary")
int contains(const char *s, int pos=-1) const
Does it contain this substring?
EST_String after(int pos, int len=1) const
Part after pos+len.