-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
44 lines (30 loc) · 1.01 KB
/
main.cpp
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
//
// Zübeyr Furkan Eryilmaz
// 21202676
// CS 202 - 01
//
// hw2.cpp
#include "hw2.h"
#include <stdlib.h>
// main function
int main(int argc, char **argv)
{
NgramTree tree;
string fileName(argv[1]);
int n = atoi(argv[2]);
tree.generateTree(fileName, n);
cout << "\nTotal " << n << "-gram count: " << tree.getTotalNgramCount() << endl;
tree.printNgramFrequencies();
cout << n << "-gram tree is complete: " << (tree.isComplete() ? "Yes" : "No") << endl;
//Before insertion of new n-grams
cout<< n << "-gram tree is full: " << (tree.isFull() ? "Yes" : "No") << endl;
tree.addNgram("samp");
tree.addNgram("samp");
tree.addNgram("zinc");
tree.addNgram("aatt");
cout << "\nTotal " << n << "-gram count: " << tree.getTotalNgramCount() << endl;
tree.printNgramFrequencies();
cout<< n << "-gram tree is complete: " << (tree.isComplete() ? "Yes" : "No") << endl;
cout<< n << "-gram tree is full: " << (tree.isFull() ? "Yes" : "No") << endl;
return 0;
}