Client   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A send() 0 7 1
A custom() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the strays/baidu-ai.
5
 *
6
 * (c) strays <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Strays\BaiDuAi\Language\Lexer;
13
14
use Strays\BaiDuAi\Kernel\BaseClient;
15
16
class Client extends BaseClient
17
{
18
    /**
19
     * 词法分析.
20
     *
21
     * @param string $text
22
     *
23
     * @return string
24
     */
25
    public function send(string $text)
26
    {
27
        $body = [
28
            'text' => $text,
29
        ];
30
31
        return $this->httpPostJson('/rpc/2.0/nlp/v1/lexer', $body);
32
    }
33
34
    /**
35
     * 词法分析定制.
36
     *
37
     * @param string $text
38
     *
39
     * @return string
40
     */
41
    public function custom(string $text)
42
    {
43
        $body = [
44
            'text' => $text,
45
        ];
46
47
        return $this->httpPostJson('/rpc/2.0/nlp/v1/lexer_custom', $body);
48
    }
49
}
50