From 68acbb9a0c7967cb90a7e3756fc94fdd8a73d154 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 29 Jan 2014 19:14:08 +0100 Subject: make use of nlp_ruby, LICENSE --- keycount | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'keycount') diff --git a/keycount b/keycount index 15b4095..deaa522 100755 --- a/keycount +++ b/keycount @@ -1,11 +1,14 @@ #!/usr/bin/env ruby +STDIN.set_encoding 'utf-8' +STDOUT.set_encoding 'utf-8' + h = {} -h.default = 0 +h.default = 0 while line = STDIN.gets - line.strip! + line.strip! h[line] += 1 end -h.each_pair {|k,v| puts "#{k} #{v}"} +h.each_pair { |k,v| puts "#{k} #{v}" } -- cgit v1.2.3