Microsoft KB Archive/99797

= Simple Training Techniques for a Recognizer =

Article ID: 99797

Article Last Modified on 8/4/2004

-

APPLIES TO


 * Microsoft Windows for Pen Computing 1.0

-



This article was previously published under Q99797



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 Download Center. 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.



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

Trainem.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. Trainem.exe 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.exe 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.exe 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.exe 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.exe 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 query words: TRAINEM

Keywords: kbdownload kbfile KB99797

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.