Skip to content

Instantly share code, notes, and snippets.

@ybenjo
Created March 18, 2011 14:23
Show Gist options
  • Save ybenjo/876147 to your computer and use it in GitHub Desktop.
Save ybenjo/876147 to your computer and use it in GitHub Desktop.
file = [ ]
$<.each do |l|
file.push l.chomp
end
file.shuffle!
s = (file.size.to_f / 10).floor
open("./train.tsv", "w"){|f|
(s*8).times do
f.puts file.pop
end
}
open("./dev.tsv", "w"){|f|
s.times do
f.puts file.pop
end
}
open("./test.tsv", "w"){|f|
file.each do |e|
f.puts e
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment