Main Page | Modules | Namespace List | Compound List | File List | Compound Members | File Members | Related Pages

Flexform.h

Go to the documentation of this file.
00001 #ifndef FLEXFORM_H
00002 #define FLEXFORM_H
00003 #pragma warning(disable:4786)
00004 #include <string>
00005 #include <map>
00006 #include <vector>
00007 #include <stack>
00008 #include "UMString.h"
00009 
00010 enum vflexform { MZ, OB, RY, SS, RT, SR, MR, KT, EF,  OOR};   
00011 const string vflexformstr[] = { "MZ", "OB", "RY", "SS", "RT", "SR", "MR", "KT", "EF", "OOR"}; 
00012 //enum vflexArt{ qu, kop, sf, uf, v1, v5k, v5g, v5s, v5t, v5n, v5h, v5b, v5m, v5r, stamm, all};
00013 //={ "qu", "kop", "sf", "uf", "v1", "v5k", "v5g", "v5s", "v5t", "v5n", "v5h", "v5b", "v5m", "v5r", "stamm", "all"};
00014 
00015 const int VFLEX=10;       
00016 const int MAXFLEX=12;    
00017 const int MAXFLEXART=15;      
00019 using namespace std;
00020  
00021 class JVerbalFlexion{
00022         
00023         int m_level;  
00024         string m_name;          
00026         vflexform m_reqform;  
00028         string m_flexart; 
00029         vector<string> m_reqflexart; 
00030         typedef vector<string> ::const_iterator VIT;  /*<! iterator for m_reqflexart member variable */
00031         
00032         map<vflexform, string> m_vflexform; 
00033         typedef map<vflexform, string> ::const_iterator IT; 
00035 public:
00036         JVerbalFlexion();
00037         JVerbalFlexion(const string*, const int);
00038         JVerbalFlexion(const string* vform, const int stufe, vflexform vflex, string& name, string& flxart, string& rqflxart);
00039         ~JVerbalFlexion();
00040         
00041                 //set variables
00043         void SetName(string& nm){ m_name=nm;}; 
00044 
00046         void SetReqForm(vflexform af){ m_reqform=af;}; 
00047 
00049         void AddReqFlex(string& af){ m_reqflexart.push_back(af);};
00050 
00052         void SetFlex(string& f){ m_flexart=f;}; 
00053                 
00054                 //return variables
00055 
00058         void GetName(string& name){ name=m_name;};   
00059 
00062         string GetName(){return m_name;};   
00063 
00066         int GetStufe(){return m_level;}   
00067 
00070         void GetStufe(int& stufe){ stufe=m_level;};  
00071 
00074         void GetReqForm(vflexform& reqform){ reqform=m_reqform;};
00075 
00078         vflexform GetReqForm(){ return m_reqform;}; 
00079 
00082         string& GetFlexArt(){return m_flexart;};  
00083 
00086         vector<string> GetReqFlexArt(){return m_reqflexart;};   
00087 
00088         //Output, just for debugging purpose
00089         void Print();
00090         void PrintName();
00091 
00092         vflexform GetFormOfString(string& str);
00093         string GetStringOfForm(vflexform);
00094         bool IsStringOfForm(string& str, vflexform vf);
00095         
00096 };
00097 
00098 //................................................................//
00099 
00100 //______                 FlexLevel                        _______//
00101 
00102 //................................................................//
00103 
00104 class FlexLevel{
00105 
00106         vector<JVerbalFlexion> m_verbflex;   
00107         typedef vector<JVerbalFlexion> ::iterator IT;  
00109         int m_MaxLength; 
00110         int m_MinLength; 
00111         int m_number_of_entries; 
00113         stack<JVerbalFlexion*> m_hypo_stack; 
00115 public:
00116         FlexLevel(int anz);  
00117         FlexLevel(string**, int anz);
00118         ~FlexLevel();
00119 
00120         
00124         int getMaxLength(){return m_MaxLength;};
00128         int getMinLength(){return m_MinLength;};
00129         
00130         bool insertFlex(string*, string, int pos);
00131         bool insertFlex(JVerbalFlexion*);
00132         
00133         vflexform findString(string&, int& level);
00134         
00135         
00136         JVerbalFlexion* findString(string& suchstring, JVerbalFlexion* last_jvf);
00137         int findString(string& suchstring, JVerbalFlexion* last_jvf, int flex_offs);
00138         void Print();
00139         
00140         JVerbalFlexion* popHypo();
00141 
00142         friend class DetLemma;
00143 };
00144 
00145 
00146 
00147 #endif;

Generated on Mon Aug 18 19:27:09 2003 for LeJa by doxygen 1.3.3