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

mootTypes.h

Go to the documentation of this file.
00001 /*-*- Mode: C++ -*-*/
00002 
00003 /*
00004    libmoot : moocow's part-of-speech tagging library
00005    Copyright (C) 2003-2004 by Bryan Jurish <moocow@ling.uni-potsdam.de>
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (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., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 */
00021 
00022 /*----------------------------------------------------------------------
00023  * Name: mootTypes.h
00024  * Author: Bryan Jurish <moocow@ling.uni-potsdam.de>
00025  * Description:
00026  *   + shared typedefs for libmoot
00027  *----------------------------------------------------------------------*/
00032 #ifndef _moot_TYPES_H
00033 #define _moot_TYPES_H
00034 
00035 #include <string>
00036 #include <deque>
00037 #include <map>
00038 #include <set>
00039 
00040 #include "mootToken.h"
00041 
00042 #if defined(__GNUC__)
00043 #  if __GNUC__ >= 3
00044 #    if __GNUC_MINOR__ == 0
00045 #      define moot_STL_NAMESPACE std
00046 #    else
00047 #      define moot_STL_NAMESPACE __gnu_cxx
00048 #    endif /* __GNUC_MINOR__ == 0 */
00049 #    include <ext/hash_map>
00050 #    include <ext/hash_set>
00051 #  else  /* __GNUC__ >= 3 */
00052 #    define moot_STL_NAMESPACE std
00053 #    include <hash_map>
00054 #    include <hash_set>
00055 #  endif /* __GNUC__ >= 3 */
00056 
00057 /*-- hack for string hashing --*/
00058 namespace moot_STL_NAMESPACE {
00059       template<> struct hash<std::string> {
00060         std::size_t operator()(const std::string &__s) const {
00061           return __stl_hash_string(__s.c_str());
00062         }
00063       };
00064 };
00065 
00066 #else  /* defined(__GNUC__) */
00067 #  include <hash_map>
00068 #  include <hash_set>
00069 #  define moot_STL_NAMESPACE std
00070 #endif /* defiend(__GNUC__) */
00071 
00073 #ifndef MAXFLOAT
00074 #include <values.h>
00075 #endif
00076 
00077 /* Namespace definitions: not yet ready */
00078 #define moot_NAMESPACE moot
00079 #define moot_BEGIN_NAMESPACE namespace moot {
00080 #define moot_END_NAMESPACE };
00081 //#define moot_NAMESPACE
00082 //#define moot_BEGIN_NAMESPACE
00083 //#define moot_END_NAMESPACE
00084 
00085 moot_BEGIN_NAMESPACE
00086 
00087 using namespace std;
00088 using namespace moot_STL_NAMESPACE;
00089 
00090 /*----------------------------------------------------------------------
00091  * Basic Types
00092  *----------------------------------------------------------------------*/
00093 
00094 //#define MOOT_USE_DOUBLE
00095 
00096 #ifdef MOOT_USE_DOUBLE
00097 
00098 typedef double ProbT;
00099 #else
00100 
00101 typedef float ProbT;
00102 #endif //-- MOOT_USE_DOUBLE
00103 
00105 typedef ProbT CountT;
00106 
00107 
00108 moot_END_NAMESPACE
00109 
00110 #endif /* _moot_TYPES_H */

Generated on Wed Jul 28 15:48:03 2004 for libmoot by doxygen1.2.15