?? eigenvectorselect.h
字號:
/***************************************************************
* 工程: 自然語言處理綜合系統
* 作者: 李赟(liyun@nlu.caai.cn)
* 修改者
* 描述: 特征抽取的部分實現
* 主要函數:IDFEigentVector 、FindClassNames 、CHIEigentVector
G_UpdateKeyWords、G_UpdateIDVector、G_UpdateDocs
G_LoadKeyWords 等
* 版本: 1.0
* 修改:
* 參考文獻:
**************************************************************/
#pragma warning(disable:4786)
#ifndef _EIGENTVECTORSELECT_H_051205_
#define _EIGENTVECTORSELECT_H_051205_
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <cmath>
#include <sstream>
#include <string>
#include "io.h"
using namespace std;
typedef enum{DF_EVS,CHI_EVS} EvsMethod;
//用于CHI分類的數據結構單元
struct EVenty{
public:
string classname;
vector<pair<unsigned int,string> > wordspair; //初始化的一個詞列表
unsigned int totalword; //總詞數
unsigned int chivalue[4]; //chi的ABCD4個變量
unsigned int curindex; //當前詞的cursor
bool isstop; //標示cursor是否到達
map<double,vector<string>,greater<double> > wordmap; //一個按權重排序的map,用于抽取特征
EVenty(){
classname = "";
totalword = curindex =0;
chivalue[0] =chivalue[1] =chivalue[2] =chivalue[3] =0;
isstop = false;
};
};
int changesuffix(char *filename,char *suffix);
int isHanzi(unsigned char ch1,unsigned char ch2);
__int16 ishtml(char *filename);
//全局函數,說明參見CPP中各函數聲明
unsigned int G_LoadKeyWords(const string &dicextname,map<string,unsigned int> &allwords,unsigned int kwdnum,const string& vecfiledir);
unsigned int G_UpdateKeyWords(const string &dicextname,map<string,unsigned int> &allwords,unsigned int kwdnum,const string& vecfiledir);
unsigned int G_UpdateDocs(const string &dicextname,const map<string,unsigned int> &allwords,const string& vecfiledir);
unsigned int G_UpdateIDVector(const string &dicextname,map<string,unsigned int> &allwords,const string& vecfiledir);
unsigned short FindClassNames(set<string>& namevec,const string& vecfiledir,const string& extstr);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -