locked Re: blank line reading by NVDA

Luke Davis
 

On Tue, 8 Oct 2019, Brian Vogel wrote:

This conversation interests me because it seems to me that two different things are being talked about.Luke's solution uses a regular expression where the
word "blank" itself must be matched, using anchors at each end.  But the original question seems to me to be about lines that contain nothing but a return,
that is, a completely blank line, so that if someone typed line one, followed by two hits of Enter, followed by line two it would be read as, "Line one
blank blank line two," by NVDA.It does not seem to me to have anything to do with the word "blank" or its equivalent in any language, so I don't know what
I'm missing, if anything at all.
What you appear to be missing, are the dynamics of the available solutions.

Sure, if we had the option of running some kind of preprocessing filter on the text before NVDA converted it to speech, we could use a regexp like the one you suggest. But have you actually tried it? I suspect if you had, you would have found that it has no effect what so ever.
That is because we don't have that preprocessing option, short of writing an add-on for this strange purpose.

What we do have available, are speech dictionaries. But with that we have a problem, because by the time the dictionaries get applied, it's far too late in the process to even see the original text. All we get to work with is a layer between the text that is going to be sent to a synth, and the text that actually arrives at a synth.

We are doing post-processing transforms on *output* not input.

How does one tell a synth to indicate a blank line? If you just send \n, or \r\n, or their ASCII control code equivalents, it will likely say nothing. The way you (NVDA) get it to say something, is to substitute the word "blank", or the locale equivalent. So that, and only that, is what we are left with intercepting and modifying or suppressing.

Now using the regular expression:  ^\s*$with nothing substituted for it should find any line that is blank, whether it's just someone having hit Enter, or any whitespace character followed by enter, and would say nothing if that's found.
Of course, if we were able to preprocess the text before NVDA's translation layers got their hooks into it, but we can't.

If the literal word "blank" were to
appear all by its lonesome on a single line it would be read, correctly, as blank.One would definitely not want to be using this method when proofreading
something written in a text editor, as you'd never know if you'd put in paragraph breaks or how many times you'd hit enter when trying to create vertical
separation.
To be clear, I was answering the question, not stating an opinion on the advisability of doing this. Which opinion is: don't, it's not worth it. But hey, to each his own.

Luke

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