rel_word_value()

extern unsigned char KADMOS_API rel_word_value
  (const RelGraph *relg, const RelResult *relr,
  int rel_graph_len, int rel_result_len, int rel_graph_start,
  const RelBranch *rel_branch, int rel_branch_len);
      

Parameter:

relg
Pointer to a structure RelGraph.
relr
Pointer to a structure RelResult.
rel_graph_len
Number of items in rel_graph.
rel_result_len
Number of items in rel_result.
rel_graph_start
start knot in RelGraph.
rel_branch
Branch in RelGraph.
rel_branch_len
Length of the branch in RelGraph.

Return value:

Confidence value for the word in relg, relr which is decribed by rel_graph_start and rel_branch. Low values mean high confidence, high values mean low confidence, comparable to the meaning of rec_value.

Comment:

This function supports the employment of dictionaries and spellcheckers. Regularly KADMOS delivers an optimum result (word) with the first alternatives in RelGraph and RelResult. For this first alternative as well as for all other alternatives a confidence value can be calculated. Any word alternative can be characterized by a path through RelGraph and the related used alternatives in RelResult, i.e. by a sequence of segmentation alternatives and recognition alternatives. We call such a sequence a 'branch'.

The branch (0,1), (0,0), (1,2) would mean: Use from the start knot the first segmentation alternative (index 0) with the second recognition alternative (index 1), use from the following knot (next[0]) the first segmentation alternative (index 0) with the first recognition alternative (index 0), and from the following knot (next[0]) the second segmentation alternative (index 1) and the third recognition alternative (index 2).

A branch (0,0), (0,0), (0,0), ...
describes the 'standard' result of KADMOS, which is for instance used by re?_textline().

rel_word_value() calculates a confidence value for every given branch in a KADMOS result given by relg and relr. If now a recognition alternative has been found in the employed dictionary, it has to be checked if the difference of the confidence values of this branch and the standard branch is below a certain threshold. If so, the result from the dictionary will be taken as recognition result of KADMOS, if not, the KADMOS standard result will be taken.

If the parameter rel_branch is equal NulL, then always the first alternatives are used. If the parameter el_branch_len is equal 0, then evaluation goes to the end of line. If also the parameter a rel_graph_start is equal 0, then a confidence level for the result of the full line is given back.

Reference: