summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <patrick@lilt.com>2021-05-21 17:49:56 +0200
committerPatrick Simianer <patrick@lilt.com>2021-05-21 17:49:56 +0200
commitaba828abbabcb9a952ad3144d8ae03e7f4e0ea87 (patch)
treeeed002472be9792f3cc08467af88b348491283e0
parentcd82bf3ff48f054c9e7b7fafcdd7ad6431940db1 (diff)
tsv-exclude
-rwxr-xr-xtsv-exclude21
1 files changed, 21 insertions, 0 deletions
diff --git a/tsv-exclude b/tsv-exclude
new file mode 100755
index 0000000..e951ea1
--- /dev/null
+++ b/tsv-exclude
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+
+require 'zipf'
+require 'set'
+
+to_exclude0 = {}
+to_exclude1 = {}
+f = ReadFile.new ARGV[0]
+
+while line = f.gets
+ p0, p1 = line.strip.split "\t"
+ to_exclude0[p0] = true
+ to_exclude1[p1] = true
+end
+
+while line = STDIN.gets
+ p0, p1 = line.strip.split "\t"
+ if not to_exclude0.has_key? p0 and not to_exclude1.has_key? p1
+ puts line
+ end
+end