Spell Out the First Three lowercase letters

Forum for TextAloud version 4

Moderator: Jim Bretti

Post Reply
ancLogan
Posts: 11
Joined: Sat Nov 09, 2019 1:17 pm
Contact:

Spell Out the First Three lowercase letters

Post by ancLogan »

Is there an expression I can use to allow the program to recognize the following text format “btnPrint”, three lowercase letters followed by another word beginning with an upper case? I would like the program to read all words of this format, “btnPrint” as “ b t n Print”
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Re: Spell Out the First Three lowercase letters

Post by Jim Bretti »

You should be able to handle something like this with a TextAloud pronunciation dictionary. You can use a regular expression to find text to replace, and respell the text using a TextAloud spell function to spell out the first three letters.

Here's how to do it. Click Control Center -> Pronunciation Dictionary Maintenance to open the dictionary maintenance dialog, select a dictionary (or create a new dictionary) then click File -> New Entry.

For the dictionary entry, set the Text Matching dropdown to Regular Expression, and use this for the expression:
([a-z]{3})([A-Z].+?)

Then set the Pronounce Using dropdown to Respell, and use this for the spelling:
##spell($1) $2

Also make sure the case sensitive checkbox is selected.

The regular expression should match text like btnPrint, and pronunce it as 'b t n Print'
Jim Bretti
NextUp.com
ancLogan
Posts: 11
Joined: Sat Nov 09, 2019 1:17 pm
Contact:

Re: Spell Out the First Three lowercase letters

Post by ancLogan »

Thank you. This works perfectly. You have saved me so much time.
Kind Regards.
Post Reply