Aid Spelling (QTWAIDSP) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Length of receiver variable Input Binary(4)
3 Format name Input Char(8)
4 Input word Input Char(*)
5 Length of input word Input Binary(4)
6 Input dictionaries Input Char(*)
7 Length of input dictionaries Input Binary(4)
8 Output dictionaries Output Char(*)
9 Length of output dictionaries Input Binary(4)
10 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Aid Spelling (QTWAIDSP) API returns a list of candidate words that are similar in spelling to the input word. The input word is generally the misspelled word and the candidate words are correctly spelled words that are spelled similarly to the input word. The QTWAIDSP API returns a maximum of six candidate words per dictionary.

The QTWAIDSP API can be used to do the following:

To perform the function, a user can specify a maximum of eight IBM or user language dictionaries in the input dictionaries parameter.


Authorities and Locks

Dictionary Authority
*USE
Dictionary Library Authority
*USE
Dictionary Lock Authority
*SHRNUP

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is to receive the information about candidate words. You can specify the size of this area to be smaller than necessary to hold information about each word as long as you specify the length parameter correctly. The API returns only the data that the area can hold. The minimum size area is 8 bytes.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable. If the length is larger than the size of the receiver variable, the results may not be predictable. The minimum length is 8 bytes.

Format name
INPUT; CHAR(8)

The content and format of the information returned in the receiver variable. You can use this format:

AIDW0100 Return all candidate words. See AIDW0100 Format.

Input word
INPUT; CHAR(*)

Locate candidate words that are spelled similarly to this word.

Length of input word
INPUT; BINARY(4)

The length of the input word.

Input dictionaries
INPUT; CHAR(*)

A structure containing a list of up to eight dictionaries that is used to locate candidate words.

Length of input dictionaries
INPUT; BINARY(4)

The length of the input dictionaries parameter. The only valid value is 172 bytes.

Output dictionaries
OUTPUT; CHAR(*)

A structure containing a list of up to eight spelling aid dictionaries that were actually used to find candidate words.

Length of output dictionaries
INPUT; BINARY(4)

The length of the output dictionaries parameter. The following are valid values:

0 No dictionaries are returned in the output dictionaries parameter.
>0 The length of space available in the output dictionaries parameter. If this length is larger than the actual size of the output dictionaries parameter, the results may not be predictable.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error Code Parameter.


AIDW0100 Format

The following information is returned in the receiver variable for the AIDW0100 format. For detailed descriptions of the fields, see Field Descriptions.

Offset Type Field
Dec Hex
Note: Fixed section.
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 BINARY(4) Number of words returned
12 C BINARY(4) Number of words available
16 10 BINARY(4) Offset to input word
20 14 BINARY(4) Length of input word
24 18 CHAR(1) Misspelled
25 19 CHAR(3) Reserved
28 1C BINARY(4) Offset to first word information entry
32 20 BINARY(4) Length of word information entry
36 24 BINARY(4) Reserved
Note: The input word for which candidate words were found. The decimal and hexadecimal offsets are not defined. The input word is found by using the offset to input word field.
    CHAR(*) Input word
Note: Format of a word information entry. The following fields are repeated for each word returned. The decimal and hexadecimal offsets depend on the number of words returned. The first word information entry is found by using the offset to first word information entry in the fixed section. Each subsequent word information entry is found by adding the length of a word information entry to the offset of the previous word information entry.
    BINARY(4) Offset to candidate word
    BINARY(4) Length of candidate word
    BINARY(4) Output dictionary number
    CHAR(*) Reserved
Note: The following field is repeated for each word returned. Each word is located by the offset to candidate word field and the length of the word is specified in the length of candidate word field.
    CHAR(*) Candidate word


Field Descriptions

Bytes available. The total length of all data available.

Bytes returned. The length of the data actually returned. If the data is truncated because the receiver variable is not large enough to hold all of the data available, the value will be less than the bytes available.

Candidate word. The candidate word that is spelled similar to the input word.

Input word. The word actually used to find candidate words.

Length of candidate word. The length of the candidate word in bytes.

Length of input word. The length of the input word in bytes.

Length of word information entry. The length of one item in the word information entry section.

Misspelled. Determines if the word is misspelled.

0 The word is spelled correctly.
1 The word is misspelled.

Number of words available. The number of candidate words that were found.

Number of words returned. The number of words actually returned in the receiver variable. If this number is smaller than the number of words available, then all of the words could not fit in the receiver variable.

Offset to candidate word. The byte offset, from the beginning of the receiver variable to the candidate word.

Offset to input word. The byte offset, from the beginning of the receiver variable to the input word.

Offset to first word information entry. The byte offset, from the beginning of the receiver variable to the first item in the word information entry section. If no candidate words are found, the value will be 0.

Output dictionary number. The index into the output dictionary list where the candidate word originated.

Reserved. An ignored field.


Error Messages

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF3CF1 E Error code parameter not valid.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF3C19 E Error occurred with receiver variable specified.
CPF3C21 E Format name &1 is not valid.
CPF3C24 E Length of the receiver variable is not valid.
CPF3C90 E Literal value cannot be changed.
CPF8751 E Number of dictionaries is not valid.
CPF8752 E No valid dictionaries were found.
CPF8754 E Length of input word not valid.
CPF8755 E Length of input dictionaries not valid.
CPF8756 E Length of output dictionaries not valid.
CPF8757 E Input word &1 is not valid.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V3R1
Top | Office APIs | APIs by category