summaryrefslogtreecommitdiff
path: root/src/odenwald.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-06-24 13:27:40 +0200
committerPatrick Simianer <p@simianer.de>2016-06-24 13:27:40 +0200
commit09444990ea43f2562b44c028297cfec115f5c646 (patch)
tree327cc00b6d4428a93df7388a15bd55195231462b /src/odenwald.cc
parent912641117aa3feaf237662e011147ad7a2efeed9 (diff)
ow binary
Diffstat (limited to 'src/odenwald.cc')
-rw-r--r--src/odenwald.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/odenwald.cc b/src/odenwald.cc
new file mode 100644
index 0000000..a520d0b
--- /dev/null
+++ b/src/odenwald.cc
@@ -0,0 +1,40 @@
+#include "hypergraph.hh"
+#include <ctime>
+
+int
+main(int argc, char** argv)
+{
+ clock_t begin_total = clock();
+
+ // read hg
+ clock_t begin_read = clock();
+ Hg::Hypergraph hg;
+ G::Vocabulary y;
+ G::Grammar g;
+ Hg::io::read(hg, g.rules, y, argv[1]);
+ //Hg::io::manual(hg, g.rules);
+ clock_t end_read = clock();
+ double elapsed_secs_read = double(end_read - begin_read) / CLOCKS_PER_SEC;
+ cerr << "read " << elapsed_secs_read << " s" << endl;
+
+ // viterbi
+ clock_t begin_viterbi = clock();
+ Hg::Path p;
+ Hg::sv_path(hg, p);
+ exit(1);
+ vector<string> s;
+ Hg::derive(p, p.back()->head, s);
+ for (auto it: s)
+ cout << it << " ";
+ cout << endl;
+ clock_t end_viterbi = clock();
+ double elapsed_secs_viterbi = double(end_viterbi - begin_viterbi) / CLOCKS_PER_SEC;
+ cerr << "viterbi " << elapsed_secs_viterbi << " s" << endl;
+
+ clock_t end_total = clock();
+ double elapsed_secs = double(end_total - begin_total) / CLOCKS_PER_SEC;
+ cerr << "total " << elapsed_secs << " s" << endl;
+
+ return 0;
+}
+