-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.py
executable file
·54 lines (42 loc) · 929 Bytes
/
start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
"""
from start import *
で読み込み
# クロール
hateusers = initializeUserList()
fillTables(hateusers)
# 計算
cluc_sim()
# テーブル設計
CREATE TABLE entry(
id INT PRIMARY KEY AUTO_INCREMENT,
url VARCHAR(255) UNIQUE,
title VARCHAR(255)
);
CREATE TABLE tag(
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) UNIQUE,
frequency INT
);
CREATE TABLE entry_tags(
id INT PRIMARY KEY AUTO_INCREMENT,
e_id INT,
t_id INT,
UNIQUE(e_id, t_id),
FOREIGN KEY(e_id) REFERENCES entry(id),
FOREIGN KEY(t_id) REFERENCES tag(id)
);
CREATE TABLE tags_sim(
id INT PRIMARY KEY AUTO_INCREMENT,
sim FLOAT,
t_id1 INT,
t_id2 INT,
weight INT,
UNIQUE(t_id1, t_id2),
FOREIGN KEY(t_id1) REFERENCES tag(id),
FOREIGN KEY(t_id2) REFERENCES tag(id)
);
"""
from hatebu_rec import *
from hatebu_db import *
from hatebu_query import *