From 0b3cdb4ae2fa176ba74a48ff7a1616395079c151 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 5 Aug 2014 22:46:43 +0200 Subject: too much to tell --- fast/hypergraph.hh | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'fast/hypergraph.hh') diff --git a/fast/hypergraph.hh b/fast/hypergraph.hh index 79ee97b..699bfdf 100644 --- a/fast/hypergraph.hh +++ b/fast/hypergraph.hh @@ -1,28 +1,25 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include #include -#include #include +#include +#include +#include +#include #include #include +#include +#include +#include +#include #include "grammar.hh" #include "semiring.hh" -#include "dummyvector.h" #include "sparse_vector.hh" +#include "weaver.hh" using namespace std; -typedef double score_t; -typedef double weight_t; - namespace Hg { @@ -69,28 +66,36 @@ struct Hypergraph { unsigned int arity; }; -void -reset(); - template void -init(list& nodes, list::iterator root, Semiring& semiring); +init(const list& nodes, const list::iterator root, const Semiring& semiring); void -topological_sort(list& nodes, list::iterator root); +reset(const list nodes, const vector edges); + +void +topological_sort(list& nodes, const list::iterator root); void viterbi(Hypergraph& hg); +typedef vector Path; + +void +viterbi_path(Hypergraph& hg, Path& p); + +void +derive(const Path& p, const Node* cur, vector& carry); + namespace io { void -read(Hypergraph& hg, vector rules, string fn); +read(Hypergraph& hg, vector& rules, const string& fn); // FIXME void -write(Hypergraph& hg, vector rules, string fn); +write(Hypergraph& hg, vector& rules, const string& fn); // TODO void -manual(Hypergraph& hg); +manual(Hypergraph& hg, vector& rules); } // namespace -- cgit v1.2.3