Currency symbols

Discussion Forum for TextAloud. Great place to share ideas, ask questions, talk with other users. If you have a tough technical question, still feel free to ask us at support@nextup.com. Also, if you would like a personal response, be sure to leave your email address.

Moderators: kdwhite, Jim Bretti, D.Leikin

Currency symbols

Postby jbenny » Fri Sep 28, 2007 7:48 pm

I have read quite a few posts and searched, but haven't found how to properly handle the Pound and Euro currency symbols. I'm not very good at regular expressions, but this is what I came up with so far.

{{re=£([\d]+)}}
$1 pounds

This works ok except for when the number is exactly "1", or when the Pound symbol has no number after it. In these cases, it should say "pound" instead of "pounds". I have the same situation with the Euro symbol.

Can anyone help me figure out how to handle the singular/plural aspect? I see that the $ is already handled properly with Crystal, Mike, Kate and Paul (sounds almost like a folk group, doesn't it?).
jbenny
 
Posts: 19
Joined: Fri Sep 28, 2007 7:39 pm

Postby D.Leikin » Sat Sep 29, 2007 7:31 am

Hi jbenny,

Introducing something like this couple of regex

Word: {{re=\£([0-9,]+\w)}}
Pronunciation: $1 pounds

Word: {{re=\£1\w}}
Pronunciation: one pound

should probably help fix the 1 pound issue, I hope.
D.Leikin
 
Posts: 682
Joined: Sat Jan 14, 2006 2:15 pm

Postby jbenny » Sat Sep 29, 2007 9:01 am

I originally only had Crystal and Mike. These voices do the $ ok, but don't do anything with the Pound or Euro symbol. Now I have Kate and Paul. I see that they get the Pound correct, but don't support the Euro.

I'll try your suggestions. Hopefully I won't mess up Kate and Paul :-)
jbenny
 
Posts: 19
Joined: Fri Sep 28, 2007 7:39 pm

Postby jbenny » Sat Sep 29, 2007 9:06 am

I just tried your expressions and it doesn't make any difference. Crystal/Mike just say the number.
jbenny
 
Posts: 19
Joined: Fri Sep 28, 2007 7:39 pm

Postby D.Leikin » Sat Sep 29, 2007 4:09 pm

My mistake, try these:

{{re=(\£[1-9][,0-9]+[0-9]+)(\s|\.\s|\,\s)}} -> $1 pounds
{{re=\£([2-9])(\s|\.\s|\,\s)}} -> $1 pounds
{{re=\£1(\s|\.\s|\,\s)}} -> one pound

If they don’t work on strings like

£1, £2, £3. £1,234, £1 £3 £1,234,561, £1234567.

make sure (i) no conflicting edits were left behind in your dictionary, (ii) £ hexadecimal character code is correct.
D.Leikin
 
Posts: 682
Joined: Sat Jan 14, 2006 2:15 pm

Postby jbenny » Sat Sep 29, 2007 9:46 pm

Almost. With Crystal/Mike, that works on all numbers I tried execpt on 10-99. It makes Kate/Paul say "pounds" twice. Also, it doesn't work at all if there is a space between the currency symbol and the number.
jbenny
 
Posts: 19
Joined: Fri Sep 28, 2007 7:39 pm

Postby D.Leikin » Sun Sep 30, 2007 6:45 am

jbenny,

Thanks for testing those expressions.

Seem to have found the fix for the issues you discovered:

{{re=(\£[1-9][,0-9]*[0-9]+)(\s|\.\s|\,\s)}} -> $1 pounds $2
{{re=(\£\s)([1-9][,0-9]*[0-9]+)(\s|\.\s|\,\s)}} -> $2 pounds $3
{{re=\£(|\s)([2-9])(\s|\.\s|\,\s)}} -> $2 pounds $3
{{re=\£(|\s)1(\s|\.\s|\,\s)}} -> one pound $2

I tried this set with both AT&T and NeoSpeech voices and all of them seem to work ok now.
D.Leikin
 
Posts: 682
Joined: Sat Jan 14, 2006 2:15 pm

Postby jbenny » Sun Sep 30, 2007 10:09 am

That works better, but with numbers of 10 or greater, Kate/Paul say "pounds" twice. This may be more trouble than it's worth. Kate/Paul seem to handle pounds correctly as-is. However, none of the voices seem to handle Euro, so the same solution should work for both currency symbols.

Thanks for trying.
jbenny
 
Posts: 19
Joined: Fri Sep 28, 2007 7:39 pm


Return to TextAloud 2 Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron