Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

KeyfileWordMap.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2004 University of Massachusetts.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 //
00014 // KeyfileWordMap
00015 //
00016 // 4 February 2004 -- tds
00017 //
00018 // A simple wrapper around Keyfile to provide a
00019 // (word <-> int) mapping.
00020 //
00021 
00022 #ifndef INDRI_KEYFILEWORDMAP_HPP
00023 #define INDRI_KEYFILEWORDMAP_HPP
00024 
00025 #include <string>
00026 #include "Keyfile.hpp"
00027 
00028 class KeyfileWordMap {
00029 private:
00030   Keyfile _wordToInt;
00031   Keyfile _intToWord;
00032   char _wordBuffer[ 1024 ];
00033 
00034 public:
00035   void create( std::string& path, const std::string& intSuffix, const std::string& wordSuffix );
00036   void open( std::string& path, const std::string& intSuffix, const std::string& wordSuffix );
00037   void openRead( std::string& path, const std::string& intSuffix, const std::string& wordSuffix );
00038   void close();
00039   int lookupID( const char* word );
00040   const char* lookupWord( int id );
00041   void put( int id, const char* word );
00042 };
00043 
00044 #endif // INDRI_KEYFILEWORDMAP_HPP

Generated on Wed Nov 3 12:58:59 2004 for Lemur Toolkit by doxygen1.2.18