Example #1
0
File: HLVRec.c Project: didw/HTS
/* EXPORT->InitLVRec: register module & set configuration parameters */
void InitLVRec(void)
{
   double f;
   int i;
   Boolean b;
   
   Register (hlvrec_version, hlvrec_vc_id);
   nParm = GetConfig("HLVREC", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
      if (GetConfFlt (cParm, nParm, "MAXLMLA", &f))
         maxLMLA = f;
      if (GetConfBool (cParm, nParm, "BUILDLATSENTEND",&b)) buildLatSE = b;
      if (GetConfBool (cParm, nParm, "FORCELATOUT",&b)) forceLatOut = b;
      if (GetConfInt (cParm, nParm,"GCFREQ", &i)) gcFreq = i;
      if (GetConfBool (cParm, nParm, "PDE",&b)) pde = b;
   }

#if 0
   printf ("sizeof(Token) = %d\n", sizeof (Token));
   printf ("sizeof(LexNodeInst) = %d\n", sizeof (LexNodeInst));
   printf ("sizeof(WordendHyp) = %d\n\n", sizeof (WordendHyp));
#endif

   CreateHeap (&recCHeap, "Decoder CHEAP", CHEAP, 1, 1.5, 10000, 100000);
}
Example #2
0
/* EXPORT->InitLabel: initialise module */
void InitLabel(void)
{
   int i;
   Boolean b;
   double d;
   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;
      if (GetConfFlt(cParm,numParm,"HTKLABELTIMESCALE",&d)) htkLabelTimeScale = d;
   }
}
Example #3
0
/* EXPORT->InitLVRec: register module & set configuration parameters */
void InitLVRec(void)
{
   double f;
   int i;
   Boolean b;
   
   Register (hlvrec_version, hlvrec_vc_id);
   nParm = GetConfig("HLVREC", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
      if (GetConfFlt (cParm, nParm, "MAXLMLA", &f))
         maxLMLA = f;
      if (GetConfBool (cParm, nParm, "BUILDLATSENTEND",&b)) buildLatSE = b;
      if (GetConfBool (cParm, nParm, "FORCELATOUT",&b)) forceLatOut = b;
      if (GetConfInt (cParm, nParm,"GCFREQ", &i)) gcFreq = i;
      if (GetConfBool (cParm, nParm, "PDE",&b)) pde = b;
      if (GetConfBool (cParm, nParm, "USEOLDPRUNE",&b)) useOldPrune = b;
      if (GetConfBool (cParm, nParm, "MERGETOKONLY",&b)) mergeTokOnly = b;
      if (GetConfFlt (cParm, nParm, "MAXLNBEAMFLR", &f)) maxLNBeamFlr = f;
      if (GetConfFlt (cParm, nParm, "DYNBEAMINC", &f)) dynBeamInc = f;

      if (useOldPrune) {
         mergeTokOnly = FALSE; maxLNBeamFlr = 0.0; dynBeamInc = 1.1;
      }
   }

#if 0
   printf ("sizeof(Token) = %d\n", sizeof (Token));
   printf ("sizeof(LexNodeInst) = %d\n", sizeof (LexNodeInst));
   printf ("sizeof(WordendHyp) = %d\n\n", sizeof (WordendHyp));
#endif

   CreateHeap (&recCHeap, "Decoder CHEAP", CHEAP, 1, 1.5, 10000, 100000);
}
Example #4
0
#include "LUtil.h"

#include "LModel.h"

#include "LPCalc.h"



#define T_TOP    0001       /* top level tracing */

#define T_FOF    0002       /* FoF table tracing */



/* -------------------------- Trace Flags ------------------------ */



static int trace = 0;



/* ---------------- Configuration Parameters --------------------- */



static ConfParam *cParm[MAXGLOBS];

static int nParm = 0;            /* total num params */


