Updated source code from upstream SVN
[svmtool++.git] / include / mapping.h
blobae7f4b93e021fd852f65d462d3b5b9cf14495bda
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.
8 *
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 #ifndef MAPPING_H
21 #include "hash.h"
23 * Cada elemento insertado en el mapping es del tipo mapping_node_t.
24 * Este objeto está compuesto por:
26 * feature char * Atributo almacenado
27 * number char * Número identificativo de el atributo en formato alfanumérico
28 * num Int Número de veces que aparece
30 class mapping_node_t
32 public:
33 char *feature;
34 char *number;
35 int num;
37 ~mapping_node_t()
39 delete feature;
40 delete number;
45 class mapping
47 private:
48 hash_t<mapping_node_t*>* mapByKey;
49 hash_t<mapping_node_t*>* mapByNumber;
50 int mapping_counter;
51 public:
52 void mappingWrite(const char *,int);
53 int mappingAddByKey(const char *key);
54 int mappingAddNumber(const char *key);
55 int mappingGetNumberByFeature(const char *key);
56 char *mappingGetFeatureByNumber(const char *key);
57 int mappingRepair(int maxFeat, int times);
58 int mappingNumElements();
59 void mappingBuilt(FILE *f,int mac_mapping_size, int count_cut_off);
61 mapping();
62 ~mapping();
65 #define MAPPING_H
66 #endif