source: trunk/gsdl/src/colservr/mgq.h@ 534

Last change on this file since 534 was 534, checked in by sjboddie, 25 years ago

added gpl notice

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
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 * $Id: mgq.h 534 1999-09-07 04:57:43Z sjboddie $
25 *
26 *********************************************************************/
27
28
29#ifndef MGQ_H
30#define MGQ_H
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36
37enum result_kinds {
38 result_docs, /* Return the documents found in last search */
39 result_docnums, /* Return document id numbers and weights */
40 result_termfreqs, /* Return terms and frequencies */
41 result_terms /* Return matching query terms */
42};
43
44int mgq_ask(char *line);
45int mgq_results(enum result_kinds kind, int skip, int howmany,
46 int (*sender)(char *, int, int, float, void *), void *ptr);
47int mgq_numdocs(void);
48int mgq_numterms(void);
49
50/* get all the terms that match wordstem using the current stemmer and */
51/* stemming method. The callback is the same style used by mgq_results */
52int mgq_equivterms (unsigned char *wordstem, int (*sender)(char *, int, int, float, void *),
53 void *ptr);
54
55/* gets the total number of documents retrieved. If this is not available */
56/* it will set total_retrieved to 0 (even when it obviously isn't) */
57int mgq_docsretrieved (int *total_retrieved, int *is_approx);
58
59/* use mgq_getmaxstemlen to determine the length of the word stems to pass */
60/* to mgq_stemword */
61int mgq_getmaxstemlen ();
62
63/* note: the stemming method and the stemmer come from the last query */
64/* "word" should be at least maxstemlen+1 long and it is a string that */
65/* starts with the string length */
66void mgq_stemword (unsigned char *word);
67
68
69int is_dbcache_full (void);
70int load_database (char *collection, char *mgdir, char *gensuffix, char *textsuffix);
71int load_text_database (char *collection);
72void close_all_databases (void);
73
74
75#ifdef __cplusplus
76}
77#endif
78
79
80#endif
Note: See TracBrowser for help on using the repository browser.