Example #5
0
// ARec constructor
ARec::ARec(const string & name, ABuffer *inb, ABuffer *outb,
           ARMan *armgr, int nnToks) : AComponent(name,(HasRealConsole()?2:ARECPRBUFSIZE))
{
   ConfParam *cParm[MAXGLOBS];       /* config parameters */
   int numParm;
   int i; double f;
   Boolean b;
   char buf[100];

   in = inb; out = outb; rmgr = armgr;
   strcpy(buf,name.c_str());
   for (i=0; i<int(strlen(buf)); i++) buf[i] = toupper(buf[i]);
   numParm = GetConfig(buf, TRUE, cParm, MAXGLOBS);
   trace=0;
   width = 400; height=120; showRD = FALSE;
   sampPeriod = 100000.0; stTime = 0.0;
   rdx0 = 420;  rdy0 =280;
   runmode = RunMode(CONTINUOUS_MODE+FLUSH_TOMARK+STOP_ATMARK+RESULT_ATEND);
   runstate = WAIT_STATE; laststate = RunState(-1);
   nToks = nnToks;
   wordPen = 0.0; lmScale = 1.0; ngScale=0.0; prScale = 1.0;
   genBeam = nBeam = 225.0; wordBeam = 200.0; maxActive = 0;
   grpName = "";  trbakFreq = 5; outseqnum = 0; inlevel = -1;
   trbakFrame = 0; trbakAc = 0.0; trbakCount = 0; trbakLastWidth=0;
   nBest=0;
   if (numParm>0){
      if (GetConfBool(cParm,numParm,"DISPSHOW",&b)) showRD = b;
      if (GetConfInt(cParm,numParm,"DISPXORIGIN",&i)) rdx0 = i;
      if (GetConfInt(cParm,numParm,"DISPYORIGIN",&i)) rdy0 = i;
      if (GetConfInt(cParm,numParm,"DISPWIDTH",&i)) width = i;
      if (GetConfInt(cParm,numParm,"DISPHEIGHT",&i)) height = i;
      if (GetConfInt(cParm,numParm,"RUNMODE",&i)) runmode = RunMode(i);
      if (GetConfInt(cParm,numParm,"NTOKS",&i)) nToks = i;
      if (GetConfFlt(cParm,numParm,"WORDPEN",&f)) wordPen = float(f);
      if (GetConfFlt(cParm,numParm,"LMSCALE",&f)) lmScale = float(f);
      if (GetConfFlt(cParm,numParm,"NGSCALE",&f)) ngScale = float(f);
      if (GetConfFlt(cParm,numParm,"PRSCALE",&f)) prScale = float(f);
      if (GetConfFlt(cParm,numParm,"GENBEAM",&f)) genBeam = float(f);
      if (GetConfFlt(cParm,numParm,"WORDBEAM",&f)) wordBeam = float(f);
      if (GetConfFlt(cParm,numParm,"NBEAM",&f)) nBeam = float(f);
      if (GetConfInt(cParm,numParm,"MAXBEAM",&i)) maxActive = i;
      if (GetConfStr(cParm,numParm,"GRPNAME",buf)) grpName=string(buf);
      if (GetConfInt(cParm,numParm,"TRBAKFREQ",&i)) trbakFreq = i;
      if (GetConfFlt(cParm,numParm,"TARGETRATE",&f)) sampPeriod = float(f);
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
      if (GetConfInt(cParm,numParm,"NBEST",&i)) nBest = i;
   }
   if (nBeam < genBeam) nBeam = genBeam;
   if ((runmode&RESULT_ASAP) || (runmode&RESULT_IMMED))
      runmode = RunMode(runmode|RESULT_ATEND);
   if(nBest>0){
      CreateHeap(&ansHeap,"Lattice heap",MSTAK,1,0.0,4000,4000);
      CreateHeap(&altHeap,"Lattice heap",MSTAK,1,0.0,4000,4000);
   }
}
Example #6
0
void SetConfParms(void)
{
   int s, i;
   char *c, buf[MAXSTRLEN], tmp[MAXSTRLEN];
   Boolean b;

   for (s = 1; s < SMAX; s++)
      winFn[s] = NULL;

   nParm = GetConfig("HMGENS", TRUE, cParm, MAXGLOBS);
   if (nParm > 0) {
      if (GetConfInt(cParm, nParm, "TRACE", &i))
         trace = i;
      if (GetConfBool(cParm, nParm, "SAVEBINARY", &b))
         inBinary = b;
      if (GetConfBool(cParm, nParm, "OUTPDF", &b))
         outPdf = b;
      if (GetConfInt(cParm, nParm, "PARMGENTYPE", &i))
         type = (ParmGenType) i;
      if (GetConfBool(cParm, nParm, "MODELALIGN", &b))
         modelAlign = b;
      if (GetConfBool(cParm, nParm, "STATEALIGN", &b))
         stateAlign = b;
      if (GetConfBool(cParm, nParm, "USEALIGN", &b))
         useAlign = b;
      if (GetConfBool(cParm, nParm, "USEHMMFB", &b))
         useHMMFB = b;
      if (GetConfStr(cParm, nParm, "INXFORMMASK", buf))
         xfInfo_hmm.inSpkrPat = xfInfo_dur.inSpkrPat = CopyString(&genStack, buf);
      if (GetConfStr(cParm, nParm, "PAXFORMMASK", buf))
         xfInfo_hmm.paSpkrPat = xfInfo_dur.paSpkrPat = CopyString(&genStack, buf);

      if (GetConfStr(cParm, nParm, "PDFSTRSIZE", buf))
         nPdfStr = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "PDFSTRORDER", buf))
         pdfStrOrder = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "PDFSTREXT", buf))
         pdfStrExt = ParseConfStrVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "WINEXT", buf))
         winExt = CopyString(&gstack, buf);
      if (GetConfStr(cParm, nParm, "WINDIR", buf))
         winDir = CopyString(&gstack, buf);
      if (GetConfStr(cParm, nParm, "WINFN", buf)) {
         for (s = 1, c = buf; s < SMAX && c != NULL; s++) {
            winFn[s] = ParseConfStrVec(&gstack, c, FALSE);
            for (i = 1; i <= winFn[s][0][0] + 2; i++)   /* "StrVec" + "n" + # of file names */
               c = ParseString(c, tmp);
            if (ParseString(c, tmp) == NULL)
               break;
         }
      }
   }
}
Example #7
0
#include "HAudio.h"

