-
Notifications
You must be signed in to change notification settings - Fork 1
/
dawg.h
43 lines (36 loc) · 945 Bytes
/
dawg.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
#ifndef DAWG_H
#define DAWG_H
#define ASCII_SIZE 256
#define SOLID 1
#define NON_SOLID 2
struct TEdge
{
struct TState * from;
struct TState * to;
int type;
};
struct TState
{
struct TEdge ** edges;
struct TState * suf_link;
int id;
struct TIntList * data;
int index;
};
struct TIntList
{
int x;
struct TIntList * Next;
};
struct TStateList
{
struct TState * state;
struct TStateList * Next;
};
int ascii[ASCII_SIZE];
int inv_ascii[ASCII_SIZE];
int dawg_states;
int read_alphabet ( const char * );
void create_edge ( struct TState *, struct TState *, int, int);
struct TState * create_state ( struct TEdge **, int, int );
#endif