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 'natto' | |
require 'open-uri' | |
@natto = Natto::MeCab.new | |
def conv(jp_text) | |
words = [] | |
jp_text.split("\n").map do |text| |
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 'natto' | |
@natto = Natto::MeCab.new | |
def conv(jp_text) | |
words = [] | |
@natto.parse(jp_text) do |n| | |
break if n.is_eos? |
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 'twitter' | |
class Const | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
ACCESS_TOKEN = '' | |
ACCESS_TOKEN_SECRET = '' | |
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 -*- | |
require 'sequel' | |
require 'natto' | |
class Responder | |
def initialize | |
@db = Sequel.connect("sqlite://./pa.db") | |
@natto = Natto::MeCab.new | |
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
create table sov( | |
s text, | |
o text, | |
v text | |
); | |
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
class Parser | |
def parse(text) | |
text.gsub(' ', ' ').split | |
end | |
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
あ | 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 |
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
# 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 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 = [] |