FreeLing  3.0
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 3 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 "freeling/morfo/language.h"
00035 #include "freeling/morfo/automat.h"
00036 #include "freeling/morfo/locutions.h"
00037 
00043 
00044 class quantities_module: public automat {
00045 
00046  private:
00047   virtual void ResetActions();
00048   virtual void SetMultiwordAnalysis(sentence::iterator, int);
00049 
00050  protected:
00051   virtual void readConfig(const std::wstring &);
00053   std::map<std::wstring,int> tok;
00055   std::map<std::wstring,long double> fract;
00057   std::map<std::wstring,std::wstring> units;
00059   locutions measures;
00060 
00062   std::wstring value1, value2;
00064   std::wstring currency_key;
00065   std::wstring unitType;
00067   std::wstring unitCode;
00068 
00069  public:
00071   quantities_module();
00072 };
00073 
00074 
00079 
00080 class quantities_default: public quantities_module {
00081 
00082  private:
00083   int ComputeToken(int,sentence::iterator&,sentence &);
00084   void StateActions(int, int, int, sentence::const_iterator);
00085 
00086  public:
00088   quantities_default(const std::wstring &);
00089 };
00090 
00091 
00096 
00097 class quantities_es: public quantities_module {
00098 
00099  private:
00100   int ComputeToken(int,sentence::iterator&, sentence &);
00101   void StateActions(int, int, int, sentence::const_iterator);
00102 
00103  public:
00105   quantities_es(const std::wstring &); 
00106 };
00107 
00112 
00113 class quantities_ca: public quantities_module {
00114 
00115  private:
00116   int ComputeToken(int,sentence::iterator&, sentence &);
00117   void StateActions(int, int, int, sentence::const_iterator);
00118 
00119  public:
00121   quantities_ca(const std::wstring &); 
00122 };
00123 
00124 
00129 
00130 class quantities_gl: public quantities_module {
00131 
00132  private:
00133   int ComputeToken(int,sentence::iterator&, sentence &);
00134   void StateActions(int, int, int, sentence::const_iterator);
00135 
00136  public:
00138   quantities_gl(const std::wstring &); 
00139 };
00140 
00145 
00146 class quantities_pt: public quantities_module {
00147 
00148  private:
00149   int ComputeToken(int,sentence::iterator&, sentence &);
00150   void StateActions(int, int, int, sentence::const_iterator);
00151 
00152  public:
00154   quantities_pt(const std::wstring &); 
00155 };
00156 
00161 
00162 class quantities_en: public quantities_module {
00163 
00164  private:
00165   int ComputeToken(int,sentence::iterator&, sentence &);
00166   void StateActions(int, int, int, sentence::const_iterator);
00167 
00168  public:
00170   quantities_en(const std::wstring &); 
00171 };
00172 
00177 
00178 class quantities_ru: public quantities_module {
00179 
00180  private:
00181   int ComputeToken(int,sentence::iterator&, sentence &);
00182   void StateActions(int, int, int, sentence::const_iterator);
00183 
00184  public:
00186   quantities_ru(const std::wstring &); 
00187 };
00188 
00189 
00190 #endif
00191