summaryrefslogtreecommitdiff
path: root/packages/poboxserver/files/OpenPOBox-1.25.diff
blob: d3add6d79cf763d578d11c85417995fbb30e686d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
diff -ur OpenPOBox.orig/asearch/Makefile OpenPOBox/asearch/Makefile
--- OpenPOBox.orig/asearch/Makefile	2001-07-23 16:18:15.000000000 +0900
+++ OpenPOBox/asearch/Makefile	2003-06-14 17:52:12.668859200 +0900
@@ -2,7 +2,6 @@
 #	$Date: 2004/09/28 03:42:40 $
 #	$Revision: 1.6 $
 #
-CC = gcc
 CFLAGS = -Xcpluscomm
 WTANGLE = perl ../wtangle/wtangle
 
diff -ur OpenPOBox.orig/romakana/rklist OpenPOBox/romakana/rklist
--- OpenPOBox.orig/romakana/rklist	2001-07-23 23:29:06.000000000 +0900
+++ OpenPOBox/romakana/rklist	2003-06-18 10:05:47.358003200 +0900
@@ -127,7 +127,7 @@
 na	¥Ê
 ne	¥Í
 ni	¥Ë
-#nn	¥ó
+nn	¥ó
 no	¥Î
 nu	¥Ì
 nya	¥Ë¥ã
diff -ur OpenPOBox.orig/server/Makefile.in OpenPOBox/server/Makefile.in
--- OpenPOBox.orig/server/Makefile.in	2002-02-19 09:37:10.000000000 +0900
+++ OpenPOBox/server/Makefile.in	2003-06-14 17:52:12.678873600 +0900
@@ -10,7 +10,6 @@
 # CFLAGS = -DUNIX @CFLAGS@ -Xcpluscomm \
 #	-I../asearch -I../romakana -I../include -g
 
-CC = gcc
 CFLAGS = -DUNIX @CFLAGS@ \
 	-I/usr/local/include -I/usr/local/lib/glib/include \
 	-I@prefix@/include \
diff -ur OpenPOBox.orig/server/pbserver.html OpenPOBox/server/pbserver.html
--- OpenPOBox.orig/server/pbserver.html	2002-02-19 09:37:10.000000000 +0900
+++ OpenPOBox/server/pbserver.html	2003-06-18 10:20:24.779673600 +0900
@@ -60,8 +60,8 @@
 
 #define POBOXSERVERPORT 1178
 
-#define MAXCANDS 100
-#define MAXWORDLEN 100
+#define MAXCANDS 300
+#define MAXWORDLEN 50
 unsigned char *cands[MAXCANDS],*candspat[MAXCANDS];
 
 int process(int);
@@ -115,7 +115,7 @@
 
 process(int sock)
 {	
-	unsigned char buf[1000],combuf[BUFSIZE];
+	unsigned char buf[8000],combuf[BUFSIZE];
 
 	unsigned char w[100],p[100];
 	int i,n;
@@ -135,9 +135,11 @@
 		pobox_usedict(NULL); // save all existing changes
 		return -1; // this makes the server's main routine disconnect 
 	case '1':
+#if 0 // delete tolower
 		for(pat=combuf+1;*pat;pat++){
 			if(isupper(*pat)) *pat = tolower(*pat);
 		}
+#endif
 		pat = combuf+1;
 		patlen = strlen(pat);
 		pobox_context(context[sock],strlen(context[sock]));
diff -ur OpenPOBox.orig/server/poboxlib.html OpenPOBox/server/poboxlib.html
--- OpenPOBox.orig/server/poboxlib.html	2002-02-19 09:37:10.000000000 +0900
+++ OpenPOBox/server/poboxlib.html	2004-09-28 10:37:22.818192000 +0900
@@ -557,7 +557,7 @@
 //
 /////////////////////////////////////////////////////////////////
 
-#define MAXCANDS 40
+#define MAXCANDS 300
 static UCHAR *cands[MAXCANDS];
 static UCHAR *candspat[MAXCANDS];
 static int ncands = 0;
@@ -603,7 +603,7 @@
 //
 // $BC18l8!:w(B
 //
-POBOX_INT pobox_search(UCHAR *pat)
+POBOX_INT pobox_search(UCHAR *orig_pat)
 {
 	int i,j;
 	int m;
@@ -615,12 +615,18 @@
 	UCHAR searchpat[1000];
 	UCHAR kana[MAXWORDLEN];
 
+	UCHAR pat[100];
+
 	Dict *dict;
 	DicEntry de;
 
 	if(pat == NULL || strlen(pat) > 100)
 		return 0;
 
+	for (p = orig_pat, s = pat; *p; p++, s++) {
+	        *s = tolower(*p);
+	}
+	*s = '\0';
 #ifndef USEGC
 	for(i=0;i<ncands;i++){
 		if(cands[i]) free(cands[i]);
@@ -642,6 +648,8 @@
 			if(*s == 0xa4) *s = 0xa5;
 		}
 		addcand(&de);
+		de.word = orig_pat;
+		addcand(&de);
 		de.word = pat;
 		addcand(&de);
 	}
@@ -769,7 +777,54 @@
 					}
 				}
 			}
+		} 
+#ifdef USELOOKUP
+                else if(dict->poboxdict->type == POBOXDICT_LOOKUP){
+		// $B$"$$$^$$8!:w$O$H$j$"$($:J]N1(B
+		// $BAw$j2>L>8!:w(B
+printf("okurigana == pat=[%s]\n",pat);
+			strcpy(searchpat, pat);
+			while (ncands == 0 && !exact && *searchpat != '\0') {
+				int i, l;
+
+printf("okurigana searchpat=[%s]\n",searchpat);
+				if(lookup_search(dict->lookup,searchpat)){
+					char *line, *s;
+					UCHAR wordbuf[100];
+					for(;(line = lookup_get_next_line(dict->lookup)) && ncands < MAXCANDS;){
+						de.pat = line;
+						for(s = line;*s && *s != '\t';s++);
+						*s++ = '\0';
+						if (strncmp(de.pat, searchpat, strlen(de.pat)) != 0) {
+							/* $BF~NO$,FI$_$G;O$^$C$F$$$J$$>l9g$O8uJd$+$i30$9(B */
+							free(line);
+							continue;
+						}
+
+						de.word = s;
+						for(;*s && *s != '\t' && *s != '\n' && *s != '\r';s++);
+						*s = '\0';
+						strcpy(wordbuf, de.word);
+						Roma2Kana(pat+strlen(de.pat)-1,kana,rktable);
+						strcat(wordbuf,kana);
+						de.word = wordbuf;
+
+						de.context = NULL;
+						addcand(&de);
+						free(line);
+printf("okurigana cand=[%s]\n",s);
+					}
+				}
+				// delete vowels
+				l = strlen(searchpat);
+				searchpat[l - 1] = '\0';
+				for (i = l - 2; i >= 0 && !consonant(searchpat[i]); i--) {
+					searchpat[i] = '\0';
+				}
+			}
 		}
+#endif
+
 	}
 
 	if(ncands+3 < MAXCANDS){