MmxGetReading Function

Description

This function returns reading strings for words having the same notation as the specified processing results. One candidate is returned at a time in order of frequency. Readings for the specified processing result phrases (independent words or independent words and ancillary words) are returned for the reading string. The reading string length used for independent words is stored in stemLen.
Do not specify a delimited input result file that was not generated by one of this API's functions.
An invalid value may be stored for the reading string length or independent word reading string length in the following cases.
  ■ An error has occurred
  ■ The reading string exceeds NJ_MAX_LEN
  ■ The reading string exceeds the size of the reading string buffer
  ■ A candidate string exceeds NJ_MAX_RESULT_LEN

The following dictionaries are included in the specified dictionary set (iwnn->dicSet) when using this function.
  ■ Integrated dictionary
  ■ User dictionary
  ■ Ancillary word dictionary
  ■ Rule dictionary
  ■ Compressed customized dictionary
  ■ Uncompressed customized dictionary
  ■ Single-kanji dictionary
Uncompressed custom dictionaries converted by the function for changing dictionary types are not targeted.
However, do not specify a custom dictionary for which parts of speech are not accurately assigned in the dictionary set.

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 MmxGetReading(
     IWNN_CLASS* iwnn,                            // Parsing information class
     wchar_t* reading,                            // Reading string
     u8* stemLen,                                 // Independent word reading string length
     const IWNN_RESULT* result,                   // Processing result
     u16 readingSize                              // Reading string buffer size
);

Arguments

NameDescription
IN / OUT IWNN_CLASS* iwnn Parsing information class
An error results if NULL is specified.
OUT wchar_t* reading The reading string storage buffer.
Prepare a wchar_t array having the size NJ_MAX_LEN+NJ_TERM_SIZE.
OUT u8* stemLen Independent word reading string length.
The reading string length is not stored if a NULL pointer has been specified.
IN const IWNN_RESULT* result The delimited input result.
Specify the delimited input processing result obtained with MmxSplitWord. If NULL is specified, the next input candidate is returned based on delimited input processing result from the previous reading.
However, an error is returned if NULL was specified when initially getting the reading.
IN u16 readingSize The reading string byte size.
Memory including a terminator must be allocated.

Return Value

s16 The reading string length stored in the reading string storage buffer.
0: If there is no reading string that corresponds to specified results, or results cannot be obtained or processed
Negative: Error

Error Codes Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
NJ_ERR_BUFFER_NOT_ENOUGH   ■ A NULL pointer was specified in reading
  ■ 0 was specified in readingSize
  ■ A size less than (NJ_MAX_LEN+NJ_TERM_SIZE)*sizeof(wchar_t) was specified in readingSize
NJ_ERR_INVALID_RESULT Data that is not the result of morphological analysis was specified in result
NJ_ERR_DIC_BROKEN   ■ The add location for user dictionary information could not be obtained from the 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 user dictionary header specified in iwnn->dicSet
  ■ The data in the user dictionary specified in iwnn->dicSet is corrupted
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_DIC_TYPE_INVALID An undefined dictionary was set in iwnn->dicSet
NJ_ERR_NO_CANDIDATE_LIST NULL was specified in result on the first call

CONFIDENTIAL