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
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
# -*- 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
# -*- 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 '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 'natto' | |
require 'open-uri' | |
@natto = Natto::MeCab.new | |
def conv(jp_text) | |
words = [] | |
jp_text.split("\n").map do |text| |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
台風すかね | |
火曜日雨降るかな | |
そうだね | |
それはどこですか | |
お元気ですか? | |
おはようございます | |
何かパワーアップしてるの? | |
ぼくはきみがチンポ感ってvia使ってたのを忘れないからね | |
むしろ養うって言え | |
違わないよ |
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
台風すかね - そうなる前に帰る予定だったのにねー…… | |
火曜日雨降るかな - そっか。 …………あ!! | |
そうだね - それに、雪歩と会えたから怖いのもいくらか紛れたし | |
それはどこですか - でも、やよいと違って家事とかあるわけじゃないんだし、これくらいでへこたれてちゃダメだよねっ! | |
お元気ですか? - 内腿...です | |
おはようございます - おはようございます!プロデューサーさん!ガチャコン!ガチャコン!ガチャコン! | |
何かパワーアップしてるの? - だって千早ちゃんって大人っぽいじゃん。 | |
ぼくはきみがチンポ感ってvia使ってたのを忘れないからね - いやいや! さすがに使ったことはないよ。お父さんが昔使っていたやつがうちにあるんだよね | |
むしろ養うって言え - う~ん…… | |
違わないよ - だって、さっき私に三十両やるって仰ったじゃございませんか |
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
台風すかね - | |
火曜日雨降るかな - 壁に耳つけて平たく見たんですね | |
そうだね - お兄さーーん! | |
それはどこですか - 続いてはラジオネーム『臀部のり』さんから! | |
お元気ですか? - ……ふふ♪ やっぱり、やさしいですね。プロデューサーさんは | |
おはようございます - 私は……ドーナツ、クッキーは何も見なくても作れますし、他も、色々作ります! | |
何かパワーアップしてるの? - んー……オムライスなんていかがでしょう? | |
ぼくはきみがチンポ感ってvia使ってたのを忘れないからね - んー……オムライスなんていかがでしょう? | |
むしろ養うって言え - ……あ、あれのこと? あれは別にそういうお話じゃなくて…… | |
違わないよ - そ、そんなわけないですよ! だって現に、あなたは普通の人間の姿をしているじゃないですか! |
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 'pp' | |
@natto = Natto::MeCab.new | |
def tf_idf(all_docs, doc_words, word) |