NVDA Speech Dict: Match pattern after line of certain pattern


William
 

Hello,


If I want to configure NVDA speech dict to match pattern that occur after certain patter of line, is it possible?


For example, if I wanna match An apple in the below example, which I only wnat to match the line of An apple that occur after the first line (

Items to be sold:)

.


Items to be sold:

An apple


Thanks,

William


 

Trying to match across line breaks is tricky, but it can be done.  The question is, given your example, if there were more items listed on individual lines below "An apple" would you be looking for those, too?

It's much easier to discuss this if you give an actual example of the data you're trying to work on, taken straight from its source, and can describe what it is that you are hoping will happen when processing it.
--

Brian - Windows 10 Pro, 64-Bit, Version 20H2, Build 19042  

Always remember others may hate you but those who hate you don't win unless you hate them.  And then you destroy yourself.

       ~ Richard M. Nixon

 


 

Subject update for clarity.
--

Brian - Windows 10 Pro, 64-Bit, Version 20H2, Build 19042  

Always remember others may hate you but those who hate you don't win unless you hate them.  And then you destroy yourself.

       ~ Richard M. Nixon

 


Luke Davis
 

William wrote:

If I want to configure NVDA speech dict to match pattern that occur after certain patter of line, is it possible?
No.

While regular expressions are capable of this, NVDA is not, because of how it processes dictionaries.

I wrote a test file:

test1
test2
test3

And did a say-all on it.
This, from the log, is how NVDA processes that event:

Input: kb(desktop):NVDA+downArrow
Speaking [CallbackCommand(name=say-all:lineReached), 'test1\r\n', CallbackCommand(name=say-all:lineReached), 'test2\r\n', CallbackCommand(name=say-all:lineReached), 'test3\r\n', CallbackCommand(name=say-all:lineReached)]

Ignoring the stuff not in single quotes, you can see that each line is handled, and therefore processed, separately.
It is little different than using your arrow key to read the text line by line.

You could commission someone to write an add-on for you to do this if you really need it, but NVDA can't do it by default.

Luke

"In this life there are obstacles, and forces who overcome obstacles. You can be either one or the other.
If you refuse to even try to clear an obstacle, you become the obstacle."
- Joel Shepherd


William
 

Ok understood, thanks.

Luke Davis 於 16/4/2021 7:28 寫道:

William wrote:

If I want to configure NVDA speech dict to match pattern that occur after certain patter of line, is it possible?
No.

While regular expressions are capable of this, NVDA is not, because of how it processes dictionaries.

I wrote a test file:

test1
test2
test3

And did a say-all on it.
This, from the log, is how NVDA processes that event:

Input: kb(desktop):NVDA+downArrow
Speaking [CallbackCommand(name=say-all:lineReached), 'test1\r\n', CallbackCommand(name=say-all:lineReached), 'test2\r\n', CallbackCommand(name=say-all:lineReached), 'test3\r\n', CallbackCommand(name=say-all:lineReached)]

Ignoring the stuff not in single quotes, you can see that each line is handled, and therefore processed, separately.
It is little different than using your arrow key to read the text line by line.

You could commission someone to write an add-on for you to do this if you really need it, but NVDA can't do it by default.

Luke

"In this life there are obstacles, and forces who overcome obstacles. You can be either one or the other.
If you refuse to even try to clear an obstacle, you become the obstacle."
- Joel Shepherd




 

On Thu, Apr 15, 2021 at 07:28 PM, Luke Davis wrote:
you can see that each line is handled, and therefore processed, separately.
-
And this really makes sense, given the overall context.

You can definitely use regular expressions outside of a screen reader to "look across lines," but even that's kind of rare.  I'd still love to know what the original data set really is and what the goal is, but that would definitely be outside the scope of the NVDA Group.  Further discussion of that nature is definitely Chat Subgroup territory.
--

Brian - Windows 10 Pro, 64-Bit, Version 20H2, Build 19042  

Always remember others may hate you but those who hate you don't win unless you hate them.  And then you destroy yourself.

       ~ Richard M. Nixon