/*
 * Copyright (c) 1991-1994  Sony Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * Except as contained in this notice, the name of Sony Corporation
 * shall not be used in advertising or otherwise to promote the sale, use
 * or other dealings in this Software without prior written authorization
 * from Sony Corporation.
 *
 */

/*
 * $SonyRCSfile: sj4_dict_const.h,v $
 * $SonyRevision: 1.1 $
 * $SonyDate: 1994/06/03 08:00:24 $
 */

#ifndef SJ4_DICT_CONST_H
#define SJ4_DICT_CONST_H

#define HUGE

#ifdef HUGE
#define MAINSEGMENTLENGTH 8192
#define MAININDEXLENGTH 32768
#else
#define MAINSEGMENTLENGTH 2048
#define MAININDEXLENGTH 2048
#endif
#define MAININDEXNUMBER 256

#define MAXYOMILENGTH 32
#define MAXKANJILENGTH 32
#define MAXHINSINUMBER 16
#define MAXATRNUMBER 16
#define MAXJOSINUMBER 16

#define MAXKNJASKNUMBER 16
#define MAXYOMIASKNUMBER 16

#define DOUONBLKSIZENUMBER 3

#define DOUONBLKTERM 0xff
#define HINSIBLKTERM 0xff

#define NORMALKANJIMASK 0x7f
#define SS3KANJI 0x0080
#define ZENHIRAASSYUKU 0x80
#define OFFSETASSYUKU 0x90
#define ZENKATAASSYUKU 0xa0
#define AIATTRIBUTE 0xb0
#define KANJIASSYUKU 0xc0
#define LEADINGHANKAKU 0xd0
#define KANAKANCOST 0xe0
#define KANJISTREND 0x00
#define ISASSYUKU 0x80
#define ASSUKUUSE2BYTE 0x90
#define KNJASSYUKUMASK 0x0f
#define KANJICODEMASK 0x0f
#define KANJIMODEMASK 0xf0
#define ATRMSKANJIOFS 0xc0c0

#ifdef HUGE
#define MAXHINDONUMBER 8000
#define MAXOFFSETNUMBER 2000
#else
#define MAXHINDONUMBER 2000
#define MAXOFFSETNUMBER 1000
#endif

