亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hlabel.c

?? 隱馬爾科夫模型工具箱
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* ----------------------------------------------------------- *//*                                                             *//*                          ___                                *//*                       |_| | |_/   SPEECH                    *//*                       | | | | \   RECOGNITION               *//*                       =========   SOFTWARE                  */ /*                                                             *//*                                                             *//* ----------------------------------------------------------- *//*         Copyright: Microsoft Corporation                    *//*          1995-2000 Redmond, Washington USA                  *//*                    http://www.microsoft.com                 *//*                                                             *//*   Use of this software is governed by a License Agreement   *//*    ** See the file License for the Conditions of Use  **    *//*    **     This banner notice must not be removed      **    *//*                                                             *//* ----------------------------------------------------------- *//*         File: HLabel.c:   Speech Label File Input           *//* ----------------------------------------------------------- */char *hlabel_version = "!HVER!HLabel:   3.2 [CUED 09/12/02]";char *hlabel_vc_id = "$Id: HLabel.c,v 1.10 2002/12/19 16:37:11 ge204 Exp $";#include "HShell.h"#include "HMem.h"#include "HMath.h"#include "HWave.h"#include "HLabel.h"/* ----------------------------- Trace Flags ------------------------- */static int trace = 0;#define T_MLF     0001     /* Top Level MLF tracing */#define T_MHASH   0002     /* MLF Hashing */#define T_MAT     0004     /* MLF Pattern Matching */#define T_SUBD    0010     /* MLF Subdir search */#define T_HTKL    0020     /* HTK Lab file loading */#define T_HASH    0040     /* GetLabId Hashing */#define T_SAV     0100     /* Label file saving *//* -------  Input file formats supported by this module ---------------       TIMIT - text files with each label on a line in the form                  start-sample end-sample  label                 (eg 456 7899 sh).                     SCRIBE - SAM format basically a sequence of tagged lines of              form                       <header stuff>                   LBD:                   LBB:  st, ,en, label                   LBB:  st, ,en, label                       ....                   ELF:                         HTK   - a HTK transcription consists of one or more label lists              where each label list is separated by 3 / characters                 <transcription> = <label list> {"///" <label list>}              each label list is a sequence of lines of text, each defining              a labelled segment of speech                 <label list> = <labelseg> { <labelseg> }              each label seg consists of optional start and end times in              units of 100ns followed by one or more label names followed          by an optional score          <label> = [<start> <end>] < <name> [<score>] > [";" <comment>]              The start and end times are written as ints externally but              are stored as doubles, the score can be              int or float.  The name must begin with a non-digit              character other than the level separator.      ESPS  - waves label files. Text files with each label on a line               in the form                 time color-code label   (eg 0.138375 121 h#)              see the ESPS waves manual pages for details*//* ----------------- Master Label File Data Structures ---------An MLF is a file containing a sequence of patterns, each patterneither points to a subdirectory to search for a label file orhas a definition immediately following it (terminated by a periodon a single line.  The file must start with the MLF id.   #!MLF!#"pattern1" -> "subdir1""pattern2" => "subdir2""pattern3"0   100 sil101 205 bah206 300 sil."pattern4"etc   where -> denotes a simple search ie the name of the file matchingpattern1 must be in subdir1; => denotes a full search so that somepart of the file's path matching pattern2 must be in subdir2*/static ConfParam *cParm[MAXGLOBS];        /* config parameters */static int numParm = 0;static Boolean stripTriPhones = FALSE;   /* Enable triPhone stripping */static int transLev = 0;           /* if >0 filter all but specified level */static int transAlt = 0;           /* if >0 filter all but specified alt */static Boolean compatMode = FALSE;  /* Allow spaces around . or /// */static char labelQuote = 0;        /* How do we quote label names *//* --------------- Global MLF Data Structures  --------- */#define MLFCHUNKSIZE 500#define MAXMLFS 200static int      numMLFs = 0;     /* number of MLF files opened */static FILE   * mlfile[MAXMLFS]; /* array [0..numMLFs-1] of MLF file */static int      mlfUsed = 0;     /* number of entries in mlfTab */static MLFEntry *mlfHead = NULL; /* head of linked list of MLFEntry */static MLFEntry *mlfTail = NULL; /* tail of linked list of MLFEntry */static MemHeap mlfHeap;          /* memory heap for MLF stuff */typedef struct {   FILE *file;   LabId name;} OutMLFEntry;static FILE *outMLF = NULL;                 /* output MLF file, if any */ static int numOutMLF = 0;                   /* number of output MLFs */ static OutMLFEntry outMLFSet[MAXMLFS];      /* array of output MLFs *//* ---------------- Label Name Hashing ----------------- */#define HASHSIZE 5701                /* size of hash table */static NameCell *hashtab[HASHSIZE];  /* the actual table */static MemHeap namecellHeap;         /* heap for name cells */static long numAccesses = 0;static long numTests = 0;/* Hash: return a hash value for given label name */static unsigned Hash(char *name){   unsigned hashval;   for (hashval=0; *name != '\0'; name++)      hashval = *name + 31*hashval;   return hashval%HASHSIZE;}/* NewCell: return a pointer to a new NameCell */static NameCell *NewCell(char *name){   char *s;   NameCell *p;   int len;   len = strlen(name);   s = (char *)New(&namecellHeap,len+1);   strcpy(s,name);   p = (NameCell *) New(&namecellHeap,sizeof(NameCell));   p->name = s; p->next = NULL; p->aux = NULL;   return p;}/* EXPORT->InitLabel: initialise module */void InitLabel(void){   int i;   Boolean b;   char str[MAXSTRLEN];   Register(hlabel_version,hlabel_vc_id);   CreateHeap(&namecellHeap,"namecellHeap",MSTAK,1,0.5,5000,20000);   for (i=0;i<HASHSIZE;i++)      hashtab[i] = NULL;   CreateHeap(&mlfHeap,"mlfHeap",MSTAK,1,0.5,10000,50000);   numParm = GetConfig("HLABEL", TRUE, cParm, MAXGLOBS);   if (numParm>0){      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;      if (GetConfBool(cParm,numParm,"STRIPTRIPHONES",&b))          stripTriPhones = b;      if (GetConfBool(cParm,numParm,"V1COMPAT",&b))  compatMode = b;      if (GetConfStr(cParm,numParm,"LABELSQUOTE",str))         labelQuote=str[0];      if (GetConfInt(cParm,numParm,"TRANSALT",&i)) transAlt = i;      if (GetConfInt(cParm,numParm,"TRANSLEV",&i)) transLev = i;   }}/* EXPORT->GetLabId: return id of given name */LabId GetLabId(char *name, Boolean insert){   int h;   NameCell *p;   ++numAccesses; ++numTests;   if ((trace&T_HASH) && numAccesses%100 == 0)       PrintNameTabStats();   h = Hash(name); p = hashtab[h];   if (p==NULL) {  /* special case - this slot empty */      if (insert)         p=hashtab[h]=NewCell(name);      return p;   }   do{             /* general case - look for name */      if (strcmp(name,p->name) == 0)         return p; /* found it */      ++numTests;      p = p->next;   } while (p != NULL);   if (insert){    /* name not stored */      p = NewCell(name);      p->next = hashtab[h];      hashtab[h] = p;    }   return p;}/* EXPORT->PrintNameTabStats: print out statistics on hash table usage */void PrintNameTabStats(void){   printf("Name Table Statistics:\n");   printf("Total Accesses: %ld\n", numAccesses);   printf("Ave Search Len: %f\n",(float)numTests/(float)numAccesses);    PrintHeapStats(&namecellHeap);   printf("\n"); fflush(stdout);}/* EXPORT->ReadLabel: into buf from file f and return TRUE if ok */Boolean ReadLabel(FILE *f, char *buf){   int c;      c = fgetc(f);   while (isspace(c)) c = fgetc(f);   if (c==EOF || !isgraph(c)) return FALSE;   do {      *buf++ = c; c = fgetc(f);   } while ( !isspace(c) && c != EOF);   if (c != EOF) ungetc(c,f);   *buf = '\0';   return TRUE;}/* -------------------- Label List Handling -------------------- *//* EXPORT->CreateTranscription: create empty transcription */Transcription *CreateTranscription(MemHeap *x){   Transcription *t;      t = (Transcription *)New(x,sizeof(Transcription));   t->head = t->tail = NULL;   t->numLists = 0;   return t;}/* EXPORT->CopyTranscription: create copy of given transcription */Transcription *CopyTranscription(MemHeap *x, Transcription *t){   Transcription *newt;   LabList *ll,*newll;      newt = CreateTranscription(x);   ll = t->head;   for (ll = t->head; ll != NULL; ll=ll->next){      newll = CopyLabelList(x,ll);      AddLabelList(newll,newt);   }   return newt;  }/* EXPORT->CreateLabelList: create a new label list with sentinels */LabList* CreateLabelList(MemHeap *x, int maxAuxLab){   LLink st,en;   LabList *ll;      ll = (LabList *)New(x,sizeof(LabList));   st = (LLink)New(x,sizeof(Label));   en = (LLink)New(x,sizeof(Label));   st->labid = en->labid = NULL;    st->pred = NULL; st->succ = en;   en->succ = NULL; en->pred = st;   ll->head = st; ll->tail = en; ll->next = NULL;   ll->maxAuxLab = maxAuxLab;   return ll;}/* EXPORT->AddLabelList: Add given label list to transcription t */void AddLabelList(LabList *ll, Transcription *t){   if (ll==NULL) return;   ++t->numLists;   if (t->tail==NULL)      t->head = t->tail = ll;   else {      t->tail->next = ll; t->tail = ll;   }}/* EXPORT->GetLabelList: get n'th label list (n=1,2,...) */LabList* GetLabelList(Transcription *t, int n){   LabList* q;   int i;      if (n>t->numLists)      HError(6570,"GetLabelList: n[%d] > numLists[%d]",n,t->numLists);   q = t->head;   for (i=1; i<n; i++) q = q->next;   return q;}/* EXPORT->CopyLabelList: return a copy of given label list */LabList* CopyLabelList(MemHeap *x, LabList* ll){   LabList *newll;   LLink p,q;      newll = CreateLabelList(x,ll->maxAuxLab);   for (q=ll->head->succ; q->succ != NULL; q = q->succ){      p = AddLabel(x,newll,q->labid,q->start,q->end,q->score);      if (ll->maxAuxLab > 0)         AddAuxLab(p,ll->maxAuxLab,q->auxLab,q->auxScore);   }   return newll;}/* EXPORT->CreateLabel: create a label with maxAux aux slots */LLink CreateLabel(MemHeap *x, int maxAux){   LLink p;   int i;   LabId *id;   float *s;      p = (LLink)New(x,sizeof(Label));   p->labid = NULL; p->score = 0.0;    p->auxLab = NULL; p->auxScore = NULL;   p->start = p->end = 0;   p->succ = p->pred = NULL;   if (maxAux > 0) {      id = (LabId *)New(x,sizeof(LabId)*maxAux);      s = (float *)New(x,sizeof(float)*maxAux);      p->auxLab = id - 1; p->auxScore = s - 1;      for (i=1; i<=maxAux; i++){         p->auxLab[i] = NULL;         p->auxScore[i] = 0.0;      }     }   return p;}/* EXPORT->AddLabel: append given label info to given label list */LLink AddLabel(MemHeap *x, LabList *ll, LabId id,               HTime st, HTime en, float score){   LLink p,q,newLL;      p = ll->tail->pred; q = ll->tail;   newLL = CreateLabel(x,ll->maxAuxLab);   newLL->labid = id; newLL->score = score; newLL->start = st; newLL->end = en;   q->pred = newLL; newLL->succ = q;   p->succ = newLL; newLL->pred = p;   return newLL;}/* EXPORT->AddAuxLab: Store n auxiliary label/score in lab */void AddAuxLab(LLink lab, int n, LabId *auxLab, float *auxScore){   int i;      for (i=1; i<=n; i++){      lab->auxLab[i] = auxLab[i];      lab->auxScore[i] = auxScore[i];   }}/* EXPORT->DeleteLabel: unlink given label from a label list */void DeleteLabel(LLink item){   LLink p,q;      if (item->pred == NULL || item->succ == NULL)      HError(6571,"DeleteLabel: attempt to delete sentinel");   p = item->pred; q = item->succ;   q->pred = p; p->succ = q;}/* EXPORT->NumCases: find num cases of primary label in label list */int NumCases(LabList *ll, LabId id){   int n = 0;   LLink p;      for (p=ll->head->succ; p->succ!=NULL; p=p->succ)       if (p->labid == id) ++n;   return n;}/* EXPORT->GetCase: find nth occ of primary label in label list */LLink GetCase(LabList *ll, LabId id, int n){   LLink p;   int k=0;      for (p=ll->head->succ; p->succ!=NULL; p=p->succ) {      if (p->labid == id)          if (++k==n) return p;   }   HError(6571,"GetCase: %d case of %s nonexistent",n,id->name);   return NULL;}/* EXPORT->NumAuxCases: find num cases of aux label i in label list */int NumAuxCases(LabList *ll, LabId id, int i){   int n = 0;   LLink p;      if (ll->maxAuxLab < i)      HError(6570,"NumAuxCases: aux idx %d > max[%d]",i,ll->maxAuxLab);   for (p=ll->head->succ; p->succ!=NULL; p=p->succ)       if ((i==0) ? (p->labid==id) : (p->auxLab[i]==id))  ++n;   return n;}/* EXPORT->GetAuxCase: find nth occ of aux label i in label list */LLink GetAuxCase(LabList *ll, LabId id, int n, int i){   LLink p;   int k=0;      if (ll->maxAuxLab < i)      HError(6570,"GetAuxCase: aux idx %d > max[%d]",i,ll->maxAuxLab);   for (p=ll->head->succ; p->succ!=NULL; p=p->succ) {      if ((i==0) ? (p->labid==id) : (p->auxLab[i]==id))         if (++k==n) return p;   }   HError(6571,"GetAuxCase: %d case of %s nonexistent",n,id->name);   return NULL;}/* EXPORT->GetLabN: return n'th primary label */LLink GetLabN(LabList *ll, int n){   int count=0;   LLink p;   for (p=ll->head->succ; p->succ!= NULL; p=p->succ)       if (++count==n) return p;   HError(6571,"GetLabN: %d'th label nonexistent",n);   return NULL;}/* EXPORT->GetAuxLabN: return n'th aux i label */LLink GetAuxLabN(LabList *ll, int n, int i){   int count=0;   LLink p;   if (ll->maxAuxLab < i)      HError(6570,"GetAuxLabN: aux idx %d > max[%d]",i,ll->maxAuxLab);   for (p=ll->head->succ; p->succ!= NULL; p=p->succ)       if (i==0 || p->auxLab[i]!=NULL)               if (++count==n) return p;   HError(6571,"GetAuxLabN: %d'th aux[%d] label nonexistent",n,i);   return NULL;}/* EXPORT->CountLabs: count num primary labels in lab list */int CountLabs(LabList *ll){   int count = 0;   LLink p;   if (ll!=NULL)      for (p=ll->head->succ; p->succ!= NULL; p=p->succ)          ++count;   return(count);}/* EXPORT->CountAuxLabs: count num aux i labels in lab list */int CountAuxLabs(LabList *ll, int i){   int count = 0;   LLink p;   if (ll!=NULL)      for (p=ll->head->succ; p->succ != NULL; p=p->succ)         if (i==0 || p->auxLab[i]!=NULL)            ++count;   return(count);}/* EXPORT->AuxLabEndTime: return the end time for the i'th aux lab */HTime AuxLabEndTime(LLink p, int i){   LLink q;      q = p->succ;   while (i!=0 && q->succ != NULL && q->auxLab[i]==NULL){      p = q; q = q->succ;   }   return p->end;}/* PrintLabel: print the given label on one line */static void PrintLabel(LLink p, int maxAux){   int n;   LabId id;      printf("%8.0f%8.0f",p->start,p->end);   printf(" %8s %5f",p->labid->name,p->score);   for (n=1; n<=maxAux; n++){      id = p->auxLab[n];      printf(" %8s %5f",(id!=NULL)?id->name:"<null>",p->auxScore[n]);   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一区二区三区在线| 91免费观看视频在线| 樱桃视频在线观看一区| 欧美国产激情一区二区三区蜜月| 91精品国产黑色紧身裤美女| 在线观看不卡一区| 91福利社在线观看| 欧美午夜精品一区| 欧美午夜电影一区| 欧美三级视频在线播放| 欧美挠脚心视频网站| 制服丝袜一区二区三区| 欧美一级免费观看| 精品国产自在久精品国产| 欧美va亚洲va香蕉在线| 精品成人一区二区三区| 国产亚洲精品超碰| 国产精品天美传媒沈樵| 亚洲色图欧美激情| 亚洲第一会所有码转帖| 美女视频黄免费的久久| 国产精品香蕉一区二区三区| 成人性视频网站| 色综合夜色一区| 欧美蜜桃一区二区三区| 日韩片之四级片| 国产日产欧美精品一区二区三区| 亚洲欧美综合网| 亚洲午夜一区二区| 久久99热99| 91麻豆国产精品久久| 欧美性色aⅴ视频一区日韩精品| 欧美日韩精品电影| 久久久不卡网国产精品二区| 18成人在线视频| 日韩高清一区二区| av在线不卡免费看| 欧美一区午夜视频在线观看| 久久蜜桃香蕉精品一区二区三区| 18涩涩午夜精品.www| 日本美女视频一区二区| 不卡一区中文字幕| 日韩一区二区三区电影在线观看| 国产三级欧美三级| 日本三级亚洲精品| voyeur盗摄精品| 欧美一区二区三区人| 专区另类欧美日韩| 国产一区999| 欧美日韩mp4| 国产精品初高中害羞小美女文| 污片在线观看一区二区| 成人18视频在线播放| 日韩欧美一区二区免费| 亚洲激情自拍偷拍| av一本久道久久综合久久鬼色| 91精品国产高清一区二区三区蜜臀| 国产精品国产精品国产专区不蜜| 久久精品国产99国产精品| 欧美午夜精品一区| 一片黄亚洲嫩模| 成人看片黄a免费看在线| 日韩亚洲欧美一区二区三区| 亚洲一区二区三区四区五区中文| 成人免费av在线| 中文字幕免费一区| 尤物av一区二区| 国产亚洲女人久久久久毛片| 日韩av电影免费观看高清完整版在线观看| 波多野结衣中文一区| 久久久国产精品麻豆| 韩国三级在线一区| 日韩一区二区三区高清免费看看 | 亚洲黄色小说网站| 成人高清免费观看| 国产日韩高清在线| 国产成人亚洲综合a∨婷婷 | 成人小视频在线观看| 精品免费一区二区三区| 蜜桃精品在线观看| 欧美成人精品1314www| 麻豆成人av在线| 欧美大黄免费观看| 蜜臀国产一区二区三区在线播放| 555www色欧美视频| 久久精品国产精品青草| 久久综合九色综合97婷婷女人| 国产一区二区三区香蕉| 久久精品人人做人人综合| 国产乱码精品1区2区3区| 国产午夜精品福利| 91啦中文在线观看| 亚洲综合色成人| 欧美久久久久中文字幕| 韩国成人在线视频| 国产精品美女久久久久高潮| 91看片淫黄大片一级在线观看| 亚洲欧美区自拍先锋| 欧美日韩在线三区| 麻豆精品新av中文字幕| 国产欧美一区二区三区在线看蜜臀 | 成人av集中营| 夜夜精品浪潮av一区二区三区| 欧美日韩亚州综合| 国产美女久久久久| 亚洲黄色在线视频| 精品国产乱码91久久久久久网站| 成人国产精品免费观看动漫| 亚洲在线免费播放| 精品国产乱码久久久久久影片| 成人看片黄a免费看在线| 亚洲成人在线网站| 日本一区二区三区四区在线视频| 一本久久精品一区二区| 美女视频黄频大全不卡视频在线播放| 久久久www成人免费无遮挡大片 | 亚洲综合色婷婷| 337p日本欧洲亚洲大胆色噜噜| 91在线精品秘密一区二区| 奇米色一区二区| 自拍偷拍欧美激情| 久久久亚洲欧洲日产国码αv| 91国偷自产一区二区三区观看| 蜜臂av日日欢夜夜爽一区| 最新日韩av在线| 日韩精品中文字幕一区| 91久久精品日日躁夜夜躁欧美| 激情图片小说一区| 五月激情六月综合| 亚洲女人****多毛耸耸8| 久久亚洲影视婷婷| 911精品国产一区二区在线| av激情成人网| 国产美女在线精品| 奇米在线7777在线精品| 亚洲 欧美综合在线网络| 亚洲男人天堂av| 国产亚洲短视频| 欧美电视剧在线看免费| 日韩一区二区视频| 91麻豆精品国产自产在线| 在线免费观看成人短视频| www.亚洲色图.com| 国产精品一区二区久久不卡| 美美哒免费高清在线观看视频一区二区 | 91精品久久久久久蜜臀| 色综合亚洲欧洲| 99re免费视频精品全部| av一本久道久久综合久久鬼色| 国产91精品入口| 国产精品亚洲人在线观看| 国产一区二区三区蝌蚪| 国产精品资源站在线| 久久99国产精品尤物| 久久精品国产一区二区三| 美女高潮久久久| 国产一区中文字幕| 国产精品自拍毛片| 懂色av中文字幕一区二区三区 | 不卡视频免费播放| 国产二区国产一区在线观看| 国模一区二区三区白浆 | 欧美国产禁国产网站cc| 国产精品欧美久久久久无广告| 久久久久国产一区二区三区四区| 国产婷婷色一区二区三区| 久久久综合九色合综国产精品| 久久久精品tv| 亚洲免费在线电影| 亚洲永久免费av| 日产国产高清一区二区三区| 日韩va欧美va亚洲va久久| 国产在线麻豆精品观看| 国产福利视频一区二区三区| av亚洲精华国产精华精华| 欧美在线观看视频一区二区三区| 欧美日韩二区三区| 日韩欧美在线1卡| 亚洲国产成人在线| 一区二区日韩电影| 久久精品久久综合| gogo大胆日本视频一区| 色婷婷亚洲精品| 91精品国产综合久久小美女| 337p粉嫩大胆噜噜噜噜噜91av| 国产精品乱人伦中文| 亚洲一区二区视频在线观看| 久久不见久久见中文字幕免费| 成人污视频在线观看| 欧洲一区二区三区在线| 日韩精品中午字幕| 亚洲视频在线观看一区| 免费不卡在线视频| 成年人网站91| 欧美一区二区免费观在线| 国产精品色噜噜| 青青草原综合久久大伊人精品优势 | 亚洲国产裸拍裸体视频在线观看乱了| 久久99精品国产91久久来源| 色呦呦国产精品|