summaryrefslogtreecommitdiff
path: root/cmp
blob: ed8460c177a813afba410028647aa1ca31c10562 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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