⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wordsegment.h

📁 这是一个中文分词程序。用户将中文文件(.txt)打开
💻 H
字号:
class CWordSegment
{
private:    
	typedef int (WINAPI* TcwsSegment)(char far* sentence);
	typedef char far* (WINAPI* TcwsGetWord)(int index, char far** buffer, char far** tag);
	typedef void (WINAPI* TcwsSetSegSetting)(unsigned int aSetting); 
	typedef unsigned int (WINAPI* TcwsGetSegSetting)(void);

	HINSTANCE hFcDLL;               // Handle to DLL

public:
	static const unsigned int cwsTag;  // word classify tag
	static const unsigned int cwsUserDict;  // User defining dictionary
	static const unsigned int cwsCPlaceName; // Chinese place name
	static const unsigned int cwsCName;  // chinese name
	static const unsigned int cwsTranslationName; // translation name, include translation
                              // person name and place name etc.
	static const unsigned int cwsIdiom; // chinese Idiom dictionary
	static const unsigned int cwsOrganiseName; // chinese organise name and etc.


public:
	TcwsSegment fcwsSegment;
	TcwsGetWord fcwsGetWord;
	TcwsSetSegSetting fcwsSetSegSetting;
	TcwsGetSegSetting fcwsGetSegSetting;

	bool InitFCDll(char * m_strFileName);
	void FreeFCDll(void);
	//perform the segmentation function. param "sentence" is the text that be segment
	//Return the word count of segmentation.
	int cwsSegment(char far* sentence); 
	//Get word from the segmention result. Index number of word, it is base 0
	// buffer is the word buffer that been define from caller
	// tag is the word tagging buffer that been define from caller
	char far* cwsGetWord(int index, char far* buffer, char far* tag);
	//set the option of segmention. Defined in const part.
	// default is "cwsIdiom or cwsCPlaceName or cwsCName or cwsTag"
	void cwsSetSegSetting(unsigned int aSetting);
	//get the option of segmention.
	unsigned int cwsGetSegSetting(void);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -