#!/usr/bin/env ruby require_relative './util.rb' fn = 'newstest2008-grammar+index' approx_lines_per_shard = 12285856#/23 STDOUT.sync = true i = 0 read_rules_from_file1(STDIN, 'stdin') { |r| i += 1 shard_percentage = ((i*100.0)/approx_lines_per_shard).round 2 STDERR.write "reporter:status:word pair key ##{i} #{shard_percentage}%\n" r.fe_word_pairs.each { |p| puts "#{p}\t#{r.id} ||| #{r.to_s}" } }