Changeset 2967 for trunk/gsdl/src/recpt/formattools.cpp
- Timestamp:
- 2002-02-15T13:51:52+13:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/formattools.cpp
r2706 r2967 27 27 #include "cgiutils.h" 28 28 #include "OIDtools.h" 29 #include "summarise.h" 29 30 30 31 #include <assert.h> … … 39 40 static bool parse_action (text_t::const_iterator &here, const text_t::const_iterator &end, 40 41 format_t *formatlistptr, text_tset &metadata, bool &getParents); 42 43 text_t format_summary (const text_t& collection, recptproto* collectproto, 44 ResultDocInfo_t &docinfo, displayclass &disp, 45 const text_t &text, bool highlight, 46 ostream& logout); 47 41 48 42 49 void metadata_t::clear() { … … 530 537 formatlistptr->command = comEndHighlight; 531 538 539 else if (meta == "Summary") 540 formatlistptr->command = comSummary; 541 532 542 else { 533 543 formatlistptr->command = comMeta; … … 959 969 case comRel: //if [RelatedDocuments] appears in format string, collect relation data 960 970 return get_related_docs(collection, collectproto, docinfo, logout); 971 case comSummary: 972 return format_summary(collection,collectproto,docinfo,disp,text,highlight,logout); 961 973 case comMeta: 962 974 … … 1077 1089 text, logout); 1078 1090 } 1091 1092 1093 /* FUNCTION NAME: format_summary 1094 * DESC: this is invoked when a [Summary] special metadata is processed. 1095 * RETURNS: a query-biased summary for the document */ 1096 1097 text_t format_summary (const text_t& collection, recptproto* collectproto, 1098 ResultDocInfo_t &docinfo, displayclass &disp, 1099 const text_t &text, bool highlight, 1100 ostream& logout) { 1101 text_t textToSummarise, query; 1102 if(text.empty()) { // get document text 1103 DocumentRequest_t docrequest; 1104 DocumentResponse_t docresponse; 1105 comerror_t err; 1106 docrequest.OID = docinfo.OID; 1107 collectproto->get_document (collection, docrequest, docresponse, err, logout); 1108 textToSummarise = docresponse.doc; 1109 } else // in practice, this would not happen, because text is only 1110 // loaded with the [Text] command 1111 textToSummarise = text; 1112 disp.expandstring("_cgiargq_",query); 1113 return summarise(textToSummarise,query,80); 1114 }
Note:
See TracChangeset
for help on using the changeset viewer.