Making NVDA say day, month name, year for dates formatted as DD/MM/YYYY


 
Edited

Dennis,

By the way, if you want to be very anal retentive about avoiding anything except a date formatted as DD/MM/YYYY or DD/MM/YY, where a leading zero could possibly be missing from the DD part, the regex would become:

(0?[1-9]|[12][0-9]|3[01])\/(ZZ)\/(\d{4}|\d{2})

and where the ZZ in the above would be 01 through 12, depending on the month it is you are trying specifically to recognize and snag.  All of the replacement strings given previously would work.

Further precision is possible for months that have less than 31 days where, if it weren't February, the 3[01], could be replaced with a straight 30 and for February, the "|3[01]" eliminated altogether and t
--

Brian - Windows 10, 64-Bit, Version 21H1, Build 19043  

I do not understand why some seek to separate a person from their actions.  The self is composed of an individual’s thoughts, actions, and expression, which are contained in and actuated by the body.  What you do and say is the clearest indicator of who you are.

      ~ Brian Vogel

 


dennis huckle
 

Many thanks.

I’ll take this all on board.

Kind regards,

Dennis huckle.

 

 

From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Brian Vogel
Sent: 22 June 2021 18:06
To: nvda@nvda.groups.io
Subject: Re: [nvda] speech dictionary

 

Dennis,

I am going to presume that all dates will have a format DD/MM/YYYY or possibly DD/MM/YY for the purposes of what follows.

First, here's the step-by-step tutorial for adding a regular expression type match to the NVDA default dictionary.  The same steps would apply to the voice or temporary dictionary, but you'd have to select the correct one of those at that step in the steps.  I will presume you want this for any voice and all the time, so the default dictionary is appropriate:
----

Adding a Regular Expression match to the Default Dictionary

1. Hit NVDA+N,P,D,D   NVDA Main Menu, Preferences, Speech dictionaries, Default Dictionary

2. Hit ALT+A to activate the Add Button or navigate to it and activate it.

3. In the dialog that appears, paste or enter a regular expression in the Pattern edit box.

4. Paste or enter the replacement you want to hear in the Replacement edit box.  If you're using a capturing regular expression this may be a sequence of backslashes followed by the numbers of the capture groups you're using.

5. The comment edit box should either have a comment that helps you to remember the purpose of this dictionary entry, which is preferable, or be left blank.

6. Leave the Case Sensitive checkbox unchecked.

7. The Type radio button should be set to Regular Expression.

8. Activate the OK button

----

Now, for the list of twelve regular expression patterns and their respective replacement strings (all of which start with backslash one, so when you get to that on the line that is where the replacement string begins).  All of the regular expression patterns start with a left parenthesis and end with a right curly brace followed by a right parenthesis:

([0123][0-9])\/(01)\/(\d{2,4})          \1 January \3

 

([0123][0-9])\/(02)\/(\d{2,4})          \1 February \3

 

([0123][0-9])\/(03)\/(\d{2,4})          \1 March \3

 

([0123][0-9])\/(04)\/(\d{2,4})          \1 April \3

 

([0123][0-9])\/(05)\/(\d{2,4})          \1 May \3

 

([0123][0-9])\/(06)\/(\d{2,4})          \1 June \3

 

([0123][0-9])\/(07)\/(\d{2,4})          \1 July \3

 

([0123][0-9])\/(08)\/(\d{2,4})          \1 August \3

 

([0123][0-9])\/(09)\/(\d{2,4})          \1 September \3

 

([0123][0-9])\/(10)\/(\d{2,4})          \1 October \3

 

([0123][0-9])\/(11)\/(\d{2,4})          \1 November \3

 

([0123][0-9])\/(12)\/(\d{2,4})          \1 December \3


----

Try putting the one for June into your default dictionary then having NVDA read that email (or this one) from me to see how the date is pronounced afterward.
 
--

Brian - Windows 10, 64-Bit, Version 21H1, Build 19043  

I do not understand why some seek to separate a person from their actions.  The self is composed of an individual’s thoughts, actions, and expression, which are contained in and actuated by the body.  What you do and say is the clearest indicator of who you are.

      ~ Brian Vogel

 


 

Dennis,

I am going to presume that all dates will have a format DD/MM/YYYY or possibly DD/MM/YY for the purposes of what follows.

