diff options
author | Patrick Simianer <p@simianer.de> | 2017-08-04 12:48:27 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2017-08-04 12:48:27 +0200 |
commit | 9f1d31143bb695ed87e773a60224a2ae84b8fd8c (patch) | |
tree | 94f3add956f1ab3708995d1922ea876a2a924ba8 /cmp | |
parent | 4bc3eec9fb26d367d174b103f77ccaa9175129ab (diff) |
cmp
Diffstat (limited to 'cmp')
-rwxr-xr-x | cmp | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#!/usr/bin/env ruby + +require 'zipf' + +f = ReadFile.new ARGV[0] +g = ReadFile.new ARGV[1] +h = ReadFile.new ARGV[2] + +i = 0 +while line = f.gets + line1 = g.gets + line2 = h.gets + b1 = (BLEU::per_sentence_bleu(line1.strip, line.split, 4)*100).round 1 + b2 = (BLEU::per_sentence_bleu(line2.strip, line.split, 4)*100).round 1 + puts i + puts "ref) " + line + puts "org #{b1}) " + line1 + puts "ada #{b2}) " + line2 + puts " >>> #{(b2-b1).round 1} <<<" + puts + i += 1 +end + |