wordsegment.h
来自「这是一个中文分词程序。用户将中文文件(.txt)打开」· C头文件 代码 · 共 42 行
H
42 行
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 + =
减小字号Ctrl + -
显示快捷键?