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

📄 wordsegment.h

📁 基于径向基函数的神经网络文本自动分类系统。
💻 H
字号:
// WordSegment.h: interface for the CWordSeg class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WORDSEGMENT_H__18EFCCE0_4780_45CA_962A_8128DD2FC299__INCLUDED_)
#define AFX_WORDSEGMENT_H__18EFCCE0_4780_45CA_962A_8128DD2FC299__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include ".\\Utility\\Dictionary.h"
#include ".\\Segment\\Segment.h"
#include ".\\Tag\\Span.h"
#include ".\\Unknown\\UnknowWord.h"
#include <afxtempl.h>
#include "UTILITY\Dictionary.h"	// Added by ClassView

AFX_INLINE UINT AFXAPI HashKey(CString key);

class CWordSegment  
{
public:
	CWordSegment();
	virtual ~CWordSegment();
	bool InitWorgSegment(char *, int nLanguage=0);
	void FreeWordSegment();
	void SetSegSetting(unsigned short);
	unsigned short GetSegSetting();
	bool Segment(char*);
	bool isInStopWords(char*);
public:
	int SegmentFile(const char *source, const char * target, BOOL bStopWord=true, BOOL bTag=false);
	PWORD_RESULT GetWordSeg(int index);
	int GetSegmentCount();
	static const unsigned short uTag;  // word classify tag
	static const unsigned short uPlace; // Chinese place name
	static const unsigned short uPerson;  // chinese name
	static const unsigned short uTransPerson; // translation name, include translation
private:
	static int ParseFile(char *pBuffer, int nStart, int &nEnd);
private:
	//m_nInit>0 初始化了; m_nInit=1 分词初始化; m_nInit=2 英文初始化
	int m_nInit;
	CMap<CString,CString,int,int> m_lstStopWords;
	unsigned short m_nOperateType;
	double m_dSmoothingPara;
	char m_pNewSentence[MAX_PATH*10];
	static char m_pSentence[MAX_PATH*10];
	CSegment m_Seg;//Seg class
	CDictionary m_dictCore,m_dictBigram;//Core dictionary,bigram dictionary
	CSpan m_POSTagger;//POS tagger
	CUnknowWord m_uPerson,m_uTransPerson,m_uPlace;//Person recognition
};
extern CWordSegment g_wordSeg;
#endif // !defined(AFX_WORDSEGMENT_H__18EFCCE0_4780_45CA_962A_8128DD2FC299__INCLUDED_)

⌨️ 快捷键说明

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