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