cvs: php-src /ext/mnogosearch php_mnogo.c
| From: | Sergey Kartashoff | Date: | Tue, 08 Jul 2003 14:00:19 +0000 |
| Subject: | cvs: php-src /ext/mnogosearch php_mnogo.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-22438@lists.php.net to get a copy of this message | ||
gluke Tue Jul 8 10:00:19 2003 EDT
Modified files:
/php-src/ext/mnogosearch php_mnogo.c
Log:
- Output of UDM_PARAM_WORDINFO_ALL was fixed
Index: php-src/ext/mnogosearch/php_mnogo.c
diff -u php-src/ext/mnogosearch/php_mnogo.c:1.77 php-src/ext/mnogosearch/php_mnogo.c:1.78
--- php-src/ext/mnogosearch/php_mnogo.c:1.77 Tue Jul 8 09:28:16 2003
+++ php-src/ext/mnogosearch/php_mnogo.c Tue Jul 8 10:00:19 2003
@@ -1,5 +1,5 @@
/* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.77 2003/07/08 13:28:16 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.78 2003/07/08 14:00:19 gluke Exp $ */
/*
+----------------------------------------------------------------------+
@@ -2148,8 +2148,9 @@
*wordinfo = '\0';
for(i = 0; i < Res->WWList.nwords; i++){
- if ((Res->WWList.Word[i].count > 0) || (Res->WWList.Word[i].origin ==
UDM_WORD_ORIGIN_QUERY)) {
- if(wordinfo[0]) strcat(wordinfo,", ");
+ if ((Res->WWList.Word[i].count > 0) ||
+ (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY)) {
+ if(wordinfo[0]) strcat(wordinfo,", ");
sprintf(UDM_STREND(wordinfo)," %s : %d", Res->WWList.Word[i].word,
Res->WWList.Word[i].count);
} else if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
if(wordinfo[0]) strcat(wordinfo,", ");
@@ -2167,7 +2168,7 @@
#if UDM_VERSION_ID >= 30204
case UDM_PARAM_WORDINFO_ALL:
{
- int len,i;
+ int len,i,j;
for(len = i = 0; i < Res->WWList.nwords; i++)
len += Res->WWList.Word[i].len;
{
@@ -2177,23 +2178,19 @@
*wordinfo = '\0';
- for(i = 0; i < Res->WWList.nwords; i++){
- if (Res->WWList.Word[i].order != corder) {
- if(wordinfo[0]) {
- sprintf(UDM_STREND(wordinfo)," / %d, ", ccount);
- }
- ccount = Res->WWList.Word[i].count;
- if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
- sprintf(UDM_STREND(wordinfo)," %s : stopword", Res->WWList.Word[i].word);
- } else {
- sprintf(UDM_STREND(wordinfo)," %s : %d", Res->WWList.Word[i].word,
Res->WWList.Word[i].count);
- corder = Res->WWList.Word[i].order;
- }
- } else {
- ccount += Res->WWList.Word[i].count;
+ for(i = 0; i < Res->WWList.nwords; i++) {
+ corder = Res->WWList.Word[i].order;
+ ccount = 0;
+ for(j = 0; j < Res->WWList.nwords; j++) {
+ if (Res->WWList.Word[j].order == corder) {
+ ccount += Res->WWList.Word[j].count;
+ }
}
- }
- if (Res->WWList.nwords) {
+ if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
+ sprintf(UDM_STREND(wordinfo),"%s%s : stopword", (*wordinfo) ? ", " :
"", Res->WWList.Word[i].word);
+ } else if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY) {
+ sprintf(UDM_STREND(wordinfo),"%s%s : %d", (*wordinfo) ? ", " :
"", Res->WWList.Word[i].word, Res->WWList.Word[i].count);
+ } else continue;
sprintf(UDM_STREND(wordinfo)," / %d", ccount);
}
RETURN_STRING(wordinfo,1);