Merge branch 'win7-taskbar'
[TortoiseGit.git] / ext / hunspell / affentry.hxx
blobbb217739867b615a4ce8e819a44b1c4e55d9a594
1 #ifndef _AFFIX_HXX_
2 #define _AFFIX_HXX_
4 #include "atypes.hxx"
5 #include "baseaffix.hxx"
6 #include "affixmgr.hxx"
8 /* A Prefix Entry */
10 class PfxEntry : public AffEntry
12 AffixMgr* pmyMgr;
14 PfxEntry * next;
15 PfxEntry * nexteq;
16 PfxEntry * nextne;
17 PfxEntry * flgnxt;
19 public:
21 PfxEntry(AffixMgr* pmgr, affentry* dp );
22 ~PfxEntry();
24 inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); }
25 struct hentry * checkword(const char * word, int len, char in_compound,
26 const FLAG needflag = FLAG_NULL);
28 struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
30 char * check_morph(const char * word, int len, char in_compound,
31 const FLAG needflag = FLAG_NULL);
33 char * check_twosfx_morph(const char * word, int len,
34 char in_compound, const FLAG needflag = FLAG_NULL);
36 inline FLAG getFlag() { return aflag; }
37 inline const char * getKey() { return appnd; }
38 char * add(const char * word, int len);
40 inline short getKeyLen() { return appndl; }
42 inline const char * getMorph() { return morphcode; }
44 inline const unsigned short * getCont() { return contclass; }
45 inline short getContLen() { return contclasslen; }
47 inline PfxEntry * getNext() { return next; }
48 inline PfxEntry * getNextNE() { return nextne; }
49 inline PfxEntry * getNextEQ() { return nexteq; }
50 inline PfxEntry * getFlgNxt() { return flgnxt; }
52 inline void setNext(PfxEntry * ptr) { next = ptr; }
53 inline void setNextNE(PfxEntry * ptr) { nextne = ptr; }
54 inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; }
55 inline void setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; }
57 inline int test_condition(const char * st);
63 /* A Suffix Entry */
65 class SfxEntry : public AffEntry
67 AffixMgr* pmyMgr;
68 char * rappnd;
70 SfxEntry * next;
71 SfxEntry * nexteq;
72 SfxEntry * nextne;
73 SfxEntry * flgnxt;
75 SfxEntry * l_morph;
76 SfxEntry * r_morph;
77 SfxEntry * eq_morph;
79 public:
81 SfxEntry(AffixMgr* pmgr, affentry* dp );
82 ~SfxEntry();
84 inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); }
85 struct hentry * checkword(const char * word, int len, int optflags,
86 AffEntry* ppfx, char ** wlst, int maxSug, int * ns,
87 // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT);
88 const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0);
90 struct hentry * check_twosfx(const char * word, int len, int optflags, AffEntry* ppfx, const FLAG needflag = NULL);
92 char * check_twosfx_morph(const char * word, int len, int optflags,
93 AffEntry* ppfx, const FLAG needflag = FLAG_NULL);
94 struct hentry * get_next_homonym(struct hentry * he);
95 struct hentry * get_next_homonym(struct hentry * word, int optflags, AffEntry* ppfx,
96 const FLAG cclass, const FLAG needflag);
99 inline FLAG getFlag() { return aflag; }
100 inline const char * getKey() { return rappnd; }
101 char * add(const char * word, int len);
104 inline const char * getMorph() { return morphcode; }
106 inline const unsigned short * getCont() { return contclass; }
107 inline short getContLen() { return contclasslen; }
108 inline const char * getAffix() { return appnd; }
110 inline short getKeyLen() { return appndl; }
112 inline SfxEntry * getNext() { return next; }
113 inline SfxEntry * getNextNE() { return nextne; }
114 inline SfxEntry * getNextEQ() { return nexteq; }
116 inline SfxEntry * getLM() { return l_morph; }
117 inline SfxEntry * getRM() { return r_morph; }
118 inline SfxEntry * getEQM() { return eq_morph; }
119 inline SfxEntry * getFlgNxt() { return flgnxt; }
121 inline void setNext(SfxEntry * ptr) { next = ptr; }
122 inline void setNextNE(SfxEntry * ptr) { nextne = ptr; }
123 inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; }
124 inline void setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; }
126 inline int test_condition(const char * st, const char * begin);
129 #endif