From 09444990ea43f2562b44c028297cfec115f5c646 Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Fri, 24 Jun 2016 13:27:40 +0200
Subject: ow binary
---
Makefile | 10 +++++-----
src/fast_weaver.cc | 40 ----------------------------------------
src/odenwald.cc | 40 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 45 deletions(-)
delete mode 100644 src/fast_weaver.cc
create mode 100644 src/odenwald.cc
diff --git a/Makefile b/Makefile
index ea66097..f59d18e 100644
--- a/Makefile
+++ b/Makefile
@@ -14,13 +14,13 @@ PRINT_END = @echo -e "\e[1;32mfinished building $@\e[0m"
###############################################################################
# all
#
-all: $(BIN)/fast_weaver util test
+all: $(BIN)/ow util test
###############################################################################
-# fast_weaver
+# ow
#
-$(BIN)/fast_weaver: $(BIN) $(SRC)/hypergraph.o $(SRC)/fast_weaver.cc
+$(BIN)/ow: $(BIN) $(SRC)/hypergraph.o $(SRC)/odenwald.cc
$(PRINT_BEGIN)
$(COMPILER) $(CFLAGS) \
-lstdc++ \
@@ -28,8 +28,8 @@ $(BIN)/fast_weaver: $(BIN) $(SRC)/hypergraph.o $(SRC)/fast_weaver.cc
$(MSGPACK_C) \
$(TCMALLOC) \
$(SRC)/hypergraph.o \
- $(SRC)/fast_weaver.cc \
- -o $(BIN)/fast_weaver
+ $(SRC)/odenwald.cc \
+ -o $(BIN)/ow
$(PRINT_END)
$(BIN):
diff --git a/src/fast_weaver.cc b/src/fast_weaver.cc
deleted file mode 100644
index a520d0b..0000000
--- a/src/fast_weaver.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "hypergraph.hh"
-#include
-
-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 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;
-}
-
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
+
+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 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;
+}
+
--
cgit v1.2.3