FAVE CMU Dictionary module¶
Functions for working with CMU pronunciation dictionary
- class fave.cmudictionary.CMU_Dictionary(dictionary_file, **kwargs)¶
Representation of the CMU dictionary
- add_dictionary_entries(infile, path='.')¶
Reads additional dictionary entries from file and adds them to the CMU dictionary
@param string infile @param string path @raises IndexError
- check_phone(phone, transcription, index)¶
checks that a phone entered by the user is part of the Arpabet
- check_transcription(transcription)¶
checks that the transcription entered for a word conforms to the Arpabet style
- check_word(word, next_word='', unknown=None, line='')¶
checks whether a given word’s phonetic transcription is in the CMU dictionary; adds the transcription to the dictionary if not
- static merge_dicts(d1, d2)¶
merges two versions of the CMU pronouncing dictionary
- read(dictionary_file)¶
@author Keelan Evanini
- write_dict(fname, dictionary=None)¶
writes the new version of the CMU dictionary (or any other dictionary) to file
- write_unknown_words(unknown, fname='unknown.txt')¶
writes the list of unknown words to file
- class fave.cmudictionary.Phone¶
represents a CMU dict phoneme (label and distinctive features)
- fave.cmudictionary.read_dict(f)¶
reads the CMU dictionary and returns it as dictionary object, allowing multiple pronunciations for the same word
- fave.cmudictionary.read_phoneset(f)¶
reads the CMU phoneset (assigns distinctive features to each phoneme); returns it as dictionary object