Changeset 319 for trunk/gsdl/src/colservr/queryinfo.cpp
- Timestamp:
- 1999-06-30T16:04:14+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/queryinfo.cpp
r311 r319 12 12 /* 13 13 $Log$ 14 Revision 1.4 1999/06/30 04:04:13 rjmcnab 15 made stemming functions available from mgsearch and made the stems 16 for the query terms available in queryinfo 17 14 18 Revision 1.3 1999/06/29 22:06:23 rjmcnab 15 19 Added a couple of fields to queryinfo to handle a special version … … 88 92 { 89 93 termstr = t.termstr; 94 termstemstr = t.termstemstr; 90 95 termfreq = t.termfreq; 91 96 … … 96 101 { 97 102 return ((x.termstr == y.termstr) && 103 (x.termstemstr == y.termstemstr) && 98 104 (x.termfreq == y.termfreq)); 99 105 } … … 108 114 { 109 115 return ((x.termfreq < y.termfreq) || 110 ((x.termfreq == y.termfreq) && (x.termst r < y.termstr)));111 116 ((x.termfreq == y.termfreq) && (x.termstemstr < y.termstemstr)) || 117 ((x.termfreq == y.termfreq) && (x.termstemstr == y.termstemstr) && (x.termstr < y.termstr))); 112 118 } 113 119 … … 115 121 { 116 122 return ((x.termfreq > y.termfreq) || 117 ((x.termfreq == y.termfreq) && (x.termst r > y.termstr)));118 123 ((x.termfreq == y.termfreq) && (x.termstemstr > y.termstemstr)) || 124 ((x.termfreq == y.termfreq) && (x.termstemstr == y.termstemstr) && (x.termstr > y.termstr))); 119 125 } 120 126 … … 125 131 126 132 outs << text_t2ascii << " t:\"" << t.termstr << "\""; 133 outs << text_t2ascii << " s:\"" << t.termstemstr << "\""; 127 134 outs << " f:" << t.termfreq << "\n"; 128 135 … … 145 152 // query results 146 153 147 void queryresultsclass::clear () 148 { 154 void queryresultsclass::clear () { 149 155 docs_matched_set = false;; 150 156 docs_matched = 0; … … 152 158 153 159 docs.erase(docs.begin(),docs.end()); 160 orgterms.erase(orgterms.begin(),orgterms.end()); 154 161 terms.erase(terms.begin(),terms.end()); 155 162 } … … 168 175 } 169 176 170 void queryresultsclass::sortqueryterms() 171 { 177 void queryresultsclass::sortuniqqueryterms() { 178 terms = orgterms; 179 180 // sort the terms 172 181 sort (terms.begin(), terms.end()); 173 } 174 175 void queryresultsclass::uniqqueryterms() 176 { 182 183 // and then unique them 177 184 vector<termfreqclass>::iterator new_end = unique (terms.begin(), terms.end()); 178 185 terms.erase(new_end, terms.end()); 179 186 } 180 181 187 182 188 … … 192 198 outs << (*docshere); 193 199 docshere++; 200 } 201 202 outs << "orgterms\n"; 203 vector<termfreqclass>::iterator orgtermshere = q.orgterms.begin(); 204 vector<termfreqclass>::iterator orgtermsend = q.orgterms.end(); 205 while (orgtermshere != orgtermsend) { 206 outs << (*orgtermshere); 207 orgtermshere++; 194 208 } 195 209
Note:
See TracChangeset
for help on using the changeset viewer.