This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gets | |
member = { | |
'J' => 1, | |
'O' => 2, | |
'I' => 4 | |
} | |
def dumpArray(array) | |
array.each do |value| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'nokogiri' | |
require "open-uri" | |
require './SSparser.rb' | |
require './db_manager.rb' | |
# http://ssimas.blog.fc2.com/ | |
#url = 'http://ssimas.blog.fc2.com/blog-entry-3218.html#more' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require './wakati.rb' | |
require './db_manager.rb' | |
class Intelligence | |
def initialize | |
@wakati = Wakati.new | |
db = DbManager.new | |
@responds = db.read("amami.db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'classifier' | |
require './db_manager.rb' | |
require 'natto' | |
@nm = Natto::MeCab.new | |
def wakati(str) | |
array = [] | |
@nm.parse(str) do |n| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'nokogiri' | |
require "open-uri" | |
require 'sequel' | |
def insert(dbname, urls) | |
db = Sequel.connect("sqlite://#{dbname}") | |
urls.each do |url| | |
db[:url].insert(value: url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'nokogiri' | |
require 'open-uri' | |
require 'Sequel' | |
require './SSparser.rb' | |
# for ankake.blog.jp | |
s = SSparser.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
class SSparser | |
def parse(body) | |
(body.count('『') > body.count('「')) ? | |
body.gsub('「', '「').gsub('『', '「').gsub('』', '」').gsub('」', '」') : | |
body.gsub('「', '「').gsub('」', '」') | |
body = body.split("\n").delete_if{|v|v.nil?} | |
ss = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
array = ["ち","ん","ぽ"] | |
c = 1 | |
narray = [] | |
1000.times do | |
narray.push array.sample | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
class SSAnalyzer | |
def corpus?(ss) | |
sla = sentence_length_average(ss) | |
ctc = consecutive_talking_count(ss) | |
return false if ctc.nil? | |
ctc = ctc/ss.length.to_f | |
(ctc >= 0.8) or (ctc >= 0.4 and sla <= 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
あ | sasamijp | 2014-03-24 23:08:33 +0900 | 448099043776794625 | |
---|---|---|---|---|
おしり | sasamijp | 2014-03-25 08:58:06 +0900 | 448247409835913216 | |
おしりターボ | firstspring1845 | 2014-03-25 08:58:31 +0900 | 448247511027695616 | |
極左 | NTTrf | 2014-03-25 09:35:42 +0900 | 448256867165159424 | |
アナル | sasamijp | 2014-03-25 10:04:17 +0900 | 448264063898746881 | |
菊地真はホモ | 1kaguya | 2014-03-25 10:04:44 +0900 | 448264173814702080 | |
ちんちん | sasamijp | 2014-03-25 10:11:35 +0900 | 448265900936798209 | |
あ | sasamijp | 2014-03-25 10:40:12 +0900 | 448273101990555649 | |
アナル | sasamijp | 2014-03-25 16:28:21 +0900 | 448360718526447616 | |
ちんちん | sasamijp | 2014-03-25 17:07:55 +0900 | 448370672822013952 |