Changeset 660
- Timestamp:
- 1999-10-12T17:13:52+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/mgpp/text/query.ranked.cpp
r655 r660 51 51 /* 52 52 $Log$ 53 Revision 1.2 1999/10/12 04:13:52 cs025 54 Calls to GetEnv eradicated; interface to parsing of query text 55 cleaned up. 56 53 57 Revision 1.1 1999/10/11 02:58:14 cs025 54 58 Base install of MG-PP … … 90 94 public: 91 95 float *OrgWeight; 96 97 HeapEntry() 98 { 99 // do nothing 100 } 92 101 93 102 inline void chain(int docno, float *weightPtr) … … 323 332 /* [RPAP - Jan 97: Stem Index Change] */ 324 333 static TermList * 325 ParseRankedQuery (stemmed_dict * sd, char *QueryLine, int Sort, int indexed, 334 ParseRankedQuery (query_data *qd, char *QueryLine, 335 RankedQueryInfo *rqi, 326 336 QueryTermList **query_term_list) /* [RPAP - Feb 97: Term Frequency] */ 327 337 { … … 336 346 *query_term_list = QueryTermList_create(0); /* [RPAP - Feb 97: Term Frequency] */ 337 347 338 if (indexed) 339 default_stem_method = BooleanEnv (GetEnv ("casefold"), 0) | (BooleanEnv (GetEnv ("stem"), 0) << 1); 348 /* [RPAP - Jan 97: Stem Index Change] */ 349 if (qd->sd->sdh.indexed) 350 default_stem_method = rqi->getWordSpecial(); 351 //BooleanEnv (GetEnv ("casefold"), 0) | (BooleanEnv (GetEnv ("stem"), 0) << 1); 340 352 else 341 default_stem_method = sd->sdh.stem_method;353 default_stem_method = qd->sd->sdh.stem_method; 342 354 343 355 while (s_in <= end) … … 382 394 case (STEMPARAM): 383 395 stem_param = atoi (param); 384 if (errno != ERANGE && indexed && stem_param >= 0 && stem_param <= 3)396 if (errno != ERANGE && qd->sd->sdh.indexed && stem_param >= 0 && stem_param <= 3) 385 397 method_using = stem_to_apply = stem_param; 386 398 break; … … 389 401 390 402 bcopy ((void *) Word, (void *) sWord, *Word + 1); 391 stemmer (stem_to_apply, sd->sdh.stemmer_num, sWord);392 393 if (! indexed || stem_to_apply == 0)403 stemmer (stem_to_apply, qd->sd->sdh.stemmer_num, sWord); 404 405 if (!qd->sd->sdh.indexed || stem_to_apply == 0) 394 406 { 395 407 /* Look for the word in the already identified terms */ … … 410 422 { 411 423 /* Look for it in the stemmed dictionary */ 412 if ((word_num = FindWord ( sd, sWord, &count, &doc_count,424 if ((word_num = FindWord (qd->sd, sWord, &count, &doc_count, 413 425 &invf_ptr, &invf_len)) != -1) 414 426 { … … 460 472 TermList *tempList = TermList_create (0); 461 473 462 if ((num_entries = FindWords ( sd, sWord, stem_to_apply, &tempList)) > 0)474 if ((num_entries = FindWords (qd->sd, sWord, stem_to_apply, &tempList)) > 0) 463 475 { 464 476 int i; … … 512 524 } /* end while */ 513 525 514 if ( Sort)526 if (rqi->Sort) 515 527 /* Sort the terms in ascending order by doc_count */ 516 528 qsort (Terms->TE, Terms->size(), sizeof (TermEntry), doc_count_comp); … … 1071 1083 QueryTermList_free (&(qd->QTL)); 1072 1084 1073 qd->TL = ParseRankedQuery (qd->sd, Query, rqi->Sort, qd->sd->sdh.indexed, /* [RPAP - Jan 97: Stem Index Change] */ 1074 &(qd->QTL)); /* [RPAP - Feb 97: Term Frequency] */ 1085 qd->TL = ParseRankedQuery (qd, Query, rqi, &(qd->QTL)); /* [RPAP - Feb 97: Term Frequency] */ 1075 1086 1076 1087 /* TermList_print (qd->TL, stderr); */
Note:
See TracChangeset
for help on using the changeset viewer.