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 allowCross()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 = 0); 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 getFlag()42 inline FLAG getFlag() { return aflag; } getKey()43 inline const char * getKey() { return appnd; } 44 char * add(const char * word, int len); 45 getKeyLen()46 inline short getKeyLen() { return appndl; } 47 getMorph()48 inline const char * getMorph() { return morphcode; } 49 getCont()50 inline const unsigned short * getCont() { return contclass; } getContLen()51 inline short getContLen() { return contclasslen; } 52 getNext()53 inline PfxEntry * getNext() { return next; } getNextNE()54 inline PfxEntry * getNextNE() { return nextne; } getNextEQ()55 inline PfxEntry * getNextEQ() { return nexteq; } getFlgNxt()56 inline PfxEntry * getFlgNxt() { return flgnxt; } 57 setNext(PfxEntry * ptr)58 inline void setNext(PfxEntry * ptr) { next = ptr; } setNextNE(PfxEntry * ptr)59 inline void setNextNE(PfxEntry * ptr) { nextne = ptr; } setNextEQ(PfxEntry * ptr)60 inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; } setFlgNxt(PfxEntry * 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 allowCross()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 = 0); 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 getFlag()110 inline FLAG getFlag() { return aflag; } getKey()111 inline const char * getKey() { return rappnd; } 112 char * add(const char * word, int len); 113 114 getMorph()115 inline const char * getMorph() { return morphcode; } 116 getCont()117 inline const unsigned short * getCont() { return contclass; } getContLen()118 inline short getContLen() { return contclasslen; } getAffix()119 inline const char * getAffix() { return appnd; } 120 getKeyLen()121 inline short getKeyLen() { return appndl; } 122 getNext()123 inline SfxEntry * getNext() { return next; } getNextNE()124 inline SfxEntry * getNextNE() { return nextne; } getNextEQ()125 inline SfxEntry * getNextEQ() { return nexteq; } 126 getLM()127 inline SfxEntry * getLM() { return l_morph; } getRM()128 inline SfxEntry * getRM() { return r_morph; } getEQM()129 inline SfxEntry * getEQM() { return eq_morph; } getFlgNxt()130 inline SfxEntry * getFlgNxt() { return flgnxt; } 131 setNext(SfxEntry * ptr)132 inline void setNext(SfxEntry * ptr) { next = ptr; } setNextNE(SfxEntry * ptr)133 inline void setNextNE(SfxEntry * ptr) { nextne = ptr; } setNextEQ(SfxEntry * ptr)134 inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; } setFlgNxt(SfxEntry * 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 145