Skip to content

Instantly share code, notes, and snippets.

@josephcc
Created January 27, 2014 17:44
Show Gist options
  • Select an option

  • Save josephcc/8653564 to your computer and use it in GitHub Desktop.

Select an option

Save josephcc/8653564 to your computer and use it in GitHub Desktop.
seen = {}
count = 0
File.open(ARGV[0]) do |iFile|
iFile.each do |line|
begin
toks = line.split
toks.each do |tok|
tok = tok.downcase
if not seen.keys.include? tok
seen[tok] = nil
end
count += 1
puts "#{count}\t#{seen.keys.size}"
end
rescue
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment