Using Respell Functions in Dictionary Entries

Using Respell Functions in Dictionary Entries

Postby Jim Bretti » Tue Sep 27, 2011 11:19 am

When creating pronunciation dictionary entries, the following "Respell Functions" can be used when the Pronounce Using dropdown is set to respell.

##Lowercase
Use the lowercase function to force upper case words to lower case. If a passage of text is all upper case, some voices will spell out each word (as letters), instead of pronouncing the upper case text as words. This function can be used to work around the problem. You might want to solve this by having a regular expression that searches for uppercase text of some minimum length, and using the ##LowerCase function to process each match.

For example, if you wanted to translate all upper case words 3 characters or longer to lower case, you could create a pronunciation dictionary as follows:

1. Set the Text Matching dropdown to "Regular Expression"

2. For the regular expression use:
\b[A-Z]{3,}\b

3. Set the Pronounce Using dropdown to "Respell"

4. For the respell string, use
##LowerCase($0)

5. The "Case Sensitive" checkbox should be selected

This dictionary entry would locate upper case text 3 characters and longer that falls on a word boundary, and convert these strings to lower case.

##Uppercase
The ##Uppercase function works exactly like the ##Lowercase function, except it converts lower case text to upper case.

##ConvertRomanNumeral
This function can be used to pronounce Roman Numeral text as a number. For example, if you have a regular expression that matches the text XXX, you can use ##ConvertRomanNumeral($0) to pronounce the text as "30" instead of "X X X".

##Sum
This function allows you to add two numbers. For example, if the regular expression capture variables $1 and $2 both match numbers, you can speak the sum of the numbers using ##Sum($1, $2). You can also add a fixed constant to capture variable. ##Sum($1, 3) will add 3 to the capture variable $1, allowing you to have the sum of the numbers spoken.
Jim Bretti
NextUp.com
Listen and Learn Anywhere
http://www.NextUp.com
Jim Bretti
 
Posts: 1328
Joined: Wed Oct 29, 2003 11:07 am

Return to TextAloud 3 Advanced FAQ

Who is online

Users browsing this forum: No registered users and 0 guests