source: trunk/gsdl/src/recpt/phindaction.h@ 3722

Last change on this file since 3722 was 3722, checked in by sjboddie, 21 years ago

* empty log message *

  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/**********************************************************************
2 *
3 * phindaction.cpp --
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#ifndef PHINDACTION_H
29#define PHINDACTION_H
30
31#include "action.h"
32
33// Include MGPP functionality.
34#include <TextGet.h>
35#include <MGQuery.h>
36#include <Terms.h>
37#include <messages.h>
38#include <GSDLQueryParser.h>
39
40class phindaction : public action {
41
42protected:
43
44 void find_phrase_number_from_word(const text_t &basepath,
45 const text_t &query,
46 DocNumArray &result);
47
48 void get_phrase_all_data(TextData &textdata, unsigned long phrase,
49 text_t &word, unsigned long &tf, unsigned long &ef,
50 unsigned long &lf, unsigned long &df,
51 vector <unsigned long> &el,
52 vector <unsigned long> &linkdest,
53 vector <UCArray> &linktype,
54 vector <unsigned long> &docnum,
55 vector <unsigned long> &docfrq);
56
57 void print_thesaurus_links(const text_t &collection, bool XMLmode,
58 TextData &textdata, vector <unsigned long> &linkdest,
59 vector <UCArray> &linktype, unsigned long first,
60 unsigned long last, displayclass &disp,
61 outconvertclass &outconvert, ostream &textout);
62
63 void get_phrase_freq_data(TextData &textdata, unsigned long phrase,
64 UCArray &word, unsigned long &tf,
65 unsigned long &ef, unsigned long &df);
66
67 void print_expansions(const text_t &collection, bool XMLmode,
68 const text_t &body, TextData &textdata,
69 const vector <unsigned long> &elist,
70 unsigned long first, unsigned long last,
71 displayclass &disp, outconvertclass &outconvert,
72 ostream &textout);
73
74 void split_phrase(const UCArray &word, const UCArray &body,
75 UCArray &prefix, UCArray &suffix);
76
77 bool phrase_match(const UCArray &text, UCArray::const_iterator &here,
78 UCArray::const_iterator end);
79
80 void print_documents(bool XMLmode, const text_t &basepath,
81 const text_t &collection,
82 const vector <unsigned long> &docNums,
83 const vector <unsigned long> &docFreq,
84 unsigned long first, unsigned long last,
85 displayclass &disp, outconvertclass &outconvert,
86 ostream &textout);
87
88 void get_document_all_data(TextData &docdata, unsigned long docNum,
89 UCArray &title, UCArray &hash);
90
91 void toUCArray(const text_t &in, UCArray &out);
92
93 void output_error (const text_t &message, ostream &textout,
94 outconvertclass &outconvert,
95 displayclass & disp, ostream &logout,
96 bool XMLmode);
97
98
99public:
100 phindaction ();
101 virtual ~phindaction ();
102
103 text_t get_action_name () {return "phind";}
104
105 void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
106 response_t &response,text_t &response_data,
107 ostream &logout);
108
109 bool do_action (cgiargsclass &args, recptprotolistclass *protos,
110 browsermapclass *browsers, displayclass &disp,
111 outconvertclass &outconvert, ostream &textout,
112 ostream &logout);
113
114
115};
116
117#endif
Note: See TracBrowser for help on using the repository browser.