blob: 81740e56f2c0674a736c4b78771457b38e8ea985 (
plain)
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
|
#include "hypergraph.hh"
#include <ctime>
int
main(int argc, char** argv)
{
Hg::Hypergraph hg;
G::Vocabulary y;
G::Grammar g;
Hg::io::read(hg, g.rules, y, argv[1]);
//Hg::io::manual(hg, g.rules);
Hg::Path p;
Hg::viterbi_path(hg, p);
vector<string> s;
clock_t begin = clock();
Hg::derive(p, p.back()->head, s);
for (auto it: s)
cout << it << " ";
cout << endl;
clock_t end = clock();
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
cout << elapsed_secs << " s" << endl;
return 0;
}
|