Add KANAKANCOST
This commit is contained in:
parent
530e94396f
commit
a6a7858eaf
20 changed files with 58916 additions and 59081 deletions
|
|
@ -62,6 +62,18 @@ int u_strcmp(u_char* a, u_char* b) {
|
|||
|
||||
int cnvhinsi(u_char* buf) {
|
||||
int i;
|
||||
|
||||
if(buf[0] == 'C') {
|
||||
int n = atoi(buf + 1);
|
||||
|
||||
if(n < 0) n = 0;
|
||||
if(n > 0xffff) n = 0xffff;
|
||||
|
||||
n = n * 0xfff / 0xffff;
|
||||
|
||||
return -(KANAKANCOST_BIT | n);
|
||||
}
|
||||
|
||||
#if 1
|
||||
for(i = 0; i <= GramMax; i++) {
|
||||
if(u_strcmp(buf, (u_char*)gramtbl[i].name) == 0) return gramtbl[i].code;
|
||||
|
|
|
|||
|
|
@ -107,10 +107,17 @@ makekanji(int* yomi, int* kanji, int* atr, int* len) {
|
|||
while(*atr) {
|
||||
i = *atr;
|
||||
atr++;
|
||||
|
||||
if(i & KANAKANCOST_BIT) {
|
||||
i &= ~KANAKANCOST_BIT;
|
||||
ktmp[pos++] = (KANAKANCOST | ((i >> 8) & 0xff));
|
||||
ktmp[pos++] = (i & 0xff);
|
||||
} else {
|
||||
#ifndef NO_ATR
|
||||
ktmp[pos++] = (AIATTRIBUTE | ((i >> 8) & 0xff));
|
||||
ktmp[pos++] = (i & 0xff);
|
||||
ktmp[pos++] = (AIATTRIBUTE | ((i >> 8) & 0xff));
|
||||
ktmp[pos++] = (i & 0xff);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if((i = top_strcmp(yomi, kanji))) {
|
||||
|
|
|
|||
|
|
@ -215,7 +215,8 @@ retry:
|
|||
|
||||
if(hinsi[0] == '[' && hinsi[i - 1] == ']') {
|
||||
hinsi[i - 1] = 0;
|
||||
i = cnvhinsi(hinsi + 1);
|
||||
|
||||
i = cnvhinsi(hinsi + 1);
|
||||
if(i > 0) {
|
||||
fprintf(stderr,
|
||||
#ifdef ENGLISH
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
#define AIATTRIBUTE 0xb0
|
||||
#define KANJIASSYUKU 0xc0
|
||||
#define LEADINGHANKAKU 0xd0
|
||||
#define KANAKANCOST 0xe0
|
||||
#define KANJISTREND 0x00
|
||||
#define ISASSYUKU 0x80
|
||||
#define ASSUKUUSE2BYTE 0x90
|
||||
|
|
@ -168,4 +169,6 @@
|
|||
#define HINSIREC 7
|
||||
#define DOUONREC 8
|
||||
|
||||
#define KANAKANCOST_BIT (1 << 24)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue