diff options
author | Patrick Simianer <p@simianer.de> | 2014-09-27 15:17:43 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-09-27 15:17:43 +0100 |
commit | f65e428784cfd2264f3fdfddd574c37acd38f54f (patch) | |
tree | 6a98f82964cbce52957a2d62f8b2c5b7ff8be095 /test/test_hg.rb | |
parent | f28694f9bdd5059050e420cca2ca2694cbb0dda4 (diff) |
cosmetic changes, bump to 1.1
Diffstat (limited to 'test/test_hg.rb')
-rwxr-xr-x | test/test_hg.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/test/test_hg.rb b/test/test_hg.rb deleted file mode 100755 index 667a3b8..0000000 --- a/test/test_hg.rb +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env ruby - -require_relative '../lib/zipf' -require 'test/unit' - - -class TestHG < Test::Unit::TestCase - - def test_viterbi - semiring = ViterbiSemiring.new - hypergraph, nodes_by_label, nodes_by_index = HG::read_hypergraph_from_json('test/hg/hg.json', semiring, true) - HG::viterbi hypergraph, nodes_by_label['root'], semiring - assert_equal('Goal', nodes_by_index.last.cat) - assert_equal(228.95, Math.log(nodes_by_index.last.score).round(2)) - # do all operations in log space - semiring = ViterbiLogSemiring.new - hypergraph, nodes_by_label, nodes_by_index = HG::read_hypergraph_from_json('test/hg/hg.json', semiring) - HG::viterbi hypergraph, nodes_by_label['root'], semiring - assert_equal('Goal', nodes_by_index.last.cat) - assert_equal(228.95, nodes_by_index.last.score.round(2)) - assert_equal hypergraph.nodes.size, 221 - assert_equal hypergraph.edges.size, 16640 - end -end - |