⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read_binhmmlist.c

📁 julius version 4.12.about sound recognition.
💻 C
字号:
/** * @file   read_rdhmmlist.c *  * <JA> * @brief  HMMListファイルを粕み哈む∈バイナリ惹∷ * * HMMList ファイルは·辑今惧の不燎山淡∈トライフォン山淡∷から * 悸狠に年盗されている %HMM へのマッピングを乖なうファイルですˉ *  * HMMListファイルでは·判眷しうる不燎について·滦炳する * HMM 年盗の叹涟を淡揭しますˉ办乖に1つづつ·妈1カラムに不燎叹· * スペ〖スで惰磊って妈2カラムに年盗されている悸狠の %HMM 叹を回年しますˉ * 妈1カラムと妈2カラムが链く票じ眷圭·すなわちその不燎叹のモデルが木儡 * %HMM として年盗されている眷圭は·妈2カラムは臼维することができますˉ * * トライフォン蝗脱箕は·HMMListファイルで判眷しうる链てのトライフォンに * ついて淡揭する涩妥がある爬に庙罢して布さいˉもし涂えられた千急辑今 * 惧で判眷しうるトライフォンがHMMListに淡揭されていない眷圭· * エラ〖となりますˉ * </JA> *  * <EN> * @brief  Read in HMMList file from binary format * * HMMList file specifies how the phones as described in word dictionary, * or their context-dependent form, should be mapped to actual defined %HMM. * * In HMMList file, the possible phone names and their corresponding %HMM * name should be specified one per line.  The phone name should be put on * the first column, and its corresponding %HMM name in the HTK %HMM definition * file should be defined on the second column.  If the two strings are * the same, which occurs when a %HMM of the phone name is directly defined, * the second column can be omitted. * * When using a triphone model, ALL the possible triphones that can appear * on the given word dictionary should be specified in the HMMList file. * If some possible triphone are not specified in the HMMList, Julius * produces error. * </EN> *  * @author Akinobu LEE * @date   Wed Feb 16 04:04:23 2005 * * $Revision: 1.1 $ *  *//* * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology * All rights reserved */#include <sent/stddefs.h>#include <sent/htk_hmm.h>#include <sent/ptree.h>static booleanload_hmmlist_callback(void **data_p, void *data, FILE *fp){  HTK_HMM_INFO *hmminfo = data;  HMM_Logical *new;  int len;  char buf[MAX_HMMNAME_LEN];  HTK_HMM_Data *d;  new = (HMM_Logical *)mybmalloc2(sizeof(HMM_Logical), &(hmminfo->lroot));  if (myfread(&(new->is_pseudo), sizeof(boolean), 1, fp) < 1) return FALSE;  if (myfread(&len, sizeof(int), 1, fp) < 1) return FALSE;  new->name = (char *)mybmalloc2(len, &(hmminfo->lroot));  if (myfread(new->name, len, 1, fp) < 1) return FALSE;  if (myfread(&len, sizeof(int), 1, fp) < 1) return FALSE;  if (myfread(buf, len, 1, fp) < 1) return FALSE;  if (new->is_pseudo) {    jlog("Error: sorry, pseudo logical phone saving not implemented yet\n");    return FALSE;  } else {    d = htk_hmmdata_lookup_physical(hmminfo, buf);    if (d == NULL) {      jlog("Error: load_hmmlist_callback: no name \"%s\" in hmmdefs!\n", buf);      return FALSE;    }    new->body.defined = d;  }  new->next = hmminfo->lgstart;  hmminfo->lgstart = new;  *data_p = new;    return TRUE;}booleanload_hmmlist_bin(FILE *fp, HTK_HMM_INFO *hmminfo){  HMM_Logical *l;  int n;  if (aptree_read(fp, &(hmminfo->logical_root), &(hmminfo->lroot), hmminfo, load_hmmlist_callback) == FALSE) {    jlog("Error: load_hmmlist_bin: failed to read hmmlist from binary file\n");    return FALSE;  }  n = 0;  for(l=hmminfo->lgstart;l;l=l->next) n++;  hmminfo->totallogicalnum = n;  return TRUE;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -