SYG 

1.0    2.0     

A symbol graph, which represents the possible interpretations identified by the recognizer.

typedef struct { 

     POINT rgpntHotSpots[MAXHOTSPOT];

     int cHotSpot;

     int nFirstBox;

     LONG lRecogVal;

     LPSYE lpsye;

     int cSye;

     LPSYC lpsyc;

     int cSyc;

     SYV syv;

     LONG lRecogVal;

     CL cl;

     int iSyc;

     UINT wStrokeFirst;

     UINT wPntFirst;

     UINT wStrokeLast;

     UINT wPntLast;

     BOOL fLastSyc;

} SYG;

 

Members

rgpntHotSpots[MAXHOTSPOT]

Hot spots of the symbol (if any). MAXHOTSPOT is defined as 8.

cHotSpot

Number of valid hot spots in rgpntHotSpots.

nFirstBox

Row-major index to box of first character in result.

lRecogVal

Reserved.

lpsye

Pointer to array of SYE3BE5AM5 structures representing nodes of symbol graph.

cSye

Number of SYE structures in array lpsye.

lpsyc

Pointer to corresponding array of SYC1AOCY0 symbol ink structures.

cSyc

Number of SYC structures in symbol graph.

 

Comments

All indexes are zero-based.

If a single entity recognized by the recognizer is mapped to a string of several symbol values, the recognizer creates multiple SYE3BE5AM5. This is the case for recognizers that can recognize highly stylized sequences of characters for example,  ing  in which the individual characters are not necessarily recognized.

The nFirstBox member has no meaning for gestures. A gesture is applied to the location indicated by its hot spot.

The SYG, SYE, and SYC1AOCY0 structures define the relationship between raw pen data and recognized results. However, in version 2.0 of the Pen API they are rarely of interest to applications for two reasons. First, API functions return recognition results without forcing the application to deal with the complexities of raw pen data. And second, SYG, SYE, and SYC apply mainly to recognizers.

All nontrivial recognizers should somehow track the pen strokes that form each character in the returned results. To be compatible with version 1.0, a recognizer must use the SYG, SYE3BE5AM5, and SYC structures and return a symbol graph an SYG structure as a member of the RCRESULT232HBID structure. Version 2.0 does not mandate how a recognizer should map pen data to symbols. However, these three structures represent a viable method. Recognizer developers writing for version 2.0 may want to use the structures or create variations.

The following information applies to version 1.0 applications and recognizers, and to version 2.0 recognizers that employ symbol graphs to relate strokes to recognized symbols. For further information about SYG, SYE, and SYC1AOCY0, see  Returning Results  in Chapter 8,  Writing a Recognizer. 

A symbol graph is a representation of the possible interpretations identified by the recognizer. The RC Manager processes the symbol graph using the dictionary path to identify the best interpretation. This best interpretation is returned in the results message along with the symbol graph.

A symbol value is a 32-bit value that represents a glyph (such as a character or a gesture) recognized by a recognizer. This is sometimes referred to as a symbol. A symbol string is an array of symbols terminated with SYV_NULL.

Each element of the symbol graph, an SYE3BE5AM5, contains information about the recognized character for example, bounding rectangle and hot spots. The SYC structure maps SYE structures back to the corresponding raw data. If two or more consecutive SYE structures map to the same SYC, they represent an indivisible unit. For example, the user might teach the system of  th  with the crossbar of the  t  connected to the  h.  SYC structures are used primarily for training.

A version 1.0 application generally does not use the symbol graph directly. Instead, it uses the hSyv member of RCRESULT232HBID, which contains a symbol string that represents the best interpretation from the symbol graph. SYE and SYC1AOCY0 structures work together with the HPENDATA memory block to identify strokes and meanings for ink. The following table lists the basic functions of these structures.

Structure

Description

HPENDATA

Contains raw data information: strokes, pen up, pen down, points, and so on.

SYC1AOCY0

A symbol character map. SYC1AOCY0 structures delimit strokes in an HPENDATA. A single shape can be identified
by one or more SYC1AOCY0 structures. Each SYC1AOCY0 identifies a starting stroke, an ending stroke, a starting point, and an ending point. A flag also indicates whether subsequent SYC1AOCY0 structures in the array contain additional strokes for the shape. (This feature is used for delayed strokes, such as the cross stroke of the letter
 t. )

SYE3BE5AM5

A symbol element. An SYE3BE5AM5 contains a symbol, which can be a character, a gesture, or a string. The symbol
is denoted by an SYV. The SYE3BE5AM5 contains an index into an array of SYC1AOCY0 structures; this array identifies the
raw data that makes up the symbol. It is possible for several SYEs to use the same SYC1AOCY0 structures. The
SYC1AOCY0 structures contain indexes into the raw data.

SYV

A symbol value.

SYG

A symbol graph.

 

A set of SYEs and SYCs, together with an HPENDATA structure, is sufficient to define ink and specify how that ink should be interpreted. The training functions TrainContext1AOCU. and TrainInk232HBEC use this information in training.