-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutils.h
More file actions
33 lines (27 loc) · 724 Bytes
/
utils.h
File metadata and controls
33 lines (27 loc) · 724 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
/*
* Description: utils.h, header file for utils.c
*/
#include <glib.h>
#define N 256
/* structs */
typedef struct {
int bigram[2];
int occ;
} Bigram;
typedef struct {
int trigram[3];
int occ;
} Trigram;
typedef struct {
char word[N];
int occ;
} Word;
/* function declarations */
void bubble_up(GList *a, GList *b, GList *x, GList *c);
void print_bigrams(GList *l);
void print_trigrams(GList *l);
void print_words(GList *l);
void free_list(GList *l);
GList *count_bigrams(FILE *fi, GList *l, int case_sensitive, int alpha_only);
GList *count_trigrams(FILE *fi, GList *l, int case_sensitive, int alpha_only);
GList *count_words(FILE *fi, GList *l, int case_sensitive);