/************************************************************************** * * mg_invf_dict_dump.cpp -- Program to printthe various inverted dictionaries * Copyright (C) 1999 Rodger McNab * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: mg_invf_dict_dump.cpp 855 2000-01-14 02:17:52Z sjboddie $ * **************************************************************************/ #include "sysfuncs.h" #include "messages.h" #include "mg_files.h" #include "invf.h" /* $Log$ Revision 1.1 2000/01/14 02:17:51 sjboddie Rodgers new C++ mg */ static void process_files (char *filename, bool printHeader, bool printWords, bool printTags) { // open the dictionary FILE *dictFile = open_file (filename, INVF_DICT_SUFFIX, "rb", MAGIC_STEM_BUILD, MG_ABORT); invf_dict_header idh; idh.Read (dictFile); // print the information from the inverted dictionary file header if (printHeader) { cout << "lookback: " << idh.lookback << "\n"; cout << "word_dict_start: " << idh.word_dict_start << "\n"; cout << "word_dict_size: " << idh.word_dict_size << "\n"; cout << "tag_dict_start: " << idh.tag_dict_start << "\n"; cout << "tag_dict_size: " << idh.tag_dict_size << "\n"; cout << "num_docs: " << idh.num_docs << "\n"; cout << "num_frags: " << idh.num_frags << "\n"; cout << "num_words: " << idh.num_words << "\n"; cout << "total_bytes: " << idh.total_bytes << "\n"; cout << "index_string_bytes: " << idh.index_string_bytes << "\n"; cout << "num_levels: " << idh.num_levels << "\n"; cout << "\n"; } if (printWords) { fseek (dictFile, idh.word_dict_start, SEEK_SET); unsigned long wordNum; word_dict_el wordEl; wordEl.SetNumLevels (idh.num_levels); for (wordNum=0; wordNum