-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtokenizer.h
More file actions
44 lines (39 loc) · 897 Bytes
/
Copy pathtokenizer.h
File metadata and controls
44 lines (39 loc) · 897 Bytes
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
typedef struct Stack Stack;
typedef struct Tokenizer Tokenizer;
typedef struct Parser Parser;
typedef struct stemmer Stemmer;
enum { TERM = 1, OTAG, CTAG };
struct Stack {
uint8_t s[KB];
int p;
int n;
};
struct Tokenizer {
char delimiters[ASCII];
int asciitab[ASCII];
Stack *mem;
int casechange;
};
struct Parser {
char type;
int c;
int n;
int x_min;
int x_max;
Hash *hcw; /* hash of common words */
Stemmer *stemmer;
int n_tag;
char doctag[64];
char idtag[64];
char *tag[64];
};
void reset(Stack *, int);
void push(Stack *, char *);
char pop(Stack *);
void printstack(Stack *);
Tokenizer *newtokenizer(char *, int, Stack *);
uint32_t gettoken(Token *, FILE *, Tokenizer *);
Parser *newparser(char, char **, int, int, int, int);
void freeparser(Parser *);
uint32_t getdoc(char **buf, Parser *parser, FILE *fp);
void __print_doc_buf(char *buf, uint32_t b);