Example: Speak -> Spubeak, more info here
Don’t give me a solution, but point me in the right direction or tell which which python library I could use? I am thinking of regex since I have to find a vowel, but then which method could I use to insert ‘ub’ in front of a vowel?
It is more complex then just a simple regex e.g.,
Simple regex won’t catch that
eis not pronounced inare.You need a library that provides a pronunciation dictionary such as
nltk.corpus.cmudict:Example:
Output
Note: It is different from the first example: each word is replaced with its syllables.