MmxSelect Function

Description

This function registers words in the learning dictionary based on the specified reading string obtained by processing delimited input.
You can limit candidate character strings to be learned to independent words found in processed results. If you do so, specify an input string that corresponds to existing independent words.
Do not specify a result file that was not generated by one of this API's functions.

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 MmxSelect(
     IWNN_CLASS* iwnn,                            // Parsing information class
     const IWNN_RESULT* result,                   // Processing result
     const wchar_t* reading,                      // Reading string
     u8 independentFlag,                          // Independent word specification flag
     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_RESULT* result The delimited input result.
An error results if NULL is specified.
IN const wchar_t* reading Get input character string.
Specify a character string of a length up to NJ_MAX_LEN+NJ_TERM_SIZE.
An error results if NULL or an empty character ("") is specified.
IN u8 independentFlag Independent word specification flag.
0: Learn results by phrase
1: Learn only independent words in results
Other: Results in an error
IN u8 connect Associative learning flag.
Specifies whether to learn by association with previously confirmed candidates.
0: Do not perform associative learning.
1: Perform associative learning.
Other: Results in an error.

Return Value

s16 Negative value: Error
Other: Normal exit

Errors

Error Codes Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
NJ_ERR_DIC_NOT_FOUND Returned when a learning dictionary was not set in iwnn->dicSet
NJ_ERR_PARAM_RESULT_NULL A NULL pointer was specified for result
NJ_ERR_PARAM_READING_NULL   ■ A NULL pointer was specified in reading
  ■ An empty string was specified in reading
NJ_ERR_READING_TOO_LONG A string exceeding the length given by NJ_MAX_LEN was specified in reading
NJ_ERR_INVALID_FLAG   ■ A value other than 0 or 1 was specified in independentFlag
  ■ A value other than 0 or 1 was specified in connect
NJ_ERR_INVALID_RESULT   ■ An unspecified code is set for operations on result
  ■ The result data specified is not the result of morphological analysis
  ■ The result data represents consecutive-clause information for ancillary words only and independentFlag is set to 1
  ■ The length of the reading string in result is 0
NJ_ERR_DIC_BROKEN   ■ The target dictionary used with result is an uncompressed dictionary and one of the following situations has occurred
  ■ The data in the stored queue associated with queue ID is corrupted
  ■ Input data longer than NJ_MAX_LEN + 1 was stored as single word data in the dictionary
  ■ Connection information for a single word in multiple queues is corrupted
  ■ The target dictionary for use with result is an uncompressed dictionary and one of the following situations occur
  ■ The queue (result->word.stem.location.current) is corrupted
  ■ An input character string longer than NJ_MAX_USER_LEN + 1 or a candidate character string longer than NJ_MAX_USER_CANDIDATE_LEN + 1 is discovered in the user dictionary
  ■ An input character string longer than NJ_MAX_LEN + 1 or a candidate character string longer than NJ_MAX_RESULT_LEN + 1 is detected in a dictionary other than the user dictionary
  ■Connection information for a single word used in multiple queues is corrupted
  ■ The add location in the user dictionary could not be obtained from the user dictionary specified in iwnn->dicSet
  ■ The number of words to register is larger than the maximum number of registered words given in the user dictionary headers specified in iwnn->dicSet
  ■ The data in the user dictionary queue specified in iwnn->dicSet is corrupted
NJ_ERR_CANDIDATE_TOO_LONG A value greater than NJ_MAX_RESULT_LEN+1 was set for the candidate string length of result
NJ_ERR_DIC_NOT_FOUND Returned when a learning dictionary was not set in iwnn->dicSet
NJ_ERR_PROTECTION_ERR Returned when operations have been performed on memory secured by using a learning dictionary function
NJ_ERR_NO_RULE_DIC Returned when a rule dictionary was not set in iwnn->dicSet

CONFIDENTIAL