1 /* 2 * Copyright (C) 2008,2009 OMRON SOFTWARE Co., Ltd. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _NJD_H_ 18 #define _NJD_H_ 19 20 #define NJ_ST_SEARCH_NO_INIT 1 21 #define NJ_ST_SEARCH_READY 2 22 #define NJ_ST_SEARCH_END 3 23 #define NJ_ST_SEARCH_END_EXT 4 24 25 #define NJ_DIC_FMT_KANAKAN 0x0 26 27 #define NJ_DIC_ID_LEN (4) 28 #define NJ_DIC_IDENTIFIER 0x4e4a4443 29 #define NJ_DIC_COMMON_HEADER_SIZE 0x001C 30 #define NJ_DIC_POS_DATA_SIZE 0x0c 31 #define NJ_DIC_POS_EXT_SIZE 0x10 32 #define NJ_DIC_VERSION1 0x00010000 33 #define NJ_DIC_VERSION2 0x00020000 34 #define NJ_DIC_VERSION3 0x00030000 35 #define NJ_DIC_VERSION2_1 0x00020001 36 37 #define ADD_WORD_DIC_TYPE_USER 0 38 #define ADD_WORD_DIC_TYPE_LEARN 1 39 40 #define DIC_FREQ_BASE 0 41 #define DIC_FREQ_HIGH 1000 42 43 #define LEARN_DIC_QUE_SIZE 32 44 #define LEARN_DIC_EXT_QUE_SIZE 6 45 46 47 #define NJ_GET_DIC_VER(h) NJ_INT32_READ((h)+4) 48 49 50 #define GET_LOCATION_STATUS(x) ((NJ_UINT8)((x)&0x0f)) 51 52 #define GET_LOCATION_OPERATION(x) ((NJ_UINT8)(((x) >> 4)&0x0f)) 53 54 #define SET_LOCATION_OPERATION(ope) ((NJ_UINT16)((ope) << 4)) 55 56 57 #define NJ_GET_DIC_FMT(h) ((NJ_UINT8)((*((h)+0x1C)) & 0x03)) 58 59 60 #define CALCULATE_HINDO(freq, base, high, div) \ 61 ((NJ_HINDO)((((freq) * ((high) - (base))) / (div)) + (base))) 62 63 #define NORMALIZE_HINDO(freq, max, min) \ 64 (((freq) < (min)) ? (min) : (((freq) > (max)) ? (max) : (freq))) 65 66 67 #endif 68