mirror of
https://github.com/cmusphinx/sphinxtrain.git
synced 2026-06-16 13:14:30 +00:00
mk_phone_graph builds a per-utterance phone graph from a word sequence; for single-pron utterances the graph is a strict linear chain matching mk_phone_list's output, otherwise it carries parallel paths for every pronunciation variant returned by lexicon_lookup_variants. Transcript tokens already disambiguated with an (N) suffix fall through to lexicon_lookup and contribute a single path. phone_graph_split_contexts duplicates any slot whose predecessors carry multiple distinct CI phones, once per distinct predecessor CI, so each slot in the result has an unambiguous left context for triphone resolution. cvt2triphone_graph walks the post-split graph and replaces each slot's CI phone with its triphone acmod_id using the same word-position back-off as cvt2triphone. state_seq_make_graph then builds a state_t array, fanning the non-emit exit of each slot out to every graph successor with uniform 1/n_next probability; for a linear graph it produces an array bit-identical to state_seq_make's output on the equivalent phone[] list. The static helpers set_next_state/set_prior_state in state_seq.c are renamed state_seq_set_next/state_seq_set_prior, exposed via the new private header state_seq_internal.h, and shared by both the linear state_seq_make and the new state_seq_make_graph. CMakeLists.txt registers the three new .c files.