ljsking / PatternSearch

5 stars 1 forks source link

패턴 통계 내기 #15

Closed ljsking closed 15 years ago

ljsking commented 15 years ago

sqlite에 저장하고 시각화하기.

ljsking commented 15 years ago

f = File.new("dump/dialogue_0001.ptxt.dump") obj = Marshal.load(f)

하지만 에러!

ljsking commented 15 years ago

require 'sentence'

ljsking commented 15 years ago

>> f = File.new('../dump/dialogue_0001.ptxt.dump')
>> while not f.eof? do
?> arr << Marshal.load(f)
>> end
=> nil
ljsking commented 15 years ago

require 'sqlite3' db = SQLite3::Database.new("test.db") db.execute("CREATE TABLE leaf(tag VARCHAR(256), count INT, PRIMARY KEY(tag))")

ljsking commented 15 years ago

db.execute('insert into leaf (tag, count) values ("tag|tag", 1)') rows = db.execute('select * from leaf where tag="tag|tag"')

ljsking commented 15 years ago

시간이 많이 걸려서 이것은 포기!