00001
00002
00003
00004
00005
00006 #ifndef MF_NGRAMPOOL_H
00007 #define MF_NGRAMPOOL_H
00008
00009 #define NGPOOL_MAXNGRAM 4 // 4-grams
00010 #define NGPOOL_HEADERSIZE 1 // 1 byte
00011
00012 #define NGPOOL_MAXSIZE NGPOOL_MAXNGRAM * CODESIZE+NGPOOL_HEADERSIZE
00013
00014
00016
00019 class ngrampool{
00020
00021 storage* mem;
00022 dictionary* dict;
00023 htable* ht;
00024
00025 public:
00026
00027 ngrampool(dictionary* d);
00028
00029 char* put(ngram);
00030
00031 int get(char* address,ngram &ng);
00032
00033 void stat(){
00034 mem->stat();
00035 }
00036
00037 ~ngrampool(){
00038 delete mem;
00039 delete dict;
00040 delete ht;
00041 }
00042 };
00043
00044 #endif