KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Script to convert numbers into their written form
Topic Summary:
Created On: 11/10/2021 05:14 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Script to convert numbers into their written form   - Alan Cantor - 11/10/2021 05:14 PM  
 Script to convert numbers into their written form   - PG LTU - 11/11/2021 10:50 AM  
 Script to convert numbers into their written form   - Alan Cantor - 11/11/2021 01:08 PM  
 Script to convert numbers into their written form   - kkkwj - 11/13/2021 01:44 AM  
 Script to convert numbers into their written form   - Alan Cantor - 11/14/2021 11:13 AM  
Keyword
 11/10/2021 05:14 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4280
Joined: 12/08/2007

I'm working with somebody who needs to express dollar amounts both as numbers, and as the words spelled out. For example:

 

$123,456 (one hundred and twenty three thousand four hundred fifty six dollars)

 

I've written a script that works by retrieving the spelled out version from the Recognition History. So to make it work, you say the dollar amount, pause, and then invoke the following command. The command calls up the Recognition History, navigates to the list of utterances, copies the value to the clipboard, closes the recognition history dialog, does some string manipulation, and then outputs the spelled out version.

 

Sub Main
    Dim engine As New DgnEngineControl, n As Long
    engine.DlgShow(dgndlgRecognitionHistory, n,, 0)
    Wait 0.5
    SendSystemKeys "{Up}"
    SendSystemKeys "{Alt+u}"
    SendSystemKeys "{Ctrl+c}"
    SendSystemKeys "{Esc}"
    Let x = Clipboard
    Let x = " (" & x & ")"
    Wait 1.3
    SendDragonKeys x

End Sub

Does anybody know of a way to directly retrieve the value of the last utterance without invoking the Recognition History dialog box, navigating from field to field, using the clipboard, and so on?

Statistics
32286 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 393 guests browsing this forum, which makes a total of 394 users using this forum.

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