Changeset 660


Ignore:
Timestamp:
1999-10-12T17:13:52+13:00 (25 years ago)
Author:
cs025
Message:

Calls to GetEnv eradicated; interface to parsing of query text
cleaned up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/query.ranked.cpp

    r655 r660  
    5151/*
    5252   $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
    5357   Revision 1.1  1999/10/11 02:58:14  cs025
    5458   Base install of MG-PP
     
    9094  public:
    9195    float *OrgWeight;
     96
     97    HeapEntry()
     98    {
     99      // do nothing
     100    }
    92101
    93102    inline void chain(int docno, float *weightPtr)
     
    323332/* [RPAP - Jan 97: Stem Index Change] */
    324333static TermList *
    325 ParseRankedQuery (stemmed_dict * sd, char *QueryLine, int Sort, int indexed,
     334ParseRankedQuery (query_data *qd, char *QueryLine,
     335          RankedQueryInfo *rqi,
    326336          QueryTermList **query_term_list)  /* [RPAP - Feb 97: Term Frequency] */
    327337{
     
    336346  *query_term_list = QueryTermList_create(0);  /* [RPAP - Feb 97: Term Frequency] */
    337347
    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);
    340352  else
    341     default_stem_method = sd->sdh.stem_method;
     353    default_stem_method = qd->sd->sdh.stem_method;
    342354
    343355  while (s_in <= end)
     
    382394        case (STEMPARAM):
    383395          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)
    385397        method_using = stem_to_apply = stem_param;
    386398          break;
     
    389401
    390402      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)
    394406    {
    395407      /* Look for the word in the already identified terms */
     
    410422        {
    411423          /* 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,
    413425                    &invf_ptr, &invf_len)) != -1)
    414426        {
     
    460472      TermList *tempList = TermList_create (0);
    461473
    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)
    463475        {
    464476          int i;
     
    512524    } /* end while */
    513525
    514   if (Sort)
     526  if (rqi->Sort)
    515527    /* Sort the terms in ascending order by doc_count */
    516528    qsort (Terms->TE, Terms->size(), sizeof (TermEntry), doc_count_comp);
     
    10711083    QueryTermList_free (&(qd->QTL));
    10721084
    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] */
    10751086
    10761087  /*  TermList_print (qd->TL, stderr); */
Note: See TracChangeset for help on using the changeset viewer.