#include "HWave.h"

#include "HVQ.h"

#include "HParm.h"

#include "HLabel.h"

#include "HModel.h"
Example #8
0
/* EXPORT->InitMap: initialise configuration parameters */
void InitMap(void)
{
   int i;
   double f;

   Register(hmap_version,hmap_vc_id);
   nParm = GetConfig("HMAP", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
     if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
     if (GetConfInt(cParm,nParm,"MINEGS",&i)) minEgs = i;
     if (GetConfFlt(cParm,nParm,"MINOBS",&f)) minObs = f;
     if (GetConfFlt(cParm,nParm,"MINVAR",&f)) minVar = f;
     if (GetConfFlt(cParm,nParm,"MAPTAU",&f)) mapTau = f;
     if (GetConfFlt(cParm,nParm,"MIXWEIGHTFLOOR",&f)) mixWeightFloor = MINMIX*f;
   }
}
Example #9
0
/* EXPORT->InitExactMPE: initialise configuration parameters */ 
void InitExactMPE(void)
{
   int i;
   double f;
   Boolean b;

   Register(hexactmpe_version,hexactmpe_vc_id);
   nParm = GetConfig("HEXACTMPE", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"PHONEBEAM",&i)) PHONE_BEAM = i;
      if (GetConfFlt(cParm,nParm,"EXACTCORRPRUNE",&f)) EXACTCORR_PRUNE = f; /*default: log(0.0002) = -8.5 */
   }
   nParm = GetConfig("HFBLAT", TRUE, cParm, MAXGLOBS); 
   if (nParm>0){
      if (GetConfFlt(cParm,nParm,"LATPROBSCALE",&f))  latProbScale = f;/* repeat of config also used in HFBLat.c */
      if (GetConfFlt(cParm,nParm,"PHNINSPEN",&f))  phnInsPen = f;     /* repeat of config also used in HFBLat.c */
#ifdef SUPPORT_QUINPHONE
      if (GetConfBool(cParm,nParm,"QUINPHONE",&b)) Quinphone = b;  /* repeat of config also used in HFBLat.c */
#endif
      if (GetConfBool(cParm,nParm,"PHONEMEE",&b)) PhoneMEE=b;     /* repeat of config also used in HFBLat.c */
      if (GetConfBool(cParm,nParm,"MWE",&b)) if(b) PhoneMEE=FALSE; /* this config also used in HFBLat.c */
      if (GetConfFlt(cParm,nParm,"INSCORRECTNESS",&f)) InsCorrectness=-fabs(f); /* to make sure negative.*/
      if (GetConfFlt(cParm,nParm,"SUBCORRECTNESS",&f)) SubCorrectness=-fabs(f); /* to make sure negative.*/
   }

}
Example #10
0
/* SetConfParms: set conf parms relevant to HInit  */
void SetConfParms(void)
{
   int i;

   nParm = GetConfig("HINIT", TRUE, cParm, MAXGLOBS);
   if (nParm>0) {
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
   }
}
Example #11
0
/* EXPORT->InitDict: register module & set configuration parameters */
void InitDict(void)
{
   int i;

   Register(hdict_version,hdict_vc_id);
   nParm = GetConfig("HDICT", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
   }
}
Example #12
0
void InitGraf(void)
{
   int i;
   
   Register(hgraf_version,hgraf_vc_id);
   nParm = GetConfig("HGRAF", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
   }
}
Example #13
0
/* EXPORT->InitVQ: initialise the VQ module */
void InitVQ(void)
{
   int i;

   Register(hvq_version);
   numParm = GetConfig("HVQ", TRUE, cParm, MAXGLOBS);
   if (numParm>0){
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
   }
   CreateHeap(&vqHeap,"vqHeap",MSTAK,1,0.2,2000,10000);
}
Example #14
0
/* EXPORT->InitSigP: initialise the SigP module */
void InitSigP(void)
{
   int i;

   Register(hsigp_version,hsigp_vc_id);
   numParm = GetConfig("HSIGP", TRUE, cParm, MAXGLOBS);
   if (numParm>0){
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
   }
   CreateHeap(&sigpHeap,"sigpHeap",MSTAK,1,0.0,5000,5000);
}
Example #15
0
/* SetConfParms: set conf parms relevant to this tool */
void SetConfParms(void)
{
   double d;
   int i;

   nParm = GetConfig("HLSTATS", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfFlt(cParm,nParm,"DISCOUNT",&d)) disCount = d;
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
   }
}
Example #16
0
/* ----------------------------------------------------------- */



