-
Notifications
You must be signed in to change notification settings - Fork 0
/
unittest.cc
31 lines (23 loc) · 1006 Bytes
/
unittest.cc
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
#include<iostream>
#include<string>
#include<regex>
#include<cassert>
#include"chomsky_norm_form.h"
int main(int argc, char **argv){
std::string cfg_s = "S -> NP VP | Aux NP VP | VP\n"
"NP -> Pronoun | Proper-Noun | Det Nominal\n"
"Nominal -> Noun | Nominal apple Noun book | Nominal PP\n"
"VP -> Verb | Verb finsh NP | Verb NP PP | Verb PP | VP PP\n"
"PP -> Preposition NP\n"
"Det -> that | this | a\n"
"Noun -> book | flight | meal | money\n"
"Verb -> book | include | prefer\n"
"Pronoun -> I | she | me\n"
"Proper-Noun -> Houston | TWA\n"
"Aux -> does\n"
"Preposition -> from | to | on | near | through";
Grammar gram(cfg_s);
gram.convert_to_cnf();
gram.print("cnfn");
return 0;
}