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