ReSpellData
typedef struct ReSpellData_tag {
ReSpellInit init;
ReSpellParm parm;
short rel_graph_in_len;
short rel_result_in_len;
const RelGraph *rel_graph_in;
const RelResult *rel_result_in;
KADMOS_ERROR (KADMOS_API *oem_spell_lookup)(const char *word, char *results, int results_size);
long oem_codepage;
char oem_wordchars[512];
short oem_reject_char;
short filler1[3];
const RelData *rel_repeat;
const RepData *rep_repeat;
RepResult *repr;
short rel_graph_out_len;
short rel_result_out_len;
short result_text_len;
short filler2;
RelGraph *rel_graph_out;
RelResult *rel_result_out;
void *result_text;
void *filler3;
} ReSpellData;
Elements:
init
- Activation of a dictionary. This parameter use be set before a call of
respell_init()
.
parm
RESPELL
can be configured with many parameters. These parameters are included in the
ReSpellParm
structure. Such a structure is an element of the structures ReSpellData and is preset to
default values with respell_init()
.
rel_graph_in_len
- Number of items of
rel_graph_in.
rel_result_in_len
- Number of items of
rel_result_in
.
rel_graph_in
- Input
RelGraph
area which is to be processed by respell_do()
.
rel_result_in
- Input
RelResult
area which is to be processed by respell_do()
. The code page is
expected to be given in rel_codepage
.
oem_spell_lookup
- Private or OEM used dictionary lookup function Parameters of this function:
word
= Word for search, results
= Memory for the result, results_size
= Length of the result.
oem_codepage
- The code page used for your own dictionary.
oem_wordchars
- All characters of all words of the private dictionary.
oem_reject_char
- The rejection character needed for the own spellchecker.
filler1
- 8 byte alignment.
rel_repeat, rep_repeat
- If the related parameter is set to the address of a related structure
RelData
or
RepData
(whichever had been used for recognition before calling respell__do()
), then
rel_do()
is called again internally for every single word which hasn't been found in the dictionary.
Only one of them (rel_repeat
or rep_repeat
) must be set if required. In case of
rel_repeat
, rel_repeat
has to contain the recognition results for rel_graph_in
and rel_result_in
. In case of rep_repeat
, repr has to point to the recognition results
of the recognized text line under rel_graph_in
and rel_result_in
. When rel_repeat
or rep_repeat
is set, PREP_INPLACE
must NOT be set in the related parm.prep
.
*repr
If the parameter rep_repeat
(above) is set, then repr has to be set to the
RepResult
data of the text line rel_graph_in
, rel_result_in
to be processed
by respell_do()
.
.
rel_graph_out_len
- Length (count of returned elements) of the output
rel_graph_out
which have been filled in by respell_do()
.
rel_result_out_len
- Length (count of returned elements) of the output
rel_graph_out
which have been filled in by respell_do()
.
result_text_len
- Length (count of returned characters) of
result_text
which has been provided by respell_do()
.
filler2
- 8 byte alignment
rel_graph_out
- If memory has been provided here (
rel_graph_out!=NULL
, rel_graph_out_maxlen>0
)
then respell_do()
will fill in here the resulting RelGraph
. The size of the provided memory
(rel_graph_out_maxlen
) must be at least rel_graph_out_len*sizeof( RelGraph)
. If the provided
memory is too small, the results are truncated.
rel_result_out
- If memory has been provided here (
rel_result_out!=NULL
, rel_result_out_maxlen>0
)
then respell_do()
will fill in here the resulting RelResult
. The size of the provided memory
(rel_result_out_maxlen
) must be at least rel_result_out_len*sizeof(RelResult)
.
If the provided memory is too small, the results are truncated. The used code page is according to the value of
rel_codepage
.
result_text
- If memory has been provided here (
result_text!=NULL
, result_text_maxlen>0
)
then respell_do()
will fill in the resulting text string. The size of the provided memory
(result_text_maxlen
) must be at least result_text_len*sizeof([w]char)
. If the provided
memory is too small, the results are truncated. The used code page is according to the value of rel_codepage
.
The parameters reject_level
, reject_char
, and text_format
in the
structure ReSpellParm
(described above) control the generation of result_text
in the same
way as with the functions re*_textline()
.
filler3
- 8 byte alignment.
Reference: