|
TrainContext
- 0 2.0
Provides the recognizer a previous recognition result that may contain errors,
plus the correct interpretation of the raw data.
Note This function is provided only for compatibility with version 1.0 of the Pen
API and will not be supported in future versions. Use TrainHREC instead.
BOOL TrainContext( LPRCRESULT lprcresult, LPSYE lpsye, int csye, LPSYC lpsyc, int csyc )
Parameters
lprcresult
Address of the RCRESULT structure containing the handle to the pen data that contains the raw data
and the recognizer's original interpretation of that data. This parameter cannot
be NULL.
lpsye
Address of an array of SYE structures that specify the correct interpretation of the raw data. The
values of the iSyc members of these structures index the SYC structures pointed to be the lpsyc parameter.
csye
The number of SYE structures in the lpsye array.
lpsyc
An array of SYC structures that establish the mapping between the raw data and the characters
in the hpendata member of the structure pointed to by the lprcresult parameter.
csyc
The number of SYC structures in the lpsyc array.
Return Value
Returns TRUE if the ink is accepted for training; otherwise, returns FALSE.
Comments
TrainContext is called by an application with a recognition result that may contain
mistakes, along with a correct interpretation, so that the recognizer can learn from
the mistake and improve subsequent recognition. A second, simpler training
function for 1.0 recognizers is provided by TrainInk.
TrainContext internally calls the function TrainContextInternal exported by the recognizer identified by the hrec member of the RC structure pointed to by the lprc member of the RCRESULT structure. A version 1.0 recognizer should export both TrainContextInternal and TrainInkInternal, but can simply return FALSE from both functions if the recognizer does not
support this type of training.
When a training application is able to provide contextual information (such as
segmentation suggestions) to the version 1.0 recognizer, it calls the TrainContext function. The lprcresult parameter points to an RCRESULT structure that contains the results of a previous recognition. The raw data
is also contained in the hpendata member of the structure pointed to be lprcresult.
In addition to providing the incorrect interpretation of the data (by means of
the symbol graph, the lpsyv member in the RCRESULT structure), a more detailed, correct interpretation is also provided by the SYE structures and SYC structures. Because the correct interpretation is passed by SYE structures, it is possible to suggest segmentation boundaries to the
recognizer.
Suppose, for example, that a user writes "lc," and the recognizer interprets
it as "k". A trainer calls TrainContext using, first, an array of SYC structures that point to the ink of the "lc" and, second, the two SYE structures with the SYV values "l" and "c". These two SYE structures share the same index into the lpsyc array, indicating that both use the ink that was interpreted as "k".
Segmentation errors can be corrected in the other direction as well. Suppose,
for example, the user writes "k" and the recognizer interprets it as "lc". A
trainer could call TrainContext using a single SYE with SYV values equal to "k" and an array of SYC structures that incorporate the ink the recognizer had previously assigned to
the "l" and the "c".
To train several SYV symbol values to a single piece of ink (for example, a long stroke that is an
"he" ligature), there will be two consecutive SYE structures one for the "h" and one for the "e". Both SYE structures have the same iSyc member; this means that the SYE structures both point to the same ink. A recognizer must take this into
consideration to avoid training the two characters separately using the same ink for
both; that would result in having "he" trained as "he he".
A recognizer can supply its own custom training dialog boxes. An application
should check whether the recognizer supports custom training by calling ConfigRecognizer with the WCR_TRAIN subfunction.
The trainer does not display an error message if TrainInk or TrainContext returns FALSE. Error messages that occur when training fails must be handled
by the recognizer.
See Also
ConfigRecognizer, TrainInk, TrainHREC, SYC, SYE, SYV_
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|