Changeset 3150 for trunk/gsdl/src
- Timestamp:
- 2002-06-17T15:25:05+12:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/mgppsearch.cpp
r2701 r3150 2 2 * 3 3 * mgppsearch.cpp -- 4 * Copyright (C) 1999 The New Zealand Digital Library Project4 * Copyright (C) 1999-2002 The New Zealand Digital Library Project 5 5 * 6 6 * A component of the Greenstone digital library software … … 32 32 #include "TextGet.h" 33 33 #include "queryinfo.h" 34 34 #include "gsdlunicode.h" 35 35 36 36 … … 126 126 127 127 UCArray queryArray; 128 SetCStr(queryArray, (queryparams.querystring.getcstr())); 129 128 // greenstone gives us the query encoded in unicode. We want utf8. 129 char* utf8querystring=to_utf8(queryparams.querystring).getcstr(); 130 SetCStr(queryArray, utf8querystring); 131 delete utf8querystring; 132 130 133 // create the mgpp query tree 131 134 QueryNode *queryTree = NULL; … … 171 174 for (int k=0; k<(int)queryResult.termFreqs.size(); k++) { 172 175 term.clear(); 173 term.termstr = GetCStr(queryResult.termFreqs[k].term); 176 char* termfreq_cstr=GetCStr(queryResult.termFreqs[k].term); 177 term.termstr = to_uni(termfreq_cstr); 178 delete termfreq_cstr; 174 179 term.termstemstr = term.termstr; 180 // we don't set term.utf8equivterms ?? - jrm21 175 181 term.termfreq = queryResult.termFreqs[k].termFreq; 176 182 queryresult.terms.push_back(term); … … 178 184 179 185 for (int j=0; j<(int)queryResult.termFreqs[k].equivTerms.size(); j++) { 180 queryresult.termvariants.insert(GetCStr(queryResult.termFreqs[k].equivTerms[j])); 186 char* equivterm_cstr=GetCStr(queryResult.termFreqs[k].equivTerms[j]); 187 queryresult.termvariants.insert(to_uni(equivterm_cstr)); 188 delete equivterm_cstr; 181 189 } 182 190 … … 222 230 223 231 UCArrayClear(browseNode.term); 224 SetCStr(browseNode.term, (queryparams.querystring.getcstr())); 232 // greenstone gives us the query encoded in unicode. We want utf8. 233 char* utf8querystring=to_utf8(queryparams.querystring).getcstr(); 234 SetCStr(browseNode.term, utf8querystring); 235 delete utf8querystring; 225 236 226 237 // do the actual query … … 231 242 for (int i=0; i<(int)browseResult.termFreqs.size(); i++) { 232 243 term.clear(); 233 term.termstr = GetCStr(browseResult.termFreqs[i].term); 244 char* term_cstr = GetCStr(browseResult.termFreqs[i].term); 245 term.termstr = to_uni(term_cstr); 246 delete term_cstr; 234 247 term.termstemstr = term.termstr; 235 248 term.termfreq = browseResult.termFreqs[i].termFreq; … … 280 293 // convert UCArray to text_t 281 294 output.clear(); 282 output = GetCStr(doctext); 295 char* doctext_cstr = GetCStr(doctext); 296 output = doctext_cstr; 297 delete doctext_cstr; 283 298 284 299 // here need to remove the <Document>, <Section>, <Paragraph> tags
Note:
See TracChangeset
for help on using the changeset viewer.