KnowBrainer Speech Recognition
Topic Title: Lowercase/uppercase <text>
Topic Summary: How can I find/write a command like that?
Created On: 04/13/2019 03:24 PM
 Linear : Threading : Single : Branch
 Lowercase/uppercase - missink - 04/13/2019 03:24 PM
 Lowercase/uppercase - R. Wilke - 04/13/2019 03:47 PM
 Lowercase/uppercase - missink - 04/13/2019 05:51 PM
 Lowercase/uppercase - locution - 04/13/2019 08:06 PM
 Lowercase/uppercase - Alan Cantor - 04/13/2019 10:34 PM
 Lowercase/uppercase - Edgar - 04/14/2019 12:57 PM
 Lowercase/uppercase - Lunis Orcutt - 04/14/2019 02:06 PM
 Lowercase/uppercase - missink - 04/19/2019 04:41 PM
 Lowercase/uppercase - locution - 04/19/2019 05:06 PM
 Lowercase/uppercase - PG LTU - 04/19/2019 06:36 PM
 Lowercase/uppercase - Scribe - 05/23/2019 11:56 AM
 Lowercase/uppercase - PG LTU - 05/23/2019 02:35 PM
 Keyword Topic Tools View similar topics Print this topic.
04/13/2019 03:24 PM

missink
New Member

Posts: 17
Joined: 03/28/2015

Is there a command like "lowercase <text>? Or "uppercase <text>"? It is referenced in the Dragon for Mac documentation (link below), but I'm on Windows (DPI 15), and those commands don't seem to be available.

https://www.nuance.com/products/help/dragon/dragon-for-mac/enx/Content/Formatting/Capitalization.htm

If there are no such commands, is there a way to write them? I only have Dragon Professional, I don't have KnowBrainer, Vocola, etc.

P.S. I realise I can say "select <text>" and then "lowercase/uppercase that", but it would be nice to have a faster workflow.

04/13/2019 03:47 PM

R. Wilke
Top-Tier Member

Posts: 7811
Joined: 03/04/2007

An "uppercase" implementation exists in DPI 15. It is "capitalize xyz". A lowercase equivalent doesn't exist, but you can roll your own.

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

No need to buy if all you want to do is try ...

DragonCapture Homepage

04/13/2019 05:51 PM

missink
New Member

Posts: 17
Joined: 03/28/2015

I'm afraid "capitalize <text>" isn't what I'm looking for here, because it produces title case. I'm looking for commands analogous to "uppercase that" (WHICH PRODUCES THIS) and "lowercase that" (which produces this), not "capitalize that" (Which Produces This).

I haven't been able to figure out how to create my own. I tried, using HeardWord "select", <dictation>, but of course that didn't work, because HeardWord wants every word to be a separate argument. It did work in special cases where was exactly equivalent to an existing vocabulary entry, like "Microsoft Word", but of course I would like it to work for once-off phrases as well. If you do know how to make it work, I would appreciate your suggestions.

(Edited because the angle brackets keep getting lost.)

04/13/2019 08:06 PM

locution
Senior Member

Posts: 124
Joined: 02/27/2019

is there a way to write them?

It's in the free tool I'll release within the next few weeks, along with a ton of crazy stuff. I'm still adding some mad features (like an advanced regex replacement grammar...) Will work not just in Word but most editors like Notepad, the text boxes on this forum etc.

If you want to know about the release, the easiest is to subscribe to this thread.

04/13/2019 10:34 PM

Alan Cantor
Top-Tier Member

Posts: 4289
Joined: 12/08/2007

In Word, you can say things like:

uppercase the previous paragraph
lowercase the next five words
uppercase the rest of this line
lowercase page 10
uppercase this sentence
lowercase the previous row
uppercase this column

There is also a bunch of commands that are prefixed by "initial cap," e.g., "initial cap the entire sentence."

04/14/2019 12:57 PM

Edgar
Top-Tier Member

Posts: 1260
Joined: 04/03/2009

Sub Main

Dim lowerCase As String

Dim upperCase As String

lowerCase = LCase (ListVar1)

MsgBox lowerCase

upperCase = UCase (ListVar1)

MsgBox upperCase

End Sub

The above is a proof of concept I call it "Test <dictation>"; I made it a global command. The next step would be to adapt to the code to your needs; I would probably create 2 new global commands:
Capitalize All <dictation>

Lowercase All <dictation>

a single command might look like:

list: "scules" with the contents:

Lowercase

Capitalize

and the command would be:
<scules> All <dictation>

Capitalize All <dictation>

would look like:

Sub Main

Dim upperCase As String

upperCase = " " & UCase (ListVar1) & " "

' somewhere on the forum is code for inserting smart spaces

' I didn't bother to use it in the above and if being lazy I would use:

' upperCase = UCase (ListVar1)

' and manage the leading and trailing spaces in dictation

SendKeys upperCase , 1

