source: main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/src/text/invf_get.h@ 23508

Last change on this file since 23508 was 23508, checked in by sjm84, 13 years ago

Committing 64 bit changes into the branch

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/**************************************************************************
2 *
3 * invf_get.h -- Inverted file reading routines
4 * Copyright (C) 1994 Neil Sharman
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: invf_get.h 23508 2010-12-17 01:04:10Z sjm84 $
21 *
22 **************************************************************************/
23
24
25#ifndef H_INVF_GET
26#define H_INVF_GET
27
28typedef struct Invf_Doc_Entry
29 {
30 int DocNum;
31 float Sum;
32 }
33Invf_Doc_Entry;
34
35typedef struct Invf_Doc_Entry_Pool
36 {
37 void *pool;
38 unsigned pool_chunks;
39 }
40Invf_Doc_Entry_Pool;
41
42typedef struct Invf_Doc_EntryH
43 {
44 Invf_Doc_Entry IDE;
45 struct Invf_Doc_EntryH *next;
46 }
47Invf_Doc_EntryH;
48
49typedef struct Hash_Table
50 {
51 Invf_Doc_EntryH *Suplimentary_Entries;
52 int Suplimentary_Size;
53 int Suplimentary_Num;
54 unsigned max;
55 unsigned num;
56 unsigned size;
57 Invf_Doc_EntryH **HashTable;
58 Invf_Doc_EntryH *Head;
59 Invf_Doc_EntryH IDEH[1];
60 }
61Hash_Table;
62
63typedef struct List_Table
64 {
65 unsigned max;
66 unsigned num;
67 Invf_Doc_Entry IDE[1];
68 }
69List_Table;
70
71typedef enum
72 {
73 op_term, op_and_terms, op_and_or_terms, op_diff_terms
74 }
75Op_types;
76
77/*Invf_Doc_Entry *HT_find(Hash_Table *HT, mg_u_long DN); */
78void HT_free (query_data * qd, Hash_Table * HT);
79void LT_free (query_data * qd, List_Table * LT);
80
81invf_data *InitInvfFile (File * InvfFile, stemmed_dict * sd);
82void FreeInvfData (invf_data * id);
83
84DocList *GetDocs (query_data * qd, WordEntry * we, BooleanQueryInfo * bqi);
85
86float *CosineDecode (query_data * qd, TermList * Terms, RankedQueryInfo * rqi);
87
88void free_ide_pool (query_data * qd, Invf_Doc_Entry_Pool * pool);
89
90Splay_Tree *CosineDecodeSplay (query_data * qd, TermList * Terms,
91 RankedQueryInfo * rqi, Invf_Doc_Entry_Pool * pool);
92
93Hash_Table *CosineDecodeHash (query_data * qd, TermList * Terms,
94 RankedQueryInfo * rqi);
95List_Table *CosineDecodeList (query_data * qd, TermList * Terms,
96 RankedQueryInfo * rqi);
97
98
99DocList *GetDocsOp (query_data * qd, WordEntry * we, Op_types op, DocList * L);
100
101
102
103#endif
Note: See TracBrowser for help on using the repository browser.