char *lutil_version = "!HVER!LUtil:   3.4 [CUED 25/04/06]";

char *lutil_vc_id = "$Id: LUtil.c,v 1.1.1.1 2006/10/11 09:54:43 jal58 Exp $";


Example #17
0
/* SetConfParms: set conf parms relevant to HSmooth  */
void SetConfParms(void)
{
   int i;
   Boolean b;
   
   nParm = GetConfig("HSMOOTH", TRUE, cParm, MAXGLOBS);
   if (nParm>0) {
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
      if (GetConfBool(cParm,nParm,"SAVEBINARY",&b)) saveBinary = b;
      if (GetConfBool(cParm,nParm,"BINARYACCFORMAT",&b)) ldBinary = b;
   }
}
Example #18
0
/* EXPORT->InitLM: initialise configuration parameters */
void InitLM(void)
{
   Boolean b;
   int i;

   Register(hlm_version,hlm_vc_id);
   nParm = GetConfig("HLM", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
      if (GetConfBool(cParm,nParm,"RAWMITFORMAT",&b)) rawMITFormat = b;
   }
}
Example #19
0
/* SetConfParms: set conf parms relevant to this tool */
void SetConfParms(void)
{
   int i;
   char s[256];
   
   nParm = GetConfig("LADAPT", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm, "TRACE",&i))      trace = i;
      if (GetConfStr(cParm,nParm, "UNKNOWNNAME",s)) strcpy(unkStr,s);
   }
   
}
Example #20
0
#define T_TOP   0001    /* Top level tracing */

#define T_MAP   0002    /* logical/physical hmm map */

#define T_UPD   0004    /* Model updates */





/* possible values of updateMode */

#define UPMODE_DUMP 1

#define UPMODE_UPDATE 2

#define UPMODE_BOTH 3



/* Global Settings */



static char * labDir = NULL;     /* label (transcription) file directory */

static char * labExt = "lab";    /* label file extension */

static char * hmmDir = NULL;     /* directory to look for hmm def files */

static char * hmmExt = NULL;     /* hmm def file extension */

static char * newDir = NULL;     /* directory to store new hmm def files */

static char * newExt = NULL;     /* extension of new reestimated hmm files */

static char * statFN;            /* stats file, if any */

static float minVar  = 0.0;      /* minimum variance (diagonal only) */

static float mixWeightFloor=0.0; /* Floor for mixture weights */

static int minEgs    = 3;        /* min examples to train a model */

static UPDSet uFlags = (UPDSet) (UPMEANS|UPVARS|UPTRANS|UPMIXES); /* update flags */

static int parMode   = -1;       /* enable one of the // modes */

static Boolean stats = FALSE;    /* enable statistics reports */