End Sub

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

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

04/14/2019 02:06 PM

Lunis Orcutt
Top-Tier Member

Posts: 39778
Joined: 10/01/2006

missink,

The latest KnowBrainer commands, which need to be added to KnowBrainer after you install it, include Lowercase <dictation> Uppercase <dictation> and Title Case <dictation>. Note that Dragon already includes capitalize <dictation> which is the same as the KnowBrainer Title Case <dictation> command but we created this command to follow the naming convention of the other 2 commands. Also note that the Dragon capitalize <dictation> command additionally moves the cursor back to the previous position which may be good or irrelevant, depending on your preferences. By contrast, the 3 KnowBrainer commands move your cursor back to the end of the current paragraph, on the assumption that you may not have finished dictating your paragraph. If you wish to copy the KnowBrainer Uppercase <dictation> command see the following script which was copied out of KnowBrainer and can easily be copied and edited to create a Lowercase <dictation> command or of course you could just get KnowBrainer 2017 which includes thousands of commands (that Dragon customers often request) and 400 artificial intelligence-like commands, such as the following, which kicks commands up a notch.

Sub Main
Dim engCtrl As New DgnEngineControl
engCtrl.Register
engCtrl.RecognitionMimic("select " & ListVar1)
engCtrl.RecognitionMimic("\all-caps that")
Wait .5
engCtrl.RecognitionMimic("end of paragraph")
engCtrl.UnRegister(False)

End Sub

PS: KnowBrainer 2017 also includes Uppercase All, Lowercase All and Title Case All which  selects all of the text in a document or field, applies the appropriate formatting to the selected text and moves the cursor to the end of the formatted text.

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

Change "No" to "Know" w/KnowBrainer 2020
Dragon/Sales@KnowBrainer.com
(615) 884-4558 ex 1

04/19/2019 04:41 PM

missink
New Member

Posts: 17
Joined: 03/28/2015

Thank you guys. Smart spaces are important to me and I have been spending a lot of time unsuccessfully struggling with them lately, so I will make do with Alan's suggestion for now.
04/19/2019 05:06 PM

locution
Senior Member

Posts: 124
Joined: 02/27/2019

@missink

If interested in this and other text transformations, also feel free to PM me — happy to set you up with a beta of what I'm working on, can give you a walk-through on Skype.

Wishing you a fun weekend,

-l

04/19/2019 06:36 PM

PG LTU
Top-Tier Member

Posts: 2197
Joined: 03/21/2007

"Smart spaces?" Try either my CheckNewPara or CheckSpacing functions (which add a space before (and after) dictation only when needed). Search the forums for those terms . . .

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

### PGRemember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.

05/23/2019 11:56 AM

Scribe
Top-Tier Member

Posts: 492
Joined: 04/02/2010

In this relatively long thread, I don't think anyone has mentioned two commands that are inbuilt in Dragon: "'All Caps That," and "No Caps That." You can use these two commands to precede text as well. For example, "No Caps Mississippi" produces "mississippi."

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

The woman who dueled with Aaron Burr and won: www.MmeJumel.com

Crohn's News Blog: www.crohns-news.net

05/23/2019 02:35 PM

PG LTU
Top-Tier Member

Posts: 2197
Joined: 03/21/2007

Thx, Scribe! Of course, the easy solution for using the "[doing something to] that" commands to xyz text is to select the xyz text first. The following works in Word where the lowercase and uppercase natural language commands are emulated by my pgEmulate.vbs:

[lowercase_uppercase] [dictation]     pgEmulate = "D:\path\to\pgEmulate.vbs " ' note the trailing space!!     ShellExecute pgEmulate & """select " & ListVar2 & """", 6 ' select the dictation text     Wait 2     ShellExecute pgEmulate & """" & ListVar1 & " that""", 6 ' emulate the Word natural language command     Wait 2     ShellExecute pgEmulate & """go back""", 6 ' go back to where you were

Hth,

EDIT: Btw, if you want these commands to work with native Dragon commands, too, you can add to your [lowercase_uppercase] list as follows:

all-caps\all capscapitalize



lowercase



no-caps\no caps

uppercase

and modify the above as follows:

    pgEmulate = "D:\path\to\pgEmulate.vbs "    ShellExecute pgEmulate & """select " & ListVar2 & """", 6    Wait 2    x = ListVar1    If InStr(x,"\") Then x = "\" & Left(x, InStr(x,"\")-1) ' note the leading \    ShellExecute pgEmulate & """" & x & " that""", 6    Wait 2    ShellExecute pgEmulate & """go back""", 6

Ht also h

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

### PGRemember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.

 KnowBrainer Speech Recognition » Commands, Scripts, and Macros - Dragon » Lowercase/uppercase Topic Tools View similar topics Print this topic.
Statistics
32287 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 2 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 344 guests browsing this forum, which makes a total of 346 users using this forum.