-
Notifications
You must be signed in to change notification settings - Fork 0
/
liblangid.h
39 lines (30 loc) · 997 Bytes
/
liblangid.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
#ifndef _LANGID_H
#define _LANGID_H
#include "sparseset.h"
#include "langid.pb-c.h"
/* Structure containing all the state required to
* implement a language identifier
*/
typedef struct {
unsigned int num_feats;
unsigned int num_langs;
unsigned int num_states;
unsigned (*tk_nextmove)[][256];
unsigned (*tk_output_c)[];
unsigned (*tk_output_s)[];
unsigned (*tk_output)[];
double (*nb_pc)[];
double (*nb_ptc)[];
char *(*nb_classes)[];
Langid__LanguageIdentifier *protobuf_model;
/* sparsesets for counting states and features. these are
* part of LanguageIdentifier as the clear operation on them
* is much less costly than allocating them from scratch
*/
Set *sv, *fv;
} LanguageIdentifier;
extern LanguageIdentifier *get_default_identifier(void);
extern LanguageIdentifier *load_identifier(char*);
extern void destroy_identifier(LanguageIdentifier*);
extern const char *identify(LanguageIdentifier*, char*, int);
#endif