SAMPLE: Simple Training Techniques for a Recognizer

Last reviewed: February 15, 1996
Article ID: Q99797
The information in this article applies to:
  • Microsoft Windows for Pen Computing version 1.0

SUMMARY

The following information concerns the Microsoft Windows for Pen Computing sample Training Emulator, version 1 (TrainInk).

There is a sample called TRAINEM in the Microsoft Software Library. This Windows for Pen Computing sample demonstrates how to do simple training on a trainable handwriting recognizer. The sample utilizes the TrainInk application programming interface (API) to do the training.

Download TRAINEM.EXE from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download TRAINEM.EXE (size: 24845 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get TRAINEM.EXE (size: 24845 bytes) 
    

MORE INFORMATION

TRAINEM is a Windows for Pen Computing version 1.0 sample, which can be run on any Windows version 3.1 or Windows for Workgroups machine that has the Pen Extensions installed [from the Microsoft Windows 3.1 Software Development Kit (SDK) or Visual C++ Development Kit.]

On a system that is running only the Pen Extensions and not the full Windows for Pen Computing environment, the virtual keyboard executable may not be present (SKB.EXE on U.S. systems) such that the ShowKeyboard call cannot bring up the virtual keyboard. In this case, when the Keyboard button is pressed, a dialog box will be displayed informing the user that the virtual keyboard could not be started.

TRAINEM demonstrates one of the training APIs used in training handwriting in a recognizer. The TrainInk API is the simpler of the two training APIs available; however, using it requires knowledge of recognizers and what they are capable of doing. Therefore, TRAINEM also demonstrates querying a recognizer to determine whether it is capable of being trained; if so, the sample demonstrates the limitations of that training.

TRAINEM also demonstrates one method of capturing ink for training, and displays an interface that a user can use to view that ink and train it to the correct value. Note that during this process, ink can be captured and saved from an hedit or bedit control, and textual information can be retrieved with ordinary window messages.

As written, TRAINEM requires the Microsoft default recognizer, also known as the Roman recognizer, MARS. Note that the ConfigRecognizer call is resident in the recognizer code itself and must be imported explicitly in the .DEF file. In the more general case, not dealt with in this sample, an application could install the recognizer at run time or query for the current recognizer and obtain a pointer to the needed function. This sample uses the more direct and easier method, though not necessarily the most robust method.

The sample also requires that some action be taken after a recognition session has taken place in the main hedit control on the main window. The user must choose either the Reset Hedit button or the Train button before further recognition sessions are allowed in the control. The control is disabled until training has taken place or until the control is reset.

This method was used to avoid losing track of the correct ink to train in the hedit control. More sophisticated training programs might explore algorithms that allow for tracking multiple recognition sessions, and bring up the appropriate result and original ink on request for training. This sample is a simple demonstration of the basics required for training a recognizer; more sophisticated algorithms for handling multiple recognition sessions are beyond its scope.


Additional reference words: 1.00 softlib TRAINEM.EXE
KBCategory: kbprg kbfile
KBSubcategory: WpenTrain


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.