Add another
[apertium.git] / apertium-tagger-training-tools / src / SmoothUtils.H
blob8393afb92b7c6e1518c017900753e7a0cb0c7b71
1 /*
2  * Copyright (C) 2004-2006 Felipe Sánchez-Martínez
3  * Copyright (C) 2006 Universitat d'Alacant
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18  * 02111-1307, USA.
19  */
20 /**
21  * Utility functions. (header file)
22  *
23  *  @author   Felipe Sánchez-Martínez - fsanchez@dlsi.ua.es
24  */
26 #ifndef __SMOOTHUTILS_H
27 #define __SMOOTHUTILS_H
29 #include <map>
30 #include <apertium/TaggerData.H>
32 using namespace std;
34 class SmoothUtils {
35 private:
36   double static lambda(double count);
37   map<int, double> static prob_amb_class_from_tag(TaggerData& tagger_data, 
38                                                   int i, 
39                                                   map<int, double> &prob_ambclass);
41 public:
42   void static calculate_smoothed_parameters(TaggerData& tagger_data,
43                                             map<int, double> &tags_count, 
44                                             map<int, map<int, double> > &tags_pairs, 
45                                             map<int, double> &ambclass_count, 
46                                             map<int, map<int, double> > &emis, 
47                                             map<int, double> &tags_count_for_emis,
48                                             double corpus_length);
52 #endif