1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * mgq.h --
|
---|
4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
5 | *
|
---|
6 | * PUT COPYRIGHT NOTICE HERE
|
---|
7 | *
|
---|
8 | * $Id: mgq.h 334 1999-07-01 09:29:21Z rjmcnab $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 |
|
---|
13 | #ifndef MGQ_H
|
---|
14 | #define MGQ_H
|
---|
15 |
|
---|
16 | #ifdef __cplusplus
|
---|
17 | extern "C" {
|
---|
18 | #endif
|
---|
19 |
|
---|
20 |
|
---|
21 | enum result_kinds {
|
---|
22 | result_docs, /* Return the documents found in last search */
|
---|
23 | result_docnums, /* Return document id numbers and weights */
|
---|
24 | result_termfreqs, /* Return terms and frequencies */
|
---|
25 | result_terms /* Return matching query terms */
|
---|
26 | };
|
---|
27 |
|
---|
28 | int mgq_ask(char *line);
|
---|
29 | int mgq_results(enum result_kinds kind, int skip, int howmany,
|
---|
30 | int (*sender)(char *, int, int, float, void *), void *ptr);
|
---|
31 | int mgq_numdocs(void);
|
---|
32 | int mgq_numterms(void);
|
---|
33 |
|
---|
34 | /* get all the terms that match wordstem using the current stemmer and */
|
---|
35 | /* stemming method. The callback is the same style used by mgq_results */
|
---|
36 | int mgq_equivterms (unsigned char *wordstem, int (*sender)(char *, int, int, float, void *),
|
---|
37 | void *ptr);
|
---|
38 |
|
---|
39 | /* gets the total number of documents retrieved. If this is not available */
|
---|
40 | /* it will set total_retrieved to 0 (even when it obviously isn't) */
|
---|
41 | int mgq_docsretrieved (int *total_retrieved, int *is_approx);
|
---|
42 |
|
---|
43 | /* use mgq_getmaxstemlen to determine the length of the word stems to pass */
|
---|
44 | /* to mgq_stemword */
|
---|
45 | int mgq_getmaxstemlen ();
|
---|
46 |
|
---|
47 | /* note: the stemming method and the stemmer come from the last query */
|
---|
48 | /* "word" should be at least maxstemlen+1 long and it is a string that */
|
---|
49 | /* starts with the string length */
|
---|
50 | void mgq_stemword (unsigned char *word);
|
---|
51 |
|
---|
52 |
|
---|
53 | int is_dbcache_full (void);
|
---|
54 | int load_database (char *collection, char *mgdir, char *gensuffix, char *textsuffix);
|
---|
55 | int load_text_database (char *collection);
|
---|
56 | void close_all_databases (void);
|
---|
57 |
|
---|
58 |
|
---|
59 | #ifdef __cplusplus
|
---|
60 | }
|
---|
61 | #endif
|
---|
62 |
|
---|
63 |
|
---|
64 | #endif
|
---|