Edinburgh Speech Tools  2.1-release
EST_relation_aux.h
Go to the documentation of this file.
1 /*************************************************************************/
2 /* */
3 /* Centre for Speech Technology Research */
4 /* University of Edinburgh, UK */
5 /* Copyright (c) 1994,1995,1996 */
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 /* Author : Paul Taylor */
34 /* Date : May 1994 */
35 /* Release: 0.9 */
36 /*-----------------------------------------------------------------------*/
37 /* Auxiliary Label Routines header file */
38 /* */
39 /*=======================================================================*/
40 
41 #ifndef __EST_RELATION_AUX_H__
42 #define __EST_RELATION_AUX_H__
43 
44 #include "EST_String.h"
45 #include "EST_Track.h"
47 #include "EST_Option.h"
48 #include "EST_THash.h"
49 
52 
54 
55 
56 void convert_to_broad(EST_Relation &seg, EST_StrList &pos_list,
57  EST_String broad_name ="", int polarity = 1);
58 void convert_to_broad_class(EST_Relation &seg, const EST_String &class_type,
59  EST_Option &options);
60 
61 int merge_label(EST_Relation &seg, const EST_String &labtype);
62 
63 void change_label(EST_Relation &seg, const EST_String &oname, const EST_String &nname);
64 
65 void merge_all_label(EST_Relation &seg, const EST_String &labtype);
66 
67 void track_to_label(const EST_Track &tr, EST_Relation &lab, float thresh=0.0);
68 void track_to_pm(const EST_Track &tr, int sample_rate, EST_Relation &lab);
69 
70 void label_to_track(const EST_Relation &lab,
71  const EST_Option &al,
72  const EST_Option &op,
73  EST_Track &tr);
74 void label_to_track(const EST_Relation &lab, EST_Track &tr,
75  float shift, float offset=0.0,
76  float range = 1.0, float req_length = -1.0,
77  const EST_String &pad="low");
78 
79 void shift_label(EST_Relation &seg, float shift);
80 void label_map(EST_Relation &seg, EST_Option &map);
81 void quantize(EST_Relation &a, float q);
82 int edit_labels(EST_Relation &a, EST_String sedfile);
83 
84 void RelationList_select(EST_RelationList &mlf, EST_StrList filenames, bool
85  exact_match);
87  const EST_String &filename,
88  bool base);
91 
93  EST_Relation &keylab, EST_String ext);
94 
96  EST_Relation &keylab,
97  EST_StrList &list, EST_String ext);
98 
100  const EST_String &filename,
101  bool base);
102 
104 
106  EST_RelationList &plist);
108  const EST_RelationList &plist);
110  const EST_RelationList &plist,
111  int time=1, int path = 1);
113  const EST_RelationList &plist,
114  const EST_String &features,
115  int path);
116 
117 EST_write_status save_WordList(const EST_String &filename,
118  const EST_RelationList &plist,
119  int n);
120 
122  EST_RelationList &plist, int n);
123 
124 
125 
127  EST_StrList &files, EST_Option &al);
128 
129 float start(EST_Item *n);
130 float duration(EST_Item *n);
131 
132 /// hashed relation lists for super speed
134  EST_hashedRelationList &hash_table,
135  const bool base);
136 
138  const EST_hashedRelationList &hash_table,
139  const EST_String &filename, bool base);
140 
141 
142 #endif /* __EST_RELATION_AUX_H__ */
void convert_to_broad_class(EST_Relation &seg, const EST_String &class_type, EST_Option &options)
void merge_all_label(EST_Relation &seg, const EST_String &labtype)
void change_label(EST_Relation &seg, const EST_String &oname, const EST_String &nname)
EST_write_status
EST_write_status save_ind_RelationList(const EST_String &filename, const EST_RelationList &plist, const EST_String &features, int path)
Definition: relation_io.cc:562
EST_TStringHash< EST_Relation * > EST_hashedRelationList
EST_Relation RelationList_combine(EST_RelationList &mlf)
A specialised hash table for when the key is an EST_String.
Definition: EST_THash.h:304
EST_read_status read_RelationList(EST_RelationList &mlf, EST_StrList &files, EST_Option &al)
Definition: relation_io.cc:636
EST_String options_relation_filetypes(void)
void quantize(EST_Relation &a, float q)
EST_write_status save_WordList(const EST_String &filename, const EST_RelationList &plist, int n)
Definition: relation_io.cc:523
void track_to_pm(const EST_Track &tr, int sample_rate, EST_Relation &lab)
bool hashed_RelationList_extract(EST_Relation *&rel, const EST_hashedRelationList &hash_table, const EST_String &filename, bool base)
int edit_labels(EST_Relation &a, EST_String sedfile)
void label_to_track(const EST_Relation &lab, const EST_Option &al, const EST_Option &op, EST_Track &tr)
void convert_to_broad(EST_Relation &seg, EST_StrList &pos_list, EST_String broad_name="", int polarity=1)
EST_Relation RelationList_extract(EST_RelationList &mlf, const EST_String &filename, bool base)
void relation_convert(EST_Relation &lab, EST_Option &al, EST_Option &op)
EST_write_status save_SentenceList(EST_String filename, EST_RelationList &plist, int n)
int merge_label(EST_Relation &seg, const EST_String &labtype)
float time(const EST_Item &item)
Definition: EST_item_aux.cc:82
EST_TList< EST_Relation > EST_RelationList
float start(EST_Item *n)
EST_write_status save_RelationList(const EST_String &filename, const EST_RelationList &plist)
int relation_divide(EST_RelationList &mlf, EST_Relation &lab, EST_Relation &keylab, EST_String ext)
void track_to_label(const EST_Track &tr, EST_Relation &lab, float thresh=0.0)
EST_read_status
void build_RelationList_hash_table(EST_RelationList &mlf, EST_hashedRelationList &hash_table, const bool base)
hashed relation lists for super speed
void shift_label(EST_Relation &seg, float shift)
float duration(EST_Item *n)
EST_Litem * RelationList_ptr_extract(EST_RelationList &mlf, const EST_String &filename, bool base)
EST_read_status load_RelationList(const EST_String &filename, EST_RelationList &plist)
Definition: relation_io.cc:582
void label_map(EST_Relation &seg, EST_Option &map)
void RelationList_select(EST_RelationList &mlf, EST_StrList filenames, bool exact_match)