Topics

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

slugolicious@...
 

If a <select> element has "yes" and "no" options, "no" is pronounced as "number" when using any of the Microsoft synthesizers (Microsoft Speech API version 5, Microsoft Speech Platform, Windows OneCore voices).  It works ok with eSpeak. 

If you have "yes" and "no" as radio buttons or checkboxes, it's correctly pronounced as "no".

Sample code:
```
<select>
  <option>yes</option>
  <option>no</option>
</select>               

<select size=5>
  <option>yes</option>
  <option>no</option>
</select>               

<label>
  <input name="a1" type="radio">
  yes
</label>
<label>
  <input name="a1" type="radio">
  no
</label>

<label>
  <input type="checkbox">
  yes
</label>
<label>
  <input type="checkbox">
  no
</label>
```

Tab to the <select>, expand the drop down list, arrow down to "no" and you'll hear "number".  If you select "no" and tab off the <select> then tab back to the <select>, you'll correctly hear "no".

If the <select> is displayed as a listbox (second example), and "no" is selected and you tab off the listbox and then tab back to it, "number" is announced.

"yes" and "no" work ok for radio buttons and checkboxes.

Quentin Christensen
 

It's the Microsoft Synthesizer trying to be helpful and assume that "no" = "number".  The two actions I can suggest are:

1) Report it to Microsoft's Disability Answer Desk, and request their synths not make those assumptions.
2) You can use NVDA's speech dictionary to add an entry for "no" to try to prevent it.  It would be worth testing whether it is case sensitive (eg is "No" treated the same as "no", or "NO"), in which case you could make a entry to change "No" (whole words only) to "no".  Just remember if you are proof reading something and looking for missed capitals :)

Kind regards

Quentin.

On Thu, Sep 12, 2019 at 5:13 AM slugolicious via Groups.Io <slugolicious=yahoo.com@groups.io> wrote:
If a <select> element has "yes" and "no" options, "no" is pronounced as "number" when using any of the Microsoft synthesizers (Microsoft Speech API version 5, Microsoft Speech Platform, Windows OneCore voices).  It works ok with eSpeak. 

If you have "yes" and "no" as radio buttons or checkboxes, it's correctly pronounced as "no".

Sample code:
```
<select>
  <option>yes</option>
  <option>no</option>
</select>               

<select size=5>
  <option>yes</option>
  <option>no</option>
</select>               

<label>
  <input name="a1" type="radio">
  yes
</label>
<label>
  <input name="a1" type="radio">
  no
</label>

<label>
  <input type="checkbox">
  yes
</label>
<label>
  <input type="checkbox">
  no
</label>
```

Tab to the <select>, expand the drop down list, arrow down to "no" and you'll hear "number".  If you select "no" and tab off the <select> then tab back to the <select>, you'll correctly hear "no".

If the <select> is displayed as a listbox (second example), and "no" is selected and you tab off the listbox and then tab back to it, "number" is announced.

"yes" and "no" work ok for radio buttons and checkboxes.



--
Quentin Christensen
Training and Support Manager

 

Quentin, I tried playing with, both of which were defined as regular expression without case sensitivity:

[Nn][Oo]\.* (\d+) number \2
[Nn][Oo](\s|$) No

The 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

I still get NVDA saying Chanel no 5.   I have tested that regular expression using every engine and all of them match anything with the standard N O period number abbreviation and snag the actual number that follows it.  I can't figure out why I'm not getting, "Chanel Number 5."  Any ideas?

This is not a complex regular expression, and I know it has to match, but the substitution "Number \2" is not giving me either the word "number" or the digits, either.
--

Brian - Windows 10 Pro, 64-Bit, Version 1903, Build 18362  

The color of truth is grey.

           ~ André Gide

 

 

Quentin Christensen
 

I must admit, I need to brush up on my regex.  Has anyone got any thoughts for Brian in the meantime?


On Thu, Sep 12, 2019 at 2:27 PM Brian Vogel <britechguy@...> wrote:
Quentin, I tried playing with, both of which were defined as regular expression without case sensitivity:

