From sumomo @ users.sourceforge.jp Tue Jan 5 11:57:10 2010 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Tue, 05 Jan 2010 11:57:10 +0900 Subject: [Julius-cvs 507] CVS update: julius4/libsent/src/wav2mfcc Message-ID: <1262660230.722069.29800.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/wav2mfcc/para.c diff -u julius4/libsent/src/wav2mfcc/para.c:1.7 julius4/libsent/src/wav2mfcc/para.c:1.8 --- julius4/libsent/src/wav2mfcc/para.c:1.7 Sat Oct 4 00:09:28 2008 +++ julius4/libsent/src/wav2mfcc/para.c Tue Jan 5 11:57:10 2010 @@ -16,7 +16,7 @@ * @author Akinobu Lee * @date Fri Oct 27 14:55:00 2006 * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * */ /* @@ -97,7 +97,7 @@ para->enormal = FALSE; para->escale = DEF_ESCALE; para->silFloor = DEF_SILFLOOR; - para->cvn = 0; + para->cvn = FALSE; para->hipass = -1; /* disabled */ para->lopass = -1; /* disabled */ //para->ss_alpha = DEF_SSALPHA; @@ -239,7 +239,7 @@ } else if (strmatch(d, "ZMEANSOURCE")) { /* -zmeansource */ para->zmeanframe = (a[0] == 'T') ? TRUE : FALSE; } else if (strmatch(d, "USEPOWER")) { /* -usepower */ - para->zmeanframe = (a[0] == 'T') ? TRUE : FALSE; + para->usepower = (a[0] == 'T') ? TRUE : FALSE; } else if (strmatch(d, "PREEMCOEF")) { /* -preemph */ para->preEmph = atof(a); } else if (strmatch(d, "USEHAMMING")) { /* (fixed to T) */ @@ -403,8 +403,17 @@ if (para->usepower) fprintf(fp, "ON\n"); else fprintf(fp, "OFF\n"); fprintf(fp, "\t CVN = "); - if (para->cvn) fprintf(fp, "ON\n"); - else fprintf(fp, "OFF\n"); + switch (para->cvn) { + case TRUE: + fprintf(fp, "ON\n"); + break; + case FALSE: + fprintf(fp, "OFF\n"); + break; + default: + fprintf(fp, "UNKNOWN\n"); + break; + } fprintf(fp, "\t VTLN = "); if(para->vtln_alpha != 1.0) { fprintf(fp, "ON, alpha=%.3f, f_low=%.1f, f_high=%.1f\n", para->vtln_alpha, para->vtln_lower, para->vtln_upper); From sumomo @ users.sourceforge.jp Tue Jan 5 11:59:38 2010 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Tue, 05 Jan 2010 11:59:38 +0900 Subject: [Julius-cvs 508] CVS update: julius4/libjulius/src Message-ID: <1262660378.453670.1080.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/beam.c diff -u julius4/libjulius/src/beam.c:1.12 julius4/libjulius/src/beam.c:1.13 --- julius4/libjulius/src/beam.c:1.12 Fri Jun 12 00:21:38 2009 +++ julius4/libjulius/src/beam.c Tue Jan 5 11:59:38 2010 @@ -42,7 +42,7 @@ * @author Akinobu LEE * @date Tue Feb 22 17:00:45 2005 * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * */ /* @@ -1703,11 +1703,15 @@ newid = create_token(d); new = &(d->tlist[d->tn][newid]); new->last_tre = &(d->bos); +#ifdef FIX_PENALTY new->last_lscore = 0.0; +#else + new->last_lscore = d->penalty1; +#endif if (wchmm->hmminfo->multipath) { - new->score = 0.0; + new->score = new->last_lscore; } else { - new->score = outprob_style(wchmm, node, d->bos.wid, 0, param); + new->score = outprob_style(wchmm, node, d->bos.wid, 0, param) + new->last_lscore; } node_assign_token(d, node, newid); } Index: julius4/libjulius/src/dfa_decode.c diff -u julius4/libjulius/src/dfa_decode.c:1.2 julius4/libjulius/src/dfa_decode.c:1.3 --- julius4/libjulius/src/dfa_decode.c:1.2 Tue Dec 18 17:45:49 2007 +++ julius4/libjulius/src/dfa_decode.c Tue Jan 5 11:59:38 2010 @@ -47,7 +47,7 @@ * @author Akinobu LEE * @date Mon Mar 7 15:31:00 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -111,7 +111,11 @@ nw[num]->id = dfa->term.tw[cate][iw]; /* word ID */ nw[num]->next_state = ns; /* next state */ nw[num]->can_insert_sp = FALSE; /* short pause should not inserted before this word */ +#ifdef FIX_PENALTY + nw[num]->lscore = 0.0; +#else nw[num]->lscore = r->config->lmp.penalty2; +#endif num++; if (num >= maxnw) return -1; /* buffer overflow */ } Index: julius4/libjulius/src/ngram_decode.c diff -u julius4/libjulius/src/ngram_decode.c:1.4 julius4/libjulius/src/ngram_decode.c:1.5 --- julius4/libjulius/src/ngram_decode.c:1.4 Sat Jul 4 23:11:42 2009 +++ julius4/libjulius/src/ngram_decode.c Tue Jan 5 11:59:38 2010 @@ -35,7 +35,7 @@ * @author Akinobu Lee * @date Fri Jul 8 14:57:51 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -513,10 +513,13 @@ nw[0]->id = r->lm->winfo->tail_silwid; } -#ifdef FIX_PENALTY - nw[0]->lscore = 0.0; -#else - nw[0]->lscore = r->config->lmp.lm_penalty2; + nw[0]->lscore = uni_prob(r->wchmm->ngram, r->wchmm->winfo->wton[nw[0]->id]); +#ifdef CLASS_NGRAM + nw[0]->lscore += r->wchmm->winfo->cprob[nw[0]->id]; +#endif + nw[0]->lscore *= r->config->lmp.lm_weight2; +#ifndef FIX_PENALTY + nw[0]->lscore += r->config->lmp.lm_penalty2; #endif return 1; /* number of words = 1 */ Index: julius4/libjulius/src/search_bestfirst_v1.c diff -u julius4/libjulius/src/search_bestfirst_v1.c:1.4 julius4/libjulius/src/search_bestfirst_v1.c:1.5 --- julius4/libjulius/src/search_bestfirst_v1.c:1.4 Fri Feb 15 03:25:14 2008 +++ julius4/libjulius/src/search_bestfirst_v1.c Tue Jan 5 11:59:38 2010 @@ -92,7 +92,7 @@ * @author Akinobu Lee * @date Sun Sep 11 23:54:53 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -1462,11 +1462,8 @@ } - if (r->lmtype == LM_PROB) { - new->lscore = nword->lscore; - } else if (r->lmtype == LM_DFA) { - new->lscore = 0.0; - } + /* 接続確率を与える */ + new->lscore = nword->lscore; if (! hmminfo->multipath) { /* a_value: 接続点の遷移確率 */ @@ -1642,11 +1639,7 @@ } new->lscore = nword->lscore; - if (r->lmtype == LM_PROB) { - new->g[peseqlen-1] = nword->lscore; - } else if (r->lmtype == LM_DFA) { - new->g[peseqlen-1] = 0; - } + new->g[peseqlen-1] = nword->lscore; for (t=peseqlen-1; t>=0; t--) { tre = bt_binsearch_atom(backtrellis, t, word); Index: julius4/libjulius/src/search_bestfirst_v2.c diff -u julius4/libjulius/src/search_bestfirst_v2.c:1.4 julius4/libjulius/src/search_bestfirst_v2.c:1.5 --- julius4/libjulius/src/search_bestfirst_v2.c:1.4 Fri Feb 15 03:25:14 2008 +++ julius4/libjulius/src/search_bestfirst_v2.c Tue Jan 5 11:59:38 2010 @@ -48,7 +48,7 @@ * @author Akinobu Lee * @date Mon Sep 12 00:58:50 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -1394,11 +1394,7 @@ new->last_ph = NULL; } - if (r->lmtype == LM_PROB) { - new->g[peseqlen-1] = nword->lscore; - } else { - new->g[peseqlen-1] = 0; - } + new->g[peseqlen-1] = nword->lscore; for (t=peseqlen-1; t>=0; t--) { tre = bt_binsearch_atom(backtrellis, t, word); From sumomo @ users.sourceforge.jp Fri Jan 8 17:29:11 2010 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Fri, 08 Jan 2010 17:29:11 +0900 Subject: [Julius-cvs 509] CVS update: julius4/libjulius/src Message-ID: <1262939351.918844.30310.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/beam.c diff -u julius4/libjulius/src/beam.c:1.13 julius4/libjulius/src/beam.c:1.14 --- julius4/libjulius/src/beam.c:1.13 Tue Jan 5 11:59:38 2010 +++ julius4/libjulius/src/beam.c Fri Jan 8 17:29:11 2010 @@ -42,7 +42,7 @@ * @author Akinobu LEE * @date Tue Feb 22 17:00:45 2005 * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * */ /* @@ -2184,11 +2184,7 @@ tre->begintime = tk->last_tre->endtime + 1; /* word beginning frame */ tre->endtime = t-1; /* word end frame */ tre->last_tre = tk->last_tre; /* link to previous trellis word */ - if (wchmm->lmtype == LM_PROB) { - tre->lscore = tk->last_lscore; /* log score (LM only) */ - } else if (wchmm->lmtype == LM_DFA) { - tre->lscore = 0.0; - } + tre->lscore = tk->last_lscore; /* log LM score */ bt_store(bt, tre); /* save to backtrellis */ #ifdef WORD_GRAPH if (tre->last_tre != NULL) { @@ -2390,7 +2386,8 @@ if (wchmm->lmtype == LM_DFA) { /* grammar: 単語挿入ペナルティを追加 */ /* grammar: add insertion penalty */ - tmpsum += d->penalty1; + ngram_score_cache = d->penalty1; + tmpsum += ngram_score_cache; /* grammar: deterministic factoring (in case category-tree not enabled) */ if (!wchmm->category_tree) {