summaryrefslogtreecommitdiff
path: root/overlap
blob: 81f9c4b305d9f17ab17bd3a2c31bfcaf1352c1f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env ruby

require 'zipf'

a = {}
a.default = 0
ReadFile.readlines_strip(ARGV[0]).map { |segment| a[segment] += 1 }
b = {}
b.default = 0
ReadFile.readlines_strip(ARGV[1]).map { |segment| b[segment] += 1 }

overlap = 0
a.each_key { |seg|
  puts b[seg] 
  overlap = overlap+b[seg] 
}

puts "---"
puts overlap