Below is a patch for the IUBio version of Wais release 8 beta 5, which includes Booleans, partial words, and literals. This patch fixes noticeable bugs in the boolean and in the partial word portions. The boolean bug fix was provided by Anders Ardo . The bug is notice in the case of "foundword AND notfoundword", where matches for foundword are returned even though notfoundword does not occur at all. The partial word bug is a silly programming error on my part (forgot to reset a flag). It leads to missing, on average, about half of the possible partial word matches. You can easily apply this patch with Larry Wall's patch program (available at many unix ftp sites), in this way, at the directory containing w8b5bio/ % patch -p < w8b5bio1.patch Note: If you use the gopher server gopherd with this WAIS linked in, you will need to relink the gopherd program. The full version of IUBio-modified WAIS can be picked up by ftp/gopher to ftp.bio.indiana.edu, in folder IUBio-Software+Data/util/wais as iubio-wais-8b5-b.tar.Z - - - - - w8b5bio-b.patch - - - - - - - - - - diff -bwcr w8b5bio/ir/irfiles.c w8b5bio.new/ir/irfiles.c *** w8b5bio/ir/irfiles.c Mon Nov 9 15:01:17 1992 --- w8b5bio.new/ir/irfiles.c Mon Mar 29 18:51:42 1993 *************** *** 680,704 **** #ifdef PARTIALWORD if (findpart) { compare = strncmp(dictionary_word, word, wordlen); ! if ((0 == compare) /*&& (wordlen < strlen(dictionary_word))*/ ) { int ati = i; /* save partword matches for later... */ savePartMatch( dictionary_block_position(i, block), dictionary_block_word_occurances(i,block)); ! while (i>low && 0 == compare) { --i; dictionary_word = dictionary_block_word(i, block); compare = strncmp(dictionary_word, word, wordlen); if (0 == compare) savePartMatch( dictionary_block_position(i, block), dictionary_block_word_occurances(i,block)); } i= ati; ! while (i0 && 0 == compare) { --i; dictionary_word = dictionary_block_word(i, block); compare = strncmp(dictionary_word, word, wordlen); if (0 == compare) savePartMatch( dictionary_block_position(i, block), dictionary_block_word_occurances(i,block)); + /* waislog(WLOG_LOW, WLOG_INFO,"Partial: dict word '%s' at low i= %ld", dictionary_word, i); */ } i= ati; ! compare= 0; /* 29Mar93: ! Found that NASTY BUG and SQUASHED IT FLAT ! */ ! /* partialword searches were missing various known matches */ ! while (idelimiters_stream; delimiters[0] = '\0'; /* init to the empty string */ ! if(false == read_string_from_file(db->delimiters_stream, ! delimiters, MAX_HEADLINE_LEN)){ waislog(WLOG_HIGH, WLOG_ERROR, ! "delimiters are corrupt in db %s", db->database_file); ! } /* need to weed out .dlm files that have no symbols... */ if (delimiters[0] == '\0') return(NULL); else return(delimiters); --- 1606,1615 ---- FILE *stream = db->delimiters_stream; delimiters[0] = '\0'; /* init to the empty string */ ! if(stream == NULL) return(NULL); ! else if (false==read_string_from_file(stream, delimiters, MAX_HEADLINE_LEN)) waislog(WLOG_HIGH, WLOG_ERROR, ! "delimiters may be corrupt in db %s", db->database_file); /* need to weed out .dlm files that have no symbols... */ if (delimiters[0] == '\0') return(NULL); else return(delimiters); diff -bwcr w8b5bio/ir/sersrch.c w8b5bio.new/ir/sersrch.c *** w8b5bio/ir/sersrch.c Thu Oct 29 19:59:32 1992 --- w8b5bio.new/ir/sersrch.c Sat Jan 16 12:54:49 1993 *************** *** 772,777 **** --- 772,787 ---- else { /* index_file_block_number is negative */ #ifdef BOOLEANS + /* dgg, 16Jan93 -- need fix for case of "foundword AND notfoundword" here */ + /* current state returns all occurences of "foundword", but should return */ + /* nothing (no notfoundwords) */ + /* ?? will this do it? -- logic not clear about this */ + /* from Anders Ardo */ + if (gLastAnd) + for (count=0; count < db->doc_table_allocated_entries; count++) { + document_score_array[count] = 0; + prev_score_array[count] = 0; + } gLastNot= gLastAnd= false; #endif return(0); /* word not present */ END of - - - - - w8b5bio1.patch - - - - - - - - - -