1 | <?php |
||
24 | class Tone extends AbstractApi |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | const ENDPOINT = '/tone'; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | const CONTENT_TYPE_TEXT_PLAIN = 'text/plain'; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | const CONTENT_TYPE_HTML = 'text/html'; |
||
40 | |||
41 | /** |
||
42 | * @var boolean |
||
43 | */ |
||
44 | private $isHtml; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | private $contentType; |
||
50 | |||
51 | /** |
||
52 | * @param string $text |
||
53 | * @param array $params |
||
54 | * |
||
55 | * @return mixed |
||
56 | * |
||
57 | * @throws \Http\Client\Exception |
||
58 | * @throws \IBM\Watson\Common\Exception\Domain\InsufficientPrivilegesException |
||
59 | * @throws \IBM\Watson\Common\Exception\Domain\NotFoundException |
||
60 | * @throws \IBM\Watson\Common\Exception\Domain\UnknownErrorException |
||
61 | * @throws \IBM\Watson\Common\Exception\Api\BadRequestException |
||
62 | */ |
||
63 | public function analyze($text, array $params = []) |
||
89 | |||
90 | /** |
||
91 | * Is supplied text html? |
||
92 | * |
||
93 | * @param bool $flag |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function isHtml($flag = false) |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | private function getContentType() |
||
114 | } |
||
115 |