NjxGetCharType Function

Description

This function identifies the character type of the specified processing result as an independent word or ancillary word. It is not possible to determine where a delimiter is between an independent word and an ancillary word for the consecutive-clause conversion results and the phrase-level conversion results obtained using the prediction API. Therefore, this function gets a character type for independent words and stores it in stemType only.
If an error occurs, undefined values may be stored in the character type (stemType, ancillaryWordType).

List of Character Types

Definition Description
NJ_TYPE_HIRAGANA Hiragana
NJ_TYPE_KATAKANA Full-width katakana
NJ_TYPE_HALF_KATAKANA Half-width katakana
NJ_TYPE_HALF_NUMERIC Half-width numeric (Arabic numeral notation)
NJ_TYPE_FULL_NUMERIC Full-width numeric (Arabic numeral notation)
NJ_TYPE_UNDEFINE Other than the above (including cases where character types are mixed or full-space and half-space characters are mixed)
If stemType is other than NULL and there are no independent words, the character type becomes NJ_TYPE_NONE. This is the same for ancillary words.

Independent words and ancillary words cannot always be distinguished depending on where processing results (result) were obtained from.
Function for getting results Operation Note
NjxAnalyze Character type is set in stemType for all results of processing. The ancillaryWordType argument is always NJ_TYPE_NONE. Because the results of consecutive-clause parsing and phrase-level parsing are made up of multiple phrases, this function identifies the character type for candidates comprising only independent words.
Because independent words and ancillary words cannot be distinguished for candidates obtained from the learning dictionary, this function determines the character type for candidates comprising only independent words.
NjxConversion Basic get character type operation Because independent words and ancillary words cannot be distinguished for candidates obtained from the learning dictionary, this function determines the character type for candidates comprising only independent words.
NjxAllCandidates Basic get character type operation Because independent words and ancillary words cannot be distinguished for candidates obtained from the learning dictionary, this function determines the character type for candidates comprising only independent words.
NjxGetWord Basic get character type operation Because independent words and ancillary words cannot be distinguished for candidates obtained from the learning dictionary, this function determines the character type for candidates comprising only independent words.
MmxSplitWord Basic get character type operation -

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 NjxGetCharType(
     u8* stemType,                                // Independent word character type
     u8* ancillaryWordType,                       // Ancillary word character type
     const IWNN_CLASS* iwnn,                      // Parsing information class
     const IWNN_RESULT* result                    // Processing result
)

Arguments

NameDescription
OUT u8* stemType Independent word character type
Character type cannot be determined if NULL is specified.
OUT u8* ancillaryWordType Independent word character type
Character type cannot be determined if NULL is specified.
IN const IWNN_CLASS* iwnn Parsing information class
An error results if NULL is specified.
IN const IWNN_RESULT* result The result of processing.
An error results if NULL is specified.

Return Value

s16 Negative value: Error
0: Normal exit
Returns 0 if stemType and ancillaryWordType are both NULL.

Error Codes 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_INVALID_RESULT Unsupported code was set for operations on result
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_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 queue ID (result->word.stem.location.current) is corrupted
  ■ An input string longer than NJ_MAX_USER_LEN or a candidate string longer than NJ_MAX_USER_CANDIDATE_LEN is found in the user dictionary
  ■ An input string longer than NJ_MAX_LEN + 1 or a candidate string longer than NJ_MAX_RESULT_LEN + 1 is found in a dictionary other than the user dictionary
  ■ Connection information for a single word used in multiple queues is corrupted

CONFIDENTIAL