## RelGraph

### Interpretation of the structur RelGraph

The best way to get the recognition result of a line is calling the rel_textline function. It gives the most likely result respecting all options, the context, the positions and others. If you are interested in all other alternatives too, you may find all information about them in the rel_graph and rel_result fields of the RelData structure.
The reason for different recognition results lies not only in different results for single characters but also in different possibilities of segmentation of touching characters. Therefore it is not possible to report all possibilities linearly, they are arranged in a graph. You find this graph in the field rel_graph. Each knot is a RelGraph structure and denotes a possible cut. It respects up to 4 alternatives, any alternative is described by an intervall up to the next cut and the recognition result for the character over this intervall. An intervall i (i=0,1,2,3) is defined by the next cut next[i], where next[i] is the index of the corresponding knot or -1, respectively, if the intervall ends with the line. The recognition result belonging to the knot i is a RelResult structure, it is a member of the rel_result field with the index result_number[i].

The left example sideof a pair of touching characters bi will show how the informations of the graph rel_graph and the field rel_result of the RelData structure can be interpreted. The recognition should be done with the HAND.REC using the default options (different classifiers or other parameters may produce different results, and there may be different segmentations by the feedback of the recognition). It is recommmended to run the sample program RelWin under the debugger, stop it after the call of rel_do, and look at the structure rel as well as their variables.

There have been determined 5 cuts, the starting point included, so rel_graph_len=5. The field rel_graphcontains 5 items:

### Node 0 (rel.rel_graph), 4 Alternatives:

1. result_number=1 next=1:
rel.rel_result.rec_char="b_"  continue at node 1.
rel.rel_result.rec_value=34
2. result_number=0 next=-1:
rel.rel_result.rec_char="k_"  End of line.
rel.rel_result.rec_value=126
3. result_number=3 next=2:
rel.rel_result.rec_char="b_" continue at node 2.
rel.rel_result.rec_value=25
4. result_number=5 next=3:
rel.rel_result.rec_char="le" u. a.continue at node 3.
rel.rel_result.rec_value=44

### Node 1 (rel.rel_graph) 1 Alternative:

1. result_number=2 next=-1:
rel.rel_result.rec_char="i_"
rel.rel_result.rec_value=62

### Node 2 (rel.rel_graph) 3 Alternatives:

1. result_number=4 next=-1:
rel.rel_result.rec_char="i_" End of Line.
rel.rel_result.rec_value=85
2. result_number=8 next=4:
rel.rel_result.rec_char="uv" u.a. continue at node 4.
rel.rel_result.rec_value=110
3. result_number=10 next=1:
result_number=10 next=1:
rel.rel_result.rec_char="._" u.a. continue at knot 1.
rel.rel_result.rec_value=85

### Node 3 (rel.rel_graph) 4 Alternatives:

1. result_number=6 next=1:
rel.rel_result.rec_char="g9" u.a. continue at knot 1.
rel.rel_result.rec_value=145
2. result_number=7 next=-1:
rel.rel_result.rec_char="n/" End of Line.
rel.rel_result.rec_value=122
3. result_number=11 next=2:
rel.rel_result.rec_char="g9" u.a. continue at node 2.
rel.rel_result.rec_value=93
4. result_number=12 next=4:
rel.rel_result.rec_char="g_" u.a. continue at node 4.
rel.rel_result.rec_value=160

### Node 4 (rel.rel_graph) 1 Alternative:rel.

1. result_number=9 next=-1:
rel.rel_result.rec_char="i_" End of Line.
rel.rel_result.rec_char="i_"

### The following alternatives were found:

1.     0->E(0)     k
2.     0 -> 1 (1) -> E ( 2)     bi
3.     0 -> 2 (3) -> E (4)     bi
4.     0 -> 2 (3) -> 4 (8) -> E (9)     bui
5.     0 -> 2 (3) -> 1 (10) -> E (2)     b.i
6.     0 -> 3 (5) -> E (7)     ln
7.     0 -> 3 (5) -> 2 (11) -> E (4)     lgi
8.     0 -> 3 (5) -> 2 (11) -> 4 (8) -> E (9)     lgui
9.     0 -> 3 (5) -> 2 (11) -> 1 (10) -> E (2)     lg.i
10.   0 -> 3 (5) -> 1 (6) -> E (2)     lgi
11.   0 -> 3 (5) -> 4 (12) -> E (9)     lgi