IWNN_DIC_SET, IWNN_DIC_INFO and IWNN_FLASH_DIC_INFO Structures

Description

The dictionary set structure specifies the set of dictionaries to be subjected to each process when dictionary look-up, conversion, prediction, or morphological analysis using iWnn is requested. Settings for each dictionary are defined in the IWNN_DIC_INFO structure. The set of dictionaries to be used is defined in IWNN_DIC_SET.

Structure Configuration

struct IWNN_FLASH_DIC_INFO {
     u32 dicType;                                 // Used internally
     u32 dicSize;                                 // Used internally
     u32 mode;                                    // Used internally
     IWNN_FILE* fileStream;                       // Used internally
     void* cacheArea[NJ_FUNC_ALL_CANDIDATES];     // Used internally
     void* extensionData;                         // Used internally
};

struct IWNN_DIC_INFO {
     u8 type;                                     // Dictionary type
     u8 limit;                                    // Search limits
     IWNN_DIC_HANDLE handle;                      // Dictionary handle
     void* extensionArea;                         // Pseudo-dictionary work area
     void* addInfo[NJ_MAX_ADDITIONAL_INFO];       // Additional information memory region
     struct {
          u16 base;                               // Base frequency by dictionary handle
          u16 high;                               // Maximum frequency by dictionary handle
     } dicFrequency[NJ_MODE_TYPE_MAX];
     NJ_SEARCH_CACHE* searchCache;                // Cache management memory region
};

struct IWNN_DIC_SET {
     IWNN_DIC_INFO dic[NJ_MAX_DIC];               // Dictionary information
     IWNN_DIC_HANDLE ruleHandle[NJ_MODE_TYPE_MAX];// Rule dictionary handle
     u16 mode;                                    // Used internally
     wchar_t keyword[NJ_MAX_KEYWORD];             // Used internally
};
The IWNN_DIC_INFO structure is used to set a pointer to the dictionary itself (handle) and the frequency range (dicFrequency). A separate frequency range is set for conversion (NJ_MODE_TYPE_CONVERSION), prediction (NJ_MODE_TYPE_PREDICTION), and morphological analysis (NJ_MODE_TYPE_MORPHOLIZE). A pointer (searchCache) to a cache management memory region must be specified for dictionaries that undergo fuzzy searches. However, the rule dictionary is an exception. Directly set a pointer to the dictionary using IWNN_DIC_SET.ruleHandle[]. Set a separate rule dictionary for conversion, prediction, and morphological analysis.
For the FLASH dictionary (target: integrated dictionary), instead of setting a pointer (handle) to the dictionary structure, set all required information in the IWNN_FLASH_DIC_INFO structure. Then set a pointer to the start of the IWNN_FLASH_DIC_INFO structure. Because functions for prediction, morphological analysis, conversion, and dictionary look-up search dictionaries in the order registered in the IWNN_DIC_SET structure, if homonym candidates having the same frequency occur in more than one dictionary, the order of registration in the structure becomes the order of candidates.

Members of the IWNN_DIC_SET structure

IWNN_DIC_INFO dic Dictionary information other than the rule dictionary.
Set dic[].handle = NULL for unused areas.
IWNN_DIC_HANDLE ruleHandle The dictionary handle of the rule dictionary.
This must be specified.

Members of the IWNN_DIC_INFO structure

u8 type Dictionary type: This is used to distinguish between regular dictionaries and pseudo-dictionaries, and to determine the type of pseudo-dictionary.
  ■ IWNN_DIC_HANDLE_TYPE_NRM: Regular dictionary
  ■ IWNN_DIC_HANDLE_TYPE_PROGRAM: Pseudo-dictionary
  ■ IWNN_DIC_HANDLE_TYPE_PROGRAM_ANCILLARY: Pseudo-dictionary (ancillary words)
  ■ IWNN_DIC_HANDLE_TYPE_ON_FLASH: FLASH dictionary
u8 limit Search limit by dictionary handle: Sets the length of the input string used to start a prediction search.
Specify an appropriate number of characters.
Setting range: From 0 to NJ_MAX_LEN+1 (0 - infinity)
If not being used, set to NJ_MAX_LEN+1.
IWNN_DIC_HANDLE handle Dictionary handle
Set to NULL if the memory region is not being used.
void* extensionArea This memory is used as the work area of the pseudo-dictionary.
Allocate memory of the size required by each pseudo-dictionary.
void* addInfo[] Additional information memory region
Stores additional information for dictionaries. This member can be used to set additional information for the integrated dictionary and no reading prediction dictionary. For other dictionaries, specify NULL for all elements.

Additional information can be set only for the number of array elements. Set NULL for elements for which there is no additional information.
Only when learnable additional information has been set in the zero-th element is that additional information the target of learning (capable of being learned). (However, if the additional information is longer than NJ_MAX_ADDITIONAL_LEN, it is not the target of learning.) Additional information set in an element other than the zero-th and additional information that cannot be learned is not the target of learning (cannot be learned) by the learning dictionary.
u16 dicFrequency.base Base frequency by dictionary handle
This value is added to the frequency value for each word in the dictionary and then used as the default frequency for words.
Setting range: From 0 to 1000
u16 dicFrequency.high Maximum frequency by dictionary handle
If the initial frequency during dictionary look-up is greater than or equal to this value, this value becomes the default frequency. Setting range: From 0 to 1000 (Make sure the value is equal to or greater than the Base Frequency by Dictionary Handle)
NJ_SEARCH_CACHE* searchCache Cache management memory region by dictionary handle
Allocates and configures the cache management memory region (NJ_SEARCH_CACHE) for dictionaries subjected to fuzzy prediction searches. Set to NULL if not being used.
Fuzzy prediction searches can be made on the following dictionaries.
  ■ Integrated dictionary
  ■ User dictionary
  ■ Customized dictionaries
  ■ Learning dictionary

Members of the IWNN_FLASH_DIC_INFO structure

Members of this structure are all set using functions.
The cache size required by the FLASH dictionary can be obtained using the function for getting the FLASH dictionary cache size (NjxGetFlashDicCacheSize). Allocate the memory size required. After allocation, set the FLASH dictionary information with the NjxSetFlashDicInfo function.

CONFIDENTIAL