1 | <?php |
||
10 | class SentenceAnalysis implements CreateableFromArray |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | const KEY_ID = 'sentence_id'; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | const KEY_TEXT = 'text'; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | const KEY_TONES = 'tones'; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $id; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $text; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | private $tones; |
||
41 | |||
42 | /** |
||
43 | * @param string $id |
||
44 | * @param string $text |
||
45 | * @param array $tones |
||
46 | */ |
||
47 | public function __construct($id, $text, array $tones = []) |
||
53 | |||
54 | /** |
||
55 | * @param array $data |
||
56 | * |
||
57 | * @return \IBM\Watson\ToneAnalyzer\Model\SentenceAnalysis |
||
58 | */ |
||
59 | public static function create(array $data) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getId() |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getText() |
||
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | public function getTones() |
||
97 | } |
||
98 |