00001 // -*- C++ -*- 00002 /* 00003 Phrasehunter - index and query text corpora 00004 Copyright (C) 2006 Torsten Marek (shlomme@gmx.de) & 00005 Armin Schmidt (armin.sch@gmail.com) 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 */ 00021 00022 /** 00023 \file py_types.h 00024 \brief global type definitions, constants, and forward decls 00025 */ 00026 00027 #ifndef PH_TYPES 00028 #define PH_TYPES PH_TYPES 00029 00030 #include <vector> 00031 #include <map> 00032 #include <boost/shared_ptr.hpp> 00033 00034 namespace PhraseHunter 00035 { 00036 00037 class TextSaver; 00038 class IndexManager; 00039 class Token; 00040 class Tokenizer; 00041 class CorpusManager; 00042 class SearchEngine; 00043 class StatisticsEngine; 00044 class ContextReader; 00045 class TokenContext; 00046 00047 //! The ID of a document in the data base. 00048 typedef uint32_t DocID; 00049 //! The ID of Token in the data base. 00050 typedef uint32_t TokenID; 00051 //! The byte offset of a Token in a document. 00052 typedef uint32_t IdxPos; 00053 00054 //! The positions of a Token in a document. 00055 typedef std::vector<IdxPos> PositionList; 00056 //! Documents and positions for a Token. 00057 typedef std::map<DocID, PositionList> OccurrenceMap; 00058 00059 //! Pointer to a Token object. 00060 typedef boost::shared_ptr<Token> TokenPtr; 00061 //! Pointer to a TokenContext object. 00062 typedef boost::shared_ptr<TokenContext> TokenContextPtr; 00063 00064 //! A vector of TokenPtr 00065 typedef std::vector<TokenPtr> TokenVector; 00066 00067 static const TokenID InvalidTokenID = 0; 00068 static const DocID InvalidDocID = 0; 00069 00070 } 00071 00072 00073 #endif // PH_TYPES