TrainInk 

1.0     2.0     

Provides raw data and a correct interpretation of the data to the recognizer.

 

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 TrainHREC1AOCU_ instead.

 

BOOL TrainInk( LPRC lprc, HPENDATA hpndt, LPSYV lpsyv )

Parameters

lprc

Address of an RC232HBHC structure, or NULL. If this parameter is NULL, the RC Manager replaces it with a pointer to the global RC structure, then calls the recognizer associated with the global RC. If lprc is not NULL, the RC Manager calls the recognizer identified by the hrec member of the RC structure.

hpndt

Handle to an HPENDATA object containing the ink to be trained. This parameter cannot be NULL.

lpsyv

Pointer to a string of SYV symbol values terminated by SYV_NULL. This parameter cannot be NULL.

Return Value

Returns TRUE if the ink described by the pen data could be trained; otherwise, it returns FALSE.

Comments

Applications call TrainInk with raw data accompanied by a correct interpretation of the data, so that the recognizer can improve subsequent recognition. A second, more complex training function for version 1.0 recognizers is provided by TrainContext1AOCU..

TrainInk is called by an application to access the TrainInkInternal function in the recognizer library. A private 1.0 recognizer must export both TrainInkInternal and TrainContextInternal, but the functions can simply return FALSE if the recognizer does not support this type of training.

TrainInk provides the lowest level of basic shape training. It requests the recognizer to assign the meaning in lpsyv to the ink in hpndt. The recognizer should interpret the ink to meet that request.

In the most common case, lpsyv points to a single character, and the recognizer will train a new shape based on the ink and that character. In other cases, multiple SYV symbol values can be passed, indicating that the ink represents multiple characters. The recognizer must decide whether to simply add a new shape with a meaning based on multiple SYV symbol values or to segment the ink into separate shapes for each SYV.

An application should check whether a recognizer supports training by calling ConfigRecognizer232HADD with the WCR_TRAIN subfunction.

The trainer does not display an error message if TrainInk or TrainContext1AOCU. returns FALSE. Error messages that occur when training fails must be handled by the recognizer.

See Also

ConfigRecognizer, TrainHREC