Path: blob/main/japanese/FreeWnn-lib/files/patch-Wnn-etc-hindo.c
18157 views
Index: Wnn/etc/hindo.c1===================================================================2RCS file: /home/cvs/private/hrs/freewnn/Wnn/etc/hindo.c,v3retrieving revision 1.1.1.14retrieving revision 1.25diff -u -p -r1.1.1.1 -r1.26--- Wnn/etc/hindo.c 20 Dec 2008 07:13:30 -0000 1.1.1.17+++ Wnn/etc/hindo.c 20 Dec 2008 15:22:40 -0000 1.28@@ -5,7 +5,7 @@9/*10* FreeWnn is a network-extensible Kana-to-Kanji conversion system.11* This file is part of FreeWnn.12- *13+ *14* Copyright Kyoto University Research Institute for Mathematical Sciences15* 1987, 1988, 1989, 1990, 1991, 199216* Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 199917@@ -49,8 +49,8 @@18�����٤�b�ΤȤ������٤ι����γ�Ψ�� 1 / ([b��4]��1)19â�� b��0�λ��ϡ����ٹ�����Ψ 02021-22- a == -1 <==> b == 0x7f = 127;23+24+ a == -1 <==> b == 0x7f = 127;25���λ������Υ���ȥ�ϡ��Ѵ��˷褷���Ѥ����ʤ�26(�����ȥ����Ȥ���Ƥ���)���Ȥ�ɽ����279/1/89 H.T.28@@ -58,47 +58,48 @@2930/** ����������ʿ�����ؿ���â������<0�λ��Υ��顼�����å��Ϥʤ���0���֤��ˡ�*/31static int32-isqrt (i)33- int i;34+isqrt(int i)35{36- register int a, b;37+ register int a, b;38+39+ if (i <= 0)40+ return (0);41+42+ for (a = i, b = 1; b <<= 1, a >>= 2;);43+44+ while ((a = i / b) < b)45+ b = (b + a) >> 1;4647- if (i <= 0)48- return (0);49- for (a = i, b = 1; b <<= 1, a >>= 2;);50- while ((a = i / b) < b)51- b = (b + a) >> 1;52- return (b);53+ return (b);54}5556/** ������a��������b */57int58-asshuku (hin)59- int hin;60+asshuku(int hin)61{62- register int c;63+ register int c;6465- if (hin == -1)66- return (127);67- if (hin <= 4)68- return (hin);69- /* ��Ⱦ������0�����ꤷ�ƤΥ��ԡ��ɥ��åס�motoni1,2�Ǥ�Ʊ�� */70-71- c = (isqrt ((hin <<= 1) + 1) + 1) & ~1;72- c += hin / c - 2;73- return (c < 126 ? c : 126);74+ if (hin == -1)75+ return (127);76+ if (hin <= 4)77+ return (hin);78+ /* ��Ⱦ������0�����ꤷ�ƤΥ��ԡ��ɥ��åס�motoni1,2�Ǥ�Ʊ�� */79+80+ c = (isqrt((hin <<= 1) + 1) + 1) & ~1;81+ c += hin / c - 2;82+83+ return (c < 126 ? c : 126);84}8586/** ������b��������(min)a */87/*88int89-motoni1(hin)90-int hin;91+motoni1(int hin)92{93register int c;9495if(hin == 127) return(-1);96- if(hin <= 4) return(hin);97+ if(hin <= 4) return(hin);98c = hin >> 2;99return( (hin - (c << 1)) * (c + 1) );100}101@@ -106,15 +107,17 @@ int hin;102103/** ������b��������(mid)a */104int105-motoni2 (hin)106- int hin;107+motoni2(int hin)108{109- register int c;110+ register int c;111+112+ if (hin == 127)113+ return (-1);114+115+ if (hin <= 4)116+ return (hin);117+118+ c = hin >> 2;119120- if (hin == 127)121- return (-1);122- if (hin <= 4)123- return (hin);124- c = hin >> 2;125- return ((hin - (c << 1)) * (c + 1) + (c >> 1));126+ return ((hin - (c << 1)) * (c + 1) + (c >> 1));127}128129130