1 /* --------------------------------------------------------------- */ 2 /* The HMM-Based Speech Synthesis System (HTS): version 1.1b */ 3 /* HTS Working Group */ 4 /* */ 5 /* Department of Computer Science */ 6 /* Nagoya Institute of Technology */ 7 /* and */ 8 /* Interdisciplinary Graduate School of Science and Engineering */ 9 /* Tokyo Institute of Technology */ 10 /* Copyright (c) 2001-2003 */ 11 /* All Rights Reserved. */ 12 /* */ 13 /* Permission is hereby granted, free of charge, to use and */ 14 /* distribute this software and its documentation without */ 15 /* restriction, including without limitation the rights to use, */ 16 /* copy, modify, merge, publish, distribute, sublicense, and/or */ 17 /* sell copies of this work, and to permit persons to whom this */ 18 /* work is furnished to do so, subject to the following conditions: */ 19 /* */ 20 /* 1. The code must retain the above copyright notice, this list */ 21 /* of conditions and the following disclaimer. */ 22 /* */ 23 /* 2. Any modifications must be clearly marked as such. */ 24 /* */ 25 /* NAGOYA INSTITUTE OF TECHNOLOGY, TOKYO INSITITUTE OF TECHNOLOGY, */ 26 /* HTS WORKING GROUP, AND THE CONTRIBUTORS TO THIS WORK DISCLAIM */ 27 /* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL */ 28 /* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ 29 /* SHALL NAGOYA INSTITUTE OF TECHNOLOGY, TOKYO INSITITUTE OF */ 30 /* TECHNOLOGY, HTS WORKING GROUP, NOR THE CONTRIBUTORS BE LIABLE */ 31 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY */ 32 /* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, */ 33 /* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS */ 34 /* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR */ 35 /* PERFORMANCE OF THIS SOFTWARE. */ 36 /* */ 37 /* --------------------------------------------------------------- */ 38 /* tree.h : decision tree definition */ 39 /* */ 40 /* 2003/06/11 by Heiga Zen */ 41 /* --------------------------------------------------------------- */ 42 43 typedef struct _Pattern{ /* pattern handler for question storage */ 44 char *pat; /* pattern */ 45 struct _Pattern *next; /* link to next pattern */ 46 } Pattern; 47 48 typedef struct _Question { /* question storage */ 49 char *qName; /* name of this question */ 50 Pattern *phead; /* link to head of pattern list */ 51 Pattern *ptail; /* link to tail of pattern list */ 52 struct _Question *next; /* link to next question */ 53 } Question; 54 55 typedef struct _Node { /* node of decision tree */ 56 int idx; /* index of this node */ 57 int pdf; /* index of pdf for this node ( leaf node only ) */ 58 struct _Node *yes; /* link to child node (yes) */ 59 struct _Node *no; /* link to child node (no) */ 60 Question *quest; /* question applied at this node */ 61 } Node; 62 63 typedef struct _Tree { 64 int state; /* state position of this tree */ 65 struct _Tree *next; /* link to next tree */ 66 Node *root; /* root node of this decision tree */ 67 } Tree; 68 69 typedef struct _TreeSet { 70 Question *qhead[3]; 71 Question *qtail[3]; 72 73 Tree *thead[3]; 74 Tree *ttail[3]; 75 76 FILE *fp[3]; 77 78 } TreeSet; 79 80 void LoadTreesFile (TreeSet *, Mtype); 81 int SearchTree (char *, Node *); 82 void InitTreeSet(TreeSet *); 83 void FreeTrees(TreeSet *ts, Mtype type); 84 85 /* -------------------- End of "tree.h" -------------------- */ 86 87