[Nn][Oo]\.* (\d+) number \2
[Nn][Oo](\s|$) No

The 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

I still get NVDA saying Chanel no 5.   I have tested that regular expression using every engine and all of them match anything with the standard N O period number abbreviation and snag the actual number that follows it.  I can't figure out why I'm not getting, "Chanel Number 5."  Any ideas?

This is not a complex regular expression, and I know it has to match, but the substitution "Number \2" is not giving me either the word "number" or the digits, either.
--

Brian - Windows 10 Pro, 64-Bit, Version 1903, Build 18362  

The color of truth is grey.

           ~ André Gide

 

 



--
Quentin Christensen
Training and Support Manager

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

 

Luke,

             [Nn][Oo]\.* (\d+) number \2 was a mistake with the \2, it should have been \1

I do not understand the need for the double backslashes in your:  ([Nn][Oo]\\.*)(?= *\\d+) as that means you are actually escaping the backslash. And running this through the Regex101.com engines confirms that. I get the "don't consume" bit, but try to avoid using that myself.

All of the above being said, I did a cut and past of your regular expression for the number abbreviation situation, and am still getting NVDA saying "No" for it.  Notepad file of test phrases is:

No, I won't go.
 
No no no
 
Chanel No. 5
 
Space no. 763
 
No. 7

---------------------------------------------
Something's off here.  I even still get the no pronunciation if I take those double backslashes out and use singles:

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

The Regex101 engines all show that matching the classic N O period abbreviation for number, but NVDA is not saying Number when that's used.

--

Brian - Windows 10 Pro, 64-Bit, Version 1903, Build 18362  

The color of truth is grey.

           ~ André Gide

 

 

 

Oddly enough, using regular expression:

[Nn][Oo]\.

works.  It requires that the N O be followed by the period, and in any instance where it is you get Number.   There is an issue, though, if no is at the very end of a sentence.  I can't seem to find a way to effectively say, "but not at the end of a sentence," at least not yet.

--

Brian - Windows 10 Pro, 64-Bit, Version 1903, Build 18362  

The color of truth is grey.

           ~ André Gide

 

 

Luke Davis
 

On Thu, 12 Sep 2019, Brian Vogel wrote:

Luke,             [Nn][Oo]\.* (\d+) number \2 was a mistake with the \2, it should have been \1I do not understand the need for the double backslashes in
your:  ([Nn][Oo]\\.*)(?= *\\d+) as that means you are actually escaping the backslash.
Right you are. In my defense, the double backslashes weren't in the original versions of those.
I wrote them in Python, and when I was done, I printed the variables and copied and pasted without looking. I am very unclear why it escaped the backslashes.
I apologize.
It originally said:

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

Luke

Luke Davis
 

slugolicious and others interested

Solved as follows...

In my testing with notepad, with MS voices, I was able to get the "no" as "number" behavior, only when there really was a number after it.
"no. 1"
"no 1"
"no 1"
All spoke as "number 1", while "no", with or without period, in any other usages, spoke as "no".
Presumptuous, but implemented intelligently.

So then I took slugolicious's actual original test case, and ran that in Firefox.

I was able to replicate the dropdown behavior, where "no" is stated as "number". Looking at the NVDA debug log, it is clear why this is happening: in certain contexts, the number of options is announced as "2 of 2" or similar. What is being sent to the synth is "no 2 of 2", which in any other circumstance should be spoken as "number 2" a vast majority of the time.

Further, since there seems to always be two spaces placed between the word and its option position whether there are 2, 99, or 110 options (I tested), we can fix this with a rather narrow regular expression.

Using a speech dictionary specifically for Microsoft David, I did a case-insensitive regular expression as follows:

Pattern: \Ano(?= \d)
Replacement: know

Note the double space inside the parenthesized portion of the expression.

All "no" as "number" cases still work, except the very particular case of the word "no", followed by two spaces, followed by a digit, which is now pronounced as "no" not "number".
(Actually it's pronounced as "know", which in English is the same thing.)

Hth

Luke