Onyx logo

Previous topic

onyx.htkfiles.htkmmf – Read HTK mmf files into our model structure.

Next topic

onyx.htkfiles.htkscp – Tools to read multiple HTK audio files as specified by one scp file

This Page

onyx.htkfiles.htklex – Read HTK lexicon files into our lexicon structure

>>> line_iter0 = StringIO(_dict0)
>>> lex0 = read_htk_lexicon(line_iter0)
>>> print(lex0)
Lexicon with 19 orthographies and 21 prons
>>> module_dir, module_name = os.path.split(__file__)
>>> htk_lex_file0 = os.path.join(module_dir, "en_lexic.v08")
>>> f = open(htk_lex_file0)
>>> lex1 = read_htk_lexicon(f)
>>> print(lex1)
Lexicon with 90996 orthographies and 99364 prons
>>> lex1.num_phones
44
onyx.htkfiles.htklex.read_htk_lexicon(line_iterable)

From an iterable over lines in an HTK lexicon file, create a FrozenLexicon