1 | <?php |
||
10 | class ToneScore implements CreateableFromArray |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | const KEY_SCORE = 'score'; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | const KEY_ID = 'tone_id'; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | const KEY_NAME = 'tone_name'; |
||
26 | |||
27 | /** |
||
28 | * @var float |
||
29 | */ |
||
30 | private $score; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $id; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $name; |
||
41 | |||
42 | /** |
||
43 | * @param float $score |
||
44 | * @param string $id |
||
45 | * @param string $name |
||
46 | */ |
||
47 | public function __construct($score, $id, $name) |
||
53 | |||
54 | /** |
||
55 | * @param array $data |
||
56 | * |
||
57 | * @return \IBM\Watson\ToneAnalyzer\Model\ToneScore |
||
58 | */ |
||
59 | public static function create(array $data) |
||
67 | |||
68 | /** |
||
69 | * @return float |
||
70 | */ |
||
71 | public function getScore() |
||
75 | |||
76 | /** |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getId() |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getName() |
||
91 | } |
||
92 |