First, here's the step-by-step tutorial for adding a regular expression type match to the NVDA default dictionary.  The same steps would apply to the voice or temporary dictionary, but you'd have to select the correct one of those at that step in the steps.  I will presume you want this for any voice and all the time, so the default dictionary is appropriate:
----
Adding a Regular Expression match to the Default Dictionary
1. Hit NVDA+N,P,D,D   NVDA Main Menu, Preferences, Speech dictionaries, Default Dictionary
2. Hit ALT+A to activate the Add Button or navigate to it and activate it.
3. In the dialog that appears, paste or enter a regular expression in the Pattern edit box.
4. Paste or enter the replacement you want to hear in the Replacement edit box.  If you're using a capturing regular expression this may be a sequence of backslashes followed by the numbers of the capture groups you're using.
5. The comment edit box should either have a comment that helps you to remember the purpose of this dictionary entry, which is preferable, or be left blank.
6. Leave the Case Sensitive checkbox unchecked.
7. The Type radio button should be set to Regular Expression.
8. Activate the OK button
----

Now, for the list of twelve regular expression patterns and their respective replacement strings (all of which start with backslash one, so when you get to that on the line that is where the replacement string begins).  All of the regular expression patterns start with a left parenthesis and end with a right curly brace followed by a right parenthesis:

([0123][0-9])\/(01)\/(\d{2,4})          \1 January \3
 
([0123][0-9])\/(02)\/(\d{2,4})          \1 February \3
 
([0123][0-9])\/(03)\/(\d{2,4})          \1 March \3
 
([0123][0-9])\/(04)\/(\d{2,4})          \1 April \3
 
([0123][0-9])\/(05)\/(\d{2,4})          \1 May \3
 
([0123][0-9])\/(06)\/(\d{2,4})          \1 June \3
 
([0123][0-9])\/(07)\/(\d{2,4})          \1 July \3
 
([0123][0-9])\/(08)\/(\d{2,4})          \1 August \3
 
([0123][0-9])\/(09)\/(\d{2,4})          \1 September \3
 
([0123][0-9])\/(10)\/(\d{2,4})          \1 October \3
 
([0123][0-9])\/(11)\/(\d{2,4})          \1 November \3
 
([0123][0-9])\/(12)\/(\d{2,4})          \1 December \3

----

Try putting the one for June into your default dictionary then having NVDA read that email (or this one) from me to see how the date is pronounced afterward.
 
--

Brian - Windows 10, 64-Bit, Version 21H1, Build 19043  

I do not understand why some seek to separate a person from their actions.  The self is composed of an individual’s thoughts, actions, and expression, which are contained in and actuated by the body.  What you do and say is the clearest indicator of who you are.

      ~ Brian Vogel

 


dennis huckle
 

Hello Brian,

Hear is the date as presented in your e-mail

Tue 22/06/2021

Hope that’s what you need.

As I am in the uk I use day/month/year

Kind regards,

Dennis huckle.

 

From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Brian Vogel
Sent: 22 June 2021 17:33
To: nvda@nvda.groups.io
Subject: Re: [nvda] speech dictionary

 

Dennis,

Please copy and paste the exact date format out of a couple of e-mail messages that are all being read numerically and I can help you with that using regular expressions for the match and the replacement using the day and year but with the month written out between the two.

Typically there are hyphens, e.g., 22-06-2021, or some other separator, often a forward slash or dot, between those date elements.  If those are not present, then we'd need to determine what always precedes and/or comes after the date that uses spaces as its separators.
--

Brian - Windows 10, 64-Bit, Version 21H1, Build 19043  

I do not understand why some seek to separate a person from their actions.  The self is composed of an individual’s thoughts, actions, and expression, which are contained in and actuated by the body.  What you do and say is the clearest indicator of who you are.

      ~ Brian Vogel

 


 

Dennis,

Please copy and paste the exact date format out of a couple of e-mail messages that are all being read numerically and I can help you with that using regular expressions for the match and the replacement using the day and year but with the month written out between the two.

Typically there are hyphens, e.g., 22-06-2021, or some other separator, often a forward slash or dot, between those date elements.  If those are not present, then we'd need to determine what always precedes and/or comes after the date that uses spaces as its separators.
--

Brian - Windows 10, 64-Bit, Version 21H1, Build 19043  

I do not understand why some seek to separate a person from their actions.  The self is composed of an individual’s thoughts, actions, and expression, which are contained in and actuated by the body.  What you do and say is the clearest indicator of who you are.

      ~ Brian Vogel

 


dennis huckle
 

Hello,

For an example.

If in an e-mail the date is spoken numerically, how can I get the date to say

22 june 2021 instead of 22 06 2021.

Just to learn more about nvda.