]> git.lyx.org Git - features.git/blob - src/3rdparty/hunspell/1.3.3/src/hunspell/affentry.hxx
add stripped down hunspell 1.3.3
[features.git] / src / 3rdparty / hunspell / 1.3.3 / src / hunspell / affentry.hxx
1 #ifndef _AFFIX_HXX_
2 #define _AFFIX_HXX_
3
4 #include "hunvisapi.h"
5
6 #include "atypes.hxx"
7 #include "baseaffix.hxx"
8 #include "affixmgr.hxx"
9
10 /* A Prefix Entry  */
11
12 class LIBHUNSPELL_DLL_EXPORTED PfxEntry : protected AffEntry
13 {
14 private:
15        PfxEntry(const PfxEntry&);
16        PfxEntry& operator = (const PfxEntry&);
17 private:
18        AffixMgr*    pmyMgr;
19
20        PfxEntry * next;
21        PfxEntry * nexteq;
22        PfxEntry * nextne;
23        PfxEntry * flgnxt;
24
25 public:
26
27   PfxEntry(AffixMgr* pmgr, affentry* dp );
28   ~PfxEntry();
29
30   inline bool          allowCross() { return ((opts & aeXPRODUCT) != 0); }
31   struct hentry *      checkword(const char * word, int len, char in_compound, 
32                             const FLAG needflag = FLAG_NULL);
33
34   struct hentry *      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
35
36   char *      check_morph(const char * word, int len, char in_compound,
37                             const FLAG needflag = FLAG_NULL);
38
39   char *      check_twosfx_morph(const char * word, int len,
40                   char in_compound, const FLAG needflag = FLAG_NULL);
41
42   inline FLAG getFlag()   { return aflag;   }
43   inline const char *  getKey()    { return appnd;  } 
44   char *               add(const char * word, int len);
45
46   inline short getKeyLen() { return appndl; } 
47
48   inline const char *  getMorph()    { return morphcode;  } 
49
50   inline const unsigned short * getCont()    { return contclass;  } 
51   inline short           getContLen()    { return contclasslen;  } 
52
53   inline PfxEntry *    getNext()   { return next;   }
54   inline PfxEntry *    getNextNE() { return nextne; }
55   inline PfxEntry *    getNextEQ() { return nexteq; }
56   inline PfxEntry *    getFlgNxt() { return flgnxt; }
57
58   inline void   setNext(PfxEntry * ptr)   { next = ptr;   }
59   inline void   setNextNE(PfxEntry * ptr) { nextne = ptr; }
60   inline void   setNextEQ(PfxEntry * ptr) { nexteq = ptr; }
61   inline void   setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; }
62   
63   inline char * nextchar(char * p);
64   inline int    test_condition(const char * st);
65 };
66
67
68
69
70 /* A Suffix Entry */
71
72 class LIBHUNSPELL_DLL_EXPORTED SfxEntry : protected AffEntry
73 {
74 private:
75        SfxEntry(const SfxEntry&);
76        SfxEntry& operator = (const SfxEntry&);
77 private:
78        AffixMgr*    pmyMgr;
79        char *       rappnd;
80
81        SfxEntry *   next;
82        SfxEntry *   nexteq;
83        SfxEntry *   nextne;
84        SfxEntry *   flgnxt;
85            
86        SfxEntry *   l_morph;
87        SfxEntry *   r_morph;
88        SfxEntry *   eq_morph;
89
90 public:
91
92   SfxEntry(AffixMgr* pmgr, affentry* dp );
93   ~SfxEntry();
94
95   inline bool          allowCross() { return ((opts & aeXPRODUCT) != 0); }
96   struct hentry *   checkword(const char * word, int len, int optflags, 
97                     PfxEntry* ppfx, char ** wlst, int maxSug, int * ns,
98 //                    const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT);
99                     const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0);
100
101   struct hentry *   check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
102
103   char *      check_twosfx_morph(const char * word, int len, int optflags,
104                  PfxEntry* ppfx, const FLAG needflag = FLAG_NULL);
105   struct hentry * get_next_homonym(struct hentry * he);
106   struct hentry * get_next_homonym(struct hentry * word, int optflags, PfxEntry* ppfx, 
107     const FLAG cclass, const FLAG needflag);
108
109
110   inline FLAG getFlag()   { return aflag;   }
111   inline const char *  getKey()    { return rappnd; } 
112   char *               add(const char * word, int len);
113
114
115   inline const char *  getMorph()    { return morphcode;  } 
116
117   inline const unsigned short * getCont()    { return contclass;  } 
118   inline short           getContLen()    { return contclasslen;  } 
119   inline const char *  getAffix()    { return appnd; } 
120
121   inline short getKeyLen() { return appndl; } 
122
123   inline SfxEntry *    getNext()   { return next;   }
124   inline SfxEntry *    getNextNE() { return nextne; }
125   inline SfxEntry *    getNextEQ() { return nexteq; }
126
127   inline SfxEntry *    getLM() { return l_morph; }
128   inline SfxEntry *    getRM() { return r_morph; }
129   inline SfxEntry *    getEQM() { return eq_morph; }
130   inline SfxEntry *    getFlgNxt() { return flgnxt; }
131
132   inline void   setNext(SfxEntry * ptr)   { next = ptr;   }
133   inline void   setNextNE(SfxEntry * ptr) { nextne = ptr; }
134   inline void   setNextEQ(SfxEntry * ptr) { nexteq = ptr; }
135   inline void   setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; }
136
137   inline char * nextchar(char * p);
138   inline int    test_condition(const char * st, const char * begin);
139
140 };
141
142 #endif
143
144