Re: NVDA pronouncing "no" as "number" with some widgets but only with Microsoft synthesizers


Luke Davis
 

On Wed, 11 Sep 2019, Brian Vogel wrote:

Quentin, I tried playing with, both of which were defined as regular expression without case sensitivity: [Nn][Oo]\.* (\d+) number \2
The most obvious problem, is that \2 should be \1. You only have one capturing subexpression, so \2 should be undefined.

That said:

Using source string:
This is no. 5 and No. 6. No it isn't!

pattern: ([Nn][Oo]\\.*)(?= *\\d+)
and replacement: number

Results in:
This is number 5 and number 6. No it isn't!

In Python, the (?=...) construct means "Match, but don't consume".

Note: tested at the python console with re.sub, not in NVDA directly.

[Nn][Oo](\s|$) NoThe above should cause any case combination of "no", optionally followed by a period, followed by a space, followed by one or more digits
to be announced as, "Number" followed by the number that is in the collection of digits.  That's the first line.The second should cause any case combination
of "no" followed by white space or where "no" is the only thing on the line to be announced as No.The problem is that the first line is not working, at
all.   If I have the line:Chanel No. 5
"Chanel number 5" with my expression above.

I would probably do your second pattern as:

[Nn][Oo](?!\.* *\d+)

Using that pattern, a replacement of "know", with this source string:
This is no no. 1, oh no!

Results in:
This is know no. 1, oh know!

And:

No. Way. This. is. No. 1!

Gets:
know. Way. This. is. No. 1!

Hth.

Luke

Join nvda@nvda.groups.io to automatically receive all group messages.