Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

  1. //------------------------------------------------------------------------------------------
  2. // ListWordBreak.hpp
  3. //
  4. // Data structures for List Of Points
  5. //
  6. //------------------------------------------------------------------------------------------
  7. #ifndef LISTWORDBREAK_HPP
  8. #define LISTWORDBREAK_HPP
  9. #include "list.hpp"
  10. #include "CThaiBreakTree.hpp"
  11. #include "CTrie.hpp"
  12. //------------------------------------------------------------------------------------------
  13. // The following class defines a WordBeakElement -- which is used to store WordBreak element.
  14. //------------------------------------------------------------------------------------------
  15. class WordBreakElement
  16. {
  17. public:
  18. WordBreakElement(CTrie* pTrie, CTrie* pTrieTrigram);
  19. ~WordBreakElement();
  20. CThaiBreakTree* breakTree;
  21. bool fFree;
  22. };
  23. //------------------------------------------------------------------------------------------
  24. // The following class defines a ListWordBreak -- singly link list of WordBreak.
  25. //
  26. // ListPoint is subclass of List it encapsulate the internal memory management of the list.
  27. //------------------------------------------------------------------------------------------
  28. class ListWordBreak : public List
  29. {
  30. public:
  31. ListWordBreak();
  32. bool Init(CTrie* pTrie,CTrie* pTrieTrigram);
  33. bool CreateWordBreak();
  34. bool GetNode(CThaiBreakTree*, bool*);
  35. void Flush();
  36. WordBreakElement* GetFreeWB(bool fCreateNode = true);
  37. void MarkWordBreak(WordBreakElement* pWordBreakElement, bool fFree);
  38. protected:
  39. void Prepend(void *item) {List::Prepend(item);}
  40. void Append(void *item) {List::Append(item);}
  41. void* Remove();
  42. CTrie* m_pTrie;
  43. CTrie* m_pTrieTrigram;
  44. #if defined (_DEBUG)
  45. bool fInit;
  46. #endif
  47. };
  48. #endif