Skip to content

Instantly share code, notes, and snippets.

@kureikei
Created Mar 1, 2015
Embed
What would you like to do?
#! /usr/local/bin/ruby21
require 'csv'
F, S = [], []
open("naist-jdic.csv", "r:EUC-JP:UTF-8"){|file|
file.each_line {|buf|
a = buf.split(",")
next if a[13] != ""
if a[11].length == 5 then F << a[0]
elsif a[11].length == 7 then S << a[0]
end
}
}
loop {
print "%s %s %s\n" % [F.sample, S.sample, F.sample]
sleep 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment