Sha256: 80253f812343b9cfcfce5c8f799abe5065ab6f791f63268db218516249f6ec92
Contents?: true
Size: 316 Bytes
Versions: 23
Compression:
Stored size: 316 Bytes
Contents
#!/usr/bin/env ruby # encoding: utf-8 require 'json' freqmap = {} data = File.read("data/ANC-all-count.txt") data = data.unpack("C*").pack("U*") data.lines.each do |l| vals = l.split("\t") freqmap[vals[0]] = vals[-1].to_i end File.open("data/wordfreq.json", 'w') do |f| f.write(JSON.dump(freqmap)) end
Version data entries
23 entries across 23 versions & 1 rubygems