#ifdef ENGLISH
#define ILLEGALFORMAT "Illegal format"
#define TOOLONGYOMI "Pronunciation too long"
#define TOOLONGKANJI "Kanji string too long"
#define TOOLONGHINSI "Verb too long"
#define TOOLONGGROUP "Illegal group"
#define TOOLONGJOSI "Illegal particle"
#define BADHINSI "Non-registered verb"
#define BADGROUP "Non-registered group"
#define BADJOSI "Non-registered particle"
#define NOYOMISTRING "Cannot get pronunciation string"
#define NOKANJISTRING "Cannot get kanji string"
#define TOOMANYATR "Too many attributes"
#define TOOMANYHINSI "Too many verbs"
#define TOOMANYJOSI "Too many particles"
#define NODATAINMAIN "Non-existent in main dictionary"
#define TOOMANYTARGET "Specify only one verb"
#define MEMNOTENOUGH "Not enough memory\n"
#define TABLEOVERFLOW "Frequency table overflowed\n"
#define CONTAINOFFSETCOMP "Contains offset compression %d\n"
#define MEMINSUFFICIENT "Memory was insufficient"
#define CVTHERE "here\n"
#define MEMALLOCFAILED "Could not allocate memory.\n"
#define HOMOPHONEBLOCK "There is a homophone block with the same reading\n"
#define WRONGREADORDER "The reading order is wrong\n"
#define TOOLARGEBLOCK "One homophone block is too large\n"
#define DUPECOMBINEDWORD "A duplicate compound word exists\n"
#define DUPECOMBINEDWORDREAD "\tReading:"
#define DUPECOMBINEDWORDKANJI "\tKanji:"
#define OFFSETTABLEOVERFLOW "Offset table overflowed\n"
#define OFFSETILLEGALSTATE "Abnormal state in real_ofsrec() %x\n"
#else
#define ILLEGALFORMAT "\245\325\245\251\241\274\245\336\245\303\245\310\244\254\260\333\276\357\244\307\244\271"
#define TOOLONGYOMI "\306\311\244\337\312\270\273\372\316\363\244\254\304\271\244\271\244\256\244\336\244\271"
#define TOOLONGKANJI "\264\301\273\372\312\270\273\372\316\363\244\254\304\271\244\271\244\256\244\336\244\271"
#define TOOLONGHINSI "\311\312\273\354\312\270\273\372\316\363\244\254\304\271\244\271\244\256\244\336\244\271"
#define TOOLONGGROUP "\245\260\245\353\241\274\245\327\314\276\244\254\260\333\276\357\244\307\244\271"
#define TOOLONGJOSI "\275\365\273\354\312\270\273\372\316\363\244\254\260\333\276\357\244\307\244\271"
#define BADHINSI "\305\320\317\277\244\265\244\354\244\306\244\244\244\312\244\244\311\312\273\354\244\307\244\271"
#define BADGROUP "\305\320\317\277\244\265\244\354\244\306\244\244\244\312\244\244\245\260\245\353\241\274\245\327\244\307\244\271"
#define BADJOSI "\305\320\317\277\244\265\244\354\244\306\244\244\244\312\244\244\275\365\273\354\244\307\244\271"
#define NOYOMISTRING "\306\311\244\337\312\270\273\372\316\363\244\254\274\350\306\300\244\307\244\255\244\336\244\273\244\363"
#define NOKANJISTRING "\264\301\273\372\312\270\273\372\316\363\244\254\274\350\306\300\244\307\244\255\244\336\244\273\244\363"
#define TOOMANYATR "\302\260\300\255\244\316\277\364\244\254\302\277\244\271\244\256\244\336\244\271"
#define TOOMANYHINSI "\311\312\273\354\244\316\277\364\244\254\302\277\244\271\244\256\244\336\244\271"
#define TOOMANYJOSI "\275\365\273\354\244\316\277\364\244\254\302\277\244\271\244\256\244\336\244\271"
#define NODATAINMAIN "\245\341\245\244\245\363\274\255\275\361\244\313\302\270\272\337\244\267\244\336\244\273\244\363"
#define TOOMANYTARGET "\311\312\273\354\244\362\243\261\244\304\273\330\304\352\244\267\244\306\244\257\244\300\244\265\244\244"
#define MEMNOTENOUGH "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n"
#define TABLEOVERFLOW "\311\321\305\331\245\306\241\274\245\326\245\353\244\254\244\242\244\325\244\354\244\336\244\267\244\277\n"
#define CONTAINOFFSETCOMP "\245\252\245\325\245\273\245\303\245\310\260\265\275\314\244\362\264\336\244\340 %d\n"
#define MEMINSUFFICIENT "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"
#define CVTHERE "\244\263\244\263\n"
#define MEMALLOCFAILED "\245\341\245\342\245\352\244\254\263\316\312\335\244\307\244\255\244\336\244\273\244\363\244\307\244\267\244\277\241\243\n"
#define HOMOPHONEBLOCK "\305\371\244\267\244\244\306\311\244\337\244\316\306\261\262\273\270\354\245\326\245\355\245\303\245\257\244\254\244\242\244\353\n"
#define WRONGREADORDER "\306\311\244\337\244\316\275\347\275\370\244\254\244\252\244\253\244\267\244\244\n"
#define TOOLARGEBLOCK "\243\261\306\261\262\273\270\354\245\326\245\355\245\303\245\257\244\254\302\347\244\255\244\271\244\256\244\336\244\271\n"
#define DUPECOMBINEDWORD "\306\261\260\354\244\316\275\317\270\354\244\254\302\270\272\337\244\267\244\277\n"
#define DUPECOMBINEDWORDREAD "\t\306\311\244\337:"
#define DUPECOMBINEDWORDKANJI "\t\264\301\273\372:"
#define OFFSETTABLEOVERFLOW "\245\252\245\325\245\273\245\303\245\310\241\246\245\306\241\274\245\326\245\353\244\254\244\242\244\325\244\354\244\336\244\267\244\277\n"
#define OFFSETILLEGALSTATE "real_ofsrec() \244\307\260\333\276\357\244\312\276\365\302\326 %x\n"
#endif

#define COMPHIRAGANA "\244\322%d"
#define COMPKATAKANA "\245\253%d"
#define COMPKANJI "\260\265%1x"
#define COMPWRONG "\244\252\244\253\244\267\244\244"
#define COMPATTR "\302\260%1x"
#define HINSITANKAN cnvhinsi((u_char*)"\303\261\264\301")

#define FALSE 0
#define TRUE (!FALSE)

#define DIVLIST 1
#define ASSYUKUREC 2
#define STRING 3
#define HINDOREC 4
#define OFFSETREC 5
#define KANJIREC 6
#define HINSIREC 7
#define DOUONREC 8

#define KANAKANCOST_BIT (1 << 24)

#endif
