G2PTopLevelMixin#

class montreal_forced_aligner.g2p.mixins.G2PTopLevelMixin(**kwargs)[source]#

Bases: MfaWorker, DictionaryMixin, G2PMixin

Abstract mixin class for top-level G2P functionality

See also

MfaWorker

For base MFA parameters

DictionaryMixin

For dictionary parsing parameters

G2PMixin

For base G2P parameters

export_pronunciations(output_file_path, export_scores=False, ensure_sorted=False)[source]#

Output pronunciations to text file

Parameters:
  • output_file_path (Path) – Path to save

  • export_scores (bool) – Flag for appending a column for the score of the pronunciation

  • ensure_sorted (bool) – Flag for ensuring that output file is sorted alphabetically

generate_pronunciations()[source]#

Generate pronunciations

Returns:

Tuple of word with their scored pronunciations

Return type:

str, list[tuple[str, float]]]