1 | /**************************************************************************
|
---|
2 | *
|
---|
3 | * IndexData.h -- Information needed for querying
|
---|
4 | * Copyright (C) 1999 Rodger McNab
|
---|
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 | **************************************************************************/
|
---|
21 |
|
---|
22 | #ifndef INDEXDATA_H
|
---|
23 | #define INDEXDATA_H
|
---|
24 |
|
---|
25 | #include <stdio.h>
|
---|
26 | #include "invf.h"
|
---|
27 | #include "FIvfLevelInfo.h"
|
---|
28 | #include "FragLevelConvert.h"
|
---|
29 | #include "Weights.h"
|
---|
30 |
|
---|
31 |
|
---|
32 | class IndexData {
|
---|
33 | public:
|
---|
34 | // general information
|
---|
35 | char basePath[512];
|
---|
36 | char filename[512];
|
---|
37 | FIvfLevel levels;
|
---|
38 |
|
---|
39 | // blocked dictionary
|
---|
40 | FILE *dictFile;
|
---|
41 | block_dict_header bdh;
|
---|
42 | block_idx biWords;
|
---|
43 | block_idx biTags;
|
---|
44 |
|
---|
45 | // stem indexes
|
---|
46 | FILE *stem1File;
|
---|
47 | FILE *stem2File;
|
---|
48 | FILE *stem3File;
|
---|
49 | stem_idx_header sih1;
|
---|
50 | stem_idx_header sih2;
|
---|
51 | stem_idx_header sih3;
|
---|
52 | block_idx sii1;
|
---|
53 | block_idx sii2;
|
---|
54 | block_idx sii3;
|
---|
55 |
|
---|
56 | // inverted file
|
---|
57 | FILE *invfFile;
|
---|
58 | invf_file_header ifh;
|
---|
59 |
|
---|
60 | // weights
|
---|
61 | FILE *approxWeightsFile;
|
---|
62 | FILE *exactWeightsFile;
|
---|
63 |
|
---|
64 | // level specific information
|
---|
65 | UCArray curLevel; // last level that was loaded
|
---|
66 | unsigned long curLevelNum;
|
---|
67 | FragLevelConvert levelConverter;
|
---|
68 | ApproxWeightsData weightData;
|
---|
69 |
|
---|
70 | IndexData ();
|
---|
71 | ~IndexData ();
|
---|
72 |
|
---|
73 | // LoadData will only load the data if it has not been loaded before
|
---|
74 | bool LoadData (const char *_basePath, const char *_filename);
|
---|
75 | bool UnloadData ();
|
---|
76 |
|
---|
77 | bool LoadLevel (const UCArray &level);
|
---|
78 | bool UnloadLevel ();
|
---|
79 | };
|
---|
80 |
|
---|
81 |
|
---|
82 | #endif
|
---|