00001 00021 /* 00022 * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University 00023 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00024 * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology 00025 * All rights reserved 00026 */ 00027 00028 #include <sent/stddefs.h> 00029 #include <sent/htk_hmm.h> 00030 00031 extern char *rdhmmdef_token; 00032 00038 static void 00039 regtree_read(FILE *fp) 00040 { 00041 int num; 00042 00043 read_token(fp); 00044 NoTokErr("missing REGTREE terminal node num"); 00045 num = atoi(rdhmmdef_token); 00046 read_token(fp); 00047 for(;;) { 00048 if (currentis("NODE")) { /* skip 3 arguments */ 00049 read_token(fp); 00050 read_token(fp); 00051 read_token(fp); 00052 read_token(fp); 00053 } else if (currentis("TNODE")) { /* skip 2 argument */ 00054 read_token(fp); 00055 read_token(fp); 00056 read_token(fp); 00057 } else { 00058 break; 00059 } 00060 } 00061 } 00062 00070 void 00071 def_regtree_macro(char *name, FILE *fp, HTK_HMM_INFO *hmm) 00072 { 00073 if (currentis("~r")) { /* macro reference */ 00074 /* ignore silently */ 00075 } else if (currentis("REGTREE")) { /* definition */ 00076 /* do not define actually, just read forward till next macro */ 00077 regtree_read(fp); 00078 } else { 00079 rderr("no regtree data\n"); 00080 } 00081 return; 00082 }