亚洲欧美第一页_禁久久精品乱码_粉嫩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在线码无精品| 欧美精品 国产精品| 国产日韩影视精品| 香港成人在线视频| 色婷婷精品久久二区二区蜜臂av| 欧美一个色资源| 一区二区久久久久久| 国产高清在线精品| 久久综合色一综合色88| 亚洲在线中文字幕| 91论坛在线播放| 国产精品毛片大码女人| 国产一区二区精品久久91| 91麻豆精品国产91久久久更新时间| 亚洲日本一区二区| av网站免费线看精品| 欧美国产一区在线| 国产精品1024久久| 久久一日本道色综合| 老汉av免费一区二区三区| 在线电影一区二区三区| 亚洲高清免费视频| 欧美视频一区二区三区在线观看| 亚洲久草在线视频| 91黄视频在线| 伊人性伊人情综合网| 在线综合亚洲欧美在线视频| 亚洲柠檬福利资源导航| 91啪在线观看| 一区二区三区精密机械公司| 91首页免费视频| 中文字幕一区在线观看视频| 99久久国产综合精品色伊| 国产精品动漫网站| 91在线码无精品| 亚洲小说欧美激情另类| 欧美日韩精品一区二区三区蜜桃 | 欧美日韩高清一区| 亚洲成人在线免费| 欧美一区二区三区小说| 麻豆精品久久久| 久久精品视频在线免费观看| 成人福利在线看| 亚洲一二三四区不卡| 91精选在线观看| 国产露脸91国语对白| 中文字幕一区二区不卡| 精品视频色一区| 久久99热这里只有精品| 国产欧美一区二区三区沐欲| 91一区二区在线| 日本强好片久久久久久aaa| 精品成人一区二区| fc2成人免费人成在线观看播放| 亚洲色图清纯唯美| 欧美一二三在线| 成人av免费观看| 天天综合网 天天综合色| 国产人成一区二区三区影院| 色婷婷综合久久久久中文一区二区 | 精品成人在线观看| 99国产精品国产精品毛片| 亚洲成人一区在线| 国产亚洲欧美在线| 一本一道综合狠狠老| 久久成人免费电影| 亚洲一区欧美一区| 亚洲精品一线二线三线| 色哟哟国产精品| 国产乱对白刺激视频不卡| 亚洲一区二区在线观看视频 | 成人一区二区三区中文字幕| 亚洲女厕所小便bbb| 久久影音资源网| 欧美二区在线观看| jlzzjlzz国产精品久久| 蜜桃免费网站一区二区三区 | 国产亚洲一区二区三区| 欧美三级电影网| 成人h动漫精品| 韩国欧美国产1区| 午夜久久电影网| 亚洲三级在线免费| 久久精品在这里| 欧美www视频| 欧美三级电影精品| 色婷婷av一区二区三区之一色屋| 精品一区二区三区视频在线观看| 亚洲国产日韩一区二区| 国产精品久久久久久久久免费桃花| 日韩一级黄色片| 欧美日韩国产综合一区二区 | 精品久久人人做人人爱| 欧美日韩一区二区三区在线看| 91视频国产观看| 成人激情校园春色| 高清视频一区二区| 国产精品1区二区.| 国产精品资源网站| 国产一区二区伦理| 激情五月婷婷综合网| 麻豆国产欧美一区二区三区| 日韩电影免费一区| 免费视频最近日韩| 日本sm残虐另类| 亚洲成a人片综合在线| 亚洲一区二区欧美激情| 亚洲精品成人精品456| 亚洲人成在线观看一区二区| 18成人在线观看| 亚洲欧美电影一区二区| 亚洲视频网在线直播| 亚洲天堂精品视频| 亚洲激情成人在线| 亚洲国产成人高清精品| 日韩av成人高清| 美女视频黄频大全不卡视频在线播放| 日本中文一区二区三区| 人人精品人人爱| 国产一区二区三区日韩| 国产一区二区美女诱惑| 岛国av在线一区| 99国产欧美另类久久久精品| 色久综合一二码| 欧美丰满少妇xxxxx高潮对白| 9191精品国产综合久久久久久| 日韩欧美一级在线播放| 久久女同性恋中文字幕| 国产精品国产三级国产有无不卡 | 国产精品网站在线观看| 亚洲婷婷综合色高清在线| 亚洲一区二区欧美日韩| 青娱乐精品视频在线| 国产综合久久久久久久久久久久| 国产成人精品综合在线观看| 91片在线免费观看| 日韩一区二区三区三四区视频在线观看| 日韩欧美资源站| 国产精品久久久久久福利一牛影视 | 国产亚洲污的网站| 日韩伦理免费电影| 日韩精品成人一区二区三区 | 麻豆精品国产91久久久久久| 成人免费高清在线观看| 欧美日韩免费一区二区三区视频| 欧美成人伊人久久综合网| 国产精品亲子乱子伦xxxx裸| 亚洲一区二区三区在线| 国产裸体歌舞团一区二区| 日本丶国产丶欧美色综合| 日韩一区二区免费高清| 亚洲免费视频中文字幕| 麻豆高清免费国产一区| 91原创在线视频| 欧美大黄免费观看| 亚洲影院免费观看| 国产毛片精品一区| 在线成人av网站| 国产精品久久久久久久第一福利| 秋霞影院一区二区| 日本高清成人免费播放| 国产亚洲一区二区三区四区 | 色综合欧美在线视频区| 亚洲精品在线三区| 亚洲国产精品人人做人人爽| 成人精品gif动图一区| 日韩欧美国产麻豆| 亚洲综合999| 99re热视频精品| 久久精品一区蜜桃臀影院| 日本不卡1234视频| 欧美色综合网站| 亚洲人吸女人奶水| 国产在线一区二区| 欧美一激情一区二区三区| 一区二区三区日韩精品视频| 成人免费高清在线| 精品播放一区二区| 日韩av高清在线观看| 欧美日本在线一区| 一区二区高清免费观看影视大全 | 国产精品一二三四五| 日韩一区二区三区三四区视频在线观看| 艳妇臀荡乳欲伦亚洲一区| 成人精品在线视频观看| 亚洲精品一区二区三区福利| 亚洲v日本v欧美v久久精品| 色妞www精品视频| 中文字幕一区在线观看| 不卡一区二区三区四区| 久久久久久免费| 国产一区999| 久久夜色精品一区| 国产综合色产在线精品| 久久久久久久久伊人| 国产精品一二三区在线| 国产日韩影视精品| 成人免费看的视频|