Pronounciation-Editor-Entry Problem

Forum for TextAloud version 3

Moderator: Jim Bretti

Post Reply
jackthebest
Posts: 58
Joined: Wed Feb 08, 2006 11:48 am
Contact:

Pronounciation-Editor-Entry Problem

Post by jackthebest »

When I try to make speak the sentence

Ich, glaube, folgendes, hallo, hallo, du.

using the following regular expression to mark the comma (,), it pronounced only the first and the third one, the others not...
(([,][\s])[A-Z,Ö,Ä,Ü][a-z,ä,ö,ü,ß]+)[\s]
([\s]([,][\s])+[a-z,ä,ö,ü,ß]+)[\s]
(([,][\s])[A-Z,Ö,Ä,Ü][a-z,ä,ö,ü,ß]+)


How can I modify it successfully to make speaking each , ?
THANKS in advance!
Best wishes,
Jakob
PS: I mark the sentence in Word 2007...
PHenry1026
Posts: 231
Joined: Thu Jan 11, 2007 12:10 pm
Contact:

Re: Pronounciation-Editor-Entry Problem

Post by PHenry1026 »

Greetings,

I am not sure what you are trying to do since you did not show the replacement string but modifying the second regex (([\s]([,][\s])+[a-z,ä,ö,ü,ß]+)[\s])to the following:

(?m)((^|[,][\s]|[\s][,]|\s)[a-z,ä,ö,ü,ß]+)(?=[\s]|\.)

should capture all words.

Percy Henry
PHenry1026
Posts: 231
Joined: Thu Jan 11, 2007 12:10 pm
Contact:

Re: Pronounciation-Editor-Entry Problem

Post by PHenry1026 »

Actually if you are just interest in capturing the words a more elegant regex would be the following:

(?m)(?<=^|\s)([a-zäöüß]+)(?=,|\s|\.)

If you also want to pick-up the commas in you capturing parenthesis then following modification should do the trick:

(?m)(?<=^|\s)([a-zäöüß,]+)(?=\s|\.)

(?<=^|\s) is a look-behind and (?=,|\s|\.) is a lookahead; they do not consume any of the text and can be very useful since other regexes can subsequently work on the unconsumed test. In both examples the replacement text should use $1 only since (?<=^|\s) and (?=\s|\.) capture nothing.

Percy Henry
Post Reply