diff options
author | ijliao <ijliao@FreeBSD.org> | 2002-07-19 09:12:40 +0000 |
---|---|---|
committer | ijliao <ijliao@FreeBSD.org> | 2002-07-19 09:12:40 +0000 |
commit | 56ffefab5962f77c3ac64b7f71b3d586fe143754 (patch) | |
tree | 957a0df989c6e79949b59b78d3f435674530fc1a /chinese/dictd | |
parent | c507d0603becf5ed7482f14bb4ae1242877f6f28 (diff) | |
download | FreeBSD-ports-56ffefab5962f77c3ac64b7f71b3d586fe143754.zip FreeBSD-ports-56ffefab5962f77c3ac64b7f71b3d586fe143754.tar.gz |
add zh-tw-dictd
PR: 40741, 40743
Submitted by: Kuang-che Wu <kcwu@kcwu.dyndns.org>
Diffstat (limited to 'chinese/dictd')
-rw-r--r-- | chinese/dictd/Makefile | 18 | ||||
-rw-r--r-- | chinese/dictd/files/patch-index.c | 71 | ||||
-rw-r--r-- | chinese/dictd/files/patch-libmaa::arg.c | 12 |
3 files changed, 101 insertions, 0 deletions
diff --git a/chinese/dictd/Makefile b/chinese/dictd/Makefile new file mode 100644 index 0000000..4710032 --- /dev/null +++ b/chinese/dictd/Makefile @@ -0,0 +1,18 @@ +# New ports collection makefile for: dictd +# Date created: 19 July 2002 +# Whom: Kuang-che Wu <kcwu@ck.tp.edu.tw> +# +# $FreeBSD$ +# + +CATEGORIES= chinese + +MAINTAINER= kcwu@ck.tp.edu.tw + +MASTERDIR= ${.CURDIR}/../../net/dictd +EXTRA_PATCHES= ${.CURDIR}/files/patch-index.c \ + ${.CURDIR}/files/patch-libmaa::arg.c + +.include "${MASTERDIR}/Makefile" + +PKGNAMEPREFIX:= ${PKGNAMEPREFIX}tw- diff --git a/chinese/dictd/files/patch-index.c b/chinese/dictd/files/patch-index.c new file mode 100644 index 0000000..a257941 --- /dev/null +++ b/chinese/dictd/files/patch-index.c @@ -0,0 +1,71 @@ +--- index.c.orig Mon Apr 29 22:43:42 2002 ++++ index.c Fri Jul 19 05:23:01 2002 +@@ -120,6 +120,15 @@ + + /* FIXME. Optimize this inner loop. */ + while (*word && start < end && *start != '\t') { ++ if ((*start & 0x80) && start+1<end && start[1]!='\t') { ++ if(start[0]!=word[0]) ++ return ((unsigned)word[0]<(unsigned)start[0])?-2:1; ++ if(start[1]!=word[1]) ++ return ((unsigned)word[1]<(unsigned)start[1])?-2:1; ++ word+=2; ++ start+=2; ++ continue; ++ } + if (!isspacealnum(*start)) { + ++start; + continue; +@@ -139,7 +148,11 @@ + ++start; + } + +- while (*start != '\t' && !isspacealnum(*start)) ++start; ++ while (*start != '\t' && !isspacealnum(*start)) ++ if((*start & 0x80) && start[1]!='\t') ++ break; ++ else ++ ++start; + + PRINTF(DBG_SEARCH,(" result = %d\n", + *word ? 1 : ((*start != '\t') ? -1 : 0))); +@@ -315,7 +328,6 @@ + int count = 0; + dictWord *datum; + const char *previous = NULL; +- + while (pt && pt < database->index->end) { + if (!compare( word, pt, database->index->end )) { + if (!previous || altcompare(previous, pt, database->index->end)) { +@@ -643,6 +655,7 @@ + char tmp; + dictWord *datum; + ++ if(*word & 0x80) return count; + #define CHECK \ + if ((pt = dict_index_search(buf, database->index)) \ + && !compare(buf, pt, database->index->end)) { \ +@@ -724,6 +737,11 @@ + if (isspace( *(const unsigned char *)w )) { + *pt++ = ' '; + } else { ++ if((*w & 0x80) && *(w+1)) { ++ *pt++=*w++; ++ *pt++=*w; ++ continue; ++ } + if (!isalnum( *(const unsigned char *)w )) continue; + *pt++ = tolower(*w); + } +@@ -790,6 +808,11 @@ + = binary_search( buf, i->start, i->end ); + } + for (j = '0'; j <= '9'; j++) { ++ buf[0] = j; ++ buf[1] = '\0'; ++ i->optStart[j] = binary_search( buf, i->start, i->end ); ++ } ++ for (j = 0x80; j <= 255; j++) { + buf[0] = j; + buf[1] = '\0'; + i->optStart[j] = binary_search( buf, i->start, i->end ); diff --git a/chinese/dictd/files/patch-libmaa::arg.c b/chinese/dictd/files/patch-libmaa::arg.c new file mode 100644 index 0000000..14176f4 --- /dev/null +++ b/chinese/dictd/files/patch-libmaa::arg.c @@ -0,0 +1,12 @@ +--- libmaa/arg.c.orig Wed Jul 17 05:21:04 2002 ++++ libmaa/arg.c Wed Jul 17 05:13:50 2002 +@@ -216,6 +216,9 @@ + ++pt; + + for (last = pt, len = 0; *pt; ++pt, ++len) { ++ if((*pt & 0x80) && pt[1]) { ++ ++pt, ++len; ++ } else + switch (*pt) { + case ' ': + case '\t': |