1 | <?php |
||
25 | class Word { |
||
26 | |||
27 | use IntegerPageTrait; |
||
28 | use StringContentTrait; |
||
29 | use StringTypeTrait; |
||
30 | |||
31 | /** |
||
32 | * Type "line break". |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | const TYPE_LINE_BREAK = "LB"; |
||
37 | |||
38 | /** |
||
39 | * Type "no line break". |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | const TYPE_NO_LINE_BREAK = "NLB"; |
||
44 | |||
45 | /** |
||
46 | * OCR confidence. |
||
47 | * |
||
48 | * @var float|null |
||
49 | */ |
||
50 | private $ocrConfidence; |
||
51 | |||
52 | /** |
||
53 | * Parent. |
||
54 | * |
||
55 | * @var Page|null |
||
56 | */ |
||
57 | private $parent; |
||
58 | |||
59 | /** |
||
60 | * Point 1. |
||
61 | * |
||
62 | * @var Point |
||
63 | */ |
||
64 | private $point1; |
||
65 | |||
66 | /** |
||
67 | * Point 2. |
||
68 | * |
||
69 | * @var Point |
||
70 | */ |
||
71 | private $point2; |
||
72 | |||
73 | /** |
||
74 | * Constructor. |
||
75 | */ |
||
76 | public function __construct() { |
||
80 | |||
81 | /** |
||
82 | * Get the OCR confidence. |
||
83 | * |
||
84 | * @return float|null Returns the OCR confidence. |
||
85 | */ |
||
86 | public function getOcrConfidence(): ?float { |
||
89 | |||
90 | /** |
||
91 | * Get the parent. |
||
92 | * |
||
93 | * @return Page|null Returns the parent. |
||
94 | */ |
||
95 | public function getParent(): ?Page { |
||
98 | |||
99 | /** |
||
100 | * Get the point 1. |
||
101 | * |
||
102 | * @return Point Returns the point 1 |
||
103 | */ |
||
104 | public function getPoint1(): Point { |
||
107 | |||
108 | /** |
||
109 | * Get the point 2. |
||
110 | * |
||
111 | * @return Point Returns the point 2. |
||
112 | */ |
||
113 | public function getPoint2(): Point { |
||
116 | |||
117 | /** |
||
118 | * Get the X1. |
||
119 | * |
||
120 | * @return float|null Returns the X1. |
||
121 | */ |
||
122 | public function getX1(): ?float { |
||
125 | |||
126 | /** |
||
127 | * Get the X2. |
||
128 | * |
||
129 | * @return float|null Returns the X2. |
||
130 | */ |
||
131 | public function getX2(): ?float { |
||
134 | |||
135 | /** |
||
136 | * Get the Y1. |
||
137 | * |
||
138 | * @return float|null Returns the Y1. |
||
139 | */ |
||
140 | public function getY1(): ?float { |
||
143 | |||
144 | /** |
||
145 | * Get the Y2. |
||
146 | * |
||
147 | * @return float|null Returns the Y2. |
||
148 | */ |
||
149 | public function getY2(): ?float { |
||
152 | |||
153 | /** |
||
154 | * Set the OCR confidence. |
||
155 | * |
||
156 | * @param float|null $ocrConfidence The OCR confidence. |
||
157 | * @return Word Returns this word. |
||
158 | */ |
||
159 | public function setOcrConfidence(?float $ocrConfidence): Word { |
||
163 | |||
164 | /** |
||
165 | * Set the parent. |
||
166 | * |
||
167 | * @param Page|null $parent The parent. |
||
168 | * @return Word Returns this word. |
||
169 | */ |
||
170 | public function setParent(Page $parent = null): Word { |
||
174 | |||
175 | /** |
||
176 | * Set the point 1. |
||
177 | * |
||
178 | * @param Point $point1 The point 1. |
||
179 | * @return Word Returns this word. |
||
180 | */ |
||
181 | protected function setPoint1(Point $point1): Word { |
||
185 | |||
186 | /** |
||
187 | * Set the point 2. |
||
188 | * |
||
189 | * @param Point $point2 The point 2. |
||
190 | * @return Word Returns this word. |
||
191 | */ |
||
192 | protected function setPoint2(Point $point2): Word { |
||
196 | |||
197 | /** |
||
198 | * Set the X1. |
||
199 | * |
||
200 | * @param float|null $x1 The X1. |
||
201 | * @return Word Returns this word. |
||
202 | */ |
||
203 | public function setX1(?float $x1): Word { |
||
207 | |||
208 | /** |
||
209 | * Set the X2. |
||
210 | * |
||
211 | * @param float|null $x2 The X2. |
||
212 | * @return Word Returns this word. |
||
213 | */ |
||
214 | public function setX2(?float $x2): Word { |
||
218 | |||
219 | /** |
||
220 | * Set the Y1. |
||
221 | * |
||
222 | * @param float|null $y1 The Y1. |
||
223 | * @return Word Returns this word. |
||
224 | */ |
||
225 | public function setY1(?float $y1): Word { |
||
229 | |||
230 | /** |
||
231 | * Set the Y2. |
||
232 | * |
||
233 | * @param float|null $y2 The Y2. |
||
234 | * @return Word Returns this word. |
||
235 | */ |
||
236 | public function setY2(?float $y2): Word { |
||
240 | } |