dic_internals.h

Go to the documentation of this file.
00001 /* Eliot                                                                     */
00002 /* Copyright (C) 1999  Antoine Fraboulet                                     */
00003 /*                                                                           */
00004 /* This file is part of Eliot.                                               */
00005 /*                                                                           */
00006 /* Eliot is free software; you can redistribute it and/or modify             */
00007 /* it under the terms of the GNU General Public License as published by      */
00008 /* the Free Software Foundation; either version 2 of the License, or         */
00009 /* (at your option) any later version.                                       */
00010 /*                                                                           */
00011 /* Eliot is distributed in the hope that it will be useful,                  */
00012 /* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
00013 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
00014 /* GNU General Public License for more details.                              */
00015 /*                                                                           */
00016 /* You should have received a copy of the GNU General Public License         */
00017 /* along with this program; if not, write to the Free Software               */
00018 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00019 
00020 /**
00021  *  \file   dic_internals.h
00022  *  \brief  Internal dictionary structures
00023  *  \author Antoine Fraboulet
00024  *  \date   2002
00025  */
00026 
00027 #ifndef _DIC_INTERNALS_H_
00028 #define _DIC_INTERNALS_H_
00029 #if defined(__cplusplus)
00030 extern "C"
00031   {
00032 #endif
00033 
00034 /**
00035  * bit masking for ascii characters \n
00036  * ('a' & CHAR) == ('A' & CHAR) == 1
00037  */
00038 #define DIC_CHAR_MASK    0x1F
00039 
00040 /**
00041  * keyword included in dictionary headers
00042  * implies little endian storage on words
00043  */
00044 #define _COMPIL_KEYWORD_ "_COMPILED_DICTIONARY_"
00045 
00046 /**
00047  *  structure of a compressed dictionary \n
00048  *  \n
00049  *  ----------------    \n
00050  *  header              \n
00051  *  ----------------    \n
00052  *  specialnode (0)     \n
00053  *  +                   \n
00054  *  + nodes             \n
00055  *  +                   \n
00056  *  firstnode (= root)  \n
00057  *  ----------------
00058  */
00059 
00060 typedef struct _Dawg_edge {
00061    unsigned int ptr  : 24;
00062    unsigned int term : 1;
00063    unsigned int last : 1;
00064    unsigned int fill : 1;
00065    unsigned int chr  : 5;
00066 } Dawg_edge;
00067 
00068 typedef struct _Dict_header {
00069   char ident[sizeof(_COMPIL_KEYWORD_)];
00070   char unused_1;
00071   char unused_2;
00072   int root;
00073   int nwords;
00074   unsigned int edgesused;
00075   unsigned int nodesused;
00076   unsigned int nodessaved;
00077   unsigned int edgessaved;
00078 } Dict_header;
00079 
00080 struct _Dictionary
00081 {
00082   Dawg_edge *dawg;
00083   unsigned int root;
00084   int nwords;
00085   int nnodes;
00086   int nedges;
00087 };
00088 
00089 #if defined(__cplusplus)
00090   }
00091 #endif
00092 #endif /* _DIC_INTERNALS_H */
00093 

Generated on Thu Dec 29 02:01:14 2005 for Eliot by  doxygen 1.4.5