NjxConversion Function

Description

This function performs phrase-level conversion or consecutive-clause conversion of the specified reading string for the specified dictionary set. If the location of phrase delimiter is specified, phrase conversion is performed using the given phrase boundaries.
Conversion results are stored in the conversion result storage buffer for each phrase. If the number of phrases to parse is specified, parsing will be performed only for that number of phrases.

This function uses the following dictionaries in the specified dictionary set (iwnn->dicSet).
  ■ Integrated dictionary
  ■ User dictionary
  ■ Learning dictionary
  ■ Ancillary word dictionary
  ■ Compressed customized dictionary
  ■ Uncompressed customized dictionary
  ■ Rule dictionary
If the location of phrase delimiters is specified, the single-kanji dictionary is also used.

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 NjxConversion(
     IWNN_CLASS* iwnn,                            // Parsing information class
     IWNN_RESULT* result,                         // Conversion result storage structure
     const wchar_t* reading,                      // Reading string
     u8 analyzeLevel,                             // Number of phrases to parse
     u8 devidePos                                 // Phrase division location
);

Arguments

NameDescription
IN / OUT IWNN_CLASS* iwnn Parsing information class
An error results if NULL is specified.
OUT IWNN_RESULT* results Buffer storing conversion results.
Enough memory to store the number of phrases being parsed must be allocated.
IN const wchar_t* reading Reading string for consecutive-clause conversion.
Add a terminator at the end of the string.
Because this string memory region is used (overwritten) internally by iWnn during kanji conversion, do not change its contents until conversion is complete.
IN u8 analyzeLevel Number of phrases to be parsed.
Specify 1 or NJ_MAX_PHRASE.
If 1 is specified, phrase-level conversion is performed.
If NJ_MAX_PHRASE is specified, consecutive-clause conversion is performed.
An error results if a value other than 1 or NJ_MAX_PHRASE is specified.
IN u8 devidePos Phrase division location.
This is used when phrase delimiter locations have been explicitly specified. Delimiter locations are specified in terms of string length (number of array elements to come next).
Set to 0 if phrase division locations are not being specified.

Return Value

s16 Positive value: The number of phrases (one or more) stored in the conversion result storage buffer.
Negative value: Error

Error Codes Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
NJ_ERR_PARAM_ILLEGAL_LEVEL   ■ A value other than 1 or NJ_MAX_PHRASE was specified for analyzeLevel
  ■ A value of 1 was specified for analyzeLevel when a value other than 0 was set in devidePos
NJ_ERR_DIC_BROKEN   ■ The add location for learning dictionary information and user dictionary information could not be obtained from the learning dictionary and user dictionary specified in iwnn->dicSet
  ■ 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 iwnn->dicSet
  ■ The data in the learning dictionary and user dictionary queue specified in iwnn->dicSet is corrupted
NJ_ERR_PARAM_RESULT_NULL A NULL pointer was specified for result
NJ_ERR_PARAM_READING_NULL A NULL pointer was specified for reading
NJ_ERR_PARAM_READING_SIZE An empty character string or reading string longer than NJ_MAX_LEN was specified for reading
NJ_ERR_PARAM_DIVISION A value greater than the length of the specified reading string was specified for devidePos
NJ_ERR_NO_RULE_DIC Returned when a rule dictionary was not set in iwnn->dicSet
NJ_ERR_NO_PARTS_OF_SPEECH The required part-of-speech information cannot be obtained from the rule dictionary
NJ_ERR_PROTECTION_ERR Operations have been performed on memory secured by using a learning dictionary function
NJ_ERR_DIC_TYPE_INVALID An undefined dictionary was set in iwnn->dicSet

CONFIDENTIAL