static char * mmfFn  = NULL;     /* output MMF file, if any */
Example #21
0
/* EXPORT->InitUtil: initialise configuration parameters */
void InitUtil(void)
{
   int i;

   Register(hutil_version);
   nParm = GetConfig("HUTIL", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
   }
   CreateHeap(&itemHeap,"HUtil: ItemList Heap",MHEAP,sizeof(ItemRec),
              1.0,200,8000);
   CreateHeap(&setHeap,"HUtil: IntSet Heap",MSTAK,1,1.0,2000,16000);
}
Example #22
0
static void SetConfParms(void)
{
   int s, i, nParm;
   char *c, buf[MAXSTRLEN], tmp[MAXSTRLEN];
   Boolean b;

   for (s = 1; s < SMAX; s++)
      winFn[s] = NULL;

   nParm = GetConfig("HMGETOOL", TRUE, cParm, MAXGLOBS);
   if (nParm > 0) {
      if (GetConfInt(cParm, nParm, "TRACE", &i))
         trace = i;
      if (GetConfBool(cParm, nParm, "SAVEBINARY", &b))
         inBinary = b;

      if (GetConfStr(cParm, nParm, "PDFSTRSIZE", buf))
         nPdfStr = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "PDFSTRORDER", buf))
         pdfStrOrder = ParseConfIntVec(&gstack, buf, TRUE);

      if (GetConfStr(cParm, nParm, "MGETRNFLAG", buf))
         pbMTrn = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "GVTRNFLAG", buf))
         pbGVTrn = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "ACCERRFLAG", buf))
         pbAccErr = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "INVQUASIZE", buf))
         pnInvQuaSize = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "VARWINSIZE", buf))
         pnVarWin = ParseConfIntVec(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "GVDISTWGHT", buf))
         pfGVWght = ParseConfVector(&gstack, buf, TRUE);
      if (GetConfStr(cParm, nParm, "GAINWTFLAG", buf))
         pbGainWght = ParseConfIntVec(&gstack, buf, TRUE);

      if (GetConfStr(cParm, nParm, "WINEXT", buf))
         winExt = CopyString(&gstack, buf);
      if (GetConfStr(cParm, nParm, "WINDIR", buf))
         winDir = CopyString(&gstack, buf);
      if (GetConfStr(cParm, nParm, "WINFN", buf)) {
         for (s = 1, c = buf; s < SMAX && c != NULL; s++) {
            winFn[s] = ParseConfStrVec(&gstack, c, FALSE);
            for (i = 1; i <= winFn[s][0][0] + 2; i++)   /* "StrVec" + "n" + # of file names */
               c = ParseString(c, tmp);
            if (ParseString(c, tmp) == NULL)
               break;
         }
      }
   }
}
/* SetConfParms: set conf parms relevant to HCompV  */
static void SetConfParms(void)
{
   Boolean b,c;
   int i;
   double d;
   
   nParm = GetConfig("HCOMPV", TRUE, cParm, MAXGLOBS);
   if (nParm>0) {
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
      if (GetConfBool(cParm,nParm,"UPDATEMEANS",&b)) meanUpdate = b;
      if (GetConfBool(cParm,nParm,"SAVEBINARY",&c)) saveBinary = c;
      if (GetConfFlt(cParm,nParm,"MINVARFLOOR",&d)) minVar = d;
   }
}
Example #24
0
/* EXPORT->InitArc: initialise configuration parameters */
void InitArc(void)
{
   int i;
   double f;

   Register(arc_version,arc_vc_id);
   nParm = GetConfig("HARC", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;                          /*   Set TRACE=1 for minimal tracing, 3 for fuller tracing.  */
      if (GetConfFlt(cParm,nParm,"LMSCALE",&f)){ LMSCALE = f; IsLMScale = TRUE; } /*   Overrides lattice-specified one.  */
      if (GetConfFlt(cParm,nParm,"FRAMEDUR",&f)){ FRAMEDUR = f; }                 /*   Important.  Frame duration in seconds.  If != 0.01, specify it. */
      if (GetConfFlt(cParm,nParm,"WDPEN",&f)){ WDPEN = f; IsWdPen = TRUE; }       /*   Overrides lattice-specified one.  */
   }
}
Example #25
0
/* EXPORT->InitMem: Initialise the module.  */
void InitMem(void)
{
   int i;
   Boolean b;
   
   Register(hmem_version, hmem_vc_id);
   CreateHeap(&gstack, "Global Stack",  MSTAK, 1, 0.0, 100000, ULONG_MAX ); /* #### should be max size_t */
   CreateHeap(&gcheap, "Global C Heap", CHEAP, 1, 0.0, 0,      0 );
   numParm = GetConfig("HMEM", TRUE, cParm, MAXGLOBS);
   if (numParm>0){
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
      if (GetConfBool(cParm,numParm,"PROTECTSTAKS",&b)) protectStaks = b;
   }
}
Example #26
0
/* SetConfParms: set conf parms relevant to this tool */
void SetConfParmsHCopy(void)
{
   int i;
   Boolean b;
   char buf[MAXSTRLEN];

   nParm = GetConfig("HCOPY", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
      if (GetConfBool(cParm,nParm,"SAVEASVQ",&b)) saveAsVQ = b;
      if (GetConfInt(cParm,nParm,"NSTREAMS",&i)) swidth0 = i;
      if (GetConfStr(cParm,nParm,"SOURCEFORMAT",buf))
         srcFF = Str2Format(buf);
      if (GetConfStr(cParm,nParm,"TARGETFORMAT",buf))
         tgtFF = Str2Format(buf);
      if (GetConfStr(cParm,nParm,"SOURCEKIND",buf))
         srcPK = Str2ParmKind(buf);
      if (GetConfStr(cParm,nParm,"TARGETKIND",buf)) {
         tgtPK = Str2ParmKind(buf);
         if (tgtPK&HASNULLE) 
            HError(1019, "SetConfParms: incompatible TARGETKIND=%s for coding", buf);
      }
   }
}
Example #27
0
char *lpcalc_vc_id = "$Id: LPCalc.c,v 1.1.1.1 2006/10/11 09:54:43 jal58 Exp $";



