KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: How many items in a list
Topic Summary: Lists
Created On: 11/04/2020 12:01 PM
Status: Post and Reply
Linear : Threading : Single : Branch
Keyword
 11/04/2020 12:01 PM
User is offline View Users Profile Print this message

Author Icon
TomDonovan
New Member

Posts: 17
Joined: 08/22/2020

In a dicatation list <MY_LIST> how many items is reasonably practical. I would like to have a list that increments by 5, from say 100 to 30,000 - is that practical? Easy enough to write a script to create the list and paste it in, but I don't know if that would be too many items as that would be close to 6000 items.

Thanks for the help.



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

Tom

 11/04/2020 12:51 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7442
Joined: 03/04/2007

Experimental testing has proved that the more items you add to a list the more potential you create for getting delays. It is a moving target, but be advised to stay clear under 500 items within the list. It also depends on how many lists and concurrently competing alternatives the recogniser has to deal with at any given time.

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



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

DragonCapture KB Download (Latest)
DragonCapture Homepage

 11/04/2020 06:57 PM
User is offline View Users Profile Print this message

Author Icon
TomDonovan
New Member

Posts: 17
Joined: 08/22/2020

Thank you.



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

Tom

 11/04/2020 07:48 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1041
Joined: 04/03/2009

Originally posted by: TomDonovanI would like to have a list that increments by 5, from say 100 to 30,000 - is that practical?

In addition to Wilke’s sage advice… It might matter whether this is a KnowBrainer list or a Dragon list (and, if Dragon, which version). It also might matter how beefy your hardware is. I have a fairly powerful desktop but with Dragon 15.3 (I have not tested this on anything newer) lists of 500 are really pushing it. However, if it is a KnowBrainer list I have no trouble with a list of ~5000 integers (1-5000 inclusive).

However, this might be a good case for an open-ended "dictation" list/command (assuming that the integer ListVar can be used as such in your case).
Move Mouse <direction> <dictation>

where the list "direction" is your typical up/down/left/right and you parse ListVar2, do some error checking to make sure that it is a viable integer then convert the integer-as-string into a mathematical integer.



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

-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

 11/05/2020 04:51 PM
User is offline View Users Profile Print this message

Author Icon
TomDonovan
New Member

Posts: 17
Joined: 08/22/2020

Thanks Edgar, I will explore the open ended dictation command. That may be an interesting compromise. I would use Knowbrainer, so I may also try loading the list and see what happens, but my gut tells me it may be too big. Machine is powerful enough, but would be a lot of items and as you say I can do some error checking to make sure i am getting what I need/want.

P.S. Thank you for the applications you've so generously shared, inspired me to solve a problem I have with a program I use that has tabs across the bottom, but no keyboard shortcuts and doesn't react to show or display numbers. After reviewing your code, I wrote an app that shows numbers across the bottom of the app window, and while the numbers aren't always exactly where I want them to be as the tabs are variaable widths, they are dense enough that I can click on any tab.



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

Tom

 11/05/2020 06:04 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1041
Joined: 04/03/2009

These have no error checking:

