-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseg.h
49 lines (47 loc) · 1.19 KB
/
seg.h
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
#ifndef _SEG_H_
#define _SEG_H_
#include "tree.h"
#include "hmm.h"
#include "symbol.h"
#include <math.h>
#include <algorithm>
#include "../commom/func.h"
typedef struct{
void* t;
int index;
std::string str;
intvector v;
}parameter;
typedef struct{
void* t;
int index;
std::string str;
}segpara;
namespace seg{
class Wordseg{
public:
std::string path;
Dict mydict;
//Hmm mhmm;
Symbol mysymbol;
public:
Wordseg();
~Wordseg();
void InitDict(const char* dictpath);
bool CheckNoeWord(treenode* r,uint16_t x);
void Check(intvector& line, std::vector<intvector>& part);
void InitDistence(float ** D, intvector &part);
void CheakChineseName(float ** D, intvector &part);
std::string Solve(float ** D, intvector &part,int wordlen);
std::string JionCon(string& str);
std::string Segement(const char* str);
std::string Segement(const char* str,int x);
std::string QuickSegement(const char* str);
std::string SegStr(intvector& part);
std::string SegAll(intvector& part,int x);
std::string _SegStr(intvector& part);
std::string Unit(std::map<unsigned int , unsigned int>& position, intvector& part);
bool SegFile(const char* inpath, const char* outpath);
};
}
#endif