langtest.utils.SoundsLikeFunctions.PronunciationFunctions#

class PronunciationFunctions#

Bases: object

Class containing functions related to phonetic representations and pronunciations.

__init__()#

Methods

__init__()

generate_pronunciation(text)

Generates the phonetic representation of a given text using the CMU dictionary.

static generate_pronunciation(text: str) List[str]#

Generates the phonetic representation of a given text using the CMU dictionary.

If the text is not found in the dictionary, it returns a list of phonetic representations obtained from the G2p class.

Parameters:

text (str) – The input text for which the pronunciation is to be generated.

Returns:

A list of phonetic representations of the input text.

Return type:

List[str]