Changeset 12380


Ignore:
Timestamp:
2006-08-02T16:30:23+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now shows the stopwords removed by Lucene, many thanks to Me and DL Consulting Ltd.

Location:
trunk/gsdl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/english.dm

    r12176 r12380  
    316316)}
    317317_textinvalidquery_ {Invalid query syntax}
     318_textstopwordsmsg_ {The following words are too common and were ignored: }
    318319
    319320_textmorethan_ {More than }
  • trunk/gsdl/src/colservr/expat_resultset.cpp

    r12262 r12380  
    5151    termfreqobj.termfreq = atoi(term_frequency_str);
    5252    queryresult_ptr->orgterms.push_back(termfreqobj);
     53  }
     54
     55  if (element_name == "StopWord") {
     56    char* stop_word_value_str = get_attribute(attributes, "value");
     57    queryresult_ptr->stopwords.insert((text_t) stop_word_value_str);
    5358  }
    5459
  • trunk/gsdl/src/colservr/lucenequeryfilter.cpp

    r9620 r12380  
    238238      ++terms_here;
    239239    }
     240
     241    // add the stop words
     242    text_tset::iterator stopwords_here = queryresults.stopwords.begin();
     243    text_tset::iterator stopwords_end = queryresults.stopwords.end();
     244    while (stopwords_here != stopwords_end) {
     245      response.stopwords.insert(*stopwords_here);
     246      ++stopwords_here;
     247    }
    240248  }
    241249
     
    367375    ++termvar_here;
    368376      }
     377
     378      // add the stop words
     379      text_tset::iterator stopwords_here = thisqueryresults.stopwords.begin();
     380      text_tset::iterator stopwords_end = thisqueryresults.stopwords.end();
     381      while (stopwords_here != stopwords_end) {
     382    multiresults.stopwords.insert(*stopwords_here);
     383    ++stopwords_here;
     384      }
    369385    }
    370386   
  • trunk/gsdl/src/colservr/queryinfo.h

    r12276 r12380  
    176176  termfreqclassarray terms;
    177177  text_tset termvariants;
    178  
     178  text_tset stopwords;
     179
    179180  void clear ();
    180181  queryresultsclass &operator=(const queryresultsclass &q);
  • trunk/gsdl/src/recpt/comtypes.cpp

    r11985 r12380  
    267267  termInfo.erase (termInfo.begin(), termInfo.end());
    268268  docInfo.erase (docInfo.begin(), docInfo.end());
     269  stopwords.clear();
    269270}
    270271
     
    274275  termInfo = x.termInfo;
    275276  docInfo = x.docInfo;
     277  stopwords = x.stopwords;
    276278  return *this;
    277279}
  • trunk/gsdl/src/recpt/comtypes.h

    r11985 r12380  
    332332  TermInfo_tarray termInfo; // empty if not requested
    333333  ResultDocInfo_tarray docInfo; // empty if not requested
     334  text_tset stopwords;
    334335
    335336  FilterResponse_t &operator=(const FilterResponse_t &x);
  • trunk/gsdl/src/recpt/queryaction.cpp

    r12276 r12380  
    12251225      ++this_term;
    12261226    }
    1227    
     1227
    12281228    if (response.numDocs > 0) {
    12291229      numdocs += response.numDocs;
     
    15781578// define_single_query_macros sets the extra macros for search_single_coll
    15791579// that couldn't be set until the query had been done. Those macros are
    1580 // _freqmsg_,
     1580// _freqmsg_ and _stopwordsmsg_
    15811581void queryaction::define_single_query_macros (cgiargsclass &args,
    15821582                          displayclass &disp,
    15831583                          const FilterResponse_t &response) {
    1584   // set up _freqmsg_ macros
     1584  // set up _freqmsg_ and _stopwordsmsg_ macros
    15851585
    15861586  text_t freqmsg = "";
     
    15941594    ++this_term;
    15951595  }
    1596  
    15971596  disp.setmacro ("freqmsg", "query", freqmsg);
     1597
     1598  text_t stopwordsmsg = "_textstopwordsmsg_ ";
     1599  text_tset::const_iterator stopwords_iterator = response.stopwords.begin();
     1600  while (stopwords_iterator != response.stopwords.end()) {
     1601    if (stopwordsmsg != "_textstopwordsmsg_ ") {
     1602      stopwordsmsg += ", ";
     1603    }
     1604    stopwordsmsg += (*stopwords_iterator);
     1605    ++stopwords_iterator;
     1606  }
     1607  disp.setmacro("stopwordsmsg", "query", stopwordsmsg);
    15981608}
    15991609
Note: See TracChangeset for help on using the changeset viewer.