Skip to content

Instantly share code, notes, and snippets.

@ybenjo
Created February 25, 2012 09:52
Show Gist options
  • Save ybenjo/1907632 to your computer and use it in GitHub Desktop.
Save ybenjo/1907632 to your computer and use it in GitHub Desktop.
annotation whether anime/not
# -*- coding: utf-8 -*-
tmp = [ ]
open("../data/results/0225_0200/seiyu_graph_all.txt", "r"){|f|
tmp = f.read.split("\n")
}
women_seiyu = []
open("../data/seiyu_namelist_women.txt", "r"){|f|
women_seiyu = f.read.split("\n")
}
seiyu = [ ]
open("../data/seiyu_namelist_all.txt", "r"){|f|
seiyu = women_seiyu | f.read.split("\n")
}
data = [ ]
# filter woman seiyu
tmp.each do |e|
head, ary = e.split("\t")
ary = ary.split(",")
size = (ary & women_seiyu).size
data.push [head, ary & women_seiyu] if size > 2
end
data.sort!{|b, a| a.last.size <=> b.last.size}
size = data.size
open("../data/results/0225_0200/seiyu_graph_hp.txt", "w"){|f|
data.each_with_index do |l, i|
title, arys = l
next if seiyu.include?(title)
next if title.include?("声優")
if title.include?("アニメ") || title.include?("漫画")
f.puts title + "\t" + arys.join(",")
next
end
puts "#{i}/#{size} - #{title}"
flag = gets.chomp
f.puts title + "\t" + arys.join(",") if flag.empty?
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment