Reordered files
[svmtool++.git] / include / dict.h
blob8d0c789315259cab111416f2beb8b37ee63afbfa
1 /*
2 * Copyright (C) 2004 Jesus Gimenez, Lluis Marquez and Senen Moya
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <stdint.h>
21 #ifndef SVMT_DICT_H
23 #define TAMTXT 100
25 struct dataDict
27 char wrd[TAMTXT];
28 int numWrd;
29 int numMaybe;
30 simpleList maybe;
33 struct infoDict
35 char txt[TAMTXT];
36 int num;
39 class dictionary
41 private:
42 hash_t d;
43 //FILE *in;
45 // FILE *openFile(char *name, char mode[]);
46 void dictLoad(FILE *in);
47 void dictCreate(FILE *f,int offset, int limit);
48 void dictIncInfo(dataDict *elem, char *pos);
50 int readInt(FILE *in);
51 infoDict *readData(FILE *in);
53 public:
54 void dictAddBackup(char *name);
55 int getElement(char *key);
56 char *getElementWord(uintptr_t ptr);
57 int getElementNumWord(uintptr_t ptr);
58 int getElementNumMaybe(uintptr_t ptr);
59 simpleList *getElementMaybe(uintptr_t ptr);
60 char *getMFT(int w);
61 char *getAmbiguityClass(int w);
63 hash_t *dictFindAmbP(int *numPOS);
64 hash_t *dictFindUnkP(int *numPOS);
65 void dictRepairFromFile(char *fileName);
66 void dictRepairHeuristic(float dratio);
68 void dictCleanListInfoDict(simpleList * l, int num);
70 dictionary(char *name, char *backup);
71 dictionary(char *name);
72 dictionary(char *name,int limInf, int limSup);
73 ~dictionary();
75 void dictWrite(char *outName);
78 #define SVMT_DICT_H
79 #endif