Ignore:
Timestamp:
2001-01-15T12:56:57+13:00 (23 years ago)
Author:
kjm18
Message:

added support for equiv terms for highlighting. THe QueryResult.TermFreqData
has UCArrayVector equivTerms now.

File:
1 edited

Legend:

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

    r1775 r1836  
    4242  UCArrayClear (tag);
    4343  UCArrayClear (term);
     44  equivTerms.erase(equivTerms.begin(), equivTerms.end());
    4445  stemMethod = 0;
    4546  matchDocs = 0;
     
    4950ostream &operator<< (ostream &s, const TermFreqData &t) {
    5051  s << "<" << t.tag << ">\"" << t.term << "\"stem("
    51     << t.stemMethod << ")docs(" << t.matchDocs << ")"
     52    << t.stemMethod << ")equiv terms(";
     53 
     54  unsigned long i;
     55  for (i=0; i<t.equivTerms.size(); i++) {
     56    s << t.equivTerms[i] << ", ";
     57  }
     58  s <<")docs(" << t.matchDocs << ")"
    5259    << "count("<<t.termFreq<<")";
    5360  return s;
     
    5865      (t1.term == t2.term) &&
    5966      (t1.stemMethod == t2.stemMethod) &&
     67      (t1.equivTerms == t2.equivTerms) &&
    6068      (t1.matchDocs == t2.matchDocs) &&
    6169      (t1.termFreq == t2.termFreq));
     
    279287               unsigned long termNum,
    280288               FragData &fragData,
    281                FragRangeArray *fragLimits) {
     289               FragRangeArray *fragLimits,
     290               UCArray & termWord) {
    282291  fragData.Clear();
    283292
     
    295304
    296305  fragData.matchDocs = wordDictEl.levelFreqs[indexData.curLevelNum];
    297 
     306  termWord = wordDictEl.el;
    298307  // seek to the appropriate place in the inverted file
    299308  fseek (indexData.invfFile, wordDictEl.invf_ptr, SEEK_SET);
     
    462471             unsigned long stemMethod,
    463472             unsigned long termWeight,
     473             UCArrayVector &equivTerms,
    464474             QueryResult &result) {
    465475  bool needRanks = (queryInfo.sortByRank || queryInfo.needRankInfo);
     
    527537    termFreqData.term = term;
    528538    termFreqData.stemMethod = stemMethod;
     539    termFreqData.equivTerms = equivTerms;
    529540    termFreqData.matchDocs = termData.matchDocs;
    530541    termFreqData.termFreq = overallwordfreq; // will be zero if needRankInfo
     
    541552                unsigned long stemMethod,
    542553                unsigned long termWeight,
     554                UCArrayVector &equivTerms,
    543555                QueryResult &result) {
    544556  bool needRanks = (queryInfo.sortByRank || queryInfo.needRankInfo);
     
    636648    termFreqData.term = term;
    637649    termFreqData.stemMethod = stemMethod;
     650    termFreqData.equivTerms = equivTerms;
    638651    termFreqData.matchDocs = termData.matchDocs;
    639652    termFreqData.termFreq = overallwordfreq;
Note: See TracChangeset for help on using the changeset viewer.