NjxGetStroke Function

Description

This function is used to get candidate reading strings from the processing result structure. If the return value indicates an error, the contents of the buffer for storing the reading string (buf) are invalid.

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 NjxGetStroke(
     wchar_t* buf,                                // Buffer for storing the reading string
     const IWNN_CLASS* iwnn,                      // Parsing information class
     const IWNN_RESULT* result,                   // Processing result structure
     u16 bufSize                                  // Byte size of the buffer for storing the reading string
);

Arguments

NameDescription
OUT wchar_t* buf The reading string storage buffer.
Allocates a buffer and specifies a pointer. Allocate memory for a wchar_t array of size NJ_MAX_LEN + NJ_TERM_SIZE.
IN const IWNN_CLASS* iwnn Parsing information class.
An error results if NULL is specified.
IN const IWNN_RESULT* result The processing result structure.
An error results if NULL is specified.
IN u16 bufSize The byte size of the reading string storage buffer.
Specify a size that includes a string terminator. Specify the size as a number of bytes.

Return Value

s16 Length of the obtained string. (Terminator not included.) A negative value indicates an error.

Error Code Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
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_BUFFER_NOT_ENOUGH   ■ A NULL pointer was specified for buf
  ■ 0 was specified for bufSize
  ■ The reading string length of result is larger than bufSize
NJ_ERR_INVALID_RESULT   ■ Unsupported code was set for operations on result
  ■ The dictionary from which candidates are to be obtained does not return a reading for reverse look-up results
  ■ The information in result is the result of morphological analysis
NJ_ERR_DIC_TYPE_INVALID The dictionary type associated with the single-word dictionary address specified in result is not supported
NJ_ERR_DIC_BROKEN This is returned if the target dictionary for result is an uncompressed dictionary and any of the following situations occur:
  ■ The data for the storage destination queue corresponding to queue ID is corrupted
  ■ Reading data longer than NJ_MAX_LEN+1 is stored in single-word data in the dictionary
  ■ Connection information for a single word used in multiple queues is corrupted
NJ_ERR_READING_TOO_LONG The length of the reading string in result exceeds NJ_MAX_LEN

CONFIDENTIAL