=begin データ「topic」の中身は 200204 16 _t1,▽話題 _t2,▽話題とか _t3,■読んだ本とか 17 18 ... という構造。 だから、year,month,date(例えば2002,04,16)からファイルポインタ(例えば200204.html#16)を作る関数date2url(year,month,date)というのがあったとして、i番目のトピックは、 urlは、 date2url(year,month,date) + topic[year+month][date][i][0] その時のstrは、 topic[year+month][i][1] となる。 =end require 'kconv' class Topics def select_tohtml(diarys, putmonth = true, year = '') @diarys = diarys topic = Marshal::load(filter_topics(diarys)) pattern = Regexp::compile(@pattern) body = '' topic.delete_if{ |month, days| days.delete_if{ |date, topics| topics.delete_if{ |line| pattern !~ line[1] } topics.size.zero? or !diarys.include?(month + date) } days.size.zero? } topic.keys.sort.reverse.each{ |month| topic[month].keys.sort.each{ |date| body << "\t\t