Edinburgh Speech Tools  2.1-release
wfst_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) 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 /* Author : Alan W Black */
34 /* Date : November 1997 */
35 /*-----------------------------------------------------------------------*/
36 /* */
37 /* Some internal classes for Weighted Finite State Transducers */
38 /* */
39 /*=======================================================================*/
40 #ifndef __WFST_AUX_H__
41 #define __WFST_AUX_H__
42 
43 #include "EST_TKVL.h"
44 #include "EST_types.h"
45 
46 // Used in minimization
47 
48 class wfst_marks {
49  private:
50  int p_x;
51  char **p_mark_table; // triangular matrix
52  char val(int p,int q)
53  { if (p < q) return p_mark_table[q][p];
54  else return p_mark_table[p][q]; }
55  void set_val(int p,int q,char e)
56  { if (p < q) p_mark_table[q][p] = e;
57  else p_mark_table[p][q] = e; }
58  public:
59  wfst_marks(int x);
60  ~wfst_marks();
61 
62  int distinguished(int p, int q) { return val(p,q) == 'd'; }
63  int undistinguished(int p, int q)
64  { return val(p,q) == 'u'; }
65  void distinguish(int p, int q) { set_val(p,q,'d'); }
66  void undistinguish(int p, int q) { set_val(p,q,'u'); }
67  void find_state_map(EST_IVector &state_map,int &num_new_states);
68 
69 };
70 
72 void mark_undistinguished(wfst_marks &marks,wfst_assumes &assumptions);
73 int equivalent_to(int y,int z,wfst_assumes &assumptions);
74 void add_assumption(int y,int z,wfst_assumes &assumptions);
75 
76 #endif
~wfst_marks()
Definition: wfst_aux.cc:62
int equivalent_to(int y, int z, wfst_assumes &assumptions)
Definition: wfst_aux.cc:131
void undistinguish(int p, int q)
Definition: wfst_aux.h:66
EST_TKVL< int, EST_IList > wfst_assumes
Definition: wfst_aux.h:71
void mark_undistinguished(wfst_marks &marks, wfst_assumes &assumptions)
Definition: wfst_aux.cc:161
int undistinguished(int p, int q)
Definition: wfst_aux.h:63
Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type ...
Definition: EST_TKVL.h:73
int distinguished(int p, int q)
Definition: wfst_aux.h:62
void distinguish(int p, int q)
Definition: wfst_aux.h:65
void add_assumption(int y, int z, wfst_assumes &assumptions)
Definition: wfst_aux.cc:95
void find_state_map(EST_IVector &state_map, int &num_new_states)
Definition: wfst_aux.cc:72
wfst_marks(int x)
Definition: wfst_aux.cc:45