#include "HShell.h"     /* HMM ToolKit Modules */

#include "HMem.h"

#include "HMath.h"

#include "HWave.h"

#include "HLabel.h"

#include "LWMap.h"      
Example #28
0
// Constructor: builds a Grammar from given file, or empty gram if no file
AGram::AGram(const string& name, const string& fname):AResource(name)
{
   ConfParam *cParm[MAXGLOBS];       /* config parameters */
   int numParm,i;
   char buf[100];

   main = NULL; isOpen = TRUE;
   // Read configuration file
   strcpy(buf,name.c_str());
   for (i=0; i<int(strlen(buf)); i++) buf[i] = toupper(buf[i]);
   numParm = GetConfig(buf, TRUE, cParm, MAXGLOBS);
   if (numParm>0){
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
   }
   if (fname!="") InitFromFile(fname.c_str());
   isOpen = FALSE;
}
Example #29
0
// Constructor: builds a Grammar from name:info in the config file
AGram::AGram(const string& name):AResource(name)
{
   ConfParam *cParm[MAXGLOBS];       /* config parameters */
   int numParm,i;
   char buf[100],buf1[100],gramFN[100];

   main = NULL; isOpen = TRUE; gramFN[0] = '\0';
   // Read configuration file
   strcpy(buf,name.c_str());
   for (i=0; i<int(strlen(buf)); i++) buf[i] = toupper(buf[i]);
   numParm = GetConfig(buf, TRUE, cParm, MAXGLOBS);
   if (numParm>0){
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
      if (GetConfStr(cParm,numParm,"GRAMFILE",buf1)) strcpy(gramFN,buf1);
   }
   if (gramFN[0] != '\0') InitFromFile(gramFN);
   isOpen = FALSE;
}
Example #30
0
/* SetConfParms: set conf parms relevant to this tool */
void SetConfParms(void)
{
   int i;
   static char b[100];

   nParm = GetConfig("LPLEX", TRUE, cParm, MAXGLOBS);
   if (nParm>0){
      if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
     if (GetConfStr(cParm,nParm,"STARTWORD",b))   sstId = GetLabId(b, TRUE);
      if (GetConfStr(cParm,nParm,"ENDWORD",b))     senId = GetLabId(b, TRUE);
      if (GetConfStr(cParm,nParm,"UNKNOWNNAME",b)) unkId = GetLabId(b, TRUE);
   }

   if (!sstId) sstId = GetLabId(DEF_STARTWORD,TRUE);
   if (!senId) senId = GetLabId(DEF_ENDWORD,TRUE);
   if (!unkId) unkId = GetLabId(DEF_UNKNOWNNAME,TRUE);

}