KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: custom command to select current sentence
Topic Summary:
Created On: 09/17/2021 07:54 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 custom command to select current sentence   - wristofdoom - 09/17/2021 07:54 PM  
 custom command to select current sentence   - Alan Cantor - 09/17/2021 08:39 PM  
 custom command to select current sentence   - wristofdoom - 09/17/2021 10:18 PM  
 custom command to select current sentence   - Alan Cantor - 09/18/2021 11:36 PM  
 custom command to select current sentence   - Alan Cantor - 09/19/2021 06:13 PM  
Keyword
 09/17/2021 07:54 PM
User is offline View Users Profile Print this message

Author Icon
wristofdoom
Top-Tier Member

Posts: 267
Joined: 09/03/2020

Does anybody have a custom command for selecting the current sentence that (mostly) works in any application?

 

I know that such a command will not be perfect, and will not pick up on common sense ideas about what constitutes a sentence.

 

However, a command that will move the caret left until it hits a "." character, and then move/select to the right until it hits another "." character seems achievable, albeit clunky. 

 

My pseudocode would look something like this:

 

 

sendkeys "^{left}" // move one word to the left

SendKeys "+{left}" // select one character to the left

SendKeys "^v" // get the selected character into the clipboard

//do some fancy logic I don't know how to do, to test if the selected character is a "period" or not. If no, then repeat the above. If yes, then start doing a new loop: 

SendKeys "{right}" // deselect the character

SendKeys "^{right}" // move one word to the right

SendKeys "+{right}" // select one character to the right

//do some logic to test to see if the character is a ".".

// If not, then increment a counter by 1, because we need to know how many words apart the two periods are from each other 

// Continue to loop the ^{right} command, and test each character to the right after each jump to see if the character is a period, and increment the counter by 1 every time it is NOT a period 

// when you finally reached a period, then select back X amount of words, using SendKeys "+^{left}"  were X = value of the counter

 

This is how I would do it as a human using the keyboard, but sounds very slow and buggy.

 

Anybody have a better way?

 



-------------------------

Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017.

Statistics
32213 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 1 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 337 guests browsing this forum, which makes a total of 338 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.