NjxAddWord Function

Description

This function registers information in the specified word information structure dictionaries that allow learning (the user dictionary, the learning dictionary, and the pseudo-dictionary).
If both a user dictionary and learning dictionary have been set in the dictionary set structure, the same words are registered in both dictionaries. However, if multiple learnable dictionaries of the same type have been set (multiple learning dictionaries or multiple user dictionaries), the learnable dictionary set first is registered. Even if learnable dictionaries are not set in the dictionary set, an error does not result (words are not registered). More than one word having the same reading string, candidate string, and part of speech group cannot be registered in the user dictionary.
If a user dictionary is specified as the destination to add a word, the associative learning flag is ignored.

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 NjxAddWord(   
     IWNN_CLASS* iwnn,                            // Parsing information class
     const IWNN_WORD_INFO* word,                  // Word registration information structure
     u8 type,                                     // Dictionary type
     u8 connect                                   // Associative learning flag
);

Arguments

NameDescription
IN / OUT IWNN_CLASS* iwnn Parsing information class
An error results if NULL is specified.
IN const IWNN_WORD_INFO* word Word registration information dictionary.
Specifies word information to be registered.
An error results if an erroneous value is set in IWNN_WORD_INFO or NULL is specified.
IN u8 type Dictionary type to register to.
0: Add to user dictionary
1: Add to learning dictionary
2: Add to pseudo-dictionary
IN u8 connect Associative learning flag.
This flag can only be enabled when a learning dictionary is specified for the dictionary type. 0: Do not perform associative learning with the word last registered.
1: Perform associative learning with the word last registered.

Return Value

s16 Negative value: Error (including cases where candidates with the same reading string and candidate string exist)
Other: Normal exit

Error Code Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
NJ_ERR_PARAM_DIC_NULL NULL was specified for iwnn->dicSet
NJ_ERR_NO_RULE_DIC A rule dictionary was not specified in iwnn->dicSet
NJ_ERR_DIC_TYPE_INVALID An undefined value was set for type
NJ_ERR_WORD_INFO_NULL NULL was specified for word
NJ_ERR_USER_READING_INVALID   ■ A reading string longer than NJ_MAX_LEN was specified for word registration in the learning dictionary
  ■ A reading string longer than NJ_MAX_USER_LEN was specified for word registration in the user dictionary
NJ_ERR_USER_CANDIDATE_INVALID   ■ A candidate string longer than NJ_MAX_RESULT_LEN was specified for word registration in the learning dictionary
  ■ A candidate string longer than NJ_MAX_USER_CANDIDATE_LEN was specified for word registration in the user dictionary
NJ_ERR_PARTS_OF_SPEECH_GROUP_INVALID An undefined value was set for the word part-of-speech group
NJ_ERR_DIC_NOT_FOUND The dictionary specified by type does not exist in the dictionary set specified in iwnn->dicSet
NJ_ERR_USER_DIC_FULL The user dictionary already contains the maximum number of registered words allowed
NJ_ERR_DIC_BROKEN   ■ Additional locations of learning information and user dictionary information could not be obtained from the learning dictionary specified in iwnn->dicSet
  ■ The number of words to register is larger than the maximum number of registered words given in the learning dictionary and user dictionary headers specified in iwnn->dicSet
  ■ The data in the learning dictionary and user dictionary queue specified in iwnn->dicSet is corrupted
NJ_ERR_SAME_WORD The word to add to the user dictionary has already been added
NJ_ERR_PROTECTION_ERR Operations have been performed on memory secured by using a learning dictionary function
NJ_ERR_INVALID_FLAG A value greater than one was specified for connect

CONFIDENTIAL