Sha256: d43d718d6ab287d3f0bfe9ad12a87fa37b97a2617b7c2d4c7bbe4616533b9ba3
Contents?: true
Size: 480 Bytes
Versions: 17
Compression:
Stored size: 480 Bytes
Contents
#!/usr/bin/env ruby # -*- coding: utf-8 -*- require 'tmpdir' tmpdir = Dir.mktmpdir table = {} Dir.entries("text").each do |name| next if [".", ".."].include?(name) path = File.join(tmpdir,name) `nkf -w #{File.join("text",name)} > #{path}` text = File.read(path) text.split("").each do |c| table[c] = table.has_key?(c) ? table[c].succ : 1 end end table.keys.sort {|a,b| table[b] <=> table[a] }.each do |key| puts "#{key.inspect[1..-2]}:#{table[key]}" end
Version data entries
17 entries across 17 versions & 1 rubygems