Github time!
This commit is contained in:
commit
e87dc5862b
27 changed files with 20178 additions and 0 deletions
19
script/process_anc_data.rb
Executable file
19
script/process_anc_data.rb
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/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
|
Loading…
Add table
Add a link
Reference in a new issue