Mercurial > freewnn
changeset 2:b605a0e60f5b
- reverted jdata.h
- fixed the bug which occurred on changing length of bunsetsu.
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Thu, 13 Dec 2007 17:42:01 +0900 |
parents | 790205f476c0 |
children | ed4bb01eb317 |
files | Wnn/include/jdata.h Wnn/jserver/jikouho_d.c |
diffstat | 2 files changed, 28 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/Wnn/include/jdata.h Thu Dec 13 04:47:24 2007 +0900 +++ b/Wnn/include/jdata.h Thu Dec 13 17:42:01 2007 +0900 @@ -36,7 +36,7 @@ #ifndef JS struct jdata { - UCHAR *kanji1; + int kanji1; short kanji2; /* */ short which; /* gyaku henkan? */ int serial; /* index is a serial number of the first @@ -148,7 +148,7 @@ { int next; /* pointer to uind2 */ int serial; - long kanjipter; + int kanjipter; w_char kosuu; w_char yomi[1]; /* actually it is variable length */ }; @@ -174,7 +174,7 @@ struct rind2 { int next[2]; /* pointer to rind2 */ - long kanjipter; + int kanjipter; }; /*
--- a/Wnn/jserver/jikouho_d.c Thu Dec 13 04:47:24 2007 +0900 +++ b/Wnn/jserver/jikouho_d.c Thu Dec 13 17:42:01 2007 +0900 @@ -158,10 +158,14 @@ static int #ifdef NO_FZK -jkt_dbn (yomi_sno, yomi_eno, beginvect, endvect, endvect1, nmax, rjkt_dbn) +jkt_dbn (int yomi_sno, int yomi_eno, int beginvect, int endvect, + int endvect1, int nmax, struct JKT_DBN **rjkt_dbn) #else -jkt_dbn (yomi_sno, yomi_eno, beginvect, fzkchar, endvect, endvect1, nmax, rjkt_dbn) +jkt_dbn (int yomi_sno, int yomi_eno, int beginvect, w_char *fzkchar, int endvect, + int endvect1, int nmax, struct JKT_DBN **rjkt_dbn) #endif /* NO_FZK */ + +#if 0 int yomi_sno; int yomi_eno; int beginvect; /* 前端ベクタ(-1:文節先頭、-2:なんでも)品詞No. */ @@ -172,6 +176,8 @@ int endvect1; /* 終端ベクタ */ register int nmax; /* 1大文節中の最大小文節数 */ struct JKT_DBN **rjkt_dbn; /* 次候補解析結果 */ +#endif + { register struct JKT_SBN **sb_que_head; /* 小文節解析結果 */ int tmp; /* 次候補ベクター数 */ @@ -190,7 +196,7 @@ sb_que_head = &db_tmp; *sb_que_head = NULL; - if ((tmp = zen_sbn (yomi_sno, yomi_eno, endvect, endvect1, sb_que_head, 1, (struct JKT_SBN *) 0 + if ((tmp = zen_sbn (yomi_sno, yomi_eno, endvect, endvect1, sb_que_head, 1, NULL #ifndef NO_KANA , &gijiflag #endif /* NO_KANA */ @@ -207,7 +213,7 @@ *sb_que_newcomer = NULL; tmp = zen_sbn (sb_one->j_c + 1, yomi_eno, sb_one->kangovect, WNN_VECT_NO, sb_que_newcomer, sb_one->kbcnt + 1, sb_one #ifndef NO_KANA - , 0 + , NULL #endif /* NO_KANA */ ); if (tmp < 0) @@ -331,7 +337,7 @@ register struct JKT_SBN *tmp; register struct JKT_SBN *next; - if (new == 0) + if (new == NULL) return (que); if (jkt_sbjunjo (que, new) < 0) { @@ -373,13 +379,13 @@ jkt_sbjunjo (que, new) struct JKT_SBN *que, *new; { - if (new == 0) + if (new == NULL) return (1); if (que->j_c > new->j_c) return (-1); if (que->j_c < new->j_c) { - if (que->lnk_br == 0) + if (que->lnk_br == NULL) return (0); if (que->lnk_br->j_c > new->j_c) return (0); @@ -393,7 +399,7 @@ return (0); /* return (-2); */ if (que->kangovect > new->kangovect) return (-1); - if (que->lnk_br == 0) + if (que->lnk_br == NULL) return (0); if (que->lnk_br->j_c > new->j_c) return (0); @@ -414,13 +420,13 @@ if (*jktdbn != 0) { - if (((*jktdbn)->lnk_br = getjktdbn ()) == 0) + if (((*jktdbn)->lnk_br = getjktdbn ()) == NULL) return (-1); (*jktdbn) = (*jktdbn)->lnk_br; } else { - if ((*rjkt_dbn = *jktdbn = getjktdbn ()) == 0) + if ((*rjkt_dbn = *jktdbn = getjktdbn ()) == NULL) return (-1); } (*jktdbn)->j_c = sbn->j_c; @@ -432,11 +438,14 @@ } static int -zen_sbn (yomi_sno, yomi_eno, endvect, endvect1, tjktsbn, bnst_num, parent +zen_sbn (int yomi_sno, int yomi_eno, int endvect, int endvect1, struct JKT_SBN **tjktsbn, + int bnst_num, struct JKT_SBN *parent #ifndef NO_KANA - , gijiflagp + , int *gijiflagp #endif /* NO_KANA */ ) + +#if 0 int yomi_sno; int yomi_eno; int endvect; /* 終端ベクタ */ @@ -447,6 +456,8 @@ #ifndef NO_KANA int *gijiflagp; #endif /* NO_KANA */ +#endif + { register int fzkcnt, ii, jktcnt; register int i, /* 幹語の終わりのインデックス */ @@ -496,7 +507,7 @@ #if !defined(NO_KANA) && !defined(KOREAN) /* カタカナ疑似文節を取り出します */ - if (gijiflagp != 0 && j < yomi_eno - 1) + if (gijiflagp != NULL && j < yomi_eno - 1) { for (ii = 0; ii < fzkcnt; ii++) { /* 付属語 */ @@ -533,7 +544,7 @@ gijisbn_top->kbcnt = bnst_num; get_giji_flg = giji_sbn->j_c; #ifndef NO_KANA - if (gijiflagp != 0 && giji_sbn->j_c == yomi_eno - 1) + if (gijiflagp != NULL && giji_sbn->j_c == yomi_eno - 1) *gijiflagp = 1; #endif /* NO_KANA */ jktcnt++;