trftools.dictionaries.read_dict

trftools.dictionaries.read_dict(dictionary='english', strip_stress=False, upper=False)

Read a forced aligner dictionary file

Parameters:
  • dictionary (Path | str) –

    Dictionary file name, or name of a built-in dictionary:

  • strip_stress (bool) – Strip stress information from vowels (e.g., ‘AH0’ -> ‘AH’).

  • upper (bool) – Force keys to uppercase.

Returns:

Dictionary mapping words to sets of pronunciations {str: {str, ...}}.

Return type:

dictionary