diff options
author | Patrick Simianer <p@simianer.de> | 2017-07-05 07:54:14 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2017-07-05 07:54:14 +0200 |
commit | aaa6be0e31ffd77f5a524c370746dd615272c87a (patch) | |
tree | 5d3eaff92f69e5c6df6836ba02bea649cc3a264b | |
parent | 5339c8fdb1df47a2dab688bf1469e02a28eb0c89 (diff) |
overlap
-rwxr-xr-x | overlap | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,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 + |