-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis.h
More file actions
executable file
·54 lines (41 loc) · 1.07 KB
/
analysis.h
File metadata and controls
executable file
·54 lines (41 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef ANALYSIS_H_INCLUDED
#define ANALYSIS_H_INCLUDED
#include"SynTreeSQ.h"
struct Span
{
int beg;
int back;
Span(int m_beg,int m_back):beg(m_beg),back(m_back){}
};
struct CountStruct
{
int leftC;
int rightC;
int matchedC;
CountStruct():leftC(0),rightC(0),matchedC(0){};
};
class AnalysisClass
{
public:
int init(const string&rst_s,vector<string>&src);
int initAlignConsist(const string&rst_s,vector<string>&srcVec);
void trimPunct(Span * span);
int Matched(vector<RTreeNode *>&allNodeVec,vector<Span*>&chartSpan);
bool IsMatch(Span* lsp, Span* rsp);
float Matchrate(int matched, int allsize);
void GetChartPath(vector<string>&src_span, vector<Span*>&chartSpan);
void ConvertNode2Span(vector<RTreeNode *>&vec,vector<Span*>&node2SpanVec);
private:
string ExtractSourceSpan(const string&s){
stringstream ss(s);
string span;
ss>>span;ss>>span;ss>>span;
return span;
}
public:
SynTreeSQ *myRtree;
vector<RTreeNode *> allNodes;
vector<Span*> spanVecFromHier;
vector<Span*>spanVecFromNode;
};
#endif // ANALYSIS_H_INCLUDED