Edinburgh Speech Tools  2.4-release
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
EST_relation_compare.h
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 /*-----------------------------------------------------------------------*/
36 /* Label Comparison Routines */
37 /* */
38 /*=======================================================================*/
39 
40 #ifndef __EST_RELATION_COMPARE_H__
41 #define __EST_RELATION_COMPARE_H__
42 
43 float label_distance1(EST_Item &ref, EST_Item &test);
44 EST_Item *nthpos(EST_Relation &a, int n);
45 void compare_labels(EST_Relation &reflab, EST_Relation &testlab);
46 void relation_match(EST_Relation &a, EST_Relation &b);
47 void function_match(EST_II_KVL &u, EST_Relation &a, EST_Relation &b);
48 void monotonic_match(EST_II_KVL &a, EST_II_KVL &b);
49 void show_links(EST_Relation &a, EST_Relation &b);
50 int close_enough(EST_Item &a, EST_Item &b);
51 int matrix_deletions(EST_FMatrix &m);
52 int matrix_insertions(EST_FMatrix &m);
53 void matrix_ceiling(EST_FMatrix &m, float max);
54 void minimise_matrix_by_row(EST_FMatrix &m);
55 void minimise_matrix_by_column(EST_FMatrix &m);
56 int lowest_pos(EST_FMatrix &m, int j);
57 float label_distance2(EST_Item &ref, EST_Item &test);
58 
59 
60 void print_results(EST_Relation &ref, EST_Relation &test, EST_FMatrix &m, int tot,
61  int del, int ins, int v);
62 void print_aligned_trans(EST_Relation &ref, EST_Relation &test, EST_FMatrix &m);
63 void pos_only(EST_Relation &a);
64 void print_s_trans(EST_Relation &a, int width=3);
65 int num_b_deletions(EST_FMatrix &m, int last, int current);
66 int num_b_insertions(EST_FMatrix &m, int last, int current);
67 int column_hit(EST_FMatrix &m, int c);
68 int row_hit(EST_FMatrix &m, int r);
69 void print_matrix_scores(EST_Relation &ref, EST_Relation &test, EST_FMatrix &a);
70 void print_i_d_scores(EST_FMatrix &m);
71 void test_labels(EST_Utterance &ref, EST_Utterance &test, EST_Option &op);
72 int commutate(EST_Item *a_ptr, EST_II_KVL &f1, EST_II_KVL &f2,
73  EST_II_KVL &lref, EST_II_KVL &ltest);
74 
75 void reassign_links(EST_Relation &a, EST_II_KVL &u, EST_String stream_type);
76 void reassign_links(EST_Relation &a, EST_Relation &b, EST_II_KVL &ua, EST_II_KVL &ub);
77 int compare_labels(EST_Utterance &ref, EST_Utterance &test, EST_String name,
78  EST_II_KVL &uref, EST_II_KVL &utest);
79 
80 int insdel(EST_II_KVL &a);
81 void error_location(EST_Relation &e, EST_FMatrix &m, int ref);
82 void multiple_matrix_compare(EST_TList<EST_Relation> &rmlf, EST_TList<EST_Relation>
83  &tmlf, EST_FMatrix &m, EST_String rpos, EST_String tpos, int
84  method, float t, int v);
85 
86 EST_FMatrix matrix_compare(EST_Relation &reflab, EST_Relation &testlab, int method,
87  float t, int v);
88 
89 void multiple_labels(EST_Relation &reflab);
90 void threshold_labels(EST_Relation &reflab, float t);
91 
92 #endif //__EST_RELATION_COMPARE_H__