summaryrefslogtreecommitdiff
path: root/test_hg.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-12 16:25:33 +0200
committerPatrick Simianer <p@simianer.de>2014-06-12 16:25:33 +0200
commit1651cfb83e0d95f9ada0b9acae6ede84e605720b (patch)
tree68def18ad3dd78893e5d5495e479010de7101dde /test_hg.rb
parente834fd628f61aca04f98691eb56e9808c33c6787 (diff)
save some memory
Diffstat (limited to 'test_hg.rb')
-rwxr-xr-xtest_hg.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/test_hg.rb b/test_hg.rb
index b72bd85..f4e2ef8 100755
--- a/test_hg.rb
+++ b/test_hg.rb
@@ -4,17 +4,16 @@ require_relative 'hg'
semiring = ViterbiSemiring.new
-hypergraph, nodes_by_id = HG::read_hypergraph_from_json('x.json', semiring, true)
+hypergraph, nodes_by_id = HG::read_hypergraph_from_json('example/3/3.json', semiring, true)
path, score = HG::viterbi_path hypergraph, nodes_by_id[-1], semiring
s = HG::derive path, path.last.head, []
puts "#{s.map { |i| i.word }.join ' '}"
puts Math.log score
puts
-
#hypergraph.reset
#paths = HG::all_paths hypergraph, nodes_by_id[-1]
-#paths.each { |p|
+#paths.each_with_index { |p,i|
# s = HG::derive p, p.last.head, []
-# puts "#{s.map { |i| i.word }.join ' '}"
+# puts "#{i+1}. #{s.map { |i| i.word }.join ' '}"
#}