summaryrefslogtreecommitdiff
path: root/filter-tokens
blob: 00c8f2cf7bf52a1034aaea310a3e6bff3c72bc11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env ruby

require 'zipf'

bad_words = {}
ReadFile.readlines_strip(ARGV[0]).each { |line|
  bad_words[line] = true
}

i = 0
while line = STDIN.gets
  bad = false
  tokens = line.split
  bad_words.keys.each { |w|
    if tokens.include? w
      bad = true 
      break
    end
  }
  puts i if bad
  i += 1
end