From 7e965fce5245a79c2c8736b3f996198d09602b3b Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Tue, 3 Jun 2014 17:11:43 +0200 Subject: getting serious --- test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 test.rb (limited to 'test.rb') diff --git a/test.rb b/test.rb new file mode 100755 index 0000000..d2b8f66 --- /dev/null +++ b/test.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +require_relative 'hg' + +semiring = ViterbiSemiring.new +hypergraph, nodes_by_label, _ = HG::read_hypergraph_from_json('example/json/test.json', semiring, true) +path, score = HG::viterbi_path hypergraph, nodes_by_label['root'], semiring +path.each { |e| + #puts e.to_s + puts " "+e.rule.to_s +} +s, score = HG::viterbi_string hypergraph, nodes_by_label['root'], semiring +puts s + + -- cgit v1.2.3