quantities_modules.h

Go to the documentation of this file.
00001 
00002 //
00003 //    FreeLing - Open Source Language Analyzers
00004 //
00005 //    Copyright (C) 2004   TALP Research Center
00006 //                         Universitat Politecnica de Catalunya
00007 //
00008 //    This library is free software; you can redistribute it and/or
00009 //    modify it under the terms of the GNU General Public
00010 //    License as published by the Free Software Foundation; either
00011 //    version 2.1 of the License, or (at your option) any later version.
00012 //
00013 //    This library is distributed in the hope that it will be useful,
00014 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //    General Public License for more details.
00017 //
00018 //    You should have received a copy of the GNU General Public
00019 //    License along with this library; if not, write to the Free Software
00020 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00021 //
00022 //    contact: Lluis Padro (padro@lsi.upc.es)
00023 //             TALP Research Center
00024 //             despatx C6.212 - Campus Nord UPC
00025 //             08034 Barcelona.  SPAIN
00026 //
00028 
00029 #ifndef _QUANTITIES_MOD
00030 #define _QUANTITIES_MOD
00031 
00032 #include <map>
00033 
00034 #include "fries/language.h"
00035 #include "freeling/automat.h"
00036 #include "freeling/locutions.h"
00037 
00043 
00044 class quantities_module: public automat {
00045 
00046    protected:
00048       std::map<std::string,int> tok;
00050       std::map<std::string,long double> fract;
00052       std::map<std::string,std::string> units;
00054       locutions measures;
00055 
00057       long double value1, value2;
00059       std::string currency_key;
00060       std::string unitType;
00062       std::string unitCode;
00063 
00064    public:
00066       quantities_module();
00067 };
00068 
00069 
00074 
00075 class quantities_default: public quantities_module {
00076 
00077    private:
00078       int ComputeToken(int,sentence::iterator&,sentence &);
00079       void ResetActions();
00080       void StateActions(int, int, int, sentence::const_iterator);
00081       void SetMultiwordAnalysis(sentence::iterator, int);
00082 
00083    public:
00085       quantities_default(const std::string &);
00086 };
00087 
00088 
00093 
00094 class quantities_es: public quantities_module {
00095 
00096    private:
00097       int ComputeToken(int,sentence::iterator&, sentence &);
00098       void ResetActions();
00099       void StateActions(int, int, int, sentence::const_iterator);
00100       void SetMultiwordAnalysis(sentence::iterator, int);
00101 
00102    public:
00104       quantities_es(const std::string &); 
00105 };
00106 
00111 
00112 class quantities_ca: public quantities_module {
00113 
00114    private:
00115       int ComputeToken(int,sentence::iterator&, sentence &);
00116       void ResetActions();
00117       void StateActions(int, int, int, sentence::const_iterator);
00118       void SetMultiwordAnalysis(sentence::iterator, int);
00119 
00120    public:
00122       quantities_ca(const std::string &); 
00123 };
00124 
00125 
00130 
00131 class quantities_gl: public quantities_module {
00132 
00133    private:
00134       int ComputeToken(int,sentence::iterator&, sentence &);
00135       void ResetActions();
00136       void StateActions(int, int, int, sentence::const_iterator);
00137       void SetMultiwordAnalysis(sentence::iterator, int);
00138 
00139    public:
00141       quantities_gl(const std::string &); 
00142 };
00143 
00148 
00149 class quantities_en: public quantities_module {
00150 
00151    private:
00152       int ComputeToken(int,sentence::iterator&, sentence &);
00153       void ResetActions();
00154       void StateActions(int, int, int, sentence::const_iterator);
00155       void SetMultiwordAnalysis(sentence::iterator, int);
00156 
00157    public:
00159       quantities_en(const std::string &); 
00160 };
00161 
00162 
00163 #endif
00164 
Generated on Tue Jul 27 16:29:25 2010 for FreeLing by  doxygen 1.6.3