-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (67 loc) · 2.66 KB
/
index.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"
type="text/javascript"></script>
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<style>
h2 {
text-transform: capitalize;
}
.small {
font-weight: normal;
font-size: 70%;
margin-left: 5px;
}
</style>
</head>
<body>
<h1>KoNLPy Data</h1>
To download the packages, use the KoNLPy downloader.
<pre>
>>> import konlpy
>>> konlpy.download()
</pre>
<div id="packages"></div>
<script>
d3.json("index.json", function(error, data) {
var types = ["dictionaries", "corpora", "taggers"];
var packages = [];
for (var item in data) {
packages.push(data[item]);
}
for (var i in types) {
var container = d3.select("#packages")
.append("div")
.attr("id", function(d) { return types[i] });
container.append("h2")
.text(function(d) { return types[i] });
var subcontainer = container.selectAll("div")
.data(packages.filter(
function(d) { return d.type==types[i] }
)).enter().append("div");
var name = subcontainer.append("h3");
name.append("span")
.attr("id", function(d) { return d["id"] })
.text(function(d) { return d["name"] });
name.append("span")
.attr("class", "small")
.text(function(d) { return "(" + Math.round(d["size"]/1000000) + "MB)" });
name.append("a")
.attr("class", "small")
.attr("href", function(d) { return "http://konlpy.github.io/konlpy-data/packages/" + d["type"] + "/" + d["id"] + ".json" })
.text("[Meta]");
name.append("a")
.attr("class", "small")
.attr("href", function(d) { return "http://konlpy.github.io/konlpy-data/packages/" + d["filepath"] })
.text("[Download]");
var desc = subcontainer.append("p").text(function(d) { return d["description"] });
var list = subcontainer.append("ul");
list.append("li").text(function(d) { return "Author: " + d["author"] });
list.append("li").text(function(d) { return "License: " + d["copyright"] });
}
});
</script>
</body>
</html>