source: trunk/gsdl/packages/mg-1.3d/src/text/term_lists.h@ 30

Last change on this file since 30 was 13, checked in by rjmcnab, 26 years ago

* empty log message *

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/**************************************************************************
2 *
3 * term_lists.h -- description
4 * Copyright (C) 1994 Authors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * $Id: term_lists.h 13 1998-11-17 09:36:00Z rjmcnab $
21 *
22 **************************************************************************/
23
24/*
25 $Log$
26 Revision 1.1 1998/11/17 09:35:44 rjmcnab
27 *** empty log message ***
28
29 * Revision 1.1 1994/10/20 03:57:08 tes
30 * I have rewritten the boolean query optimiser and abstracted out the
31 * components of the boolean query.
32 *
33 */
34
35#ifndef TERM_LISTS_H
36#define TERM_LISTS_H
37
38#include "sysfuncs.h"
39
40#define MAXTERMSTRLEN 1023 /* maximum number of characters in term string */
41
42typedef struct WordEntry
43 {
44 int word_num; /* Unique number for each different word */
45 u_long count; /* Number of times the word occurs in the text */
46 u_long doc_count; /* Number of documents that contain the word */
47 u_long max_doc_count; /* [RPAP - Jan 97: Stem Index Change] */
48 u_long invf_ptr; /* This is a byte position of the
49 inverted file entry corresponding to the word */
50 u_long invf_len; /* This is the length of the inverted
51 file entry in bytes */
52 }
53WordEntry;
54
55typedef struct TermEntry
56 {
57 WordEntry WE;
58 int Count; /* The number of times the word occurs in the query */
59 u_char *Word; /* The word. */
60 u_char *Stem; /* [RPAP - Jan 97: Stem Index Change] - The stemmed non-cf version of Word */
61 int require_match; /* [RJM 07/97: Ranked Required Terms] 0=optional match, 1=must match */
62 }
63TermEntry;
64
65typedef struct TermList
66 {
67 int list_size;
68 int num;
69 TermEntry TE[1];
70 }
71TermList;
72
73#define GetNthWE(term_list, n) (&((term_list)->TE[(n)].WE))
74
75/* --- prototypes --- */
76void ConvertTermsToString (TermList * query_term_list, char *str);
77int AddTermEntry (TermList ** query_term_list, TermEntry * te);
78int AddTerm (TermList ** query_term_list, u_char * Word, int Count, int word_num,
79 u_long count, u_long doc_count, u_long invf_ptr, u_long invf_len); /* [RPAP - Feb 97: Term Frequency] */
80void ResetTermList (TermList ** tl);
81void FreeTermList (TermList ** the_tl);
82void PrintWordEntry (WordEntry * we, FILE * file);
83void PrintTermEntry (TermEntry * te, FILE * file);
84void PrintTermList (TermList * tl, FILE * file);
85TermList *MakeTermList (int n);
86
87
88#endif
Note: See TracBrowser for help on using the repository browser.