-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
143 lines (133 loc) · 4.22 KB
/
index.php
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!--
LICENSE: GPL v2
Copyright 2017 MagCho, uria
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<!doctype hmtl>
<!--1.入力された文章を変数($text)へ代入する-->
<html>
<head>
<meta charset="utf-8" />
<title>感情解析v4</title>
<style type="text/css">
div#form{
float: left;
background-color: #b2b2ff;
padding: 20px;
margin:10px,20px,0px,20px;
display: block;
width: 80%;
}
.input-form{
width: 70%;
height: 30px;
font-size: 100%;
}
.input-botton{
height: 30px;
}
div#log{
float: left;
background-color: #b2ffb2;
padding: 20px;
margin:10px,20px,0px,20px;
display: none;
width:80%;
}
div.credit{
display: block;
background-color: #d8ffb2;
padding: 20px;
margin:10px,20px,0px,20px;
float: left;
width: 80%;
}
div#result{
display: block;
padding: 20px;
margin:10px,20px,0px,20px;
background: #ffd8b2;
float: left;
width: 80%;
}
pre.var-dump{
margin:0 0 0 2em;
}
b.result{
font-size: 1.5em;
}
</style>
<!-- <script type="text/javascript">
function checkdiv( obj,id ) {
if( obj.checked ){
document.getElementById("log").style.display = "block";
}
else {
document.getElementById("log").style.display = "none";
}
}
</script> -->
</head>
<!--=====送信フォームここから=====-->
<body>
<div id="form">
<form class="a" method="post" action="index.php">
<input class="input-form" type="text" name="sentence" />
<input class="input-button" type="submit" />
<!-- <input type="checkbox" name="example" value="表示" onclick="checkdiv(this,'checkBox')">処理ログの表示 -->
</form>
</div>
<!--~~~~~~送信フォームここまで~~~~~~-->
<div id="result">
<?php
echo "「{$_POST['sentence']}」<br />";
include('./lib/Tsukushi.php');
$hoge = new Tsukushi([
'DB_host' => 'mysql',
'DB_user' => 'root',
'DB_pass' => 'password',
'DB_name' => 'kaken',
'APPID' => '',
'DB_word_score' => 'word_score_dic_table'
]);
echo "[{$hoge->DB_word_score}]: ".$hoge->getscore($_POST['sentence'])."<br>";
$huga = new Tsukushi([
'DB_host' => 'mysql',
'DB_user' => 'root',
'DB_pass' => 'password',
'DB_name' => 'kaken',
'APPID' => '',
'DB_word_score' => 'word_score_tweet_dic_table'
]);
echo "[{$huga->DB_word_score}]: ".$huga->getscore($_POST['sentence'])."<br>";
?>
</div>
<div class="credit">
<h2>Credit</h2>
<p style="margin-left: 15px;float: left;">
Hiroya Takamura, Takashi Inui, Manabu Okumura,<br>
"Extracting Semantic Orientations of Words using Spin Model",<br>
In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL2005) ,<br>
pages 133--140, 2005.
</p>
<!-- Begin Yahoo! JAPAN Web Services Attribution Snippet -->
<p style="float: left";>
<a href="http://developer.yahoo.co.jp/about">
<img src="http://i.yimg.jp/images/yjdn/yjdn_attbtn1_88_35.gif" width="88" height="35" title="Webサービス by Yahoo! JAPAN" alt="Web Services by Yahoo! JAPAN" border="0" style="margin:15px 15px 15px 15px">
</a>
</p>
<!-- End Yahoo! JAPAN Web Services Attribution Snippet -->
<p style="margin-left: 15px;padding-top: 15px" style="float: left;">
IPAdictionary IPA情報処理推進機構
</p>
</div>