texttree.h

来自「包含最大频繁序列的挖掘; 包含层次聚类算法」· C头文件 代码 · 共 45 行

H
45
字号
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
Header: TextTree.h
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef TextTree_H
#define TextTree_H

#include "CMRmisc.h"

using namespace std;

struct TextTree {
	TextTree() : classid(-1),doctid(-1), vNumber(0), vLabel(0), firstChild(0), nextSibling(0), parent(0) 
	{
	} 
	
	TextTree(int t) : classid(-1), doctid(t), vNumber(0), vLabel(0), firstChild(0), nextSibling(0), parent(0) 
	{
	}
	
	TextTree(int t, short v) : doctid(t), vNumber(v), 
		vLabel(v,-1), firstChild(v,-1), nextSibling(v,-1), parent(v,-1) ,classid(-1)
	{
	}
	
	~TextTree()
	{
	}
	//assuming the copy constructor and operator= have default definition
	
	int doctid;
	short vNumber;
	vector<short> vLabel;
	vector<short> firstChild;
	vector<short> nextSibling;
	vector<short> parent;
	vector< pair<int, vector<short> > > path;//pair(pathid,path)
	int classid;
};

istream& operator>>(istream& in, TextTree& rhs);
ostream& operator<<(ostream& out, const TextTree& rhs);

#endif //TextTree_H

⌨️ 快捷键说明

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