root/gsdl/trunk/src/colservr/mgq.h @ 15757

Revision 1285, 2.6 KB (checked in by sjboddie, 20 years ago)

Removed CVS logging information from source files

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1/**********************************************************************
2 *
3 * mgq.h --
4 * Copyright (C) 1999  The New Zealand Digital Library Project
5 *
6 * A component of the Greenstone digital library software
7 * from the New Zealand Digital Library Project at the
8 * University of Waikato, New Zealand.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 *********************************************************************/
25
26
27#ifndef MGQ_H
28#define MGQ_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34 
35enum result_kinds {
36  result_docs,      /* Return the documents found in last search */
37  result_docnums,   /* Return document id numbers and weights */
38  result_termfreqs, /* Return terms and frequencies */
39  result_terms      /* Return matching query terms */
40};
41
42int mgq_ask(char *line);
43int mgq_results(enum result_kinds kind, int skip, int howmany,
44        int (*sender)(char *, int, int, float, void *), void *ptr);
45int mgq_numdocs(void);
46int mgq_numterms(void);
47
48/* get all the terms that match wordstem using the current stemmer and */
49/* stemming method. The callback is the same style used by mgq_results */
50int mgq_equivterms (unsigned char *wordstem, int (*sender)(char *, int, int, float, void *),
51            void *ptr);
52
53/* gets the total number of documents retrieved. If this is not available */
54/* it will set total_retrieved to 0 (even when it obviously isn't) */
55int mgq_docsretrieved (int *total_retrieved, int *is_approx);
56 
57/* use mgq_getmaxstemlen to determine the length of the word stems to pass */
58/* to mgq_stemword */
59int mgq_getmaxstemlen ();
60
61/* note: the stemming method and the stemmer come from the last query */
62/* "word" should be at least maxstemlen+1 long and it is a string that */
63/* starts with the string length */
64void mgq_stemword (unsigned char *word);
65
66 
67int is_dbcache_full (void);
68int load_database (char *collection, char *mgdir, char *gensuffix, char *textsuffix);
69int load_text_database (char *collection);
70void close_all_databases (void);
71
72
73#ifdef __cplusplus
74}
75#endif
76
77
78#endif
Note: See TracBrowser for help on using the browser.