forked from jaiminpan/pg_jieba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjieba.h
50 lines (40 loc) · 1.05 KB
/
jieba.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
50
/*-------------------------------------------------------------------------
*
* jieba.h
* Contains functions which acted as an interface between the C++ and C
*
* Author: Jaimin Pan <[email protected]>
*
* IDENTIFICATION
* jieba.h
*
*-------------------------------------------------------------------------
*/
#ifndef JIEBA_API_H
#define JIEBA_API_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct JiebaCtx JiebaCtx;
typedef struct ParStat ParStat;
typedef struct JiebaResult
{
char* str;
unsigned char len;
int attr;
} JiebaResult;
#define MODE_MP 1
#define MODE_HMM 2
#define MODE_MIX 3
#define MODE_QRY 4
extern JiebaCtx* Jieba_New(const char* dict_path, const char* hmm_path, const char* user_dict);
extern void Jieba_Free(JiebaCtx* ctx);
extern ParStat* Jieba_Cut(JiebaCtx* ctx, const char* str, int len, int mode);
extern JiebaResult* Jieba_GetNext(JiebaCtx* ctx, ParStat* stat);
extern ParStat* ParStat_New();
extern void ParStat_Free(ParStat* stat);
#include "jieba_token.h"
#ifdef __cplusplus
}
#endif
#endif /* JIEBA_API_H */