summaryrefslogtreecommitdiff
path: root/overlapping_rules/word_pair_keys.rb
blob: 8b5444189ea1ff28750f30ac97988372d069856e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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}"
  }
}