trftools.dictionaries.read_cmupd

trftools.dictionaries.read_cmupd(strip_stress=False, apostrophe="'")

Read the CMU-Pronunciation Dictionary

Parameters:
  • strip_stress (bool) – Remove stress from pronunciations (default False).

  • apostrophe (str | bool) – Character to replace apostrophe with in keys (e.g., “COULDN’T”; default is to keep apostrophe; set to False to split entries with apostrophes into pre- and post-apostrophy components).

Returns:

cmu – Dictionary mapping words (all caps) to lists of pronunciations.

Return type:

dict {str: list of str}