forked from fukuball/CKIPClient-PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckip-test-driver-schedule.php
53 lines (40 loc) · 1.11 KB
/
ckip-test-driver-schedule.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
<?php
/**
* ckip-test-driver-schedule.php
*
* PHP version 5
*
* @category PHP
* @package /
* @author Fukuball Lin <[email protected]>
* @license No Licence
* @version Release: <1.0>
* @link http://[email protected]
*/
require_once "src/CKIPClient.php";
// change to yours
define("CKIP_SERVER", "000.000.000.000");
define("CKIP_PORT", 0000);
define("CKIP_USERNAME", "xxxxxx");
define("CKIP_PASSWORD", "xxxxxxxxx");
$ckip_client_obj = new CKIPClient(
CKIP_SERVER,
CKIP_PORT,
CKIP_USERNAME,
CKIP_PASSWORD
);
$raw_text = "獨立音樂需要大家一起來推廣,歡迎加入我們的行列。";
$raw_text = str_replace(",", "\n", $raw_text);
$raw_text = str_replace("。", "\n", $raw_text);
$raw_text = str_replace(",", "\n", $raw_text);
$raw_text = str_replace(".", "\n", $raw_text);
$raw_text_array = explode("\n", $raw_text);
$raw_text_array = array_filter($raw_text_array);
foreach ($raw_text_array as $raw_sentence) {
$return_text = $ckip_client_obj->send($raw_sentence);
echo $return_text;
$return_term = $ckip_client_obj->getTerm();
print_r($return_term);
sleep(5);
}
?>