/*-
 * Copyright (c) 2000-2001
 * Tatsuya Kudoh(CDR/TK),ROYALPANDA.    All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#ifndef _REGG_P_H_
#define _REGG_P_H_

#include"regg.h"

#define REGG_CODE_TYPE_HIRA	0	/* hiragana */
#define REGG_CODE_TYPE_KATA	1	/* katakana */
#define REGG_CODE_TYPE_UPPER	2	/* A-Z */
#define REGG_CODE_TYPE_LOWER	3	/* a-z */
#define REGG_CODE_TYPE_OTHER	4

#define REGG_NUM_KANA_ASSOC	80

#define REGG_HASHSIZE		256

#if 1
#define REGG_UDICSIZE		6143
#else
#define REGG_UDICSIZE		127
#endif

#define REGG_NUM_CANDIDATE	512



/*
** hiragana - katakana - consonant association
*/

typedef struct{
	unsigned code[2];	/* 0 =hiragana, 1 = katakana */
	unsigned char cons;
}kana_assoc_t;


typedef struct udic_cand_t{
	struct udic_cand_t *next;
	unsigned char data[0];
}udic_cand_t;


typedef struct udic_yomi_t{
	struct udic_yomi_t *next;
	udic_cand_t cand;
	unsigned char data[0];
}udic_yomi_t;


#define REGG_PRIO_YOMILEN	10
#define REGG_PRIO_LEVEL		3
#if 1
#define REGG_PRIO_NUM_ENTRY	128
#else
#define REGG_PRIO_NUM_ENTRY	8
#endif

#define REGG_SAVE_FILE_SIZE	((	\
	   REGG_UDICSIZE + 1 \
	+ (REGG_PRIO_YOMILEN + 2*REGG_PRIO_LEVEL) * REGG_PRIO_NUM_ENTRY \
	+ 127) / 128)


typedef struct prio_t{
	struct prio_t *next;
	unsigned char data[REGG_PRIO_YOMILEN+1];
	int index[REGG_PRIO_LEVEL];
}prio_t;
	

extern kana_assoc_t ReggKanaAssoc[REGG_NUM_KANA_ASSOC];

#endif
