NjxSearchWord Function

Description

This function sets the search cursor used for dictionary look-up of the specified reading string and for getting words. When getting the target word, get the word using the NjxGetWord function and the dictionary search cursor structure.
If getting all words using dictionary look-up from the user dictionary and learning dictionary: Specify "" (an empty string) for the reading string of the word to be searched using the dictionary search cursor, and specify prefix match search for the search method.
If the return value indicates that no candidate matches the search conditions (0) or an error, undefined values may be stored in the dictionary search cursor (cursor).

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 NjxSearchWord(
     IWNN_CURSOR* cursor,                         // Dictionary search cursor structure
     const IWNN_CLASS* iwnn                       // Parsing information class
);

Arguments

NameDescription
IN / OUT IWNN_CURSOR* cursor Dictionary search cursor structure.
Set item such as the dictionary set structure, search conditions, and the reading string before searching for the target word. For details on this structure, see Section 8.5, Dictionary Search Cursor (IWNN_CURSOR).
An error results if NULL is specified.
IN const IWNN_CLASS* iwnn Parsing information class
An error results if NULL is specified.

Return Value

s16 Negative: Error
1: Candidates matching search conditions were found
0: No candidates matching search conditions were found

Error Code Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
NJ_ERR_PARAM_CURSOR_NULL NULL was set in cursor
NJ_ERR_PARAM_DIC_NULL NULL was set in the dictionary set for cursor
NJ_ERR_PARAM_READING_NULL NULL was set in the reading for cursor
NJ_ERR_READING_TOO_LONG The length of the reading string in cursor exceeds NM_MAX_LEN
NJ_ERR_PARAM_KANJI_NULL A derived search was the specified search method in cursor and NULL was set in the candidate string
NJ_ERR_CANDIDATE_TOO_LONG The length of the candidate string in cursor exceeded NJ_MAX_RESULT_LEN
NJ_ERR_PARAM_OPERATION An undefined value was set for the search method in cursor
NJ_ERR_PARAM_MODE An undefined value was set for the candidate retrieval order in cursor
NJ_ERR_DIC_TYPE_INVALID A dictionary not matching the specifications was set in cursor
NJ_ERR_DIC_BROKEN   ■ The add location for learning dictionary and user dictionary could not be obtained from the learning dictionary specified in the dictionary set in cursor
  ■ The number of words to register is greater than the maximum number of registerable words as defined in the learning dictionary and user dictionary header specified in the dictionary in cursor
  ■ The data in the learning dictionary and user dictionary queue specified in the dictionary set in cursor is corrupted

If words are added or learning operations are performed after getting the dictionary search cursor (IWNN_CURSOR), get the dictionary search cursor again because the user dictionary and learning dictionary are updated.
Note that for the dictionaries included in this package, all of the dictionary words cannot be obtained by specifying "" (empty string) for the reading string.

CONFIDENTIAL