summaryrefslogtreecommitdiff
path: root/per_sentence_ter
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-07-05 11:01:46 +0200
committerPatrick Simianer <p@simianer.de>2016-07-05 11:01:46 +0200
commit2b1d7f881c19c4d4b5afae194e02d3300c7675d0 (patch)
tree5a06ee7de98640a39244b57bb369697176b44ebf /per_sentence_ter
parent69949dda35c3ea21d8e926e5f0a596a0a0f61c6a (diff)
mv
Diffstat (limited to 'per_sentence_ter')
-rwxr-xr-xper_sentence_ter33
1 files changed, 0 insertions, 33 deletions
diff --git a/per_sentence_ter b/per_sentence_ter
deleted file mode 100755
index fa283ef..0000000
--- a/per_sentence_ter
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'zipf'
-require 'trollop'
-require 'tempfile'
-
-def main
- conf = Trollop::options do
- opt :input, "input", :type => :string, :default => '-'
- opt :references, "references", :type => :string, :required => true
- opt :mteval_bin, "cdec's mteval/fast_score", :type => :string, :default => '`/toolbox/cdec-dtrain/mteval/fast_score'
- end
-
- refs = ReadFile.readlines_strip conf[:references]
- input = ReadFile.new conf[:input]
- i = -1
- while line = input.gets
- line.strip!
- i += 1
- a = Tempfile.new 'pster'
- b = Tempfile.new 'pster'
- a.write line+"\n"
- b.write refs[i]+"\n"
- a.close; b.close
- score = `/toolbox/cdec-dtrain/mteval/fast_score -i #{a.path} -r #{b.path} -m ter 2>/dev/null`
- puts score
- a.unlink; b.unlink
- end
- input.close
-end
-
-main
-