[110] | 1 | /**********************************************************************
|
---|
| 2 | *
|
---|
| 3 | * mgq.h --
|
---|
| 4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
| 5 | *
|
---|
[534] | 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.
|
---|
[110] | 9 | *
|
---|
[534] | 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 | *
|
---|
[110] | 24 | *********************************************************************/
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | #ifndef MGQ_H
|
---|
| 28 | #define MGQ_H
|
---|
| 29 |
|
---|
| 30 | #ifdef __cplusplus
|
---|
| 31 | extern "C" {
|
---|
| 32 | #endif
|
---|
| 33 |
|
---|
[319] | 34 |
|
---|
[110] | 35 | enum result_kinds {
|
---|
[319] | 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 | };
|
---|
[110] | 41 |
|
---|
| 42 | int mgq_ask(char *line);
|
---|
[324] | 43 | int mgq_results(enum result_kinds kind, int skip, int howmany,
|
---|
[319] | 44 | int (*sender)(char *, int, int, float, void *), void *ptr);
|
---|
[110] | 45 | int mgq_numdocs(void);
|
---|
| 46 | int mgq_numterms(void);
|
---|
| 47 |
|
---|
[324] | 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 */
|
---|
| 50 | int mgq_equivterms (unsigned char *wordstem, int (*sender)(char *, int, int, float, void *),
|
---|
| 51 | void *ptr);
|
---|
[334] | 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) */
|
---|
| 55 | int mgq_docsretrieved (int *total_retrieved, int *is_approx);
|
---|
[324] | 56 |
|
---|
[319] | 57 | /* use mgq_getmaxstemlen to determine the length of the word stems to pass */
|
---|
| 58 | /* to mgq_stemword */
|
---|
| 59 | int mgq_getmaxstemlen ();
|
---|
[110] | 60 |
|
---|
[319] | 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 */
|
---|
| 64 | void mgq_stemword (unsigned char *word);
|
---|
| 65 |
|
---|
| 66 |
|
---|
[115] | 67 | int is_dbcache_full (void);
|
---|
[110] | 68 | int load_database (char *collection, char *mgdir, char *gensuffix, char *textsuffix);
|
---|
| 69 | int load_text_database (char *collection);
|
---|
[115] | 70 | void close_all_databases (void);
|
---|
[110] | 71 |
|
---|
| 72 |
|
---|
| 73 | #ifdef __cplusplus
|
---|
| 74 | }
|
---|
| 75 | #endif
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 | #endif
|
---|