this first one would look like "size window # by #" (it throws away the middle word "buy":

… <Dictation>

Sub Main
   Dim dictationAsString As String
   Dim x, y As Integer

   dictationAsString = ListVar1
   dictationArray = Split (dictationAsString, " ", -1)' use automatic variable
   x = CInt (dictationArray(0))
   y = CInt (dictationArray(2))
' [do something with these values]
End Sub

this next one would look like "use number #" :

… <Dictation>

Sub Main
   Dim S As String
   Dim N As Integer

   N = Val(ListVar1)
   S = CStr (N)
' [do something with one of these values]
End Sub

I sure wish I could figure out some way to do this C# code in Dragon/KnowBrainer basic:

         int temp = 0;
         string fifty = "50";

         try {
            temp = Convert.ToInt32(fifty);

            if ((temp < 1) || (temp > 99)) {
               ;//do not use temp
            }
            else
               ;//use temp
         }
         catch (Exception pException) {
            ;//do not use temp
         }

Obviously, there is Dragon/KnowBrainer Basic code to convert a string to an integer but, as far as I can tell it has no way to do error checking.



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

-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

 11/06/2020 10:15 AM
User is offline View Users Profile Print this message

Author Icon
TomDonovan
New Member

Posts: 17
Joined: 08/22/2020

Edgar do you mean something like this

'#Language "WWB.NET"
Sub Main
Try
Dim i as integer
Dim s as string
s = "not a value"
i = cint(s)
Catch Ex as System.Exception
Debug.Print Ex.ToString() '"error"
End Try
End Sub

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

Tom

 11/06/2020 11:22 AM
User is online View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3696
Joined: 01/14/2008

Originally posted by: Edgar

 

I sure wish I could figure out some way to do this C# code in Dragon/KnowBrainer basic:

Obviously, there is Dragon/KnowBrainer Basic code to convert a string to an integer but, as far as I can tell it has no way to do error checking.

 

 

As Tom has said use WWB .Net with KB, you can convert anything from C#, obviously there are restrictions like threading.

 

https://www.tutlane.com/tutorial/visual-basic/vb-try-catch-statement



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



 11/06/2020 03:06 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1041
Joined: 04/03/2009

Originally posted by: TomDonovan Edgar do you mean something like

Yes, exactly! Thank you so much, I'm swamped for the next few days but when I get a working example for converting <dictation> to an integer I will post it.



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

-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

 11/06/2020 03:44 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 518
Joined: 07/08/2019

One of the nice things about calling out to AutoHotKey, or any modern-Perlish-regex-capable language, is that I can do things like

    if( 0 < RegExMatch(command,
               "^PUFF window row ([0-9]+) column ([0-9]+)"
               . " in ([0-9]+) (x|by) ([0-9]+) grid$",
               Match) ) {
         Resize_Window_Relative_Display( win_id,  ... )

Q: do any of the Dragon/KnowBrainer scripting languages support regexps similar to Perl's in power?  (AHK and many other systems use PCRE, the Perl Compatible Regex Library.)  I cannot imagine many reasons why PCRE should not be available to Basic scripting languages.

Probably the most important thing is have capture groups. Unnamed above; even better if explicitly named, eg. "row (?P<row>\d+)" --> result in Match["row"] containing that field's string.



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

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.

 11/06/2020 08:49 PM
User is offline View Users Profile Print this message

Author Icon
TomDonovan
New Member

Posts: 17
Joined: 08/22/2020

Yes you can use regular expressions. I haven't yet, but been thinking about it, but here is my test that I used a while back to prove it works.

'#Language "WWB.NET"
imports System.Text.RegularExpressions

Sub Main
Dim sText as String = "X0ABCXABC"
Dim reTaskID As New Regex("(X)", RegexOptions.IgnoreCase)
Dim mcTaskID As MatchCollection = reTaskID.Matches(sText)
If mcTaskID.Count > 0 Then
msgbox("Count: " & mcTaskID.Count)
end if

end sub


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

Tom

 11/07/2020 05:56 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1041
Joined: 04/03/2009

Obviously, this won't work in Dragon; it works in KnowBrainer:

'#Language "WWB.NET"
Sub Main
 Try
' Code that may cause exception
 Dim x As Integer
 x = Integer.Parse("1")
MsgBox "GOOD 1"
 x = Integer.Parse("one")' fails
MsgBox "GOOD one"

Catch ex As System.Exception
' Exception handling
MsgBox "bad " & ex.Message
End Try
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

 11/13/2020 06:21 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 518
Joined: 07/08/2019

Thanks @TomDonocan.

 

Q: do you know if these are full PCRE?

I guess not actual PCRE code, depeding on the license.

(I am sick and tired of Microsoft half-assed and incomplrte implementations of Open Source stuff.  But MS is doing more and more Open Source - see the UNIX subsystem for Windows. I can hope.)

 

https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference

 

makes it look pretty good, but I have npt done a full comparison.  

 

Plus, they don't say PCRE or POSIX or any other regexp standard that I can find.



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

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.



 11/13/2020 09:44 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2126
Joined: 03/21/2007

Dragon supports RegEx through the VBScript. Here is a reference implementation:

Sub Main
    MsgBox RegExReturn(InputBox("TEXT"), _
        InputBox("REPLACEMENT TEXT"), _
            InputBox("PATTERN",,"[A-Z]{2,}"))
End Sub

' RegExReturn("input", "replacement text", "pattern") 
Public Function RegExReturn(ByVal words As String, _
    repl As String, pat As String) As String
    Static regEx As Object
    If regEx Is Nothing Then
        Set regEx = CreateObject("VBScript.RegExp")
        With regEx
            .Global = True
            .Pattern = pat
        End With
    End If
    RegExReturn = regEx.Replace(words, repl)
End Function


I'm sure you could work it out from here . . .



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




PG





Remember 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.



 11/14/2020 04:45 AM
User is offline View Users Profile Print this message

Author Icon
brocky921
New Member

Posts: 1
Joined: 11/14/2020

excellent way of sharing important pieces of information https://xn--jblbluetoothkopfhrer-kbc.com



-------------------------
https://xn--jblbluetoothkopfhrer-kbc.com

 11/14/2020 07:18 AM
User is offline View Users Profile Print this message

Author Icon
Mphillipson
Top-Tier Member

Posts: 251
Joined: 09/22/2014

Another option when trying to shrink a list is you can use a combination. For example you have one list that is for the hundreds and another list for the units.

 



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

Thanks Mark


 


Dragon Professional Advanced Scripting/KnowBrainer Scripts
Video Examples of Coding by Voice

KnowBrainer Speech Recognition » KnowBrainer Software and Support » How many items in a list

Statistics
31938 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 597 guests browsing this forum, which makes a total of 599 users using this forum.

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