Using Respell Functions in Dictionary Entries

Moderator: Jim Bretti

Post Reply
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Using Respell Functions in Dictionary Entries

Post by Jim Bretti »

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
Post Reply