affentry.hxx 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #ifndef _AFFIX_HXX_
  2. #define _AFFIX_HXX_
  3. #include "hunvisapi.h"
  4. #include "atypes.hxx"
  5. #include "baseaffix.hxx"
  6. #include "affixmgr.hxx"
  7. /* A Prefix Entry */
  8. class LIBHUNSPELL_DLL_EXPORTED PfxEntry : protected AffEntry
  9. {
  10. AffixMgr* pmyMgr;
  11. PfxEntry * next;
  12. PfxEntry * nexteq;
  13. PfxEntry * nextne;
  14. PfxEntry * flgnxt;
  15. public:
  16. PfxEntry(AffixMgr* pmgr, affentry* dp );
  17. ~PfxEntry();
  18. inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); }
  19. struct hentry * checkword(const char * word, int len, char in_compound,
  20. const FLAG needflag = FLAG_NULL);
  21. struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
  22. char * check_morph(const char * word, int len, char in_compound,
  23. const FLAG needflag = FLAG_NULL);
  24. char * check_twosfx_morph(const char * word, int len,
  25. char in_compound, const FLAG needflag = FLAG_NULL);
  26. inline FLAG getFlag() { return aflag; }
  27. inline const char * getKey() { return appnd; }
  28. char * add(const char * word, int len);
  29. inline short getKeyLen() { return appndl; }
  30. inline const char * getMorph() { return morphcode; }
  31. inline const unsigned short * getCont() { return contclass; }
  32. inline short getContLen() { return contclasslen; }
  33. inline PfxEntry * getNext() { return next; }
  34. inline PfxEntry * getNextNE() { return nextne; }
  35. inline PfxEntry * getNextEQ() { return nexteq; }
  36. inline PfxEntry * getFlgNxt() { return flgnxt; }
  37. inline void setNext(PfxEntry * ptr) { next = ptr; }
  38. inline void setNextNE(PfxEntry * ptr) { nextne = ptr; }
  39. inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; }
  40. inline void setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; }
  41. inline char * nextchar(char * p);
  42. inline int test_condition(const char * st);
  43. };
  44. /* A Suffix Entry */
  45. class LIBHUNSPELL_DLL_EXPORTED SfxEntry : protected AffEntry
  46. {
  47. AffixMgr* pmyMgr;
  48. char * rappnd;
  49. SfxEntry * next;
  50. SfxEntry * nexteq;
  51. SfxEntry * nextne;
  52. SfxEntry * flgnxt;
  53. SfxEntry * l_morph;
  54. SfxEntry * r_morph;
  55. SfxEntry * eq_morph;
  56. public:
  57. SfxEntry(AffixMgr* pmgr, affentry* dp );
  58. ~SfxEntry();
  59. inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); }
  60. struct hentry * checkword(const char * word, int len, int optflags,
  61. PfxEntry* ppfx, char ** wlst, int maxSug, int * ns,
  62. // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT);
  63. const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0);
  64. struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
  65. char * check_twosfx_morph(const char * word, int len, int optflags,
  66. PfxEntry* ppfx, const FLAG needflag = FLAG_NULL);
  67. struct hentry * get_next_homonym(struct hentry * he);
  68. struct hentry * get_next_homonym(struct hentry * word, int optflags, PfxEntry* ppfx,
  69. const FLAG cclass, const FLAG needflag);
  70. inline FLAG getFlag() { return aflag; }
  71. inline const char * getKey() { return rappnd; }
  72. char * add(const char * word, int len);
  73. inline const char * getMorph() { return morphcode; }
  74. inline const unsigned short * getCont() { return contclass; }
  75. inline short getContLen() { return contclasslen; }
  76. inline const char * getAffix() { return appnd; }
  77. inline short getKeyLen() { return appndl; }
  78. inline SfxEntry * getNext() { return next; }
  79. inline SfxEntry * getNextNE() { return nextne; }
  80. inline SfxEntry * getNextEQ() { return nexteq; }
  81. inline SfxEntry * getLM() { return l_morph; }
  82. inline SfxEntry * getRM() { return r_morph; }
  83. inline SfxEntry * getEQM() { return eq_morph; }
  84. inline SfxEntry * getFlgNxt() { return flgnxt; }
  85. inline void setNext(SfxEntry * ptr) { next = ptr; }
  86. inline void setNextNE(SfxEntry * ptr) { nextne = ptr; }
  87. inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; }
  88. inline void setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; }
  89. inline char * nextchar(char * p);
  90. inline int test_condition(const char * st, const char * begin);
  91. };
  92. #endif