source: main/branches/64_bit_Greenstone/greenstone2/runtime-src/src/recpt/phindaction.h@ 23508

Last change on this file since 23508 was 23508, checked in by sjm84, 13 years ago

Committing 64 bit changes into the branch

  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1/**********************************************************************
2 *
3 * phindaction.h --
4 *
5 * Copyright 2001 Gordon W. Paynter
6 * Copyright 2001 The New Zealand Digital Library Project
7 *
8 * A component of the Greenstone digital library software
9 * from the New Zealand Digital Library Project at the
10 * University of Waikato, New Zealand.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *
26 *********************************************************************/
27
28#include "gsdl_modules_cfg.h"
29#ifdef GSDL_USE_PHIND_ACTION
30
31#ifndef PHINDACTION_H
32#define PHINDACTION_H
33
34#include "mglong.h"
35#include "action.h"
36
37// Include MGPP functionality.
38#include <TextGet.h>
39#include <MGQuery.h>
40#include <Terms.h>
41#include <messages.h>
42#include <GSDLQueryParser.h>
43
44class phindaction : public action {
45
46protected:
47
48 bool find_phrase_number_from_word(const text_t &basepath,
49 const text_t &query,
50 DocNumArray &result);
51
52 bool get_phrase_all_data(TextData &textdata, mg_u_long phrase,
53 text_t &word, mg_u_long &tf, mg_u_long &ef,
54 mg_u_long &lf, mg_u_long &df,
55 vector <mg_u_long> &el,
56 vector <mg_u_long> &linkdest,
57 vector <UCArray> &linktype,
58 vector <mg_u_long> &docnum,
59 vector <mg_u_long> &docfrq);
60
61 bool print_thesaurus_links(const text_t &collection, bool XMLmode,
62 TextData &textdata, vector <mg_u_long> &linkdest,
63 vector <UCArray> &linktype, mg_u_long first,
64 mg_u_long last, displayclass &disp,
65 outconvertclass &outconvert, ostream &textout);
66
67 bool get_phrase_freq_data(TextData &textdata, mg_u_long phrase,
68 UCArray &word, mg_u_long &tf,
69 mg_u_long &ef, mg_u_long &df);
70
71 void print_expansions(const text_t &collection, bool XMLmode,
72 const text_t &body, TextData &textdata,
73 const vector <mg_u_long> &elist,
74 mg_u_long first, mg_u_long last,
75 displayclass &disp, outconvertclass &outconvert,
76 ostream &textout);
77
78 void split_phrase(const UCArray &word, const UCArray &body,
79 UCArray &prefix, UCArray &suffix);
80
81 bool phrase_match(const UCArray &text, UCArray::const_iterator &here,
82 UCArray::const_iterator end);
83
84 bool print_documents(bool XMLmode, const text_t &basepath,
85 const text_t &collection,
86 const vector <mg_u_long> &docNums,
87 const vector <mg_u_long> &docFreq,
88 mg_u_long first, mg_u_long last,
89 displayclass &disp, outconvertclass &outconvert,
90 ostream &textout);
91
92 bool get_document_all_data(TextData &docdata, mg_u_long docNum,
93 UCArray &title, UCArray &hash);
94
95 void toUCArray(const text_t &in, UCArray &out);
96
97 void output_error (const text_t &message, ostream &textout,
98 outconvertclass &outconvert,
99 displayclass & disp, ostream &logout,
100 bool XMLmode);
101
102
103public:
104 phindaction ();
105 virtual ~phindaction ();
106
107 text_t get_action_name () {return "phind";}
108
109 void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
110 response_t &response,text_t &response_data,
111 ostream &logout);
112
113 bool do_action (cgiargsclass &args, recptprotolistclass *protos,
114 browsermapclass *browsers, displayclass &disp,
115 outconvertclass &outconvert, ostream &textout,
116 ostream &logout);
117
118
119};
120
121#endif //!PHINDACTION_H
122#endif //GSDL_USE_PHIND_ACTION
123
Note: See TracBrowser for help on using the repository browser.