Silencing Reading of Numbers in NVDA
Bhavya shah
Dear all,
I use NVDA 2020.3 and would like to disable reporting of all digits. The number could be of varying length and would be bounded on its left and right by commas. This may come off as an odd request, but I require this for a very specific usage case. I am guessing there is a way to construct a speech dictionary entry to achieve this; if so, if you could compose and share it, that would be massively helpful. I would greatly appreciate any assistance with the above. Thanks. -- Best Regards Bhavya Shah Stanford University | Class of 2024 E-mail Address: bhavya.shah125@... LinkedIn: https://www.linkedin.com/in/bhavyashah125/ |
|
Tony Malykh
Just use a simple regular expression:
toggle quoted message
Show quoted text
,\d+, Or use negative lookahead and lookbehind to preserve the commas, something like: (?<!,)\d+(?!,) You can either do it via speech dictionary to remove them completely, or you can use my Phonetic Punctuation add-on to replace it with some short sound - so that you will at least be aware that there's a number there. HTH On 12/15/2020 9:33 PM, Bhavya shah wrote:
Dear all, |
|
Bhavya shah
Dear Tony,
toggle quoted message
Show quoted text
Thanks a bunch! The second one didn't work unfortunately, but the first one does, so I should be good to go. Thanks for suggesting the Phonetic Punctuations add-on but I don't think that will be necessary in my case. Is there a good resource where I can understand the syntax of regular expressions? I would like to learn more about them in order to be able to write them independently in the future. Thanks. On 12/15/20, Tony Malykh <anton.malykh@...> wrote:
Just use a simple regular expression: --
Best Regards Bhavya Shah Stanford University | Class of 2024 E-mail Address: bhavya.shah125@... LinkedIn: https://www.linkedin.com/in/bhavyashah125/ |
|
On Wed, Dec 16, 2020 at 02:49 AM, Bhavya shah wrote:
Is there a good resource where I can understand the syntax of regular expressions?- There are, literally, thousands of online resources about regular expressions and how to use them, as well as a huge number of books (though I don't know how many would be available in either Braille or other accessible media). When it comes to regular expression teaching materials, "good" generally means written in a style that you find approachable. Some of the resources I've love the most for regular expression syntax are despised by others and vice versa. I'd start by focusing on regular expression basics or regular expressions for beginners and, after having that bit at least somewhat nailed down, moving along into more complicated material. I could be dead before I ever came to know half of what there is to know about regular expressions, and particularly if I were trying to understand the various "flavors" of regular expression processors out there. For NVDA, it follows Python regex syntax, but for most of what ends up being done in dictionaries you're not constructing something that is likely to be different across the regex processors. -- Brian - Windows 10 Pro, 64-Bit, Version 20H2, Build 19042 [Regarding the Supreme Court refusing to hear the case brought by Texas to overturn the votes certified by 4 states:] Pleased with the SCOTUS ruling, but also immediately slightly terrified of where this crazy train goes next. We should know by now there’s a bottomless supply of crazy. ~ Brendan Buck, former adviser to Speakers of the House Paul Ryan and John Boehner
|
|
On Wed, Dec 16, 2020 at 01:36 AM, Tony Malykh wrote:
,\d+,- Although I cannot easily think of a case "in a typical document" where this would snag something and make it silent, I'd imagine it could happen for large number values that include comma separation, e.g., 10,455,342.05. That regex should match the ",455," part of that number, which could prove very problematic. The only reason I mention this is if that regex is working perfectly when you're working with the document you need it for, you will want to remove it from the dictionary afterward. Take it from someone who's been bitten in the posterior by having left things in the speech dictionary that I put there for testing purposes, and that later came into play where they were never intended to, making the screen reader output either incomprehensible or where it was omitting key information. The "simpler" the regex the more likely it is to eventually capture something you really never intended for it to capture. That doesn't mean they shouldn't be used when convenient, but you need to remember to "clean up after you're finished" so they don't come back to bite you in the posterior later. -- Brian - Windows 10 Pro, 64-Bit, Version 20H2, Build 19042 [Regarding the Supreme Court refusing to hear the case brought by Texas to overturn the votes certified by 4 states:] Pleased with the SCOTUS ruling, but also immediately slightly terrified of where this crazy train goes next. We should know by now there’s a bottomless supply of crazy. ~ Brendan Buck, former adviser to Speakers of the House Paul Ryan and John Boehner
|
|
Tony Malykh
AH, I meant to use positive lookahead and lookbehind, not the negative ones. My brain was not working very clearly last night apparently. In case you still need the fancy one, here is the correct one:
toggle quoted message
Show quoted text
(?<=,)\d+(?=,) On 12/15/2020 11:49 PM, Bhavya shah wrote:
Dear Tony, |
|