NjxAnalyze Function

Description

This function is used to get a list of best candidates including the predicted candidate (fuzzy prediction candidate), kana-kanji conversion (consecutive-clause conversion, phrase-level conversion), and all candidates.
If the return value indicates no candidate (0) or an error, an undefined value may be stored in the processing result (result). Processing results can be obtained one at a time in the following order by calling this function once.

When reading is specified:

(1) Prediction results from a learning dictionary, or forward match searchable dictionary
(2) Consecutive-clause conversion results
(3) Phrase-level conversion results
(4) All retrieved candidate results

If no reading is specified
(This is used to get the predicted candidate to connect to after having done the above "When reading is specified:"):

(1) Connection prediction results for the learning dictionary, no reading prediction dictionary, integrated dictionary, and prediction dictionary for connecting phrases.

If no reading is specified
(This is used when the state setting category is "start of sentence" to get the prediction candidates to connect to this part of speech):

(1) The following dictionaries are used in all prediction and conversion processing of connection prediction results of the prediction dictionary for connecting phrases, the integrated dictionary, no reading prediction dictionary, and learning dictionary.
(◎: Used (fuzzy matching), ○: Used (no fuzzy matching), -: Not used)
Prediction Consecutive-clause conversion, Phrase-level conversion Get all candidates Derived prediction
Integrated dictionary
Single kanji dictionary - - -
User dictionary -
Learning dictionary
No reading prediction dictionary - -
Ancillary word dictionary -
Compressed customized dictionary (dictionary for forward look-up complete match searches) - - -
Compressed customized dictionary (dictionary for forward look-up prefix match searches) - -
Compressed customized dictionary (dictionary for reverse look-up complete match searches) - -
Uncompressed customized dictionary -
Rule dictionary

If you are using consecutive-clause conversion and phrase-level conversion results, be sure to include ancillary word dictionaries in the dictionary set. The longer the input reading string, the more time required for consecutive-clause and single-word analysis. Certain provisions such as applying a limit to the length of input string are therefore required in order to get consecutive-clause and single-word parsing results under high-speed button input conditions.
These operating settings are made using a prediction option (IWNN_ANALYZE_OPTION). For details, see Section 8.9, Prediction Option (IWNN_ANALYZE_OPTION).

Syntax

#include <mw/iwnn/iwnnCTR.h>

s16 NjxAnalyze(
     IWNN_CLASS* iwnn,                            // Parsing information class
     IWNN_RESULT* result,                         // Processing result structure
     const IWNN_CHARSET* charSet,                 // Fuzzy character set structure
     const wchar_t* reading,                      // String to be parsed
     const IWNN_ANALYZE_OPTION* option            // Prediction option
);

Arguments

NameDescription
IN / OUT IWNN_CLASS* iwnn Parsing information class
An error results if NULL is specified.
OUT IWNN_RESULT* result Buffer storing results of parsing.
One region of the buffer having a size of at least sizeof(IWNN_RESULT) is required.
An error results if NULL is specified.
IN const IWNN_CHARSET* charSet Fuzzy character set structure used to make fuzzy searches.
If not being used, specify NULL.
Do not change the content of this buffer until all operations have ended because it is used internally by the system.
IN const wchar_t* reading String to be parsed.
Add a terminator at the end of the string.
If NULL is specified, the character string previously analyzed is used again. If an empty character string ("") is specified, you can obtain the optimized analysis associated with the previously learned results (NjxSelect).
Do not change the contents of the buffer until all operations are complete because this character-string memory is used internally by iWnn.
IN const IWNN_ANALYZE_OPTION* option Prediction option.
This option specifies information such as the type of candidates to get and the maximum number of retrieved candidates.
If NULL is specified, the software executes based on default values and the recommended value for the prediction option. Note: For details, see Section 8.9, Prediction Option (IWNN_ANALYZE_OPTION).

Return Value

s16 Negative: Error
0: No candidates
1: Candidates found

Error Codes Description of Error
NJ_ERR_PARAM_ENVIRONMENT_NULL A NULL pointer was specified for iwnn
NJ_ERR_PARAM_DIC_NULL A NULL pointer was specified for iwnn->dicSet
NJ_ERR_NO_RULE_DIC Returned when a rule dictionary was not set in iwnn->dicSet
NJ_ERR_PARAM_RESULT_NULL A NULL pointer was specified for result
NJ_ERR_NOT_SELECT_YET Returned when NULL was specified for reading, but there are no previous prediction conditions
NJ_ERR_PARAM_READING_SIZE An input character string longer than NJ_MAX_LEN + 1 was specified for reading
NJ_ERR_PARAM_ILLEGAL_LIMIT Returned when an out-of-bounds value is specified for option
NJ_ERR_DIC_BROKEN   ■ Additional locations of learning 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 larger than the maximum number of registered words given in the learning dictionary and user dictionary headers specified in iwnn->dicSet
  ■ The data in the learning dictionary and user dictionary queue specified in iwnn->dicSet is corrupted
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_CACHE_BROKEN Returned when the cache management area specified in iwnn->dicSet is corrupted
NJ_ERR_PROTECTION_ERR Returned when operations have been performed on memory secured by using a learning dictionary function

CONFIDENTIAL