57 #include <sphinxbase/err.h>
58 #include <sphinxbase/ckd_alloc.h>
59 #include <sphinxbase/strfuncs.h>
60 #include <sphinxbase/cmd_ln.h>
65 #include "fsg_search_internal.h"
66 #include "fsg_history.h"
67 #include "fsg_lextree.h"
71 #define __FSG_DBG_CHAN__ 0
91 fsg_search_init(cmd_ln_t *config,
99 fsgs = ckd_calloc(1,
sizeof(*fsgs));
100 ps_search_init(ps_search_base(fsgs), &fsg_funcs, config, acmod, dict, d2p);
103 fsgs->
hmmctx = hmm_context_init(bin_mdef_n_emit_state(acmod->
mdef),
105 if (fsgs->
hmmctx == NULL) {
106 ps_search_free(ps_search_base(fsgs));
111 fsgs->
history = fsg_history_init(NULL, dict);
115 fsgs->
fsgs = hash_table_new(5, HASH_CASE_YES);
120 = (int32) logmath_log(acmod->
lmath, cmd_ln_float64_r(config,
"-beam"))
123 = (int32) logmath_log(acmod->
lmath, cmd_ln_float64_r(config,
"-pbeam"))
126 = (int32) logmath_log(acmod->
lmath, cmd_ln_float64_r(config,
"-wbeam"))
130 fsgs->lw = cmd_ln_float32_r(config,
"-lw");
131 fsgs->pip = (int32) (logmath_log(acmod->
lmath, cmd_ln_float32_r(config,
"-pip"))
134 fsgs->
wip = (int32) (logmath_log(acmod->
lmath, cmd_ln_float32_r(config,
"-wip"))
139 if (cmd_ln_boolean_r(config,
"-bestpath"))
143 fsgs->
ascale = 1.0 / cmd_ln_float32_r(config,
"-ascale");
145 E_INFO(
"FSG(beam: %d, pbeam: %d, wbeam: %d; wip: %d, pip: %d)\n",
147 fsgs->
wip, fsgs->pip);
150 if ((path = cmd_ln_str_r(config,
"-fsg"))) {
153 if ((fsg = fsg_model_readfile(path, acmod->
lmath, fsgs->lw)) == NULL)
155 if (
fsg_set_add(fsgs, fsg_model_name(fsg), fsg) != fsg) {
161 if (fsg_search_reinit(ps_search_base(fsgs),
162 ps_search_dict(fsgs),
163 ps_search_dict2pid(fsgs)) < 0)
167 else if ((path = cmd_ln_str_r(config,
"-jsgf"))) {
172 if ((fsgs->
jsgf = jsgf_parse_file(path, NULL)) == NULL)
177 if ((toprule = cmd_ln_str_r(config,
"-toprule"))) {
179 anglerule = string_join(
"<", toprule,
">", NULL);
180 rule = jsgf_get_rule(fsgs->
jsgf, anglerule);
183 E_ERROR(
"Start rule %s not found\n", toprule);
189 jsgf_rule_iter_t *itor;
191 for (itor = jsgf_rule_iter(fsgs->
jsgf); itor;
192 itor = jsgf_rule_iter_next(itor)) {
193 rule = jsgf_rule_iter_rule(itor);
194 if (jsgf_rule_public(rule))
198 E_ERROR(
"No public rules found in %s\n", path);
202 fsg = jsgf_build_fsg(fsgs->
jsgf, rule, acmod->
lmath, fsgs->lw);
203 if (
fsg_set_add(fsgs, fsg_model_name(fsg), fsg) != fsg) {
209 if (fsg_search_reinit(ps_search_base(fsgs),
210 ps_search_dict(fsgs),
211 ps_search_dict2pid(fsgs)) < 0)
215 return ps_search_base(fsgs);
218 fsg_search_free(ps_search_base(fsgs));
228 ps_search_deinit(search);
230 jsgf_grammar_free(fsgs->
jsgf);
233 fsg_history_reset(fsgs->
history);
234 fsg_history_set_fsg(fsgs->
history, NULL, NULL);
235 fsg_history_free(fsgs->
history);
238 for (itor = hash_table_iter(fsgs->
fsgs);
239 itor; itor = hash_table_iter_next(itor)) {
240 fsg_model_t *fsg = (fsg_model_t *) hash_entry_val(itor->ent);
243 hash_table_free(fsgs->
fsgs);
245 hmm_context_free(fsgs->
hmmctx);
259 ps_search_base_reinit(search, dict, d2p);
262 if (fsgs->
fsg == NULL)
270 ps_search_acmod(fsgs)->mdef,
274 fsg_history_set_fsg(fsgs->
history, fsgs->
fsg, dict);
281 fsg_search_add_silences(
fsg_search_t *fsgs, fsg_model_t *fsg)
287 dict = ps_search_dict(fsgs);
301 fsg_model_add_silence(fsg,
"<sil>", -1,
302 cmd_ln_float32_r(ps_search_config(fsgs),
"-silprob"));
305 for (wid = dict_filler_start(dict); wid < dict_filler_end(dict); ++wid) {
306 char const *word = dict_wordstr(dict, wid);
307 if (wid == dict_startwid(dict) || wid == dict_finishwid(dict))
309 fsg_model_add_silence(fsg, word, -1,
310 cmd_ln_float32_r(ps_search_config(fsgs),
"-fillprob"));
319 fsg_search_check_dict(
fsg_search_t *fsgs, fsg_model_t *fsg)
324 dict = ps_search_dict(fsgs);
325 for (i = 0; i < fsg_model_n_word(fsg); ++i) {
329 word = fsg_model_word_str(fsg, i);
330 wid = dict_wordid(dict, word);
332 E_ERROR(
"The word '%s' is missing in the dictionary\n", word);
341 fsg_search_add_altpron(
fsg_search_t *fsgs, fsg_model_t *fsg)
347 dict = ps_search_dict(fsgs);
350 n_word = fsg_model_n_word(fsg);
351 for (i = 0; i < n_word; ++i) {
355 word = fsg_model_word_str(fsg, i);
356 wid = dict_wordid(dict, word);
358 while ((wid = dict_nextalt(dict, wid)) !=
BAD_S3WID) {
359 n_alt += fsg_model_add_alt(fsg, word, dict_wordstr(dict, wid));
364 E_INFO(
"Added %d alternate word transitions\n", n_alt);
373 if (hash_table_lookup(fsgs->
fsgs, name, &val) < 0)
375 return (fsg_model_t *)val;
382 name = fsg_model_name(fsg);
384 if (!fsg_search_check_dict(fsgs, fsg))
388 if (cmd_ln_boolean_r(ps_search_config(fsgs),
"-fsgusefiller")
389 && !fsg_model_has_sil(fsg))
390 fsg_search_add_silences(fsgs, fsg);
391 if (cmd_ln_boolean_r(ps_search_config(fsgs),
"-fsgusealtpron")
392 && !fsg_model_has_alt(fsg))
393 fsg_search_add_altpron(fsgs, fsg);
395 return (fsg_model_t *)hash_table_enter(fsgs->
fsgs, name, fsg);
406 if (hash_table_lookup(fsgs->
fsgs, key, &val) < 0) {
407 E_ERROR(
"FSG `%s' to be deleted not found\n", key);
413 hash_table_delete(fsgs->
fsgs, key);
415 if (fsgs->
fsg == oldfsg) {
418 fsg_history_set_fsg(fsgs->
history, NULL, NULL);
432 for (itor = hash_table_iter(fsgs->
fsgs);
433 itor; itor = hash_table_iter_next(itor)) {
436 oldfsg = (fsg_model_t *) hash_entry_val(itor->ent);
438 key = hash_entry_key(itor->ent);
439 hash_table_iter_free(itor);
444 E_WARN(
"FSG '%s' to be deleted not found\n", fsg_model_name(fsg));
459 E_ERROR(
"FSG '%s' not known; cannot make it current\n", name);
469 return hash_table_iter(fsgs->
fsgs);
475 return hash_table_iter_next(itor);
481 return ((fsg_model_t *)itor->ent->val);
487 hash_table_iter_free(itor);
499 for (gn = fsgs->
pnode_active; gn; gn = gnode_next(gn)) {
501 hmm = fsg_pnode_hmmptr(pnode);
502 assert(hmm_frame(hmm) == fsgs->
frame);
524 E_ERROR(
"Frame %d: No active HMM!!\n", fsgs->
frame);
528 for (n = 0, gn = fsgs->
pnode_active; gn; gn = gnode_next(gn), n++) {
532 hmm = fsg_pnode_hmmptr(pnode);
533 assert(hmm_frame(hmm) == fsgs->
frame);
536 E_INFO(
"pnode(%08x) active @frm %5d\n", (int32) pnode,
538 hmm_dump(hmm, stdout);
540 score = hmm_vit_eval(hmm);
542 E_INFO(
"pnode(%08x) after eval @frm %5d\n",
543 (int32) pnode, fsgs->
frame);
544 hmm_dump(hmm, stdout);
552 E_INFO(
"[%5d] %6d HMM; bestscr: %11d\n", fsgs->
frame, n, bestscore);
557 maxhmmpf = cmd_ln_int32_r(ps_search_config(fsgs),
"-maxhmmpf");
558 if (maxhmmpf != -1 && n > maxhmmpf) {
580 if (n > fsg_lextree_n_pnode(fsgs->
lextree))
581 E_FATAL(
"PANIC! Frame %d: #HMM evaluated(%d) > #PNodes(%d)\n",
593 int32 newscore, thresh, nf;
596 assert(!fsg_pnode_leaf(pnode));
598 nf = fsgs->
frame + 1;
601 hmm = fsg_pnode_hmmptr(pnode);
603 for (child = fsg_pnode_succ(pnode);
604 child; child = fsg_pnode_sibling(child)) {
605 newscore = hmm_out_score(hmm) + child->logs2prob;
608 && (newscore
BETTER_THAN hmm_in_score(&child->hmm))) {
610 if (hmm_frame(&child->hmm) < nf) {
617 hmm_enter(&child->hmm, newscore, hmm_out_history(hmm), nf);
632 assert(fsg_pnode_leaf(pnode));
634 hmm = fsg_pnode_hmmptr(pnode);
635 fl = fsg_pnode_fsglink(pnode);
638 wid = fsg_link_wid(fl);
642 E_INFO(
"[%5d] Exit(%08x) %10d(score) %5d(pred)\n",
643 fsgs->
frame, (int32) pnode,
644 hmm_out_score(hmm), hmm_out_history(hmm));
651 if (fsg_model_is_filler(fsgs->
fsg, wid)
653 || (dict_is_single_phone(ps_search_dict(fsgs),
654 dict_wordid(ps_search_dict(fsgs),
655 fsg_model_word_str(fsgs->
fsg, wid))))) {
660 fsg_history_entry_add(fsgs->
history,
664 hmm_out_history(hmm),
665 pnode->ci_ext, ctxt);
670 fsg_history_entry_add(fsgs->
history,
674 hmm_out_history(hmm),
675 pnode->ci_ext, pnode->ctxt);
692 int32 thresh, word_thresh, phone_thresh;
697 phone_thresh = fsgs->
bestscore + fsgs->pbeam;
700 for (gn = fsgs->
pnode_active; gn; gn = gnode_next(gn)) {
702 hmm = fsg_pnode_hmmptr(pnode);
704 if (hmm_bestscore(hmm) >= thresh) {
706 if (hmm_frame(hmm) == fsgs->
frame) {
707 hmm_frame(hmm) = fsgs->
frame + 1;
713 assert(hmm_frame(hmm) == fsgs->
frame + 1);
716 if (!fsg_pnode_leaf(pnode)) {
717 if (hmm_out_score(hmm) >= phone_thresh) {
719 fsg_search_pnode_trans(fsgs, pnode);
723 if (hmm_out_score(hmm) >= word_thresh) {
725 fsg_search_pnode_exit(fsgs, pnode);
739 int32 bpidx, n_entries, thresh, newscore;
748 n_entries = fsg_history_n_entries(fsgs->
history);
750 for (bpidx = fsgs->
bpidx_start; bpidx < n_entries; bpidx++) {
752 hist_entry = fsg_history_entry_get(fsgs->
history, bpidx);
754 l = fsg_hist_entry_fsglink(hist_entry);
757 s = l ? fsg_link_to_state(l) : fsg_model_start_state(fsg);
765 for (itor = fsg_model_arcs(fsg, s); itor;
766 itor = fsg_arciter_next(itor)) {
767 fsg_link_t *l = fsg_arciter_get(itor);
770 if (fsg_link_wid(l) != -1)
773 fsg_hist_entry_score(hist_entry) +
776 if (newscore >= thresh) {
777 fsg_history_entry_add(fsgs->
history, l,
778 fsg_hist_entry_frame(hist_entry),
781 fsg_hist_entry_lc(hist_entry),
782 fsg_hist_entry_rc(hist_entry));
796 int32 bpidx, n_entries;
799 int32 score, newscore, thresh, nf, d;
803 n_entries = fsg_history_n_entries(fsgs->
history);
806 nf = fsgs->
frame + 1;
808 for (bpidx = fsgs->
bpidx_start; bpidx < n_entries; bpidx++) {
809 hist_entry = fsg_history_entry_get(fsgs->
history, bpidx);
811 score = fsg_hist_entry_score(hist_entry);
812 assert(fsgs->
frame == fsg_hist_entry_frame(hist_entry));
814 l = fsg_hist_entry_fsglink(hist_entry);
817 d = l ? fsg_link_to_state(l) : fsg_model_start_state(fsgs->
820 lc = fsg_hist_entry_lc(hist_entry);
823 for (root = fsg_lextree_root(fsgs->
lextree, d);
824 root; root = root->sibling) {
827 if ((root->ctxt.bv[lc >> 5] & (1 << (lc & 0x001f))) &&
828 (hist_entry->rc.bv[rc >> 5] & (1 << (rc & 0x001f)))) {
836 newscore = score + root->logs2prob;
839 && (newscore
BETTER_THAN hmm_in_score(&root->hmm))) {
840 if (hmm_frame(&root->hmm) < nf) {
847 (
"[%5d] WordTrans bpidx[%d] -> pnode[%08x] (activated)\n",
848 fsgs->
frame, bpidx, (int32) root);
854 (
"[%5d] WordTrans bpidx[%d] -> pnode[%08x]\n",
855 fsgs->
frame, bpidx, (int32) root);
859 hmm_enter(&root->hmm, newscore, bpidx, nf);
868 fsg_search_step(
ps_search_t *search,
int frame_idx)
879 fsg_search_sen_active(fsgs);
889 fsg_search_hmm_eval(fsgs);
896 fsg_search_hmm_prune_prop(fsgs);
897 fsg_history_end_frame(fsgs->
history);
903 fsg_search_null_prop(fsgs);
904 fsg_history_end_frame(fsgs->
history);
910 fsg_search_word_trans(fsgs);
918 for (gn = fsgs->
pnode_active; gn; gn = gnode_next(gn)) {
920 hmm = fsg_pnode_hmmptr(pnode);
922 if (hmm_frame(hmm) == fsgs->
frame) {
927 assert(hmm_frame(hmm) == (fsgs->
frame + 1));
963 silcipid = bin_mdef_ciphone_id(ps_search_acmod(fsgs)->mdef,
"SIL");
969 fsg_history_reset(fsgs->
history);
970 fsg_history_utt_start(fsgs->
history);
979 fsg_history_entry_add(fsgs->
history,
980 NULL, -1, 0, -1, silcipid, ctxt);
984 fsg_search_null_prop(fsgs);
987 fsg_search_word_trans(fsgs);
1013 for (gn = fsgs->
pnode_active; gn; gn = gnode_next(gn)) {
1029 n_hist = fsg_history_n_entries(fsgs->
history);
1031 (
"%d frames, %d HMMs (%d/fr), %d senones (%d/fr), %d history entries (%d/fr)\n\n",
1036 n_hist, (fsgs->
frame > 0) ? n_hist / fsgs->
frame : 0);
1042 fsg_search_find_exit(
fsg_search_t *fsgs,
int frame_idx,
int final, int32 *out_score)
1046 int bpidx, frm, last_frm, besthist;
1049 if (frame_idx == -1)
1050 frame_idx = fsgs->
frame - 1;
1051 last_frm = frm = frame_idx;
1054 bpidx = fsg_history_n_entries(fsgs->
history) - 1;
1056 hist_entry = fsg_history_entry_get(fsgs->
history, bpidx);
1057 if (fsg_hist_entry_frame(hist_entry) <= frame_idx) {
1058 frm = last_frm = fsg_hist_entry_frame(hist_entry);
1068 bestscore = INT_MIN;
1071 while (frm == last_frm) {
1075 fl = fsg_hist_entry_fsglink(hist_entry);
1076 score = fsg_hist_entry_score(hist_entry);
1084 || fsg_link_to_state(fl) == fsg_model_final_state(fsg)) {
1093 hist_entry = fsg_history_entry_get(fsgs->
history, bpidx);
1094 frm = fsg_hist_entry_frame(hist_entry);
1098 if (besthist == -1) {
1099 E_ERROR(
"Final state not reached in frame %d\n", frame_idx);
1105 *out_score = bestscore;
1111 fsg_search_bestpath(
ps_search_t *search, int32 *out_score,
int backward)
1122 if (search->
post == 0)
1131 fsg_search_hyp(
ps_search_t *search, int32 *out_score)
1134 dict_t *dict = ps_search_dict(search);
1140 bpidx = fsg_search_find_exit(fsgs, fsgs->
frame, fsgs->
final, out_score);
1150 if ((dag = fsg_search_lattice(search)) == NULL) {
1151 E_WARN(
"Failed to obtain the lattice while bestpath enabled\n");
1154 if ((link = fsg_search_bestpath(search, out_score, FALSE)) == NULL) {
1155 E_WARN(
"Failed to bestpath in a lattice\n");
1165 fsg_link_t *fl = fsg_hist_entry_fsglink(hist_entry);
1166 char const *baseword;
1169 bp = fsg_hist_entry_pred(hist_entry);
1170 wid = fsg_link_wid(fl);
1171 if (wid < 0 || fsg_model_is_filler(fsgs->
fsg, wid))
1173 baseword = dict_basestr(dict,
1175 fsg_model_word_str(fsgs->
fsg, wid)));
1176 len += strlen(baseword) + 1;
1184 search->
hyp_str = ckd_calloc(1, len);
1187 c = search->
hyp_str + len - 1;
1190 fsg_link_t *fl = fsg_hist_entry_fsglink(hist_entry);
1191 char const *baseword;
1194 bp = fsg_hist_entry_pred(hist_entry);
1195 wid = fsg_link_wid(fl);
1196 if (wid < 0 || fsg_model_is_filler(fsgs->
fsg, wid))
1198 baseword = dict_basestr(dict,
1200 fsg_model_word_str(fsgs->
fsg, wid)));
1201 len = strlen(baseword);
1203 memcpy(c, baseword, len);
1220 if ((bp = fsg_hist_entry_pred(hist_entry)) >= 0)
1221 ph = fsg_history_entry_get(fsgs->
history, bp);
1222 seg->
word = fsg_model_word_str(fsgs->
fsg, hist_entry->fsglink->wid);
1223 seg->
ef = fsg_hist_entry_frame(hist_entry);
1224 seg->
sf = ph ? fsg_hist_entry_frame(ph) + 1 : 0;
1226 if (seg->
sf > seg->
ef) seg->
sf = seg->
ef;
1230 seg->
lscr = hist_entry->fsglink->logs2prob;
1233 seg->
ascr = hist_entry->score - ph->score - seg->
lscr;
1236 seg->
ascr = hist_entry->score - seg->
lscr;
1244 ckd_free(itor->
hist);
1258 fsg_seg_bp2itor(seg, itor->
hist[itor->
cur]);
1268 fsg_search_seg_iter(
ps_search_t *search, int32 *out_score)
1274 bpidx = fsg_search_find_exit(fsgs, fsgs->
frame, fsgs->
final, out_score);
1284 if ((dag = fsg_search_lattice(search)) == NULL)
1286 if ((link = fsg_search_bestpath(search, out_score, TRUE)) == NULL)
1295 itor = ckd_calloc(1,
sizeof(*itor));
1296 itor->
base.
vt = &fsg_segfuncs;
1303 bp = fsg_hist_entry_pred(hist_entry);
1315 itor->
hist[cur] = hist_entry;
1316 bp = fsg_hist_entry_pred(hist_entry);
1336 if ((dag = fsg_search_lattice(search)) == NULL)
1338 if ((link = fsg_search_bestpath(search, NULL, TRUE)) == NULL)
1340 return search->
post;
1349 new_node(
ps_lattice_t *dag, fsg_model_t *fsg,
int sf,
int ef, int32 wid, int32 ascr)
1353 for (node = dag->
nodes; node; node = node->
next)
1354 if (node->
sf == sf && node->
wid == wid)
1359 if (node->
lef == -1 || node->
lef < ef)
1361 if (node->
fef == -1 || node->
fef > ef)
1372 node->
fef = node->
lef = ef;
1387 find_node(
ps_lattice_t *dag, fsg_model_t *fsg,
int sf, int32 wid)
1391 for (node = dag->
nodes; node; node = node->
next)
1392 if (node->
sf == sf && node->
wid == wid)
1401 glist_t start = NULL;
1405 for (node = dag->
nodes; node; node = node->
next) {
1406 if (node->
sf == 0 && node->
exits) {
1407 E_INFO(
"Start node %s.%d:%d:%d\n",
1408 fsg_model_word_str(fsgs->
fsg, node->
wid),
1410 start = glist_add_ptr(start, node);
1419 node = gnode_ptr(start);
1425 wid = fsg_model_word_add(fsgs->
fsg,
"<s>");
1426 if (fsgs->
fsg->silwords)
1427 bitvec_set(fsgs->
fsg->silwords, wid);
1428 node = new_node(dag, fsgs->
fsg, 0, 0, wid, 0);
1429 for (st = start; st; st = gnode_next(st))
1444 for (node = dag->
nodes; node; node = node->
next) {
1446 E_INFO(
"End node %s.%d:%d:%d (%d)\n",
1447 fsg_model_word_str(fsgs->
fsg, node->
wid),
1449 end = glist_add_ptr(end, node);
1455 node = gnode_ptr(end);
1457 else if (nend == 0) {
1463 for (node = dag->
nodes; node; node = node->
next) {
1471 E_INFO(
"End node %s.%d:%d:%d (%d)\n",
1472 fsg_model_word_str(fsgs->
fsg, node->
wid),
1482 wid = fsg_model_word_add(fsgs->
fsg,
"</s>");
1483 if (fsgs->
fsg->silwords)
1484 bitvec_set(fsgs->
fsg->silwords, wid);
1485 node = new_node(dag, fsgs->
fsg, fsgs->
frame, fsgs->
frame, wid, 0);
1488 for (st = end; st; st = gnode_next(st)) {
1504 q = glist_add_ptr(NULL, end);
1510 q = gnode_free(q, NULL);
1512 for (x = node->
entries; x; x = x->next) {
1516 q = glist_add_ptr(q, next);
1558 n = fsg_history_n_entries(fsgs->
history);
1559 for (i = 0; i < n; ++i) {
1566 if (fh->fsglink == NULL || fh->fsglink->wid == -1)
1579 ascr = fh->score - pfh->score;
1580 sf = pfh->frame + 1;
1593 node = new_node(dag, fsg, sf, fh->frame, fh->fsglink->wid, ascr);
1599 n = fsg_history_n_entries(fsgs->
history);
1600 for (i = 0; i < n; ++i) {
1602 fsg_arciter_t *itor;
1608 if (fh->fsglink == NULL || fh->fsglink->wid == -1)
1614 sf = pfh->frame + 1;
1615 ascr = fh->score - pfh->score;
1621 src = find_node(dag, fsg, sf, fh->fsglink->wid);
1624 for (itor = fsg_model_arcs(fsg, fsg_link_to_state(fh->fsglink));
1625 itor; itor = fsg_arciter_next(itor)) {
1626 fsg_link_t *link = fsg_arciter_get(itor);
1629 if (link->wid >= 0) {
1634 if ((dest = find_node(dag, fsg, sf, link->wid)) != NULL)
1642 fsg_arciter_t *itor2;
1645 for (itor2 = fsg_model_arcs(fsg, fsg_link_to_state(link));
1646 itor2; itor2 = fsg_arciter_next(itor2)) {
1647 fsg_link_t *link = fsg_arciter_get(itor2);
1648 if (link->wid == -1)
1650 if ((dest = find_node(dag, fsg, sf, link->wid)) != NULL)
1658 if ((dag->
start = find_start_node(fsgs, dag)) == NULL)
1660 if ((dag->
end = find_end_node(fsgs, dag)) == NULL)
1662 E_INFO(
"lattice start node %s.%d end node %s.%d\n",
1664 fsg_model_word_str(fsg, dag->
end->
wid), dag->
end->
sf);
1670 for (node = dag->
nodes; node; node = node->
next) {
1672 fsg_model_word_str(fsg, node->
wid));
1682 mark_reachable(dag, dag->
end);
1686 int32 silpen, fillpen;
1688 silpen = (int32)(logmath_log(fsg->lmath,
1689 cmd_ln_float32_r(ps_search_config(fsgs),
"-silprob"))
1692 fillpen = (int32)(logmath_log(fsg->lmath,
1693 cmd_ln_float32_r(ps_search_config(fsgs),
"-fillprob"))