#ifndef WSENGINEER
#define WSENGINEER
#include <windows.h>
typedef wchar_t WCHAR;
typedef WCHAR* PWCHAR;

//InitializeEngineer
extern "C" __declspec(dllimport)
bool InitializeEngineer(const char* pszKnowledgebasePath);

//Segment the GB2312/BIG5 text
extern "C" __declspec(dllimport)
PCHAR SegmentAText(const PCHAR pszAText);

//Segment the Unicode text
extern "C" __declspec(dllimport)
PWCHAR ProcessUnicodeText(const PWCHAR pszWText);

typedef bool(*LPInitializeEngineer)(const char*);
typedef PCHAR (*LPSegmentAText)(const PCHAR );
typedef PWCHAR (*LPSegmentWText)(const PWCHAR);

class CWSEngineer  
{
public:
	CWSEngineer();
	virtual ~CWSEngineer();

	//Initialize the Engineer
	bool InitializeEngineer(const char* pszKnowledgebasePath);

	//Segment the GB2312 or BIG5 text
	PCHAR SegmentAText(const PCHAR pszAText);

	//Segment the Unicode text
	PWCHAR SegmentWText(const PWCHAR pszWText);
protected:
	static LPInitializeEngineer m_pInitializeEngineer;
	static LPSegmentAText	m_pSegmentAText;
	static LPSegmentWText	m_pSegmentWText;
	static HINSTANCE          m_hInstWSEngineer;
	static bool               m_bLoadWSDLL;
	CRITICAL_SECTION          m_CriticalSection;
	bool LoadDLL();
	void UnloadDLL();
};

#endif