[3365] | 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"
|
---|
[13477] | 30 | #include "stemmer.h"
|
---|
[3365] | 31 |
|
---|
| 32 | class IndexData {
|
---|
| 33 | public:
|
---|
| 34 | // general information
|
---|
[4205] | 35 | char basePath[FILENAME_MAX];
|
---|
| 36 | char filename[FILENAME_MAX];
|
---|
[3365] | 37 | FIvfLevel levels;
|
---|
| 38 |
|
---|
| 39 | // blocked dictionary
|
---|
| 40 | FILE *dictFile;
|
---|
| 41 | block_dict_header bdh;
|
---|
| 42 | block_idx biWords;
|
---|
| 43 | block_idx biTags;
|
---|
| 44 |
|
---|
[13477] | 45 | /* [JFG - Mar 06: Accent folding patch] */
|
---|
[3365] | 46 | // stem indexes
|
---|
[13477] | 47 | FILE *stemFile[STEM_MAX];
|
---|
| 48 | stem_idx_header sih[STEM_MAX];
|
---|
| 49 | block_idx sii[STEM_MAX];
|
---|
| 50 |
|
---|
[3365] | 51 | // inverted file
|
---|
| 52 | FILE *invfFile;
|
---|
| 53 | invf_file_header ifh;
|
---|
| 54 |
|
---|
| 55 | // weights
|
---|
| 56 | FILE *approxWeightsFile;
|
---|
| 57 | FILE *exactWeightsFile;
|
---|
| 58 |
|
---|
| 59 | // level specific information
|
---|
| 60 | UCArray curLevel; // last level that was loaded
|
---|
| 61 | unsigned long curLevelNum;
|
---|
| 62 | FragLevelConvert levelConverter;
|
---|
| 63 | ApproxWeightsData weightData;
|
---|
| 64 |
|
---|
| 65 | IndexData ();
|
---|
| 66 | ~IndexData ();
|
---|
| 67 |
|
---|
| 68 | // LoadData will only load the data if it has not been loaded before
|
---|
| 69 | bool LoadData (const char *_basePath, const char *_filename);
|
---|
| 70 | bool UnloadData ();
|
---|
| 71 |
|
---|
| 72 | bool LoadLevel (const UCArray &level);
|
---|
| 73 | bool UnloadLevel ();
|
---|
| 74 | };
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 | #endif
|
---|