Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

mootFSMPotsdam.h

Go to the documentation of this file.
00001 /*-*- Mode: C++ -*-*/
00002 
00003 /*
00004    libmootm : moocow's morphology library:
00005    Copyright (C) 2003-2005 by Bryan Jurish <moocow@ling.uni-potsdam.de>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Lesser General Public
00009    License as published by the Free Software Foundation; either
00010    version 2.1 of the License, or (at your option) any later version.
00011    
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Lesser General Public License for more details.
00016    
00017    You should have received a copy of the GNU Lesser General Public
00018    License along with this library; if not, write to the Free Software
00019    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00020 */
00021 
00022 /*----------------------------------------------------------------------
00023  * Name: mootFSMPotsdam.h
00024  * Author: Bryan Jurish <moocow@ling.uni-potsdam.de>
00025  * Description:
00026  *   + mootm FSMs: uni-potsdam FSMlib
00027  *----------------------------------------------------------------------*/
00032 #ifndef _moot_FSM_POTSDAM_H
00033 #define _moot_FSM_POTSDAM_H
00034 
00035 #ifdef HAVE_CONFIG_H
00036 # include <mootmUnConfig.h>
00037 # include <mootmConfig.h>
00038 #endif
00039 
00040 #if defined(USE_FSM_POTSDAM)
00041 
00042 #include <mootFSMBase.h>
00043 
00044 #include <FSMTypes.h>
00045 #include <FSM.h>
00046 #include <FSMSymSpec.h>
00047 #include <FSMWeight.h>
00048 
00049 #include <vector>
00050 #include <string>
00051 #include <list>
00052 #include <set>
00053 
00055 #define moot_SYM_ATT_COMPAT true
00056 
00057 namespace mootm {
00058   using namespace std;
00059   using namespace moot;
00060 
00064   class mootFSMPotsdam : public mootFSMBase {
00065   protected:
00066     /*------------------------------------------------------------
00067      * protected types
00068      */
00070     typedef FSMSymbolString TagString;
00071 
00073     typedef FSM::FSMWeightedSymbolVector MorphAnalysis;
00074 
00076     typedef set<MorphAnalysis> MorphAnalysisSet;
00077 
00079     typedef set<FSMSymbolString> TagStringSet;
00080 
00081 
00082   protected:
00083     /*------------------------------------------------------------
00084      * protected data
00085      */
00086     FSMSymSpec *syms;         
00087     FSM        *mfst;         
00089     list<string> syms_msgs;   
00090     FSM          result;      
00093     MorphAnalysisSet analyses;
00094 
00095   public:
00096     /*------------------------------------------------------------
00097      * public methods
00098      */
00100     mootFSMPotsdam(void)
00101       : syms(NULL),
00102         mfst(NULL)
00103     {};
00104 
00106     ~mootFSMPotsdam(void) {
00107       if (mfst) delete mfst;
00108       if (syms) delete syms;
00109     };
00110 
00112     virtual bool load(const string &fstfile, const string &symfile="");
00113 
00115     virtual bool valid(void) const
00116     { return syms && mfst && *mfst; }
00117 
00119     virtual mootToken& analyze_token(mootToken &tok, bool want_avm=true, bool want_warnings=true);
00120 
00121     
00122   protected:
00123     /*------------------------------------------------------------
00124      * protected (non-API) methods
00125      */
00127     void check_symspec_messages(void);
00128 
00129   }; // class mootFSMPotsdam
00130 
00131 
00133   typedef class mootFSMPotsdam mootFSM;
00134 
00135 }; // namespace mootm
00136 
00137 #endif /* defined(USE_FSM_POTSDAM) */
00138 
00139 
00140 #ifdef HAVE_CONFIG_H
00141 # include <mootmUnConfig.h>
00142 #endif
00143 
00144 
00145 #endif /* _moot_FSM_POTSDAM_H */

Generated on Fri Dec 2 18:14:56 2005 for libmootm by  doxygen 1.4.3-20050530