def write_fst_no_silence(lexicon, nonterminals=None, left_context_phones=None):
    "Writes the text format of L.fst to the standard output.  This version is for\n    when --sil-prob=0.0, meaning there is no optional silence allowed.\n\n      'lexicon' is a list of 3-tuples (word, pron-prob, prons) as returned by\n        read_lexiconp().\n     'nonterminals', which relates to grammar decoding (see kaldi-asr.org/doc/grammar.html),\n        is either None, or the user-defined nonterminal symbols as a list of\n        strings, e.g. ['#nonterm:contact_list', ... ].\n     'left_context_phones', which also relates to grammar decoding, and must be\n        supplied if 'nonterminals' is supplied is either None or a list of\n        phones that may appear as left-context, e.g. ['a', 'ah', ... '#nonterm_bos'].\n    "
    loop_state = 0
    next_state = 1
    for (word, pronprob, pron) in lexicon:
        cost = (- math.log(pronprob))
        cur_state = loop_state
        for i in range((len(pron) - 1)):
            print('{src}\t{dest}\t{phone}\t{word}\t{cost}'.format(src=cur_state, dest=next_state, phone=pron[i], word=(word if (i == 0) else '<eps>'), cost=(cost if (i == 0) else 0.0)))
            cur_state = next_state
            next_state += 1
        i = (len(pron) - 1)
        print('{src}\t{dest}\t{phone}\t{word}\t{cost}'.format(src=cur_state, dest=loop_state, phone=(pron[i] if (i >= 0) else '<eps>'), word=(word if (i <= 0) else '<eps>'), cost=(cost if (i <= 0) else 0.0)))
    if (nonterminals is not None):
        next_state = write_nonterminal_arcs(start_state, loop_state, next_state, nonterminals, left_context_phones)
    print('{state}\t{final_cost}'.format(state=loop_state, final_cost=0.0))
Writes the text format of L.fst to the standard output.  This version is for
when --sil-prob=0.0, meaning there is no optional silence allowed.

  'lexicon' is a list of 3-tuples (word, pron-prob, prons) as returned by
    read_lexiconp().
 'nonterminals', which relates to grammar decoding (see kaldi-asr.org/doc/grammar.html),
    is either None, or the user-defined nonterminal symbols as a list of
    strings, e.g. ['#nonterm:contact_list', ... ].
 'left_context_phones', which also relates to grammar decoding, and must be
    supplied if 'nonterminals' is supplied is either None or a list of
    phones that may appear as left-context, e.g. ['a', 'ah', ... '#nonterm_bos'].
def write_fst_no_silence(lexicon, nonterminals=None, left_context_phones=None):
    "Writes the text format of L.fst to the standard output.  This version is for\n    when --sil-prob=0.0, meaning there is no optional silence allowed.\n\n      'lexicon' is a list of 3-tuples (word, pron-prob, prons) as returned by\n        read_lexiconp().\n     'nonterminals', which relates to grammar decoding (see kaldi-asr.org/doc/grammar.html),\n        is either None, or the user-defined nonterminal symbols as a list of\n        strings, e.g. ['#nonterm:contact_list', ... ].\n     'left_context_phones', which also relates to grammar decoding, and must be\n        supplied if 'nonterminals' is supplied is either None or a list of\n        phones that may appear as left-context, e.g. ['a', 'ah', ... '#nonterm_bos'].\n    "
    loop_state = 0
    next_state = 1
    for (word, pronprob, pron) in lexicon:
        cost = (- math.log(pronprob))
        cur_state = loop_state
        for i in range((len(pron) - 1)):
            print('{src}\t{dest}\t{phone}\t{word}\t{cost}'.format(src=cur_state, dest=next_state, phone=pron[i], word=(word if (i == 0) else '<eps>'), cost=(cost if (i == 0) else 0.0)))
            cur_state = next_state
            next_state += 1
        i = (len(pron) - 1)
        print('{src}\t{dest}\t{phone}\t{word}\t{cost}'.format(src=cur_state, dest=loop_state, phone=(pron[i] if (i >= 0) else '<eps>'), word=(word if (i <= 0) else '<eps>'), cost=(cost if (i <= 0) else 0.0)))
    if (nonterminals is not None):
        next_state = write_nonterminal_arcs(start_state, loop_state, next_state, nonterminals, left_context_phones)
    print('{state}\t{final_cost}'.format(state=loop_state, final_cost=0.0))