Edinburgh Speech Tools  2.1-release
EST_relation_compare.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 /*-----------------------------------------------------------------------*/
36 /* Label Comparison Routines */
37 /* */
38 /*=======================================================================*/
39 
40 #ifndef __EST_RELATION_COMPARE_H__
41 #define __EST_RELATION_COMPARE_H__
42 
43 #include <cstdlib>
44 #include "EST_Item.h"
45 #include "EST_Relation.h"
46 #include "EST_String.h"
47 #include "EST_Option.h"
48 #include "EST_Utterance.h"
49 
50 float label_distance1(EST_Item &ref, EST_Item &test);
51 EST_Item *nthpos(EST_Relation &a, int n);
52 void compare_labels(EST_Relation &reflab, EST_Relation &testlab);
57 int close_enough(EST_Item &a, EST_Item &b);
60 void matrix_ceiling(EST_FMatrix &m, float max);
64 float label_distance2(EST_Item &ref, EST_Item &test);
65 
66 
67 void print_results(EST_Relation &ref, EST_Relation &test, EST_FMatrix &m, int tot,
68  int del, int ins, int v);
70 void pos_only(EST_Relation &a);
71 void print_s_trans(EST_Relation &a, int width=3);
72 int num_b_deletions(EST_FMatrix &m, int last, int current);
73 int num_b_insertions(EST_FMatrix &m, int last, int current);
78 void test_labels(EST_Utterance &ref, EST_Utterance &test, EST_Option &op);
79 int commutate(EST_Item *a_ptr, EST_II_KVL &f1, EST_II_KVL &f2,
80  EST_II_KVL &lref, EST_II_KVL &ltest);
81 
82 void reassign_links(EST_Relation &a, EST_II_KVL &u, EST_String stream_type);
85  EST_II_KVL &uref, EST_II_KVL &utest);
86 
87 int insdel(EST_II_KVL &a);
88 void error_location(EST_Relation &e, EST_FMatrix &m, int ref);
90  &tmlf, EST_FMatrix &m, EST_String rpos, EST_String tpos, int
91  method, float t, int v);
92 
93 EST_FMatrix matrix_compare(EST_Relation &reflab, EST_Relation &testlab, int method,
94  float t, int v);
95 
96 void multiple_labels(EST_Relation &reflab);
97 void threshold_labels(EST_Relation &reflab, float t);
98 
99 #endif //__EST_RELATION_COMPARE_H__
int insdel(EST_II_KVL &a)
void error_location(EST_Relation &e, EST_FMatrix &m, int ref)
int num_b_insertions(EST_FMatrix &m, int last, int current)
void compare_labels(EST_Relation &reflab, EST_Relation &testlab)
float label_distance1(EST_Item &ref, EST_Item &test)
EST_Item * nthpos(EST_Relation &a, int n)
ssize_t column_hit(EST_FMatrix &m, ssize_t c)
void relation_match(EST_Relation &a, EST_Relation &b)
int num_b_deletions(EST_FMatrix &m, int last, int current)
int commutate(EST_Item *a_ptr, EST_II_KVL &f1, EST_II_KVL &f2, EST_II_KVL &lref, EST_II_KVL &ltest)
void multiple_matrix_compare(EST_TList< EST_Relation > &rmlf, EST_TList< EST_Relation > &tmlf, EST_FMatrix &m, EST_String rpos, EST_String tpos, int method, float t, int v)
void threshold_labels(EST_Relation &reflab, float t)
void print_results(EST_Relation &ref, EST_Relation &test, EST_FMatrix &m, int tot, int del, int ins, int v)
int ssize_t
ssize_t lowest_pos(EST_FMatrix &m, ssize_t j)
void print_i_d_scores(EST_FMatrix &m)
float max(float a, float b)
Definition: EST_cluster.cc:143
ssize_t matrix_insertions(EST_FMatrix &m)
void multiple_labels(EST_Relation &reflab)
int close_enough(EST_Item &a, EST_Item &b)
EST_FMatrix matrix_compare(EST_Relation &reflab, EST_Relation &testlab, int method, float t, int v)
void test_labels(EST_Utterance &ref, EST_Utterance &test, EST_Option &op)
void monotonic_match(EST_II_KVL &a, EST_II_KVL &b)
ssize_t matrix_deletions(EST_FMatrix &m)
Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type ...
Definition: EST_TKVL.h:73
void minimise_matrix_by_row(EST_FMatrix &m)
void print_s_trans(EST_Relation &a, int width=3)
void matrix_ceiling(EST_FMatrix &m, float max)
void pos_only(EST_Relation &a)
float label_distance2(EST_Item &ref, EST_Item &test)
void function_match(EST_II_KVL &u, EST_Relation &a, EST_Relation &b)
void minimise_matrix_by_column(EST_FMatrix &m)
void show_links(EST_Relation &a, EST_Relation &b)
void print_matrix_scores(EST_Relation &ref, EST_Relation &test, EST_FMatrix &a)
ssize_t row_hit(EST_FMatrix &m, ssize_t r)
void print_aligned_trans(EST_Relation &ref, EST_Relation &test, EST_FMatrix &m)
void reassign_links(EST_Relation &a, EST_II_KVL &u, EST_String stream_type)