1 | /**************************************************************************
|
---|
2 | *
|
---|
3 | * text_get.h -- Function for reading documents from the compressed text
|
---|
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: text_get.h 25147 2012-02-28 00:59:00Z kjdon $
|
---|
21 | *
|
---|
22 | **************************************************************************/
|
---|
23 |
|
---|
24 | #ifndef H_TEXT_GET
|
---|
25 | #define H_TEXT_GET
|
---|
26 |
|
---|
27 |
|
---|
28 |
|
---|
29 | /* FetchDocStart ()
|
---|
30 | * Reads into DocEnt the starting position of the document in the *.text file
|
---|
31 | * Where the first document is document number 1
|
---|
32 | * It returns the true weight of the document.
|
---|
33 | */
|
---|
34 | double FetchDocStart (query_data * qd, mg_u_long DN, mg_u_long * seek_pos, mg_u_long * len);
|
---|
35 |
|
---|
36 | mg_u_long FetchInitialParagraph (text_data * td, mg_u_long ParaNum);
|
---|
37 |
|
---|
38 |
|
---|
39 | /* FetchCompressed ()
|
---|
40 | * Reads into buffer DocBuff the compressed form of document DocNum.
|
---|
41 | * Where the first document is document number 1
|
---|
42 | */
|
---|
43 | int FetchCompressed (query_data * qd, char **DocBuff, DocEntry * DocEnt);
|
---|
44 |
|
---|
45 | text_data *LoadTextData (File * text, File * text_idx_wgt, File * text_idx);
|
---|
46 |
|
---|
47 | void FreeTextData (text_data * td);
|
---|
48 |
|
---|
49 | int GetPosLens (query_data * qd, DocEntry * Docs, int num);
|
---|
50 |
|
---|
51 | int LoadBuffers (query_data * qd, DocEntry * Docs, int max_mem, int num);
|
---|
52 |
|
---|
53 | void FreeBuffers (query_data * qd, DocEntry * Docs, int num);
|
---|
54 |
|
---|
55 |
|
---|
56 |
|
---|
57 | compression_dict *LoadCompDict (File * text_comp_dict,
|
---|
58 | File * text_aux_dict,
|
---|
59 | File * text_fast_comp_dict);
|
---|
60 |
|
---|
61 | void FreeCompDict (compression_dict * cd);
|
---|
62 |
|
---|
63 |
|
---|
64 | int DecodeText (compression_dict * cd,
|
---|
65 | u_char * s_in, int l_in, u_char * s_out, int *l_out);
|
---|
66 |
|
---|
67 | #endif
|
---|