Regular Expressions and Masks Question regarding "the"
Moderator: Jim Bretti
Regular Expressions and Masks Question regarding "the"
For my own personal (and, possibly, very anal) preference, I like it when the word "the" is pronounced "thee" in front of words beginning with vowels, and the normal "thuh" in front of words that begin with consonants. I believe that Text Aloud's Pronunciation Dictionary has the capability to do that by utilizing the regular expressions and/or masking function, but the whole subject is completely baffling to me, and I simply do not have time right now to figure out regular expressions in order to make a change that is merely for my convenience. If someone could give me a very simplified explanation as to how this could be done without going too in-depth into the mechanics, I would greatly appreciate it. Thanks for any advice on the subject - T.J.
-
- Posts: 231
- Joined: Thu Jan 11, 2007 12:10 pm
- Contact:
Re: Regular Expressions and Masks Question regarding "the"
Greetings,
What you are requesting can easily be handled with a regex/phoneme combination, but they are complications: since regex/phoneme combinations are currently extremely slow in TA3, I would not generalized the solution but do it on a case by case basis since some voices like AT&T NV already does a very good job of this.
Here are two sample examples of a vowel and constant correction. From one of your pronunciation dictionaries first choose Text Matching Regular expression and enter the following regex:
(?#the_v)(?m)(?<=^|\s)the(?= owner)(?=\b)
Next choose Pronounce using Phoneme and enter
dh iy
For a constant use the following sample template:
(?#the_c)(?m)(?<=^|\s)the(?= boy)(?=\b)
dh ax
Percy Henry
P.S. these regex wont work if "the" is preceded by some initial punctuation like 'the or "the, in these cases you could use a more generalized regex like the following:
(?#the_v)(?m)(?<=^|\s|['"‘“(]|\p{Pi}|\p{Ps}|\p{Pd})the(?= owner)(?=\b)
What you are requesting can easily be handled with a regex/phoneme combination, but they are complications: since regex/phoneme combinations are currently extremely slow in TA3, I would not generalized the solution but do it on a case by case basis since some voices like AT&T NV already does a very good job of this.
Here are two sample examples of a vowel and constant correction. From one of your pronunciation dictionaries first choose Text Matching Regular expression and enter the following regex:
(?#the_v)(?m)(?<=^|\s)the(?= owner)(?=\b)
Next choose Pronounce using Phoneme and enter
dh iy
For a constant use the following sample template:
(?#the_c)(?m)(?<=^|\s)the(?= boy)(?=\b)
dh ax
Percy Henry
P.S. these regex wont work if "the" is preceded by some initial punctuation like 'the or "the, in these cases you could use a more generalized regex like the following:
(?#the_v)(?m)(?<=^|\s|['"‘“(]|\p{Pi}|\p{Ps}|\p{Pd})the(?= owner)(?=\b)