From 254830b86da314bed23f44230710e1ba221af4c9 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 12 Aug 2012 23:15:14 -0400 Subject: nasty unit test failure --- decoder/hg_test.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'decoder/hg_test.h') diff --git a/decoder/hg_test.h b/decoder/hg_test.h index 2e308c37..c098961d 100644 --- a/decoder/hg_test.h +++ b/decoder/hg_test.h @@ -64,12 +64,20 @@ Name HGjsons[]= { } +void AddNullEdge(Hypergraph* hg) { + TRule x; + x.arity_ = 0; + hg->nodes_[0].in_edges_.push_back(hg->AddEdge(TRulePtr(new TRule(x)), Hypergraph::TailNodeVector())->id_); +} + void HGSetup::CreateTinyLatticeHG(Hypergraph* hg) { Json(hg,HGjsons[TinyLatticeHG]); + AddNullEdge(hg); } void HGSetup::CreateLatticeHG(Hypergraph* hg) { Json(hg,HGjsons[LatticeHG]); + AddNullEdge(hg); } void HGSetup::CreateHG_tiny(Hypergraph* hg) { -- cgit v1.2.3 From 8df50dcff502990b69349f753ca2bb7223610bee Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 13 Aug 2012 09:59:00 -0400 Subject: maybe fix? --- decoder/hg_test.h | 1 + 1 file changed, 1 insertion(+) (limited to 'decoder/hg_test.h') diff --git a/decoder/hg_test.h b/decoder/hg_test.h index c098961d..e96cb0b1 100644 --- a/decoder/hg_test.h +++ b/decoder/hg_test.h @@ -68,6 +68,7 @@ void AddNullEdge(Hypergraph* hg) { TRule x; x.arity_ = 0; hg->nodes_[0].in_edges_.push_back(hg->AddEdge(TRulePtr(new TRule(x)), Hypergraph::TailNodeVector())->id_); + hg->edges_.back().head_node_ = 0; } void HGSetup::CreateTinyLatticeHG(Hypergraph* hg) { -- cgit v1.2.3