Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitchX
GitHub Repository: BitchX/BitchX1.3
Path: blob/master/dll/europa/cse476/p1.cpp
1074 views
1
#include <iostream.h>
2
#include <fstream.h>
3
#include <string.h>
4
5
#include "parse.h"
6
#include "grammar.h"
7
#include "lexicon.h"
8
#include "list.h"
9
#include "gnode.h"
10
11
Grammar grammar("grammar.txt");
12
Lexicon lexicon("lexicon.txt");
13
14
int main(int argc, char *argv[]) {
15
char *sentence = "Jack was happy to see a dog.";
16
17
// cout << "[nlp]$ " << sentence << endl;
18
// parse(sentence);
19
20
sentence = new char[1000];
21
cout << "[nlp]$ " << flush;
22
cin.getline(sentence, 999);
23
// while(cin) {
24
if(strlen(sentence))
25
parse(sentence);
26
27
// cout << "[nlp]$ " << flush;
28
// cin.getline(sentence, 999);
29
// }
30
31
cout << "Bye bye..." << endl;
32
}
33
34