forked from yanyiwu/cjieba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jieba.h
37 lines (27 loc) · 1 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
#define FFI_LIB "./libjieba.so"
typedef void* Jieba;
Jieba NewJieba(const char* dict_path, const char* hmm_path, const char* user_dict, const char* idf_path, const char* stop_word_path);
void FreeJieba(Jieba);
typedef struct {
const char* word;
size_t len;
} CJiebaWord;
typedef struct {
const char* word;
size_t len;
char tag[0];
} CJiebaWordWithTag;
CJiebaWord* Cut(Jieba handle, const char* sentence, size_t len);
CJiebaWord* CutWithoutTagName(Jieba, const char*, size_t, const char*);
void FreeWords(CJiebaWord* words);
CJiebaWordWithTag* CutWithTag(Jieba, const char*, size_t);
void FreeWordTag(CJiebaWordWithTag* words);
bool JiebaInsertUserWord(Jieba handle, const char* word);
typedef void* Extractor;
Extractor NewExtractor(const char* dict_path,
const char* hmm_path,
const char* idf_path,
const char* stop_word_path,
const char* user_dict_path);
CJiebaWord* Extract(Extractor handle, const char* sentence, size_t len, size_t topn);
void FreeExtractor(Extractor handle);