nametag/nametag.cpp

filter: Statementstmt 32.6% 2162 / 6631 Branchbran 16.3% 1297 / 7952 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 23.7% 3459 / 14583 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/Ufal/NameTag.c ↑ Summary
1 // This file is part of NameTag <http://github.com/ufal/nametag/>.
2 //
3 // This file is a bundle of all sources and headers of NameTag library.
4 // Comments and copyrights of all individual files are kept.
5  
6 #include <algorithm>
7 #include <array>
8 #include <atomic>
9 #include <cassert>
10 #include <cmath>
11 #include <cstddef>
12 #include <cstdint>
13 #include <cstdlib>
14 #include <cstring>
15 #include <fstream>
16 #include <iomanip>
17 #include <iostream>
18 #include <iterator>
19 #include <limits>
20 #include <map>
21 #include <memory>
22 #include <random>
23 #include <sstream>
24 #include <stdexcept>
25 #include <string>
26 #include <unordered_map>
27 #include <unordered_set>
28 #include <utility>
29 #include <vector>
30  
31 namespace ufal {
32 namespace nametag {
33  
34 /////////
35 // File: utils/common.h
36 /////////
37  
38 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
39 //
40 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
41 // Mathematics and Physics, Charles University in Prague, Czech Republic.
42 //
43 // This Source Code Form is subject to the terms of the Mozilla Public
44 // License, v. 2.0. If a copy of the MPL was not distributed with this
45 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
46  
47 // Headers available in all sources
48  
49 namespace utils {
50  
51 using namespace std;
52  
53 // Assert that int is at least 4B
54 static_assert(sizeof(int) >= sizeof(int32_t), "Int must be at least 4B wide!");
55  
56 // Assert that we are on a little endian system
57 #ifdef __BYTE_ORDER__
58 static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, "Only little endian systems are supported!");
59 #endif
60  
61 #define runtime_failure(message) exit((cerr << message << endl, 1))
62  
63 } // namespace utils
64  
65 /////////
66 // File: common.h
67 /////////
68  
69 // This file is part of NameTag <http://github.com/ufal/nametag/>.
70 //
71 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
72 // Mathematics and Physics, Charles University in Prague, Czech Republic.
73 //
74 // This Source Code Form is subject to the terms of the Mozilla Public
75 // License, v. 2.0. If a copy of the MPL was not distributed with this
76 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
77  
78 using namespace utils;
79  
80 /////////
81 // File: classifier/classifier_outcome.h
82 /////////
83  
84 // This file is part of NameTag <http://github.com/ufal/nametag/>.
85 //
86 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
87 // Mathematics and Physics, Charles University in Prague, Czech Republic.
88 //
89 // This Source Code Form is subject to the terms of the Mozilla Public
90 // License, v. 2.0. If a copy of the MPL was not distributed with this
91 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
92  
93 typedef uint32_t classifier_outcome;
94  
95 /////////
96 // File: bilou/entity_type.h
97 /////////
98  
99 // This file is part of NameTag <http://github.com/ufal/nametag/>.
100 //
101 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
102 // Mathematics and Physics, Charles University in Prague, Czech Republic.
103 //
104 // This Source Code Form is subject to the terms of the Mozilla Public
105 // License, v. 2.0. If a copy of the MPL was not distributed with this
106 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
107  
108 typedef classifier_outcome entity_type;
109 enum :entity_type { entity_type_unknown = ~0U };
110  
111 /////////
112 // File: bilou/bilou_type.h
113 /////////
114  
115 // This file is part of NameTag <http://github.com/ufal/nametag/>.
116 //
117 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
118 // Mathematics and Physics, Charles University in Prague, Czech Republic.
119 //
120 // This Source Code Form is subject to the terms of the Mozilla Public
121 // License, v. 2.0. If a copy of the MPL was not distributed with this
122 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
123  
124 typedef unsigned bilou_type;
125 enum :bilou_type { bilou_type_B, bilou_type_I, bilou_type_L, bilou_type_O, bilou_type_U, bilou_type_total, bilou_type_unknown = ~0U };
126  
127 /////////
128 // File: bilou/bilou_probabilities.h
129 /////////
130  
131 // This file is part of NameTag <http://github.com/ufal/nametag/>.
132 //
133 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
134 // Mathematics and Physics, Charles University in Prague, Czech Republic.
135 //
136 // This Source Code Form is subject to the terms of the Mozilla Public
137 // License, v. 2.0. If a copy of the MPL was not distributed with this
138 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
139  
140 class bilou_probabilities {
141 public:
142 struct probability_info {
143 double probability;
144 entity_type entity;
145 };
146  
147 array<probability_info, bilou_type_total> bilou;
148 };
149  
150 class bilou_probabilities_global : public bilou_probabilities {
151 public:
152 bilou_type best;
153 array<bilou_type, bilou_type_total> previous;
154  
155 void init(const bilou_probabilities& local);
156 void update(const bilou_probabilities& local, const bilou_probabilities_global& prev);
157 };
158  
159 /////////
160 // File: bilou/bilou_probabilities.cpp
161 /////////
162  
163 // This file is part of NameTag <http://github.com/ufal/nametag/>.
164 //
165 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
166 // Mathematics and Physics, Charles University in Prague, Czech Republic.
167 //
168 // This Source Code Form is subject to the terms of the Mozilla Public
169 // License, v. 2.0. If a copy of the MPL was not distributed with this
170 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
171  
172 4 void bilou_probabilities_global::init(const bilou_probabilities& local) {
173 4 bilou = local.bilou;
174 4 ▶ previous.fill(bilou_type_unknown);
Branch: 1 branch
BranchTrueFalseTotal
previous.fill(bilou_type_unknown); 4 0 4
175  
176 4 best = bilou_type_B;
177 4 bilou[bilou_type_I].probability = 0;
178 4 bilou[bilou_type_L].probability = 0;
179 4 ▶ if (bilou[bilou_type_O].probability > bilou[best].probability) best = bilou_type_O;
Branch: 1 branch
BranchTrueFalseTotal
if (bilou[bilou_type_O].probability > bilou[best].probability) best = bilou_type_O; 4 0 4
180 4 ▶ if (bilou[bilou_type_U].probability > bilou[best].probability) best = bilou_type_U;
Branch: 1 branch
BranchTrueFalseTotal
if (bilou[bilou_type_U].probability > bilou[best].probability) best = bilou_type_U; 2 2 4
181 4 }
182  
183 10 void bilou_probabilities_global::update(const bilou_probabilities& local, const bilou_probabilities_global& prev) {
184 // Find the best of previous LOU
185 10 bilou_type best_LOU = bilou_type_L;
186 10 double best_LOU_prob = prev.bilou[bilou_type_L].probability;
187 10 ▶ if (prev.bilou[bilou_type_O].probability > best_LOU_prob) {
Branch: 1 branch
BranchTrueFalseTotal
if (prev.bilou[bilou_type_O].probability > best_LOU_prob) { 10 0 10
188 10 best_LOU = bilou_type_O;
189 10 best_LOU_prob = prev.bilou[bilou_type_O].probability;
190 }
191 10 ▶ if (prev.bilou[bilou_type_U].probability > best_LOU_prob) {
Branch: 1 branch
BranchTrueFalseTotal
if (prev.bilou[bilou_type_U].probability > best_LOU_prob) { 6 4 10
192 6 best_LOU = bilou_type_U;
193 6 best_LOU_prob = prev.bilou[bilou_type_U].probability;
194 }
195  
196 // Find the best of previous BI
197 10 bilou_type best_BI = bilou_type_B;
198 10 double best_BI_prob = prev.bilou[bilou_type_B].probability;
199 10 ▶ if (prev.bilou[bilou_type_I].probability > best_BI_prob) {
Branch: 1 branch
BranchTrueFalseTotal
if (prev.bilou[bilou_type_I].probability > best_BI_prob) { 0 10 10
200 0 best_BI = bilou_type_I;
201 0 best_BI_prob = prev.bilou[bilou_type_I].probability;
202 }
203  
204 // Normalize the best_*_prob probabilities
205 10 ▶ if (best_BI_prob > best_LOU_prob) {
Branch: 1 branch
BranchTrueFalseTotal
if (best_BI_prob > best_LOU_prob) { 0 10 10
206 0 best_LOU_prob /= best_BI_prob;
207 0 best_BI_prob = 1;
208 } else {
209 10 best_BI_prob /= best_LOU_prob;
210 10 best_LOU_prob = 1;
211 }
212  
213 // Store update probabilites
214 10 bilou[bilou_type_B].probability = best_LOU_prob * local.bilou[bilou_type_B].probability;
215 10 bilou[bilou_type_B].entity = local.bilou[bilou_type_B].entity;
216 10 previous[bilou_type_B] = best_LOU;
217 10 best = bilou_type_B;
218  
219 10 bilou[bilou_type_I].probability = best_BI_prob * local.bilou[bilou_type_I].probability;
220 10 bilou[bilou_type_I].entity = prev.bilou[best_BI].entity;
221 10 previous[bilou_type_I] = best_BI;
222 10 ▶ if (bilou[bilou_type_I].probability > bilou[best].probability) best = bilou_type_I;
Branch: 1 branch
BranchTrueFalseTotal
if (bilou[bilou_type_I].probability > bilou[best].probability) best = bilou_type_I; 0 10 10
223  
224 10 bilou[bilou_type_L].probability = best_BI_prob * local.bilou[bilou_type_L].probability;
225 10 bilou[bilou_type_L].entity = prev.bilou[best_BI].entity;
226 10 previous[bilou_type_L] = best_BI;
227 10 ▶ if (bilou[bilou_type_L].probability > bilou[best].probability) best = bilou_type_L;
Branch: 1 branch
BranchTrueFalseTotal
if (bilou[bilou_type_L].probability > bilou[best].probability) best = bilou_type_L; 0 10 10
228  
229 10 bilou[bilou_type_O].probability = best_LOU_prob * local.bilou[bilou_type_O].probability;
230 10 bilou[bilou_type_O].entity = local.bilou[bilou_type_O].entity;
231 10 previous[bilou_type_O] = best_LOU;
232 10 ▶ if (bilou[bilou_type_O].probability > bilou[best].probability) best = bilou_type_O;
Branch: 1 branch
BranchTrueFalseTotal
if (bilou[bilou_type_O].probability > bilou[best].probability) best = bilou_type_O; 10 0 10
233  
234 10 bilou[bilou_type_U].probability = best_LOU_prob * local.bilou[bilou_type_U].probability;
235 10 bilou[bilou_type_U].entity = local.bilou[bilou_type_U].entity;
236 10 previous[bilou_type_U] = best_LOU;
237 10 ▶ if (bilou[bilou_type_U].probability > bilou[best].probability) best = bilou_type_U;
Branch: 1 branch
BranchTrueFalseTotal
if (bilou[bilou_type_U].probability > bilou[best].probability) best = bilou_type_U; 4 6 10
238 10 }
239  
240 /////////
241 // File: classifier/classifier_feature.h
242 /////////
243  
244 // This file is part of NameTag <http://github.com/ufal/nametag/>.
245 //
246 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
247 // Mathematics and Physics, Charles University in Prague, Czech Republic.
248 //
249 // This Source Code Form is subject to the terms of the Mozilla Public
250 // License, v. 2.0. If a copy of the MPL was not distributed with this
251 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
252  
253 typedef uint32_t classifier_feature;
254 typedef vector<classifier_feature> classifier_features;
255  
256 /////////
257 // File: features/ner_feature.h
258 /////////
259  
260 // This file is part of NameTag <http://github.com/ufal/nametag/>.
261 //
262 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
263 // Mathematics and Physics, Charles University in Prague, Czech Republic.
264 //
265 // This Source Code Form is subject to the terms of the Mozilla Public
266 // License, v. 2.0. If a copy of the MPL was not distributed with this
267 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
268  
269 typedef classifier_feature ner_feature;
270 enum :ner_feature { ner_feature_unknown = ~0U };
271 typedef classifier_features ner_features;
272  
273 /////////
274 // File: bilou/ner_word.h
275 /////////
276  
277 // This file is part of NameTag <http://github.com/ufal/nametag/>.
278 //
279 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
280 // Mathematics and Physics, Charles University in Prague, Czech Republic.
281 //
282 // This Source Code Form is subject to the terms of the Mozilla Public
283 // License, v. 2.0. If a copy of the MPL was not distributed with this
284 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
285  
286 struct ner_word {
287 string form;
288 string raw_lemma;
289 vector<string> raw_lemmas_all;
290 string lemma_id;
291 string lemma_comments;
292 string tag;
293  
294 4 ner_word() {}
295 ner_word(const string& form) : form(form) {}
296 };
297  
298 /////////
299 // File: bilou/ner_sentence.h
300 /////////
301  
302 // This file is part of NameTag <http://github.com/ufal/nametag/>.
303 //
304 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
305 // Mathematics and Physics, Charles University in Prague, Czech Republic.
306 //
307 // This Source Code Form is subject to the terms of the Mozilla Public
308 // License, v. 2.0. If a copy of the MPL was not distributed with this
309 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
310  
311 struct ner_sentence {
312 unsigned size = 0;
313 vector<ner_word> words;
314 vector<ner_features> features;
315  
316 struct probability_info {
317 bilou_probabilities local;
318 bool local_filled;
319 bilou_probabilities_global global;
320 };
321 vector<probability_info> probabilities;
322  
323 struct previous_stage_info {
324 bilou_type bilou;
325 entity_type entity;
326 };
327 vector<previous_stage_info> previous_stage;
328  
329 void resize(unsigned size);
330 void clear_features();
331 void clear_probabilities_local_filled();
332 void clear_previous_stage();
333  
334 void compute_best_decoding();
335 void fill_previous_stage();
336 };
337  
338 /////////
339 // File: bilou/ner_sentence.cpp
340 /////////
341  
342 // This file is part of NameTag <http://github.com/ufal/nametag/>.
343 //
344 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
345 // Mathematics and Physics, Charles University in Prague, Czech Republic.
346 //
347 // This Source Code Form is subject to the terms of the Mozilla Public
348 // License, v. 2.0. If a copy of the MPL was not distributed with this
349 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
350  
351 4 void ner_sentence::resize(unsigned size) {
352 4 this->size = size;
353 4 ▶ if (words.size() < size) words.resize(size);
Branch: 1 branch
BranchTrueFalseTotal
if (words.size() < size) words.resize(size); 2 2 4
354 4 ▶ if (features.size() < size) features.resize(size);
Branch: 1 branch
BranchTrueFalseTotal
if (features.size() < size) features.resize(size); 2 2 4
355 4 ▶ if (probabilities.size() < size) probabilities.resize(size);
Branch: 1 branch
BranchTrueFalseTotal
if (probabilities.size() < size) probabilities.resize(size); 2 2 4
356 4 ▶ if (previous_stage.size() < size) previous_stage.resize(size);
Branch: 1 branch
BranchTrueFalseTotal
if (previous_stage.size() < size) previous_stage.resize(size); 2 2 4
357 4 }
358  
359 4 void ner_sentence::clear_features() {
360 18 ▶ for (unsigned i = 0; i < size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < size; i++) 14 4 18
361 14 features[i].clear();
362 4 }
363  
364 4 void ner_sentence::clear_probabilities_local_filled() {
365 18 ▶ for (unsigned i = 0; i < size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < size; i++) 14 4 18
366 14 probabilities[i].local_filled = false;
367 4 }
368  
369 2 void ner_sentence::clear_previous_stage() {
370 9 ▶ for (unsigned i = 0; i < size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < size; i++) { 7 2 9
371 7 previous_stage[i].bilou = bilou_type_unknown;
372 7 previous_stage[i].entity = entity_type_unknown;
373 }
374 2 }
375  
376 4 void ner_sentence::compute_best_decoding() {
377 // Find best L O U bilou_type for the last word
378 4 bilou_type best = bilou_type_L;
379 4 auto& last_bilou = probabilities[size - 1].global.bilou;
380 4 ▶ if (last_bilou[bilou_type_O].probability > last_bilou[best].probability) best = bilou_type_O;
Branch: 1 branch
BranchTrueFalseTotal
if (last_bilou[bilou_type_O].probability > last_bilou[best].probability) best = bilou_type_O; 4 0 4
381 4 ▶ if (last_bilou[bilou_type_U].probability > last_bilou[best].probability) best = bilou_type_U;
Branch: 1 branch
BranchTrueFalseTotal
if (last_bilou[bilou_type_U].probability > last_bilou[best].probability) best = bilou_type_U; 0 4 4
382 4 probabilities[size - 1].global.best = best;
383  
384 // Store the best bilou_type for all preceeding words
385 14 ▶ for (unsigned i = size - 1; i; i--) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = size - 1; i; i--) { 10 4 14
386 10 best = probabilities[i].global.previous[best];
387 10 probabilities[i - 1].global.best = best;
388 }
389 4 }
390  
391 4 void ner_sentence::fill_previous_stage() {
392 18 ▶ for (unsigned i = 0; i < size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < size; i++) { 14 4 18
393 14 previous_stage[i].bilou = probabilities[i].global.best;
394 14 previous_stage[i].entity = probabilities[i].global.bilou[probabilities[i].global.best].entity;
395 }
396 4 }
397  
398 /////////
399 // File: classifier/classifier_instance.h
400 /////////
401  
402 // This file is part of NameTag <http://github.com/ufal/nametag/>.
403 //
404 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
405 // Mathematics and Physics, Charles University in Prague, Czech Republic.
406 //
407 // This Source Code Form is subject to the terms of the Mozilla Public
408 // License, v. 2.0. If a copy of the MPL was not distributed with this
409 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
410  
411 class classifier_instance {
412 public:
413 classifier_features features;
414 classifier_outcome outcome;
415  
416 classifier_instance(const classifier_features& features, const classifier_outcome& outcome) : features(features), outcome(outcome) {}
417 };
418  
419 /////////
420 // File: classifier/network_parameters.h
421 /////////
422  
423 // This file is part of NameTag <http://github.com/ufal/nametag/>.
424 //
425 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
426 // Mathematics and Physics, Charles University in Prague, Czech Republic.
427 //
428 // This Source Code Form is subject to the terms of the Mozilla Public
429 // License, v. 2.0. If a copy of the MPL was not distributed with this
430 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
431  
432 struct network_parameters {
433 int iterations;
434 double missing_weight;
435 double initial_learning_rate;
436 double final_learning_rate;
437 double gaussian_sigma;
438 int hidden_layer; // Experimental use only.
439 };
440  
441 /////////
442 // File: utils/binary_decoder.h
443 /////////
444  
445 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
446 //
447 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
448 // Mathematics and Physics, Charles University in Prague, Czech Republic.
449 //
450 // This Source Code Form is subject to the terms of the Mozilla Public
451 // License, v. 2.0. If a copy of the MPL was not distributed with this
452 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
453  
454 namespace utils {
455  
456 //
457 // Declarations
458 //
459  
460 class binary_decoder_error : public runtime_error {
461 public:
462 0 explicit binary_decoder_error(const char* description) : runtime_error(description) {}
463 };
464  
465 class binary_decoder {
466 public:
467 inline unsigned char* fill(unsigned len);
468  
469 inline unsigned next_1B();
470 inline unsigned next_2B();
471 inline unsigned next_4B();
472 inline void next_str(string& str);
473 template <class T> inline const T* next(unsigned elements);
474  
475 inline bool is_end();
476 inline unsigned tell();
477 inline void seek(unsigned pos);
478  
479 private:
480 vector<unsigned char> buffer;
481 const unsigned char* data;
482 const unsigned char* data_end;
483 };
484  
485 //
486 // Definitions
487 //
488  
489 7 unsigned char* binary_decoder::fill(unsigned len) {
490 7 buffer.resize(len);
491 7 data = buffer.data();
492 7 data_end = buffer.data() + len;
493  
494 7 return buffer.data();
495 }
496  
497 313 unsigned binary_decoder::next_1B() {
498 313 ▶ if (data + 1 > data_end) throw binary_decoder_error("No more data in binary_decoder");
Branch: 2 branches
BranchTrueFalseTotal
if (data + 1 > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 313 313
if (data + 1 > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
499 313 return *data++;
500 }
501  
502 679 unsigned binary_decoder::next_2B() {
503 679 ▶ if (data + sizeof(uint16_t) > data_end) throw binary_decoder_error("No more data in binary_decoder");
Branch: 2 branches
BranchTrueFalseTotal
if (data + sizeof(uint16_t) > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 679 679
if (data + sizeof(uint16_t) > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
504 uint16_t result;
505 679 memcpy(&result, data, sizeof(uint16_t));
506 679 data += sizeof(uint16_t);
507 679 return result;
508 }
509  
510 516 unsigned binary_decoder::next_4B() {
511 516 ▶ if (data + sizeof(uint32_t) > data_end) throw binary_decoder_error("No more data in binary_decoder");
Branch: 2 branches
BranchTrueFalseTotal
if (data + sizeof(uint32_t) > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 516 516
if (data + sizeof(uint32_t) > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
512 uint32_t result;
513 516 memcpy(&result, data, sizeof(uint32_t));
514 516 data += sizeof(uint32_t);
515 516 return result;
516 }
517  
518 46 void binary_decoder::next_str(string& str) {
519 46 unsigned len = next_1B();
520 46 ▶ if (len == 255) len = next_4B();
Branch: 1 branch
BranchTrueFalseTotal
if (len == 255) len = next_4B(); 0 46 46
521 46 str.assign(next<char>(len), len);
522 46 }
523  
524 489 template <class T> const T* binary_decoder::next(unsigned elements) {
525 489 ▶ if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder");
Branch: 8 branches
BranchTrueFalseTotal
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 116 116
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 253 253
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 2 2
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 118 118
if (data + sizeof(T) * elements > data_end) throw binary_decoder_error("No more data in binary_decoder"); 0 0 0
526 489 const T* result = (const T*) data;
527 489 data += sizeof(T) * elements;
528 489 return result;
529 }
530  
531 7 bool binary_decoder::is_end() {
532 7 return data >= data_end;
533 }
534  
535 1 unsigned binary_decoder::tell() {
536 1 return data - buffer.data();
537 }
538  
539 1 void binary_decoder::seek(unsigned pos) {
540 1 ▶ if (pos > buffer.size()) throw binary_decoder_error("Cannot seek past end of binary_decoder");
Branch: 2 branches
BranchTrueFalseTotal
if (pos > buffer.size()) throw binary_decoder_error("Cannot seek past end of binary_decoder"); 0 1 1
if (pos > buffer.size()) throw binary_decoder_error("Cannot seek past end of binary_decoder"); 0 0 0
541 1 data = buffer.data() + pos;
542 1 }
543  
544 } // namespace utils
545  
546 /////////
547 // File: utils/string_piece.h
548 /////////
549  
550 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
551 //
552 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
553 // Mathematics and Physics, Charles University in Prague, Czech Republic.
554 //
555 // This Source Code Form is subject to the terms of the Mozilla Public
556 // License, v. 2.0. If a copy of the MPL was not distributed with this
557 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
558  
559 namespace utils {
560  
561 struct string_piece {
562 const char* str;
563 size_t len;
564  
565 4 string_piece() : str(nullptr), len(0) {}
566 3 string_piece(const char* str) : str(str), len(strlen(str)) {}
567 37 string_piece(const char* str, size_t len) : str(str), len(len) {}
568 50 string_piece(const string& str) : str(str.c_str()), len(str.size()) {}
569 };
570  
571 0 inline ostream& operator<<(ostream& os, const string_piece& str) {
572 0 return os.write(str.str, str.len);
573 }
574  
575 0 inline bool operator==(const string_piece& a, const string_piece& b) {
576 0 ▶ return a.len == b.len && memcmp(a.str, b.str, a.len) == 0;
Branch: 2 branches
BranchTrueFalseTotal
return a.len == b.len && memcmp(a.str, b.str, a.len) == 0; 0 0 0
return a.len == b.len && memcmp(a.str, b.str, a.len) == 0; 0 0 0
577 }
578  
579 inline bool operator!=(const string_piece& a, const string_piece& b) {
580 return a.len != b.len || memcmp(a.str, b.str, a.len) != 0;
581 }
582  
583 } // namespace utils
584  
585 /////////
586 // File: utils/binary_encoder.h
587 /////////
588  
589 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
590 //
591 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
592 // Mathematics and Physics, Charles University in Prague, Czech Republic.
593 //
594 // This Source Code Form is subject to the terms of the Mozilla Public
595 // License, v. 2.0. If a copy of the MPL was not distributed with this
596 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
597  
598 namespace utils {
599  
600 //
601 // Declarations
602 //
603  
604 class binary_encoder {
605 public:
606 inline binary_encoder();
607  
608 inline void add_1B(unsigned val);
609 inline void add_2B(unsigned val);
610 inline void add_4B(unsigned val);
611 inline void add_float(double val);
612 inline void add_double(double val);
613 inline void add_str(string_piece str);
614 inline void add_data(string_piece data);
615 template <class T> inline void add_data(const vector<T>& data);
616 template <class T> inline void add_data(const T* data, size_t elements);
617  
618 vector<unsigned char> data;
619 };
620  
621 //
622 // Definitions
623 //
624  
625 binary_encoder::binary_encoder() {
626 data.reserve(16);
627 }
628  
629 0 void binary_encoder::add_1B(unsigned val) {
630 0 ▶ if (uint8_t(val) != val) runtime_failure("Should encode value " << val << " in one byte!");
Branch: 1 branch
BranchTrueFalseTotal
if (uint8_t(val) != val) runtime_failure("Should encode value " << val << " in one byte!"); 0 0 0
631 0 ▶ data.push_back(val);
Branch: 1 branch
BranchTrueFalseTotal
data.push_back(val); 0 0 0
632 0 }
633  
634 void binary_encoder::add_2B(unsigned val) {
635 if (uint16_t(val) != val) runtime_failure("Should encode value " << val << " in two bytes!");
636 data.insert(data.end(), (unsigned char*) &val, ((unsigned char*) &val) + sizeof(uint16_t));
637 }
638  
639 0 void binary_encoder::add_4B(unsigned val) {
640 if (uint32_t(val) != val) runtime_failure("Should encode value " << val << " in four bytes!");
641 0 ▶ data.insert(data.end(), (unsigned char*) &val, ((unsigned char*) &val) + sizeof(uint32_t));
Branch: 1 branch
BranchTrueFalseTotal
data.insert(data.end(), (unsigned char*) &val, ((unsigned char*) &val) + sizeof(uint32_t)); 0 0 0
642 0 }
643  
644 void binary_encoder::add_float(double val) {
645 data.insert(data.end(), (unsigned char*) &val, ((unsigned char*) &val) + sizeof(float));
646 }
647  
648 void binary_encoder::add_double(double val) {
649 data.insert(data.end(), (unsigned char*) &val, ((unsigned char*) &val) + sizeof(double));
650 }
651  
652 0 void binary_encoder::add_str(string_piece str) {
653 0 add_1B(str.len < 255 ? str.len : 255);
654 0 ▶ if (!(str.len < 255)) add_4B(str.len);
Branch: 1 branch
BranchTrueFalseTotal
if (!(str.len < 255)) add_4B(str.len); 0 0 0
655 0 add_data(str);
656 0 }
657  
658 0 void binary_encoder::add_data(string_piece data) {
659 0 ▶ this->data.insert(this->data.end(), (const unsigned char*) data.str, (const unsigned char*) (data.str + data.len));
Branch: 1 branch
BranchTrueFalseTotal
this->data.insert(this->data.end(), (const unsigned char*) data.str, (const unsigned char*) (data.str + data.len)); 0 0 0
660 0 }
661  
662 template <class T>
663 void binary_encoder::add_data(const vector<T>& data) {
664 this->data.insert(this->data.end(), (const unsigned char*) data.data(), (const unsigned char*) (data.data() + data.size()));
665 }
666  
667 template <class T>
668 void binary_encoder::add_data(const T* data, size_t elements) {
669 this->data.insert(this->data.end(), (const unsigned char*) data, (const unsigned char*) (data + elements));
670 }
671  
672 } // namespace utils
673  
674 /////////
675 // File: classifier/network_classifier.h
676 /////////
677  
678 // This file is part of NameTag <http://github.com/ufal/nametag/>.
679 //
680 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
681 // Mathematics and Physics, Charles University in Prague, Czech Republic.
682 //
683 // This Source Code Form is subject to the terms of the Mozilla Public
684 // License, v. 2.0. If a copy of the MPL was not distributed with this
685 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
686  
687 class network_classifier {
688 public:
689 bool load(istream& is);
690 bool save(ostream& os);
691  
692 bool train(unsigned features, unsigned outcomes, const vector<classifier_instance>& train,
693 const vector<classifier_instance>& heldout, const network_parameters& parameters, bool verbose);
694  
695 void classify(const classifier_features& features, vector<double>& outcomes, vector<double>& buffer) const;
696  
697 private:
698 // Direct connections
699 vector<vector<float>> weights;
700 vector<vector<uint32_t>> indices;
701 double missing_weight;
702  
703 // Hidden layer, experimental use only
704 vector<vector<float>> hidden_weights[2];
705 vector<double> hidden_layer, hidden_error;
706  
707 // Output layer
708 vector<double> output_layer, output_error;
709  
710 inline void propagate(const classifier_features& features);
711 inline void propagate(const classifier_features& features, vector<double>& hidden_layer, vector<double>& output_layer) const;
712 inline void backpropagate(const classifier_instance& instance, double learning_rate, double gaussian_sigma);
713 inline classifier_outcome best_outcome();
714  
715 template<class T> void load_matrix(binary_decoder& data, vector<vector<T>>& m);
716 template<class T> void save_matrix(binary_encoder& enc, const vector<vector<T>>& m);
717 };
718  
719 /////////
720 // File: utils/compressor.h
721 /////////
722  
723 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
724 //
725 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
726 // Mathematics and Physics, Charles University in Prague, Czech Republic.
727 //
728 // This Source Code Form is subject to the terms of the Mozilla Public
729 // License, v. 2.0. If a copy of the MPL was not distributed with this
730 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
731  
732 namespace utils {
733  
734 class binary_decoder;
735 class binary_encoder;
736  
737 class compressor {
738 public:
739 static bool load(istream& is, binary_decoder& data);
740 static bool save(ostream& os, const binary_encoder& enc);
741 };
742  
743 } // namespace utils
744  
745 /////////
746 // File: utils/unaligned_access.h
747 /////////
748  
749 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
750 //
751 // Copyright 2017 Institute of Formal and Applied Linguistics, Faculty of
752 // Mathematics and Physics, Charles University in Prague, Czech Republic.
753 //
754 // This Source Code Form is subject to the terms of the Mozilla Public
755 // License, v. 2.0. If a copy of the MPL was not distributed with this
756 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
757  
758 namespace utils {
759  
760 //
761 // Declarations
762 //
763  
764 template<class T, class P>
765 inline T unaligned_load(const P* ptr);
766  
767 template<class T, class P>
768 inline T unaligned_load_inc(const P*& ptr);
769  
770 template<class T, class P>
771 inline void unaligned_store(P* ptr, T value);
772  
773 template<class T, class P>
774 inline void unaligned_store_inc(P*& ptr, T value);
775  
776 template<class T>
777 T* unaligned_lower_bound(T* first, size_t size, T val);
778  
779 template<class T>
780 T* unaligned_upper_bound(T* first, size_t size, T val);
781  
782 //
783 // Definitions
784 //
785  
786 template<class T, class P>
787 0 inline T unaligned_load(const P* ptr) {
788 T value;
789 0 memcpy(&value, ptr, sizeof(T));
790 0 return value;
791 }
792  
793 template<class T, class P>
794 0 inline T unaligned_load_inc(const P*& ptr) {
795 T value;
796 0 memcpy(&value, ptr, sizeof(T));
797 0 ((const char*&)ptr) += sizeof(T);
798 0 return value;
799 }
800  
801 template<class T, class P>
802 0 inline void unaligned_store(P* ptr, T value) {
803 0 memcpy(ptr, &value, sizeof(T));
804 0 }
805  
806 template<class T, class P>
807 42 inline void unaligned_store_inc(P*& ptr, T value) {
808 42 memcpy(ptr, &value, sizeof(T));
809 42 ((char*&)ptr) += sizeof(T);
810 42 }
811  
812 template<class T>
813 10 T* unaligned_lower_bound(T* first, size_t size, T val) {
814 26 ▶ while (size) {
Branch: 1 branch
BranchTrueFalseTotal
while (size) { 16 10 26
815 16 size_t step = size >> 1;
816 16 ▶ if (unaligned_load<T>(first + step) < val) {
Branch: 1 branch
BranchTrueFalseTotal
if (unaligned_load<T>(first + step) < val) { 6 10 16
817 6 first += step + 1;
818 6 size -= step + 1;
819 } else {
820 10 size = step;
821 }
822 }
823 10 return first;
824 }
825  
826 template<class T>
827 T* unaligned_upper_bound(T* first, size_t size, T val) {
828 while (size) {
829 size_t step = size >> 1;
830 if (!(val < unaligned_load<T>(first + step))) {
831 first += step + 1;
832 size -= step + 1;
833 } else {
834 size = step;
835 }
836 }
837 return first;
838 }
839  
840 } // namespace utils
841  
842 /////////
843 // File: classifier/network_classifier.cpp
844 /////////
845  
846 // This file is part of NameTag <http://github.com/ufal/nametag/>.
847 //
848 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
849 // Mathematics and Physics, Charles University in Prague, Czech Republic.
850 //
851 // This Source Code Form is subject to the terms of the Mozilla Public
852 // License, v. 2.0. If a copy of the MPL was not distributed with this
853 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
854  
855 2 bool network_classifier::load(istream& is) {
856 2 binary_decoder data;
857 2 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 2 0 2
if (!compressor::load(is, data)) return false; 0 2 2
858  
859 try {
860 // Direct connections
861 2 ▶ load_matrix(data, indices);
Branch: 1 branch
BranchTrueFalseTotal
load_matrix(data, indices); 2 0 2
862 2 ▶ missing_weight = unaligned_load<double>(data.next<double>(1));
Branch: 1 branch
BranchTrueFalseTotal
missing_weight = unaligned_load<double>(data.next<double>(1)); 2 0 2
863 2 ▶ load_matrix(data, weights);
Branch: 1 branch
BranchTrueFalseTotal
load_matrix(data, weights); 2 0 2
864  
865 // Hidden layer
866 2 hidden_weights[0].clear();
867 2 hidden_weights[1].clear();
868 2 ▶ hidden_layer.resize(data.next_2B());
Branch: 2 branches
BranchTrueFalseTotal
hidden_layer.resize(data.next_2B()); 2 0 2
hidden_layer.resize(data.next_2B()); 2 0 2
869 2 ▶ if (!hidden_layer.empty()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!hidden_layer.empty()) { 0 2 2
870 0 ▶ load_matrix(data, hidden_weights[0]);
Branch: 1 branch
BranchTrueFalseTotal
load_matrix(data, hidden_weights[0]); 0 0 0
871 0 ▶ load_matrix(data, hidden_weights[1]);
Branch: 1 branch
BranchTrueFalseTotal
load_matrix(data, hidden_weights[1]); 0 0 0
872 }
873  
874 // Output layer
875 2 ▶ unsigned outcomes = data.next_2B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned outcomes = data.next_2B(); 2 0 2
876 2 ▶ output_layer.resize(outcomes);
Branch: 1 branch
BranchTrueFalseTotal
output_layer.resize(outcomes); 2 0 2
877 2 ▶ output_error.resize(outcomes);
Branch: 2 branches
BranchTrueFalseTotal
output_error.resize(outcomes); 2 0 2
output_error.resize(outcomes); 0 0 0
878 } catch (binary_decoder_error&) {
879 return false;
880 }
881  
882 2 return data.is_end();
883 2 }
884  
885 template<class T>
886 4 void network_classifier::load_matrix(binary_decoder& data, vector<vector<T>>& m) {
887 4 m.resize(data.next_4B());
888 664 ▶ for (auto&& row : m) {
Branch: 2 branches
BranchTrueFalseTotal
for (auto&& row : m) { 330 2 332
for (auto&& row : m) { 330 2 332
889 660 ▶ row.resize(data.next_2B());
Branch: 4 branches
BranchTrueFalseTotal
row.resize(data.next_2B()); 330 0 330
row.resize(data.next_2B()); 330 0 330
row.resize(data.next_2B()); 330 0 330
row.resize(data.next_2B()); 330 0 330
890 660 ▶ if (!row.empty())
Branch: 2 branches
BranchTrueFalseTotal
if (!row.empty()) 116 214 330
if (!row.empty()) 116 214 330
891 232 ▶ memcpy((unsigned char*) row.data(), data.next<T>(row.size()), row.size() * sizeof(T));
Branch: 2 branches
BranchTrueFalseTotal
memcpy((unsigned char*) row.data(), data.next<T>(row.size()), row.size() * sizeof(T)); 116 0 116
memcpy((unsigned char*) row.data(), data.next<T>(row.size()), row.size() * sizeof(T)); 116 0 116
892 }
893 4 }
894  
895 0 bool network_classifier::train(unsigned features, unsigned outcomes, const vector<classifier_instance>& train,
896 const vector<classifier_instance>& heldout, const network_parameters& parameters, bool verbose) {
897 // Assertions
898 0 ▶ if (features <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; }
Branch: 4 branches
BranchTrueFalseTotal
if (features <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
if (features <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
if (features <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
if (features <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
899 0 ▶ if (outcomes <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; }
Branch: 4 branches
BranchTrueFalseTotal
if (outcomes <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
if (outcomes <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
if (outcomes <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
if (outcomes <= 0) { if (verbose) cerr << "There must be more than zero features!" << endl; return false; } 0 0 0
900 0 ▶ if (train.empty()) { if (verbose) cerr << "No training data!" << endl; return false; }
Branch: 4 branches
BranchTrueFalseTotal
if (train.empty()) { if (verbose) cerr << "No training data!" << endl; return false; } 0 0 0
if (train.empty()) { if (verbose) cerr << "No training data!" << endl; return false; } 0 0 0
if (train.empty()) { if (verbose) cerr << "No training data!" << endl; return false; } 0 0 0
if (train.empty()) { if (verbose) cerr << "No training data!" << endl; return false; } 0 0 0
901 0 ▶ for (auto&& instance : train) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& instance : train) { 0 0 0
902 0 ▶ if (instance.outcome >= outcomes) { if (verbose) cerr << "Training instances out of range!" << endl; return false; }
Branch: 4 branches
BranchTrueFalseTotal
if (instance.outcome >= outcomes) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
if (instance.outcome >= outcomes) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
if (instance.outcome >= outcomes) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
if (instance.outcome >= outcomes) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
903 0 ▶ for(auto& feature : instance.features)
Branch: 1 branch
BranchTrueFalseTotal
for(auto& feature : instance.features) 0 0 0
904 0 ▶ if (feature >= features) { if (verbose) cerr << "Training instances out of range!" << endl; return false; }
Branch: 4 branches
BranchTrueFalseTotal
if (feature >= features) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
if (feature >= features) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
if (feature >= features) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
if (feature >= features) { if (verbose) cerr << "Training instances out of range!" << endl; return false; } 0 0 0
905 }
906 0 ▶ for (auto&& instance : heldout)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& instance : heldout) 0 0 0
907 0 ▶ for(auto& feature : instance.features)
Branch: 1 branch
BranchTrueFalseTotal
for(auto& feature : instance.features) 0 0 0
908 0 ▶ if (feature >= features) { if (verbose) cerr << "Heldout instances out of range!" << endl; return false; }
Branch: 4 branches
BranchTrueFalseTotal
if (feature >= features) { if (verbose) cerr << "Heldout instances out of range!" << endl; return false; } 0 0 0
if (feature >= features) { if (verbose) cerr << "Heldout instances out of range!" << endl; return false; } 0 0 0
if (feature >= features) { if (verbose) cerr << "Heldout instances out of range!" << endl; return false; } 0 0 0
if (feature >= features) { if (verbose) cerr << "Heldout instances out of range!" << endl; return false; } 0 0 0
909  
910 0 ▶ mt19937 generator(42);
Branch: 1 branch
BranchTrueFalseTotal
mt19937 generator(42); 0 0 0
911 0 ▶ uniform_real_distribution<float> uniform(-0.1f, 0.1f);
Branch: 1 branch
BranchTrueFalseTotal
uniform_real_distribution<float> uniform(-0.1f, 0.1f); 0 0 0
912  
913 // Compute indices from existing feature-outcome pairs
914 0 indices.clear();
915 0 ▶ indices.resize(features);
Branch: 1 branch
BranchTrueFalseTotal
indices.resize(features); 0 0 0
916 0 ▶ for (auto&& instance : train)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& instance : train) 0 0 0
917 0 ▶ for (auto&& feature : instance.features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : instance.features) 0 0 0
918 0 ▶ indices[feature].emplace_back(instance.outcome);
Branch: 1 branch
BranchTrueFalseTotal
indices[feature].emplace_back(instance.outcome); 0 0 0
919  
920 0 ▶ for (auto&& row : indices) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& row : indices) { 0 0 0
921 0 ▶ sort(row.begin(), row.end());
Branch: 1 branch
BranchTrueFalseTotal
sort(row.begin(), row.end()); 0 0 0
922 0 ▶ row.resize(unique(row.begin(), row.end()) - row.begin());
Branch: 2 branches
BranchTrueFalseTotal
row.resize(unique(row.begin(), row.end()) - row.begin()); 0 0 0
row.resize(unique(row.begin(), row.end()) - row.begin()); 0 0 0
923 }
924  
925 // Initialize direct connections
926 0 weights.clear();
927 0 ▶ for (auto&& row : indices)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& row : indices) 0 0 0
928 0 ▶ weights.emplace_back(row.size());
Branch: 1 branch
BranchTrueFalseTotal
weights.emplace_back(row.size()); 0 0 0
929 0 missing_weight = parameters.missing_weight;
930  
931 // Initialize hidden layer
932 0 ▶ hidden_layer.resize(parameters.hidden_layer);
Branch: 1 branch
BranchTrueFalseTotal
hidden_layer.resize(parameters.hidden_layer); 0 0 0
933 0 ▶ if (!hidden_layer.empty()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!hidden_layer.empty()) { 0 0 0
934 0 ▶ hidden_error.resize(hidden_layer.size());
Branch: 1 branch
BranchTrueFalseTotal
hidden_error.resize(hidden_layer.size()); 0 0 0
935  
936 0 ▶ hidden_weights[0].resize(features);
Branch: 1 branch
BranchTrueFalseTotal
hidden_weights[0].resize(features); 0 0 0
937 0 ▶ for (auto&& row : hidden_weights[0])
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& row : hidden_weights[0]) 0 0 0
938 0 ▶ for (auto&& weight : row.resize(hidden_layer.size()), row)
Branch: 2 branches
BranchTrueFalseTotal
for (auto&& weight : row.resize(hidden_layer.size()), row) 0 0 0
for (auto&& weight : row.resize(hidden_layer.size()), row) 0 0 0
939 0 ▶ weight = uniform(generator) + uniform(generator) + uniform(generator);
Branch: 3 branches
BranchTrueFalseTotal
weight = uniform(generator) + uniform(generator) + uniform(generator); 0 0 0
weight = uniform(generator) + uniform(generator) + uniform(generator); 0 0 0
weight = uniform(generator) + uniform(generator) + uniform(generator); 0 0 0
940  
941 0 ▶ hidden_weights[1].resize(hidden_layer.size());
Branch: 1 branch
BranchTrueFalseTotal
hidden_weights[1].resize(hidden_layer.size()); 0 0 0
942 0 ▶ for (auto&& row : hidden_weights[1])
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& row : hidden_weights[1]) 0 0 0
943 0 ▶ for (auto&& weight : row.resize(outcomes), row)
Branch: 2 branches
BranchTrueFalseTotal
for (auto&& weight : row.resize(outcomes), row) 0 0 0
for (auto&& weight : row.resize(outcomes), row) 0 0 0
944 0 ▶ weight = uniform(generator) + uniform(generator) + uniform(generator);
Branch: 3 branches
BranchTrueFalseTotal
weight = uniform(generator) + uniform(generator) + uniform(generator); 0 0 0
weight = uniform(generator) + uniform(generator) + uniform(generator); 0 0 0
weight = uniform(generator) + uniform(generator) + uniform(generator); 0 0 0
945 }
946  
947 // Initialize output layer
948 0 ▶ output_layer.resize(outcomes);
Branch: 1 branch
BranchTrueFalseTotal
output_layer.resize(outcomes); 0 0 0
949 0 ▶ output_error.resize(outcomes);
Branch: 1 branch
BranchTrueFalseTotal
output_error.resize(outcomes); 0 0 0
950  
951 // Normalize gaussian_sigma
952 0 double gaussian_sigma = parameters.gaussian_sigma / train.size();
953  
954 // Train
955 0 vector<int> permutation;
956 0 ▶ for (unsigned i = 0; i < train.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < train.size(); i++) 0 0 0
957 0 ▶ permutation.push_back(i);
Branch: 1 branch
BranchTrueFalseTotal
permutation.push_back(i); 0 0 0
958  
959 0 ▶ for (int iteration = 0; iteration < parameters.iterations; iteration++) {
Branch: 1 branch
BranchTrueFalseTotal
for (int iteration = 0; iteration < parameters.iterations; iteration++) { 0 0 0
960 0 ▶ if (verbose) cerr << "Iteration " << iteration + 1 << ": ";
Branch: 4 branches
BranchTrueFalseTotal
if (verbose) cerr << "Iteration " << iteration + 1 << ": "; 0 0 0
if (verbose) cerr << "Iteration " << iteration + 1 << ": "; 0 0 0
if (verbose) cerr << "Iteration " << iteration + 1 << ": "; 0 0 0
if (verbose) cerr << "Iteration " << iteration + 1 << ": "; 0 0 0
961  
962 0 ▶ double learning_rate = parameters.final_learning_rate && parameters.iterations > 1 ?
Branch: 2 branches
BranchTrueFalseTotal
double learning_rate = parameters.final_learning_rate && parameters.iterations > 1 ? 0 0 0
double learning_rate = parameters.final_learning_rate && parameters.iterations > 1 ? 0 0 0
963 0 exp(((parameters.iterations - 1 - iteration) * log(parameters.initial_learning_rate) + iteration * log(parameters.final_learning_rate)) / (parameters.iterations-1)) :
964 0 parameters.initial_learning_rate;
965 0 double logprob = 0;
966 0 int training_correct = 0;
967  
968 // Process instances in random order
969 0 ▶ shuffle(permutation.begin(), permutation.end(), generator);
Branch: 1 branch
BranchTrueFalseTotal
shuffle(permutation.begin(), permutation.end(), generator); 0 0 0
970 0 ▶ for (auto&& train_index : permutation) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& train_index : permutation) { 0 0 0
971 0 auto& instance = train[train_index];
972 0 ▶ propagate(instance.features);
Branch: 1 branch
BranchTrueFalseTotal
propagate(instance.features); 0 0 0
973  
974 // Update logprob and training_correct
975 0 logprob += log(output_layer[instance.outcome]);
976 0 training_correct += best_outcome() == instance.outcome;
977  
978 // Improve network weights according to correct outcome
979 0 backpropagate(instance, learning_rate, gaussian_sigma);
980 }
981 0 ▶ if (verbose)
Branch: 1 branch
BranchTrueFalseTotal
if (verbose) 0 0 0
982 0 ▶ cerr << "a " << fixed << setprecision(3) << learning_rate
Branch: 3 branches
BranchTrueFalseTotal
cerr << "a " << fixed << setprecision(3) << learning_rate 0 0 0
cerr << "a " << fixed << setprecision(3) << learning_rate 0 0 0
cerr << "a " << fixed << setprecision(3) << learning_rate 0 0 0
983 0 ▶ << ", logprob " << scientific << setprecision(4) << logprob
Branch: 3 branches
BranchTrueFalseTotal
<< ", logprob " << scientific << setprecision(4) << logprob 0 0 0
<< ", logprob " << scientific << setprecision(4) << logprob 0 0 0
<< ", logprob " << scientific << setprecision(4) << logprob 0 0 0
984 0 ▶ << ", training acc " << fixed << setprecision(2) << training_correct * 100. / train.size()
Branch: 3 branches
BranchTrueFalseTotal
<< ", training acc " << fixed << setprecision(2) << training_correct * 100. / train.size() 0 0 0
<< ", training acc " << fixed << setprecision(2) << training_correct * 100. / train.size() 0 0 0
<< ", training acc " << fixed << setprecision(2) << training_correct * 100. / train.size() 0 0 0
985 0 ▶ << "%, ";
Branch: 1 branch
BranchTrueFalseTotal
<< "%, "; 0 0 0
986  
987 // Evaluate heldout accuracy if heldout data are present
988 0 ▶ if (!heldout.empty()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!heldout.empty()) { 0 0 0
989 0 int heldout_correct = 0;
990 0 ▶ for (auto&& instance : heldout) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& instance : heldout) { 0 0 0
991 0 ▶ propagate(instance.features);
Branch: 1 branch
BranchTrueFalseTotal
propagate(instance.features); 0 0 0
992 0 heldout_correct += best_outcome() == instance.outcome;
993 }
994 0 ▶ if (verbose) cerr << "heldout acc " << heldout_correct * 100. / heldout.size() << ", ";
Branch: 4 branches
BranchTrueFalseTotal
if (verbose) cerr << "heldout acc " << heldout_correct * 100. / heldout.size() << ", "; 0 0 0
if (verbose) cerr << "heldout acc " << heldout_correct * 100. / heldout.size() << ", "; 0 0 0
if (verbose) cerr << "heldout acc " << heldout_correct * 100. / heldout.size() << ", "; 0 0 0
if (verbose) cerr << "heldout acc " << heldout_correct * 100. / heldout.size() << ", "; 0 0 0
995 }
996 0 ▶ if (verbose) cerr << "done." << endl;
Branch: 3 branches
BranchTrueFalseTotal
if (verbose) cerr << "done." << endl; 0 0 0
if (verbose) cerr << "done." << endl; 0 0 0
if (verbose) cerr << "done." << endl; 0 0 0
997 }
998 0 return true;
999 0 }
1000  
1001 14 void network_classifier::classify(const classifier_features& features, vector<double>& outcomes, vector<double>& buffer) const {
1002 14 ▶ if (outcomes.size() != output_layer.size()) outcomes.resize(output_layer.size());
Branch: 1 branch
BranchTrueFalseTotal
if (outcomes.size() != output_layer.size()) outcomes.resize(output_layer.size()); 1 13 14
1003 14 ▶ if (buffer.size() != hidden_layer.size()) buffer.resize(hidden_layer.size());
Branch: 1 branch
BranchTrueFalseTotal
if (buffer.size() != hidden_layer.size()) buffer.resize(hidden_layer.size()); 0 14 14
1004  
1005 // Propagation
1006 14 propagate(features, buffer, outcomes);
1007 14 }
1008  
1009 0 void network_classifier::propagate(const classifier_features& features) {
1010 0 propagate(features, hidden_layer, output_layer);
1011 0 }
1012  
1013 14 void network_classifier::propagate(const classifier_features& features, vector<double>& hidden_layer, vector<double>& output_layer) const {
1014 14 ▶ output_layer.assign(output_layer.size(), features.size() * missing_weight);
Branch: 1 branch
BranchTrueFalseTotal
output_layer.assign(output_layer.size(), features.size() * missing_weight); 14 0 14
1015  
1016 // Direct connections
1017 305 ▶ for (auto&& feature : features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : features) 291 14 305
1018 291 ▶ if (feature < indices.size())
Branch: 1 branch
BranchTrueFalseTotal
if (feature < indices.size()) 291 0 291
1019 705 ▶ for (unsigned i = 0; i < indices[feature].size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < indices[feature].size(); i++) 414 291 705
1020 414 output_layer[indices[feature][i]] += weights[feature][i] - missing_weight;
1021  
1022 // Hidden layer
1023 14 ▶ if (!hidden_layer.empty()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!hidden_layer.empty()) { 0 14 14
1024 0 ▶ for (auto&& weight : hidden_layer)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& weight : hidden_layer) 0 0 0
1025 0 weight = 0;
1026  
1027 // Propagate to hidden layer
1028 0 ▶ for (auto&& feature : features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : features) 0 0 0
1029 0 ▶ if (feature < hidden_weights[0].size())
Branch: 1 branch
BranchTrueFalseTotal
if (feature < hidden_weights[0].size()) 0 0 0
1030 0 ▶ for (unsigned i = 0; i < hidden_layer.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < hidden_layer.size(); i++) { 0 0 0
1031 0 hidden_layer[i] += hidden_weights[0][feature][i];
1032 }
1033  
1034 // Apply logistic sigmoid to hidden layer
1035 0 ▶ for (auto&& weight : hidden_layer)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& weight : hidden_layer) 0 0 0
1036 0 weight = 1 / (1 + exp(-weight));
1037  
1038 // Propagate to output_layer
1039 0 ▶ for (unsigned h = 0; h < hidden_layer.size(); h++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned h = 0; h < hidden_layer.size(); h++) 0 0 0
1040 0 ▶ for (unsigned i = 0; i < output_layer.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < output_layer.size(); i++) 0 0 0
1041 0 output_layer[i] += hidden_layer[h] * hidden_weights[1][h][i];
1042 }
1043  
1044 // Apply softmax sigmoid to output_layer layer
1045 14 double sum = 0;
1046 140 ▶ for (unsigned i = 0; i < output_layer.size(); sum += output_layer[i], i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < output_layer.size(); sum += output_layer[i], i++) 126 14 140
1047 126 output_layer[i] = exp(output_layer[i]);
1048 14 sum = 1 / sum;
1049 140 ▶ for (unsigned i = 0; i < output_layer.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < output_layer.size(); i++) 126 14 140
1050 126 output_layer[i] *= sum;
1051 14 }
1052  
1053 0 classifier_outcome network_classifier::best_outcome() {
1054 0 classifier_outcome best = 0;
1055 0 ▶ for (unsigned i = 1; i < output_layer.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 1; i < output_layer.size(); i++) 0 0 0
1056 0 ▶ if (output_layer[i] > output_layer[best])
Branch: 1 branch
BranchTrueFalseTotal
if (output_layer[i] > output_layer[best]) 0 0 0
1057 0 best = i;
1058  
1059 0 return best;
1060 }
1061  
1062 0 void network_classifier::backpropagate(const classifier_instance& instance, double learning_rate, double gaussian_sigma) {
1063 // Compute error vector
1064 0 ▶ for (unsigned i = 0; i < output_error.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < output_error.size(); i++) 0 0 0
1065 0 ▶ output_error[i] = (i == instance.outcome) - output_layer[i];
Branch: 1 branch
BranchTrueFalseTotal
output_error[i] = (i == instance.outcome) - output_layer[i]; 0 0 0
1066  
1067 // Update direct connections
1068 0 ▶ for (auto&& feature : instance.features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : instance.features) 0 0 0
1069 0 ▶ for (unsigned i = 0; i < indices[feature].size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < indices[feature].size(); i++) 0 0 0
1070 0 weights[feature][i] += learning_rate * output_error[indices[feature][i]] - weights[feature][i] * gaussian_sigma;
1071  
1072 // Update hidden layer
1073 0 ▶ if (!hidden_layer.empty()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!hidden_layer.empty()) { 0 0 0
1074 // Backpropagate output_error into hidden_error
1075 0 ▶ for (unsigned h = 0; h < hidden_layer.size(); h++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned h = 0; h < hidden_layer.size(); h++) { 0 0 0
1076 0 hidden_error[h] = 0;
1077 0 ▶ for (unsigned i = 0; i < output_layer.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < output_layer.size(); i++) 0 0 0
1078 0 hidden_error[h] += hidden_weights[1][h][i] * output_error[i];
1079 0 hidden_error[h] *= hidden_layer[h] * (1-hidden_layer[h]);
1080 }
1081  
1082 // Update hidden_weights[1]
1083 0 ▶ for (unsigned h = 0; h < hidden_layer.size(); h++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned h = 0; h < hidden_layer.size(); h++) 0 0 0
1084 0 ▶ for (unsigned i = 0; i < output_layer.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < output_layer.size(); i++) 0 0 0
1085 0 hidden_weights[1][h][i] += learning_rate * hidden_layer[h] * output_error[i] - hidden_weights[1][h][i] * gaussian_sigma;
1086  
1087 // Update hidden_weights[0]
1088 0 ▶ for (auto&& feature : instance.features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : instance.features) 0 0 0
1089 0 ▶ for (unsigned i = 0; i < hidden_layer.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < hidden_layer.size(); i++) 0 0 0
1090 0 hidden_weights[0][feature][i] += learning_rate * hidden_error[i] - hidden_weights[0][feature][i] * gaussian_sigma;
1091 }
1092 0 }
1093  
1094 /////////
1095 // File: ner/entity_map.h
1096 /////////
1097  
1098 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1099 //
1100 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1101 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1102 //
1103 // This Source Code Form is subject to the terms of the Mozilla Public
1104 // License, v. 2.0. If a copy of the MPL was not distributed with this
1105 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1106  
1107 class entity_map {
1108 public:
1109 entity_type parse(const char* str, bool add_entity = false) const;
1110 const string& name(entity_type entity) const;
1111  
1112 bool load(istream& is);
1113 bool save(ostream& os) const;
1114  
1115 entity_type size() const;
1116 private:
1117 mutable unordered_map<string, entity_type> str2id;
1118 mutable vector<string> id2str;
1119 string empty;
1120 };
1121  
1122 /////////
1123 // File: tokenizer/tokenizer.h
1124 /////////
1125  
1126 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1127 //
1128 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1129 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1130 //
1131 // This Source Code Form is subject to the terms of the Mozilla Public
1132 // License, v. 2.0. If a copy of the MPL was not distributed with this
1133 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1134  
1135 // Range of a token, measured in Unicode characters, not UTF8 bytes.
1136 // It must be in sync with morphodita::token_range.
1137 struct token_range {
1138 size_t start;
1139 size_t length;
1140  
1141 token_range() {}
1142 token_range(size_t start, size_t length) : start(start), length(length) {}
1143 };
1144  
1145 class tokenizer {
1146 public:
1147 0 virtual ~tokenizer() {}
1148  
1149 virtual void set_text(string_piece text, bool make_copy = false) = 0;
1150 virtual bool next_sentence(vector<string_piece>* forms, vector<token_range>* tokens) = 0;
1151  
1152 // Static factory method
1153 static tokenizer* new_vertical_tokenizer();
1154 };
1155  
1156 /////////
1157 // File: ner/ner.h
1158 /////////
1159  
1160 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1161 //
1162 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1163 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1164 //
1165 // This Source Code Form is subject to the terms of the Mozilla Public
1166 // License, v. 2.0. If a copy of the MPL was not distributed with this
1167 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1168  
1169 struct named_entity {
1170 size_t start;
1171 size_t length;
1172 string type;
1173  
1174 named_entity() {}
1175 3 named_entity(size_t start, size_t length, const string& type) : start(start), length(length), type(type) {}
1176 };
1177  
1178 class ner {
1179 public:
1180 0 virtual ~ner() {}
1181  
1182 static ner* load(const char* fname);
1183 static ner* load(istream& is);
1184  
1185 // Perform named entity recognition on a tokenizes sentence and return found
1186 // named entities in the given vector.
1187 virtual void recognize(const vector<string_piece>& forms, vector<named_entity>& entities) const = 0;
1188  
1189 // Return the possible entity types
1190 virtual void entity_types(vector<string>& types) const = 0;
1191  
1192 // Return gazetteers used by the recognizer, if any, optionally with the index of entity type
1193 virtual void gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const = 0;
1194  
1195 // Construct a new tokenizer instance appropriate for this recognizer.
1196 // Can return NULL if no such tokenizer exists.
1197 virtual tokenizer* new_tokenizer() const = 0;
1198 };
1199  
1200 /////////
1201 // File: tagger/tagger_ids.h
1202 /////////
1203  
1204 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1205 //
1206 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1207 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1208 //
1209 // This Source Code Form is subject to the terms of the Mozilla Public
1210 // License, v. 2.0. If a copy of the MPL was not distributed with this
1211 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1212  
1213 class tagger_ids {
1214 public:
1215 enum tagger_id { TRIVIAL, EXTERNAL, MORPHODITA };
1216  
1217 0 static bool parse(const string& str, tagger_id& id) {
1218 0 ▶ if (str == "trivial") return id = TRIVIAL, true;
Branch: 1 branch
BranchTrueFalseTotal
if (str == "trivial") return id = TRIVIAL, true; 0 0 0
1219 0 ▶ if (str == "external") return id = EXTERNAL, true;
Branch: 1 branch
BranchTrueFalseTotal
if (str == "external") return id = EXTERNAL, true; 0 0 0
1220 0 ▶ if (str == "morphodita") return id = MORPHODITA, true;
Branch: 1 branch
BranchTrueFalseTotal
if (str == "morphodita") return id = MORPHODITA, true; 0 0 0
1221 0 return false;
1222 }
1223 };
1224  
1225 typedef tagger_ids::tagger_id tagger_id;
1226  
1227 /////////
1228 // File: tagger/tagger.h
1229 /////////
1230  
1231 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1232 //
1233 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1234 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1235 //
1236 // This Source Code Form is subject to the terms of the Mozilla Public
1237 // License, v. 2.0. If a copy of the MPL was not distributed with this
1238 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1239  
1240 class tagger {
1241 public:
1242 0 virtual ~tagger() {}
1243  
1244 virtual void tag(const vector<string_piece>& forms, ner_sentence& sentence) const = 0;
1245  
1246 // Factory methods
1247 static tagger* load_instance(istream& is);
1248 static tagger* create_and_encode_instance(const string& tagger_id_and_params, ostream& os);
1249  
1250 protected:
1251 virtual bool load(istream& is) = 0;
1252 virtual bool create_and_encode(const string& params, ostream& os) = 0;
1253  
1254 private:
1255 static tagger* create(tagger_id id);
1256 };
1257  
1258 /////////
1259 // File: features/nlp_pipeline.h
1260 /////////
1261  
1262 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1263 //
1264 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1265 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1266 //
1267 // This Source Code Form is subject to the terms of the Mozilla Public
1268 // License, v. 2.0. If a copy of the MPL was not distributed with this
1269 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1270  
1271 struct nlp_pipeline {
1272 ufal::nametag::tokenizer* tokenizer;
1273 const ufal::nametag::tagger* tagger;
1274  
1275 1 nlp_pipeline(ufal::nametag::tokenizer* tokenizer, const ufal::nametag::tagger* tagger) : tokenizer(tokenizer), tagger(tagger) {}
1276 };
1277  
1278 /////////
1279 // File: features/feature_processor.h
1280 /////////
1281  
1282 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1283 //
1284 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1285 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1286 //
1287 // This Source Code Form is subject to the terms of the Mozilla Public
1288 // License, v. 2.0. If a copy of the MPL was not distributed with this
1289 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1290  
1291 class feature_processor {
1292 public:
1293 virtual ~feature_processor();
1294  
1295 virtual bool parse(int window, const vector<string>& args, entity_map& entities,
1296 ner_feature* total_features, const nlp_pipeline& pipeline);
1297 virtual void load(binary_decoder& data, const nlp_pipeline& pipeline);
1298 virtual void save(binary_encoder& enc);
1299  
1300 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const;
1301 virtual void process_entities(ner_sentence& sentence, vector<named_entity>& entities, vector<named_entity>& buffer) const;
1302  
1303 virtual void gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const;
1304  
1305 protected:
1306 int window;
1307  
1308 99 inline ner_feature lookup(const string& key, ner_feature* total_features) const {
1309 99 ▶ auto it = map.find(key);
Branch: 1 branch
BranchTrueFalseTotal
auto it = map.find(key); 99 0 99
1310 99 ▶ if (it == map.end() && total_features) {
Branch: 3 branches
BranchTrueFalseTotal
if (it == map.end() && total_features) { 4 95 99
if (it == map.end() && total_features) { 0 4 4
if (it == map.end() && total_features) { 0 99 99
1311 0 ▶ it = map.emplace(key, window + *total_features).first;
Branch: 1 branch
BranchTrueFalseTotal
it = map.emplace(key, window + *total_features).first; 0 0 0
1312 0 *total_features += 2*window + 1;
1313 }
1314 99 ▶ return it != map.end() ? it->second : ner_feature_unknown;
Branch: 1 branch
BranchTrueFalseTotal
return it != map.end() ? it->second : ner_feature_unknown; 95 4 99
1315 }
1316  
1317 mutable unordered_map<string, ner_feature> map;
1318  
1319 // Factory method
1320 public:
1321 static feature_processor* create(const string& name);
1322 };
1323  
1324 /////////
1325 // File: features/feature_processor.cpp
1326 /////////
1327  
1328 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1329 //
1330 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
1331 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1332 //
1333 // This Source Code Form is subject to the terms of the Mozilla Public
1334 // License, v. 2.0. If a copy of the MPL was not distributed with this
1335 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1336  
1337 // Feature processor -- methods and virtual methods
1338 0 feature_processor::~feature_processor() {}
1339  
1340 0 bool feature_processor::parse(int window, const vector<string>& /*args*/, entity_map& /*entities*/,
1341 ner_feature* total_features, const nlp_pipeline& /*pipeline*/) {
1342 0 ▶ if (window < 0) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (window < 0) return false; 0 0 0
1343 0 ▶ if (!total_features) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!total_features) return false; 0 0 0
1344  
1345 0 this->window = window;
1346  
1347 0 map.clear();
1348 0 ▶ lookup(string(), total_features); // Always add an empty string to the map
Branch: 1 branch
BranchTrueFalseTotal
lookup(string(), total_features); // Always add an empty string to the map 0 0 0
1349  
1350 0 return true;
1351 }
1352  
1353 8 void feature_processor::load(binary_decoder& data, const nlp_pipeline& /*pipeline*/) {
1354 8 window = data.next_4B();
1355  
1356 8 map.clear();
1357 8 map.rehash(data.next_4B());
1358 43 ▶ for (unsigned i = data.next_4B(); i > 0; i--) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = data.next_4B(); i > 0; i--) { 35 8 43
1359 35 string key;
1360 35 ▶ data.next_str(key);
Branch: 1 branch
BranchTrueFalseTotal
data.next_str(key); 35 0 35
1361 35 ▶ map.emplace(key, data.next_4B());
Branch: 2 branches
BranchTrueFalseTotal
map.emplace(key, data.next_4B()); 35 0 35
map.emplace(key, data.next_4B()); 35 0 35
1362 35 }
1363 8 }
1364  
1365 0 void feature_processor::save(binary_encoder& enc) {
1366 0 ▶ enc.add_4B(window);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(window); 0 0 0
1367  
1368 0 ▶ enc.add_4B(map.bucket_count());
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(map.bucket_count()); 0 0 0
1369 0 ▶ enc.add_4B(map.size());
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(map.size()); 0 0 0
1370  
1371 0 ▶ vector<pair<string, ner_feature>> map_elements(map.begin(), map.end());
Branch: 1 branch
BranchTrueFalseTotal
vector<pair<string, ner_feature>> map_elements(map.begin(), map.end()); 0 0 0
1372 0 ▶ sort(map_elements.begin(), map_elements.end());
Branch: 1 branch
BranchTrueFalseTotal
sort(map_elements.begin(), map_elements.end()); 0 0 0
1373 0 ▶ for (auto&& element : map_elements) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& element : map_elements) { 0 0 0
1374 0 ▶ enc.add_str(element.first);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_str(element.first); 0 0 0
1375 0 ▶ enc.add_4B(element.second);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(element.second); 0 0 0
1376 }
1377 0 }
1378  
1379 0 void feature_processor::process_sentence(ner_sentence& /*sentence*/, ner_feature* /*total_features*/, string& /*buffer*/) const {}
1380  
1381 16 void feature_processor::process_entities(ner_sentence& /*sentence*/, vector<named_entity>& /*entities*/, vector<named_entity>& /*buffer*/) const {}
1382  
1383 0 void feature_processor::gazetteers(vector<string>& /*gazetteers*/, vector<int>* /*gazetteer_types*/) const {}
1384  
1385 /////////
1386 // File: unilib/unicode.h
1387 /////////
1388  
1389 // This file is part of UniLib <http://github.com/ufal/unilib/>.
1390 //
1391 // Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
1392 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1393 //
1394 // This Source Code Form is subject to the terms of the Mozilla Public
1395 // License, v. 2.0. If a copy of the MPL was not distributed with this
1396 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1397 //
1398 // UniLib version: 3.3.1
1399 // Unicode version: 15.0.0
1400  
1401 namespace unilib {
1402  
1403 class unicode {
1404 enum : uint8_t {
1405 _Lu = 1, _Ll = 2, _Lt = 3, _Lm = 4, _Lo = 5,
1406 _Mn = 6, _Mc = 7, _Me = 8,
1407 _Nd = 9, _Nl = 10, _No = 11,
1408 _Pc = 12, _Pd = 13, _Ps = 14, _Pe = 15, _Pi = 16, _Pf = 17, _Po = 18,
1409 _Sm = 19, _Sc = 20, _Sk = 21, _So = 22,
1410 _Zs = 23, _Zl = 24, _Zp = 25,
1411 _Cc = 26, _Cf = 27, _Cs = 28, _Co = 29, _Cn = 30
1412 };
1413  
1414 public:
1415 typedef uint32_t category_t;
1416 enum : category_t {
1417 Lu = 1 << _Lu, Ll = 1 << _Ll, Lt = 1 << _Lt, Lut = Lu | Lt, LC = Lu | Ll | Lt,
1418 Lm = 1 << _Lm, Lo = 1 << _Lo, L = Lu | Ll | Lt | Lm | Lo,
1419 Mn = 1 << _Mn, Mc = 1 << _Mc, Me = 1 << _Me, M = Mn | Mc | Me,
1420 Nd = 1 << _Nd, Nl = 1 << _Nl, No = 1 << _No, N = Nd | Nl | No,
1421 Pc = 1 << _Pc, Pd = 1 << _Pd, Ps = 1 << _Ps, Pe = 1 << _Pe, Pi = 1 << _Pi,
1422 Pf = 1 << _Pf, Po = 1 << _Po, P = Pc | Pd | Ps | Pe | Pi | Pf | Po,
1423 Sm = 1 << _Sm, Sc = 1 << _Sc, Sk = 1 << _Sk, So = 1 << _So, S = Sm | Sc | Sk | So,
1424 Zs = 1 << _Zs, Zl = 1 << _Zl, Zp = 1 << _Zp, Z = Zs | Zl | Zp,
1425 Cc = 1 << _Cc, Cf = 1 << _Cf, Cs = 1 << _Cs, Co = 1 << _Co, Cn = 1 << _Cn, C = Cc | Cf | Cs | Co | Cn
1426 };
1427  
1428 static inline category_t category(char32_t chr);
1429  
1430 static inline char32_t lowercase(char32_t chr);
1431 static inline char32_t uppercase(char32_t chr);
1432 static inline char32_t titlecase(char32_t chr);
1433  
1434 private:
1435 static const char32_t CHARS = 0x110000;
1436 static const int32_t DEFAULT_CAT = Cn;
1437  
1438 static const uint8_t category_index[CHARS >> 8];
1439 static const uint8_t category_block[][256];
1440 static const uint8_t othercase_index[CHARS >> 8];
1441 static const char32_t othercase_block[][256];
1442  
1443 enum othercase_type { LOWER_ONLY = 1, UPPERTITLE_ONLY = 2, UPPER_ONLY = 3, LOWER_THEN_UPPER = 4, UPPER_THEN_TITLE = 5, TITLE_THEN_LOWER = 6 };
1444 };
1445  
1446 283 unicode::category_t unicode::category(char32_t chr) {
1447 283 ▶ return chr < CHARS ? 1 << category_block[category_index[chr >> 8]][chr & 0xFF] : DEFAULT_CAT;
Branch: 1 branch
BranchTrueFalseTotal
return chr < CHARS ? 1 << category_block[category_index[chr >> 8]][chr & 0xFF] : DEFAULT_CAT; 283 0 283
1448 }
1449  
1450 4 char32_t unicode::lowercase(char32_t chr) {
1451 4 ▶ if (chr < CHARS) {
Branch: 1 branch
BranchTrueFalseTotal
if (chr < CHARS) { 4 0 4
1452 4 char32_t othercase = othercase_block[othercase_index[chr >> 8]][chr & 0xFF];
1453 4 ▶ if ((othercase & 0xFF) == othercase_type::LOWER_ONLY) return othercase >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::LOWER_ONLY) return othercase >> 8; 4 0 4
1454 0 ▶ if ((othercase & 0xFF) == othercase_type::LOWER_THEN_UPPER) return othercase >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::LOWER_THEN_UPPER) return othercase >> 8; 0 0 0
1455 0 ▶ if ((othercase & 0xFF) == othercase_type::TITLE_THEN_LOWER) return othercase_block[othercase_index[(othercase >> 8) >> 8]][(othercase >> 8) & 0xFF] >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::TITLE_THEN_LOWER) return othercase_block[othercase_index[(othercase >> 8) >> 8]][(othercase >> 8) & 0xFF] >> 8; 0 0 0
1456 }
1457 0 return chr;
1458 }
1459  
1460 0 char32_t unicode::uppercase(char32_t chr) {
1461 0 ▶ if (chr < CHARS) {
Branch: 1 branch
BranchTrueFalseTotal
if (chr < CHARS) { 0 0 0
1462 0 char32_t othercase = othercase_block[othercase_index[chr >> 8]][chr & 0xFF];
1463 0 ▶ if ((othercase & 0xFF) == othercase_type::UPPERTITLE_ONLY) return othercase >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::UPPERTITLE_ONLY) return othercase >> 8; 0 0 0
1464 0 ▶ if ((othercase & 0xFF) == othercase_type::UPPER_ONLY) return othercase >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::UPPER_ONLY) return othercase >> 8; 0 0 0
1465 0 ▶ if ((othercase & 0xFF) == othercase_type::UPPER_THEN_TITLE) return othercase >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::UPPER_THEN_TITLE) return othercase >> 8; 0 0 0
1466 0 ▶ if ((othercase & 0xFF) == othercase_type::LOWER_THEN_UPPER) return othercase_block[othercase_index[(othercase >> 8) >> 8]][(othercase >> 8) & 0xFF] >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if ((othercase & 0xFF) == othercase_type::LOWER_THEN_UPPER) return othercase_block[othercase_index[(othercase >> 8) >> 8]][(othercase >> 8) & 0xFF] >> 8; 0 0 0
1467 }
1468 0 return chr;
1469 }
1470  
1471 char32_t unicode::titlecase(char32_t chr) {
1472 if (chr < CHARS) {
1473 char32_t othercase = othercase_block[othercase_index[chr >> 8]][chr & 0xFF];
1474 if ((othercase & 0xFF) == othercase_type::UPPERTITLE_ONLY) return othercase >> 8;
1475 if ((othercase & 0xFF) == othercase_type::TITLE_THEN_LOWER) return othercase >> 8;
1476 if ((othercase & 0xFF) == othercase_type::UPPER_THEN_TITLE) return othercase_block[othercase_index[(othercase >> 8) >> 8]][(othercase >> 8) & 0xFF] >> 8;
1477 }
1478 return chr;
1479 }
1480  
1481 } // namespace unilib
1482  
1483 /////////
1484 // File: unilib/utf8.h
1485 /////////
1486  
1487 // This file is part of UniLib <http://github.com/ufal/unilib/>.
1488 //
1489 // Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
1490 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1491 //
1492 // This Source Code Form is subject to the terms of the Mozilla Public
1493 // License, v. 2.0. If a copy of the MPL was not distributed with this
1494 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1495 //
1496 // UniLib version: 3.3.1
1497 // Unicode version: 15.0.0
1498  
1499 namespace unilib {
1500  
1501 class utf8 {
1502 public:
1503 static bool valid(const char* str);
1504 static bool valid(const char* str, size_t len);
1505 static inline bool valid(const std::string& str);
1506  
1507 static inline char32_t decode(const char*& str);
1508 static inline char32_t decode(const char*& str, size_t& len);
1509 static inline char32_t first(const char* str);
1510 static inline char32_t first(const char* str, size_t len);
1511 static inline char32_t first(const std::string& str);
1512  
1513 static void decode(const char* str, std::u32string& decoded);
1514 static void decode(const char* str, size_t len, std::u32string& decoded);
1515 static inline void decode(const std::string& str, std::u32string& decoded);
1516  
1517 class string_decoder {
1518 public:
1519 class iterator;
1520 inline iterator begin();
1521 inline iterator end();
1522 private:
1523 inline string_decoder(const char* str);
1524 const char* str;
1525 friend class utf8;
1526 };
1527 static inline string_decoder decoder(const char* str);
1528 static inline string_decoder decoder(const std::string& str);
1529  
1530 class buffer_decoder {
1531 public:
1532 class iterator;
1533 inline iterator begin();
1534 inline iterator end();
1535 private:
1536 inline buffer_decoder(const char* str, size_t len);
1537 const char* str;
1538 size_t len;
1539 friend class utf8;
1540 };
1541 static inline buffer_decoder decoder(const char* str, size_t len);
1542  
1543 static inline void append(char*& str, char32_t chr);
1544 static inline void append(std::string& str, char32_t chr);
1545 static void encode(const std::u32string& str, std::string& encoded);
1546  
1547 template<class F> static void map(F f, const char* str, std::string& result);
1548 template<class F> static void map(F f, const char* str, size_t len, std::string& result);
1549 template<class F> static void map(F f, const std::string& str, std::string& result);
1550  
1551 private:
1552 static const char REPLACEMENT_CHAR = '?';
1553 };
1554  
1555 bool utf8::valid(const std::string& str) {
1556 return valid(str.c_str());
1557 }
1558  
1559 68 char32_t utf8::decode(const char*& str) {
1560 68 ▶ if (((unsigned char)*str) < 0x80) return (unsigned char)*str++;
Branch: 1 branch
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80) return (unsigned char)*str++; 58 10 68
1561 10 ▶ else if (((unsigned char)*str) < 0xC0) return ++str, REPLACEMENT_CHAR;
Branch: 1 branch
BranchTrueFalseTotal
else if (((unsigned char)*str) < 0xC0) return ++str, REPLACEMENT_CHAR; 0 10 10
1562 10 ▶ else if (((unsigned char)*str) < 0xE0) {
Branch: 1 branch
BranchTrueFalseTotal
else if (((unsigned char)*str) < 0xE0) { 10 0 10
1563 10 char32_t res = (((unsigned char)*str++) & 0x1F) << 6;
1564 10 ▶ if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 2 branches
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 10 0 10
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 10 10
1565 10 return res + (((unsigned char)*str++) & 0x3F);
1566 0 ▶ } else if (((unsigned char)*str) < 0xF0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF0) { 0 0 0
1567 0 char32_t res = (((unsigned char)*str++) & 0x0F) << 12;
1568 0 ▶ if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 2 branches
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1569 0 res += (((unsigned char)*str++) & 0x3F) << 6;
1570 0 ▶ if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 2 branches
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1571 0 return res + (((unsigned char)*str++) & 0x3F);
1572 0 ▶ } else if (((unsigned char)*str) < 0xF8) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF8) { 0 0 0
1573 0 char32_t res = (((unsigned char)*str++) & 0x07) << 18;
1574 0 ▶ if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 2 branches
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1575 0 res += (((unsigned char)*str++) & 0x3F) << 12;
1576 0 ▶ if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 2 branches
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1577 0 res += (((unsigned char)*str++) & 0x3F) << 6;
1578 0 ▶ if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 2 branches
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1579 0 return res + (((unsigned char)*str++) & 0x3F);
1580 0 } else return ++str, REPLACEMENT_CHAR;
1581 }
1582  
1583 218 char32_t utf8::decode(const char*& str, size_t& len) {
1584 218 ▶ if (!len) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (!len) return 0; 0 218 218
1585 218 --len;
1586 218 ▶ if (((unsigned char)*str) < 0x80) return (unsigned char)*str++;
Branch: 1 branch
BranchTrueFalseTotal
if (((unsigned char)*str) < 0x80) return (unsigned char)*str++; 195 23 218
1587 23 ▶ else if (((unsigned char)*str) < 0xC0) return ++str, REPLACEMENT_CHAR;
Branch: 1 branch
BranchTrueFalseTotal
else if (((unsigned char)*str) < 0xC0) return ++str, REPLACEMENT_CHAR; 0 23 23
1588 23 ▶ else if (((unsigned char)*str) < 0xE0) {
Branch: 1 branch
BranchTrueFalseTotal
else if (((unsigned char)*str) < 0xE0) { 23 0 23
1589 23 char32_t res = (((unsigned char)*str++) & 0x1F) << 6;
1590 23 ▶ if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 3 branches
BranchTrueFalseTotal
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 23 0 23
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 23 0 23
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 23 23
1591 23 return res + ((--len, ((unsigned char)*str++)) & 0x3F);
1592 0 ▶ } else if (((unsigned char)*str) < 0xF0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF0) { 0 0 0
1593 0 char32_t res = (((unsigned char)*str++) & 0x0F) << 12;
1594 0 ▶ if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 3 branches
BranchTrueFalseTotal
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1595 0 res += ((--len, ((unsigned char)*str++)) & 0x3F) << 6;
1596 0 ▶ if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 3 branches
BranchTrueFalseTotal
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1597 0 return res + ((--len, ((unsigned char)*str++)) & 0x3F);
1598 0 ▶ } else if (((unsigned char)*str) < 0xF8) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF8) { 0 0 0
1599 0 char32_t res = (((unsigned char)*str++) & 0x07) << 18;
1600 0 ▶ if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 3 branches
BranchTrueFalseTotal
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1601 0 res += ((--len, ((unsigned char)*str++)) & 0x3F) << 12;
1602 0 ▶ if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 3 branches
BranchTrueFalseTotal
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1603 0 res += ((--len, ((unsigned char)*str++)) & 0x3F) << 6;
1604 0 ▶ if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR;
Branch: 3 branches
BranchTrueFalseTotal
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
if (len <= 0 || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return REPLACEMENT_CHAR; 0 0 0
1605 0 return res + ((--len, ((unsigned char)*str++)) & 0x3F);
1606 0 } else return ++str, REPLACEMENT_CHAR;
1607 }
1608  
1609 char32_t utf8::first(const char* str) {
1610 return decode(str);
1611 }
1612  
1613 char32_t utf8::first(const char* str, size_t len) {
1614 return decode(str, len);
1615 }
1616  
1617 char32_t utf8::first(const std::string& str) {
1618 return first(str.c_str());
1619 }
1620  
1621 void utf8::decode(const std::string& str, std::u32string& decoded) {
1622 decode(str.c_str(), decoded);
1623 }
1624  
1625 class utf8::string_decoder::iterator {
1626 public:
1627 using iterator_category = std::input_iterator_tag;
1628 using value_type = char32_t;
1629 using difference_type = ptrdiff_t;
1630 using pointer = char32_t*;
1631 using reference = char32_t&;
1632 0 iterator(const char* str) : codepoint(0), next(str) { operator++(); }
1633 iterator(const iterator& it) : codepoint(it.codepoint), next(it.next) {}
1634 0 ▶ iterator& operator++() { if (next) { codepoint = decode(next); if (!codepoint) next = nullptr; } return *this; }
Branch: 2 branches
BranchTrueFalseTotal
iterator& operator++() { if (next) { codepoint = decode(next); if (!codepoint) next = nullptr; } return *this; } 0 0 0
iterator& operator++() { if (next) { codepoint = decode(next); if (!codepoint) next = nullptr; } return *this; } 0 0 0
1635 iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
1636 bool operator==(const iterator& other) const { return next == other.next; }
1637 0 bool operator!=(const iterator& other) const { return next != other.next; }
1638 0 const char32_t& operator*() { return codepoint; }
1639 private:
1640 char32_t codepoint;
1641 const char* next;
1642 };
1643  
1644 0 utf8::string_decoder::string_decoder(const char* str) : str(str) {}
1645  
1646 0 utf8::string_decoder::iterator utf8::string_decoder::begin() {
1647 0 return iterator(str);
1648 }
1649  
1650 0 utf8::string_decoder::iterator utf8::string_decoder::end() {
1651 0 return iterator(nullptr);
1652 }
1653  
1654 utf8::string_decoder utf8::decoder(const char* str) {
1655 return string_decoder(str);
1656 }
1657  
1658 0 utf8::string_decoder utf8::decoder(const std::string& str) {
1659 0 return string_decoder(str.c_str());
1660 }
1661  
1662 class utf8::buffer_decoder::iterator {
1663 public:
1664 using iterator_category = std::input_iterator_tag;
1665 using value_type = char32_t;
1666 using difference_type = ptrdiff_t;
1667 using pointer = char32_t*;
1668 using reference = char32_t&;
1669 iterator(const char* str, size_t len) : codepoint(0), next(str), len(len) { operator++(); }
1670 iterator(const iterator& it) : codepoint(it.codepoint), next(it.next), len(it.len) {}
1671 iterator& operator++() { if (!len) next = nullptr; if (next) codepoint = decode(next, len); return *this; }
1672 iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
1673 bool operator==(const iterator& other) const { return next == other.next; }
1674 bool operator!=(const iterator& other) const { return next != other.next; }
1675 const char32_t& operator*() { return codepoint; }
1676 private:
1677 char32_t codepoint;
1678 const char* next;
1679 size_t len;
1680 };
1681  
1682 utf8::buffer_decoder::buffer_decoder(const char* str, size_t len) : str(str), len(len) {}
1683  
1684 utf8::buffer_decoder::iterator utf8::buffer_decoder::begin() {
1685 return iterator(str, len);
1686 }
1687  
1688 utf8::buffer_decoder::iterator utf8::buffer_decoder::end() {
1689 return iterator(nullptr, 0);
1690 }
1691  
1692 utf8::buffer_decoder utf8::decoder(const char* str, size_t len) {
1693 return buffer_decoder(str, len);
1694 }
1695  
1696 void utf8::append(char*& str, char32_t chr) {
1697 if (chr < 0x80) *str++ = chr;
1698 else if (chr < 0x800) { *str++ = 0xC0 + (chr >> 6); *str++ = 0x80 + (chr & 0x3F); }
1699 else if (chr < 0x10000) { *str++ = 0xE0 + (chr >> 12); *str++ = 0x80 + ((chr >> 6) & 0x3F); *str++ = 0x80 + (chr & 0x3F); }
1700 else if (chr < 0x200000) { *str++ = 0xF0 + (chr >> 18); *str++ = 0x80 + ((chr >> 12) & 0x3F); *str++ = 0x80 + ((chr >> 6) & 0x3F); *str++ = 0x80 + (chr & 0x3F); }
1701 else *str++ = REPLACEMENT_CHAR;
1702 }
1703  
1704 4 void utf8::append(std::string& str, char32_t chr) {
1705 4 ▶ if (chr < 0x80) str += chr;
Branch: 1 branch
BranchTrueFalseTotal
if (chr < 0x80) str += chr; 4 0 4
1706 0 ▶ else if (chr < 0x800) { str += 0xC0 + (chr >> 6); str += 0x80 + (chr & 0x3F); }
Branch: 1 branch
BranchTrueFalseTotal
else if (chr < 0x800) { str += 0xC0 + (chr >> 6); str += 0x80 + (chr & 0x3F); } 0 0 0
1707 0 ▶ else if (chr < 0x10000) { str += 0xE0 + (chr >> 12); str += 0x80 + ((chr >> 6) & 0x3F); str += 0x80 + (chr & 0x3F); }
Branch: 1 branch
BranchTrueFalseTotal
else if (chr < 0x10000) { str += 0xE0 + (chr >> 12); str += 0x80 + ((chr >> 6) & 0x3F); str += 0x80 + (chr & 0x3F); } 0 0 0
1708 0 ▶ else if (chr < 0x200000) { str += 0xF0 + (chr >> 18); str += 0x80 + ((chr >> 12) & 0x3F); str += 0x80 + ((chr >> 6) & 0x3F); str += 0x80 + (chr & 0x3F); }
Branch: 1 branch
BranchTrueFalseTotal
else if (chr < 0x200000) { str += 0xF0 + (chr >> 18); str += 0x80 + ((chr >> 12) & 0x3F); str += 0x80 + ((chr >> 6) & 0x3F); str += 0x80 + (chr & 0x3F); } 0 0 0
1709 0 else str += REPLACEMENT_CHAR;
1710 4 }
1711  
1712 0 template<class F> void utf8::map(F f, const char* str, std::string& result) {
1713 0 result.clear();
1714  
1715 0 ▶ for (char32_t chr; (chr = decode(str)); )
Branch: 1 branch
BranchTrueFalseTotal
for (char32_t chr; (chr = decode(str)); ) 0 0 0
1716 0 append(result, f(chr));
1717 0 }
1718  
1719 0 template<class F> void utf8::map(F f, const char* str, size_t len, std::string& result) {
1720 0 result.clear();
1721  
1722 0 ▶ while (len)
Branch: 1 branch
BranchTrueFalseTotal
while (len) 0 0 0
1723 0 append(result, f(decode(str, len)));
1724 0 }
1725  
1726 0 template<class F> void utf8::map(F f, const std::string& str, std::string& result) {
1727 0 map(f, str.c_str(), result);
1728 0 }
1729  
1730 } // namespace unilib
1731  
1732 /////////
1733 // File: utils/parse_int.h
1734 /////////
1735  
1736 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
1737 //
1738 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
1739 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1740 //
1741 // This Source Code Form is subject to the terms of the Mozilla Public
1742 // License, v. 2.0. If a copy of the MPL was not distributed with this
1743 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1744  
1745 namespace utils {
1746  
1747 //
1748 // Declarations
1749 //
1750  
1751 // Try to parse an int from given string. If the int cannot be parsed or does
1752 // not fit into int, false is returned and the error string is filled using the
1753 // value_name argument.
1754 inline bool parse_int(string_piece str, const char* value_name, int& value, string& error);
1755  
1756 // Try to parse an int from given string. If the int cannot be parsed or does
1757 // not fit into int, an error is displayed and program exits.
1758 inline int parse_int(string_piece str, const char* value_name);
1759  
1760 //
1761 // Definitions
1762 //
1763  
1764 0 bool parse_int(string_piece str, const char* value_name, int& value, string& error) {
1765 0 string_piece original = str;
1766  
1767 // Skip spaces
1768 0 ▶ while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v'))
Branch: 7 branches
BranchTrueFalseTotal
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
1769 0 str.str++, str.len--;
1770  
1771 // Allow minus
1772 0 bool positive = true;
1773 0 ▶ if (str.len && (str.str[0] == '+' || str.str[0] == '-')) {
Branch: 3 branches
BranchTrueFalseTotal
if (str.len && (str.str[0] == '+' || str.str[0] == '-')) { 0 0 0
if (str.len && (str.str[0] == '+' || str.str[0] == '-')) { 0 0 0
if (str.len && (str.str[0] == '+' || str.str[0] == '-')) { 0 0 0
1774 0 positive = str.str[0] == '+';
1775 0 str.str++, str.len--;
1776 }
1777  
1778 // Parse value, checking for overflow/underflow
1779 0 ▶ if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false;
Branch: 6 branches
BranchTrueFalseTotal
if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false; 0 0 0
if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false; 0 0 0
if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false; 0 0 0
if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false; 0 0 0
if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false; 0 0 0
if (!str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': empty string."), false; 0 0 0
1780 0 ▶ if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false;
Branch: 7 branches
BranchTrueFalseTotal
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (!(str.str[0] >= '0' || str.str[0] <= '9')) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
1781  
1782 0 value = 0;
1783 0 ▶ while (str.len && str.str[0] >= '0' && str.str[0] <= '9') {
Branch: 3 branches
BranchTrueFalseTotal
while (str.len && str.str[0] >= '0' && str.str[0] <= '9') { 0 0 0
while (str.len && str.str[0] >= '0' && str.str[0] <= '9') { 0 0 0
while (str.len && str.str[0] >= '0' && str.str[0] <= '9') { 0 0 0
1784 0 ▶ if (positive) {
Branch: 1 branch
BranchTrueFalseTotal
if (positive) { 0 0 0
1785 0 ▶ if (value > (numeric_limits<int>::max() - (str.str[0] - '0')) / 10)
Branch: 1 branch
BranchTrueFalseTotal
if (value > (numeric_limits<int>::max() - (str.str[0] - '0')) / 10) 0 0 0
1786 0 ▶ return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': overflow occured."), false;
Branch: 5 branches
BranchTrueFalseTotal
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': overflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': overflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': overflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': overflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': overflow occured."), false; 0 0 0
1787 0 value = 10 * value + (str.str[0] - '0');
1788 } else {
1789 0 ▶ if (value < (numeric_limits<int>::min() + (str.str[0] - '0')) / 10)
Branch: 1 branch
BranchTrueFalseTotal
if (value < (numeric_limits<int>::min() + (str.str[0] - '0')) / 10) 0 0 0
1790 0 ▶ return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': underflow occured."), false;
Branch: 5 branches
BranchTrueFalseTotal
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': underflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': underflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': underflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': underflow occured."), false; 0 0 0
return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': underflow occured."), false; 0 0 0
1791 0 value = 10 * value - (str.str[0] - '0');
1792 }
1793 0 str.str++, str.len--;
1794 }
1795  
1796 // Skip spaces
1797 0 ▶ while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v'))
Branch: 7 branches
BranchTrueFalseTotal
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
while (str.len && (str.str[0] == ' ' || str.str[0] == '\f' || str.str[0] == '\n' || str.str[0] == '\r' || str.str[0] == '\t' || str.str[0] == '\v')) 0 0 0
1798 0 str.str++, str.len--;
1799  
1800 // Check for remaining characters
1801 0 ▶ if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false;
Branch: 6 branches
BranchTrueFalseTotal
if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
if (str.len) return error.assign("Cannot parse ").append(value_name).append(" int value '").append(original.str, original.len).append("': non-digit character found."), false; 0 0 0
1802  
1803 0 return true;
1804 }
1805  
1806 0 int parse_int(string_piece str, const char* value_name) {
1807 int result;
1808 0 string error;
1809  
1810 0 ▶ if (!parse_int(str, value_name, result, error))
Branch: 2 branches
BranchTrueFalseTotal
if (!parse_int(str, value_name, result, error)) 0 0 0
if (!parse_int(str, value_name, result, error)) 0 0 0
1811 0 ▶ runtime_failure(error);
Branch: 2 branches
BranchTrueFalseTotal
runtime_failure(error); 0 0 0
runtime_failure(error); 0 0 0
1812  
1813 0 return result;
1814 0 }
1815  
1816 } // namespace utils
1817  
1818 /////////
1819 // File: utils/path_from_utf8.h
1820 /////////
1821  
1822 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
1823 //
1824 // Copyright 2022 Institute of Formal and Applied Linguistics, Faculty of
1825 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1826 //
1827 // This Source Code Form is subject to the terms of the Mozilla Public
1828 // License, v. 2.0. If a copy of the MPL was not distributed with this
1829 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1830  
1831 namespace utils {
1832  
1833 //
1834 // Declarations
1835 //
1836  
1837 #ifdef _WIN32
1838 inline wstring path_from_utf8(const char* str);
1839 inline wstring path_from_utf8(const string& str);
1840 #else
1841 inline string path_from_utf8(const char* str);
1842 inline const string& path_from_utf8(const string& str);
1843 #endif
1844  
1845 //
1846 // Definitions
1847 //
1848  
1849 #ifdef _WIN32
1850  
1851 inline wstring path_from_utf8(const char* str) {
1852 // We could implement this using codecvt_utf8_utf16, but it is not available
1853 // in GCC 4.9, which we still use. We could also use MultiByteToWideChar,
1854 // but using it would require changing our build infrastructure -- hence
1855 // we implement the conversion manually.
1856 wstring wstr;
1857 while (*str) {
1858 char32_t chr;
1859 if (((unsigned char)*str) < 0x80) chr = (unsigned char)*str++;
1860 else if (((unsigned char)*str) < 0xC0) chr = '?', ++str;
1861 else if (((unsigned char)*str) < 0xE0) {
1862 chr = (((unsigned char)*str++) & 0x1F) << 6;
1863 if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) chr = '?';
1864 else chr += ((unsigned char)*str++) & 0x3F;
1865 } else if (((unsigned char)*str) < 0xF0) {
1866 chr = (((unsigned char)*str++) & 0x0F) << 12;
1867 if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) chr = '?';
1868 else {
1869 chr += (((unsigned char)*str++) & 0x3F) << 6;
1870 if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) chr = '?';
1871 else chr += ((unsigned char)*str++) & 0x3F;
1872 }
1873 } else if (((unsigned char)*str) < 0xF8) {
1874 chr = (((unsigned char)*str++) & 0x07) << 18;
1875 if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) chr = '?';
1876 else {
1877 chr += (((unsigned char)*str++) & 0x3F) << 12;
1878 if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) chr = '?';
1879 else {
1880 chr += (((unsigned char)*str++) & 0x3F) << 6;
1881 if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) chr = '?';
1882 else chr += ((unsigned char)*str++) & 0x3F;
1883 }
1884 }
1885 } else chr = '?', ++str;
1886  
1887 if (chr <= 0xFFFF) wstr.push_back(chr);
1888 else if (chr <= 0x10FFFF) {
1889 wstr.push_back(0xD800 + ((chr - 0x10000) >> 10));
1890 wstr.push_back(0xDC00 + ((chr - 0x10000) & 0x3FF));
1891 } else {
1892 wstr.push_back('?');
1893 }
1894 }
1895 return wstr;
1896 }
1897  
1898 inline wstring path_from_utf8(const string& str) {
1899 return path_from_utf8(str.c_str());
1900 }
1901  
1902 #else
1903  
1904 1 inline string path_from_utf8(const char* str) {
1905 2 ▶ return str;
Branch: 1 branch
BranchTrueFalseTotal
return str; 1 0 1
1906 }
1907  
1908 0 inline const string& path_from_utf8(const string& str) {
1909 0 return str;
1910 }
1911  
1912 #endif
1913  
1914 } // namespace utils
1915  
1916 /////////
1917 // File: utils/split.h
1918 /////////
1919  
1920 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
1921 //
1922 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
1923 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1924 //
1925 // This Source Code Form is subject to the terms of the Mozilla Public
1926 // License, v. 2.0. If a copy of the MPL was not distributed with this
1927 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1928  
1929 namespace utils {
1930  
1931 //
1932 // Declarations
1933 //
1934  
1935 // Split given text on the separator character.
1936 inline void split(const string& text, char sep, vector<string>& tokens);
1937 inline void split(string_piece text, char sep, vector<string_piece>& tokens);
1938  
1939 //
1940 // Definitions
1941 //
1942  
1943 0 void split(const string& text, char sep, vector<string>& tokens) {
1944 0 tokens.clear();
1945 0 ▶ if (text.empty()) return;
Branch: 1 branch
BranchTrueFalseTotal
if (text.empty()) return; 0 0 0
1946  
1947 0 string::size_type index = 0;
1948 0 ▶ for (string::size_type next; (next = text.find(sep, index)) != string::npos; index = next + 1)
Branch: 1 branch
BranchTrueFalseTotal
for (string::size_type next; (next = text.find(sep, index)) != string::npos; index = next + 1) 0 0 0
1949 0 ▶ tokens.emplace_back(text, index, next - index);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(text, index, next - index); 0 0 0
1950  
1951 0 ▶ tokens.emplace_back(text, index);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(text, index); 0 0 0
1952 }
1953  
1954 void split(string_piece text, char sep, vector<string_piece>& tokens) {
1955 tokens.clear();
1956 if (!text.len) return;
1957  
1958 const char* str = text.str;
1959 for (const char* next; (next = (const char*) memchr(str, sep, text.str + text.len - str)); str = next + 1)
1960 tokens.emplace_back(str, next - str);
1961  
1962 tokens.emplace_back(str, text.str + text.len - str);
1963 }
1964  
1965 } // namespace utils
1966  
1967 /////////
1968 // File: utils/url_detector.h
1969 /////////
1970  
1971 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
1972 //
1973 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
1974 // Mathematics and Physics, Charles University in Prague, Czech Republic.
1975 //
1976 // This Source Code Form is subject to the terms of the Mozilla Public
1977 // License, v. 2.0. If a copy of the MPL was not distributed with this
1978 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
1979  
1980 namespace utils {
1981  
1982 class url_detector {
1983 public:
1984 enum url_type { NO_URL = 0, URL = 1, EMAIL = 2 };
1985  
1986 // Detect whether given string is an url or an email.
1987 // If length==nullptr, the whole str must match.
1988 // If length!=nullptr, length of longest matching prefix is returned.
1989 static url_type detect(string_piece str, size_t* length = nullptr);
1990 };
1991  
1992 } // namespace utils
1993  
1994 /////////
1995 // File: features/feature_processor_instances.cpp
1996 /////////
1997  
1998 // This file is part of NameTag <http://github.com/ufal/nametag/>.
1999 //
2000 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
2001 // Mathematics and Physics, Charles University in Prague, Czech Republic.
2002 //
2003 // This Source Code Form is subject to the terms of the Mozilla Public
2004 // License, v. 2.0. If a copy of the MPL was not distributed with this
2005 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
2006  
2007 // Helper functions defined as macros so that they can access arguments without passing them
2008 #define apply_in_window(I, Feature) apply_in_range(I, Feature, -window, window)
2009  
2010 #define apply_in_range(I, Feature, Left, Right) { \
2011 ner_feature _feature = (Feature); \
2012 if (_feature != ner_feature_unknown) \
2013 for (int _w = int(I) + (Left) < 0 ? 0 : int(I) + (Left), \
2014 _end = int(I) + (Right) + 1 < int(sentence.size) ? int(I) + (Right) + 1 : sentence.size; \
2015 _w < _end; _w++) \
2016 sentence.features[_w].emplace_back(_feature + _w - int(I)); \
2017 }
2018  
2019 #define apply_outer_words_in_window(Feature) { \
2020 ner_feature _outer_feature = (Feature); \
2021 if (_outer_feature != ner_feature_unknown) \
2022 for (int _i = 1; _i <= window; _i++) { \
2023 apply_in_window(-_i, _outer_feature); \
2024 apply_in_window(sentence.size - 1 + _i, _outer_feature); \
2025 } \
2026 }
2027  
2028 #define lookup_empty() /* lookup(string()) always returns */(window)
2029  
2030 //////////////////////////////////////////////////////////////
2031 // Feature processor instances (ordered lexicographically) //
2032 //////////////////////////////////////////////////////////////
2033 namespace feature_processors {
2034  
2035 // BrownClusters
2036 class brown_clusters : public feature_processor {
2037 public:
2038 0 virtual bool parse(int window, const vector<string>& args, entity_map& entities,
2039 ner_feature* total_features, const nlp_pipeline& pipeline) override {
2040 0 ▶ if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
2041 0 ▶ if (args.size() < 1) return cerr << "BrownCluster requires a cluster file as the first argument!" << endl, false;
Branch: 3 branches
BranchTrueFalseTotal
if (args.size() < 1) return cerr << "BrownCluster requires a cluster file as the first argument!" << endl, false; 0 0 0
if (args.size() < 1) return cerr << "BrownCluster requires a cluster file as the first argument!" << endl, false; 0 0 0
if (args.size() < 1) return cerr << "BrownCluster requires a cluster file as the first argument!" << endl, false; 0 0 0
2042  
2043 0 ▶ ifstream in(path_from_utf8(args[0]).c_str());
Branch: 1 branch
BranchTrueFalseTotal
ifstream in(path_from_utf8(args[0]).c_str()); 0 0 0
2044 0 ▶ if (!in.is_open()) return cerr << "Cannot open Brown clusters file '" << args[0] << "'!" << endl, false;
Branch: 5 branches
BranchTrueFalseTotal
if (!in.is_open()) return cerr << "Cannot open Brown clusters file '" << args[0] << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open Brown clusters file '" << args[0] << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open Brown clusters file '" << args[0] << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open Brown clusters file '" << args[0] << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open Brown clusters file '" << args[0] << "'!" << endl, false; 0 0 0
2045  
2046 0 vector<size_t> substrings;
2047 0 ▶ substrings.emplace_back(string::npos);
Branch: 1 branch
BranchTrueFalseTotal
substrings.emplace_back(string::npos); 0 0 0
2048 0 ▶ for (unsigned i = 1; i < args.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 1; i < args.size(); i++) { 0 0 0
2049 0 ▶ int len = parse_int(args[i].c_str(), "BrownCluster_prefix_length");
Branch: 1 branch
BranchTrueFalseTotal
int len = parse_int(args[i].c_str(), "BrownCluster_prefix_length"); 0 0 0
2050 0 ▶ if (len <= 0)
Branch: 1 branch
BranchTrueFalseTotal
if (len <= 0) 0 0 0
2051 0 ▶ return cerr << "Wrong prefix length '" << len << "' in BrownCluster specification!" << endl, false;
Branch: 4 branches
BranchTrueFalseTotal
return cerr << "Wrong prefix length '" << len << "' in BrownCluster specification!" << endl, false; 0 0 0
return cerr << "Wrong prefix length '" << len << "' in BrownCluster specification!" << endl, false; 0 0 0
return cerr << "Wrong prefix length '" << len << "' in BrownCluster specification!" << endl, false; 0 0 0
return cerr << "Wrong prefix length '" << len << "' in BrownCluster specification!" << endl, false; 0 0 0
2052 else
2053 0 ▶ substrings.emplace_back(len);
Branch: 1 branch
BranchTrueFalseTotal
substrings.emplace_back(len); 0 0 0
2054 }
2055  
2056 0 clusters.clear();
2057 0 unordered_map<string, unsigned> cluster_map;
2058 0 unordered_map<string, ner_feature> prefixes_map;
2059 0 string line;
2060 0 vector<string> tokens;
2061 0 ▶ while (getline(in, line)) {
Branch: 3 branches
BranchTrueFalseTotal
while (getline(in, line)) { 0 0 0
while (getline(in, line)) { 0 0 0
while (getline(in, line)) { 0 0 0
2062 0 ▶ split(line, '\t', tokens);
Branch: 1 branch
BranchTrueFalseTotal
split(line, '\t', tokens); 0 0 0
2063 0 ▶ if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false;
Branch: 7 branches
BranchTrueFalseTotal
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (tokens.size() != 2) return cerr << "Wrong line '" << line << "' in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
2064  
2065 0 ▶ string cluster = tokens[0], form = tokens[1];
Branch: 2 branches
BranchTrueFalseTotal
string cluster = tokens[0], form = tokens[1]; 0 0 0
string cluster = tokens[0], form = tokens[1]; 0 0 0
2066 0 ▶ auto it = cluster_map.find(cluster);
Branch: 1 branch
BranchTrueFalseTotal
auto it = cluster_map.find(cluster); 0 0 0
2067 0 ▶ if (it == cluster_map.end()) {
Branch: 1 branch
BranchTrueFalseTotal
if (it == cluster_map.end()) { 0 0 0
2068 0 unsigned id = clusters.size();
2069 0 ▶ clusters.emplace_back();
Branch: 1 branch
BranchTrueFalseTotal
clusters.emplace_back(); 0 0 0
2070 0 ▶ for (auto&& substring : substrings)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& substring : substrings) 0 0 0
2071 0 ▶ if (substring == string::npos || substring < cluster.size())
Branch: 3 branches
BranchTrueFalseTotal
if (substring == string::npos || substring < cluster.size()) 0 0 0
if (substring == string::npos || substring < cluster.size()) 0 0 0
if (substring == string::npos || substring < cluster.size()) 0 0 0
2072 0 ▶ clusters.back().emplace_back(prefixes_map.emplace(cluster.substr(0, substring), *total_features + (2*window + 1) * (int)prefixes_map.size() + window).first->second);
Branch: 3 branches
BranchTrueFalseTotal
clusters.back().emplace_back(prefixes_map.emplace(cluster.substr(0, substring), *total_features + (2*window + 1) * (int)prefixes_map.size() + window).first->second); 0 0 0
clusters.back().emplace_back(prefixes_map.emplace(cluster.substr(0, substring), *total_features + (2*window + 1) * (int)prefixes_map.size() + window).first->second); 0 0 0
clusters.back().emplace_back(prefixes_map.emplace(cluster.substr(0, substring), *total_features + (2*window + 1) * (int)prefixes_map.size() + window).first->second); 0 0 0
2073 0 ▶ it = cluster_map.emplace(cluster, id).first;
Branch: 1 branch
BranchTrueFalseTotal
it = cluster_map.emplace(cluster, id).first; 0 0 0
2074 }
2075 0 ▶ if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false;
Branch: 8 branches
BranchTrueFalseTotal
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
if (!map.emplace(form, it->second).second) return cerr << "Form '" << form << "' is present twice in Brown cluster file '" << args[0] << "'!" << endl, false; 0 0 0
2076 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
2077  
2078 0 *total_features += (2*window + 1) * prefixes_map.size();
2079 0 return true;
2080 0 }
2081  
2082 0 virtual void load(binary_decoder& data, const nlp_pipeline& pipeline) override {
2083 0 feature_processor::load(data, pipeline);
2084  
2085 0 clusters.resize(data.next_4B());
2086 0 ▶ for (auto&& cluster : clusters) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& cluster : clusters) { 0 0 0
2087 0 ▶ cluster.resize(data.next_4B());
Branch: 2 branches
BranchTrueFalseTotal
cluster.resize(data.next_4B()); 0 0 0
cluster.resize(data.next_4B()); 0 0 0
2088 0 ▶ for (auto&& feature : cluster)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : cluster) 0 0 0
2089 0 ▶ feature = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
feature = data.next_4B(); 0 0 0
2090 }
2091 0 }
2092  
2093 0 virtual void save(binary_encoder& enc) override {
2094 0 feature_processor::save(enc);
2095  
2096 0 enc.add_4B(clusters.size());
2097 0 ▶ for (auto&& cluster : clusters) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& cluster : clusters) { 0 0 0
2098 0 ▶ enc.add_4B(cluster.size());
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(cluster.size()); 0 0 0
2099 0 ▶ for (auto&& feature : cluster)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : cluster) 0 0 0
2100 0 ▶ enc.add_4B(feature);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(feature); 0 0 0
2101 }
2102 0 }
2103  
2104 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* /*total_features*/, string& /*buffer*/) const override {
2105 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2106 0 ▶ auto it = map.find(sentence.words[i].raw_lemma);
Branch: 1 branch
BranchTrueFalseTotal
auto it = map.find(sentence.words[i].raw_lemma); 0 0 0
2107 0 ▶ if (it != map.end()) {
Branch: 1 branch
BranchTrueFalseTotal
if (it != map.end()) { 0 0 0
2108 0 auto& cluster = clusters[it->second];
2109 0 ▶ for (auto&& feature : cluster)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : cluster) 0 0 0
2110 0 ▶ apply_in_window(i, feature);
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, feature); 0 0 0
apply_in_window(i, feature); 0 0 0
apply_in_window(i, feature); 0 0 0
2111 }
2112 }
2113 0 }
2114  
2115 private:
2116 vector<vector<ner_feature>> clusters;
2117 };
2118  
2119 // CzechAddContainers
2120 class czech_add_containers : public feature_processor {
2121 public:
2122 0 virtual bool parse(int window, const vector<string>& args, entity_map& entities, ner_feature* total_features, const nlp_pipeline& pipeline) override {
2123 0 ▶ if (window) return cerr << "CzechAddContainers cannot have non-zero window!" << endl, false;
Branch: 1 branch
BranchTrueFalseTotal
if (window) return cerr << "CzechAddContainers cannot have non-zero window!" << endl, false; 0 0 0
2124  
2125 0 return feature_processor::parse(window, args, entities, total_features, pipeline);
2126 }
2127  
2128 0 virtual void process_entities(ner_sentence& /*sentence*/, vector<named_entity>& entities, vector<named_entity>& buffer) const override {
2129 0 buffer.clear();
2130  
2131 0 ▶ for (unsigned i = 0; i < entities.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < entities.size(); i++) { 0 0 0
2132 // P if ps+ pf+
2133 0 ▶ if (entities[i].type.compare("pf") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("pf") != 0)) {
Branch: 5 branches
BranchTrueFalseTotal
if (entities[i].type.compare("pf") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("pf") != 0)) { 0 0 0
if (entities[i].type.compare("pf") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("pf") != 0)) { 0 0 0
if (entities[i].type.compare("pf") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("pf") != 0)) { 0 0 0
if (entities[i].type.compare("pf") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("pf") != 0)) { 0 0 0
if (entities[i].type.compare("pf") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("pf") != 0)) { 0 0 0
2134 0 unsigned j = i + 1;
2135 0 ▶ while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("pf") == 0) j++;
Branch: 4 branches
BranchTrueFalseTotal
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("pf") == 0) j++; 0 0 0
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("pf") == 0) j++; 0 0 0
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("pf") == 0) j++; 0 0 0
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("pf") == 0) j++; 0 0 0
2136 0 ▶ if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) {
Branch: 4 branches
BranchTrueFalseTotal
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) { 0 0 0
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) { 0 0 0
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) { 0 0 0
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) { 0 0 0
2137 0 j++;
2138 0 ▶ while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) j++;
Branch: 4 branches
BranchTrueFalseTotal
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) j++; 0 0 0
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) j++; 0 0 0
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) j++; 0 0 0
while (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ps") == 0) j++; 0 0 0
2139 0 ▶ buffer.emplace_back(entities[i].start, entities[j - 1].start + entities[j - 1].length - entities[i].start, "P");
Branch: 1 branch
BranchTrueFalseTotal
buffer.emplace_back(entities[i].start, entities[j - 1].start + entities[j - 1].length - entities[i].start, "P"); 0 0 0
2140 }
2141 }
2142  
2143 // T if td tm ty | td tm
2144 0 ▶ if (entities[i].type.compare("td") == 0 && i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("tm") == 0) {
Branch: 5 branches
BranchTrueFalseTotal
if (entities[i].type.compare("td") == 0 && i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("tm") == 0) { 0 0 0
if (entities[i].type.compare("td") == 0 && i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("tm") == 0) { 0 0 0
if (entities[i].type.compare("td") == 0 && i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("tm") == 0) { 0 0 0
if (entities[i].type.compare("td") == 0 && i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("tm") == 0) { 0 0 0
if (entities[i].type.compare("td") == 0 && i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("tm") == 0) { 0 0 0
2145 0 unsigned j = i + 2;
2146 0 ▶ if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ty") == 0) j++;
Branch: 4 branches
BranchTrueFalseTotal
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ty") == 0) j++; 0 0 0
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ty") == 0) j++; 0 0 0
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ty") == 0) j++; 0 0 0
if (j < entities.size() && entities[j].start == entities[j-1].start + entities[j-1].length && entities[j].type.compare("ty") == 0) j++; 0 0 0
2147 0 ▶ buffer.emplace_back(entities[i].start, entities[j - 1].start + entities[j - 1].length - entities[i].start, "T");
Branch: 1 branch
BranchTrueFalseTotal
buffer.emplace_back(entities[i].start, entities[j - 1].start + entities[j - 1].length - entities[i].start, "T"); 0 0 0
2148 }
2149 // T if !td tm ty
2150 0 ▶ if (entities[i].type.compare("tm") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("td") != 0))
Branch: 5 branches
BranchTrueFalseTotal
if (entities[i].type.compare("tm") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("td") != 0)) 0 0 0
if (entities[i].type.compare("tm") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("td") != 0)) 0 0 0
if (entities[i].type.compare("tm") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("td") != 0)) 0 0 0
if (entities[i].type.compare("tm") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("td") != 0)) 0 0 0
if (entities[i].type.compare("tm") == 0 && (!i || entities[i-1].start + entities[i-1].length < entities[i].start || entities[i-1].type.compare("td") != 0)) 0 0 0
2151 0 ▶ if (i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("ty") == 0)
Branch: 4 branches
BranchTrueFalseTotal
if (i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("ty") == 0) 0 0 0
if (i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("ty") == 0) 0 0 0
if (i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("ty") == 0) 0 0 0
if (i+1 < entities.size() && entities[i+1].start == entities[i].start + entities[i].length && entities[i+1].type.compare("ty") == 0) 0 0 0
2152 0 ▶ buffer.emplace_back(entities[i].start, entities[i + 1].start + entities[i + 1].length - entities[i].start, "T");
Branch: 1 branch
BranchTrueFalseTotal
buffer.emplace_back(entities[i].start, entities[i + 1].start + entities[i + 1].length - entities[i].start, "T"); 0 0 0
2153  
2154 0 buffer.push_back(entities[i]);
2155 }
2156  
2157 0 ▶ if (buffer.size() > entities.size()) entities = buffer;
Branch: 1 branch
BranchTrueFalseTotal
if (buffer.size() > entities.size()) entities = buffer; 0 0 0
2158 0 }
2159  
2160 // CzechAddContainers used to be entity_processor which had empty load and save methods.
2161 0 virtual void load(binary_decoder& /*data*/, const nlp_pipeline& /*pipeline*/) override {}
2162 0 virtual void save(binary_encoder& /*enc*/) override {}
2163 };
2164  
2165 // CzechLemmaTerm
2166 class czech_lemma_term : public feature_processor {
2167 public:
2168 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2169 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2170 0 ▶ for (unsigned pos = 0; pos + 2 < sentence.words[i].lemma_comments.size(); pos++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned pos = 0; pos + 2 < sentence.words[i].lemma_comments.size(); pos++) 0 0 0
2171 0 ▶ if (sentence.words[i].lemma_comments[pos] == '_' && sentence.words[i].lemma_comments[pos+1] == ';') {
Branch: 3 branches
BranchTrueFalseTotal
if (sentence.words[i].lemma_comments[pos] == '_' && sentence.words[i].lemma_comments[pos+1] == ';') { 0 0 0
if (sentence.words[i].lemma_comments[pos] == '_' && sentence.words[i].lemma_comments[pos+1] == ';') { 0 0 0
if (sentence.words[i].lemma_comments[pos] == '_' && sentence.words[i].lemma_comments[pos+1] == ';') { 0 0 0
2172 0 buffer.assign(1, sentence.words[i].lemma_comments[pos+2]);
2173 0 ▶ apply_in_window(i, lookup(buffer, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
2174 }
2175 }
2176 0 }
2177 };
2178  
2179 // Form
2180 class form : public feature_processor {
2181 public:
2182 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& /*buffer*/) const override {
2183 18 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 14 4 18
2184 54 ▶ apply_in_window(i, lookup(sentence.words[i].form, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(sentence.words[i].form, total_features)); 12 2 14
apply_in_window(i, lookup(sentence.words[i].form, total_features)); 40 0 40
apply_in_window(i, lookup(sentence.words[i].form, total_features)); 40 12 52
2185  
2186 36 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 4 0 4
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 4 12
2187 4 }
2188 };
2189  
2190 // FormCapitalization
2191 class form_capitalization : public feature_processor {
2192 public:
2193 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2194 using namespace unilib;
2195  
2196 0 ner_feature fst_cap = lookup(buffer.assign("f"), total_features);
2197 0 ner_feature all_cap = lookup(buffer.assign("a"), total_features);
2198 0 ner_feature mixed_cap = lookup(buffer.assign("m"), total_features);
2199  
2200 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2201 0 bool was_upper = false, was_lower = false;
2202  
2203 0 auto* form = sentence.words[i].form.c_str();
2204 char32_t chr;
2205 0 ▶ for (bool first = true; (chr = utf8::decode(form)); first = false) {
Branch: 1 branch
BranchTrueFalseTotal
for (bool first = true; (chr = utf8::decode(form)); first = false) { 0 0 0
2206 0 auto category = unicode::category(chr);
2207 0 ▶ was_upper = was_upper || category & unicode::Lut;
Branch: 2 branches
BranchTrueFalseTotal
was_upper = was_upper || category & unicode::Lut; 0 0 0
was_upper = was_upper || category & unicode::Lut; 0 0 0
2208 0 ▶ was_lower = was_lower || category & unicode::Ll;
Branch: 2 branches
BranchTrueFalseTotal
was_lower = was_lower || category & unicode::Ll; 0 0 0
was_lower = was_lower || category & unicode::Ll; 0 0 0
2209  
2210 0 ▶ if (first && was_upper) apply_in_window(i, fst_cap);
Branch: 5 branches
BranchTrueFalseTotal
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
2211 }
2212 0 ▶ if (was_upper && !was_lower) apply_in_window(i, all_cap);
Branch: 5 branches
BranchTrueFalseTotal
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
2213 0 ▶ if (was_upper && was_lower) apply_in_window(i, mixed_cap);
Branch: 5 branches
BranchTrueFalseTotal
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
2214 }
2215 0 }
2216 };
2217  
2218 // FormCaseNormalized
2219 class form_case_normalized : public feature_processor {
2220 public:
2221 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2222 using namespace unilib;
2223  
2224 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2225 0 buffer.clear();
2226 0 ▶ for (auto&& chr : utf8::decoder(sentence.words[i].form))
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& chr : utf8::decoder(sentence.words[i].form)) 0 0 0
for (auto&& chr : utf8::decoder(sentence.words[i].form)) 0 0 0
for (auto&& chr : utf8::decoder(sentence.words[i].form)) 0 0 0
2227 0 ▶ utf8::append(buffer, buffer.empty() ? chr : unicode::lowercase(chr));
Branch: 2 branches
BranchTrueFalseTotal
utf8::append(buffer, buffer.empty() ? chr : unicode::lowercase(chr)); 0 0 0
utf8::append(buffer, buffer.empty() ? chr : unicode::lowercase(chr)); 0 0 0
2228 0 ▶ apply_in_window(i, lookup(buffer, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
2229 }
2230  
2231 0 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
2232 0 }
2233 };
2234  
2235 // Gazetteers
2236 class gazetteers : public feature_processor {
2237 public:
2238 enum { G = 0, U = 1, B = 2, L = 3, I = 4 };
2239  
2240 0 virtual bool parse(int window, const vector<string>& args, entity_map& entities,
2241 ner_feature* total_features, const nlp_pipeline& pipeline) override {
2242 0 cerr << "The 'Gazetteers' feature template is deprecated, use 'GazetteersEnhanced' !" << endl;
2243  
2244 0 ▶ if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
2245  
2246 0 gazetteers_info.clear();
2247 0 ▶ for (auto&& arg : args) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& arg : args) { 0 0 0
2248 0 ▶ ifstream in(path_from_utf8(arg).c_str());
Branch: 1 branch
BranchTrueFalseTotal
ifstream in(path_from_utf8(arg).c_str()); 0 0 0
2249 0 ▶ if (!in.is_open()) return cerr << "Cannot open gazetteers file '" << arg << "'!" << endl, false;
Branch: 5 branches
BranchTrueFalseTotal
if (!in.is_open()) return cerr << "Cannot open gazetteers file '" << arg << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open gazetteers file '" << arg << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open gazetteers file '" << arg << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open gazetteers file '" << arg << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open gazetteers file '" << arg << "'!" << endl, false; 0 0 0
2250  
2251 0 unsigned longest = 0;
2252 0 string gazetteer;
2253 0 string line;
2254 0 vector<string> tokens;
2255 0 ▶ while (getline(in, line)) {
Branch: 3 branches
BranchTrueFalseTotal
while (getline(in, line)) { 0 0 0
while (getline(in, line)) { 0 0 0
while (getline(in, line)) { 0 0 0
2256 0 ▶ split(line, ' ', tokens);
Branch: 1 branch
BranchTrueFalseTotal
split(line, ' ', tokens); 0 0 0
2257 0 ▶ for (unsigned i = 0; i < tokens.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < tokens.size(); i++) 0 0 0
2258 0 ▶ if (!tokens[i][0])
Branch: 2 branches
BranchTrueFalseTotal
if (!tokens[i][0]) 0 0 0
if (!tokens[i][0]) 0 0 0
2259 0 ▶ tokens.erase(tokens.begin() + i--);
Branch: 1 branch
BranchTrueFalseTotal
tokens.erase(tokens.begin() + i--); 0 0 0
2260 0 ▶ if (tokens.size() > longest) longest = tokens.size();
Branch: 1 branch
BranchTrueFalseTotal
if (tokens.size() > longest) longest = tokens.size(); 0 0 0
2261  
2262 0 gazetteer.clear();
2263 0 ▶ for (unsigned i = 0; i < tokens.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < tokens.size(); i++) { 0 0 0
2264 0 ▶ if (i) gazetteer += ' ';
Branch: 2 branches
BranchTrueFalseTotal
if (i) gazetteer += ' '; 0 0 0
if (i) gazetteer += ' '; 0 0 0
2265 0 ▶ gazetteer += tokens[i];
Branch: 1 branch
BranchTrueFalseTotal
gazetteer += tokens[i]; 0 0 0
2266 0 ▶ auto it = map.emplace(gazetteer, (int)gazetteers_info.size()).first;
Branch: 1 branch
BranchTrueFalseTotal
auto it = map.emplace(gazetteer, (int)gazetteers_info.size()).first; 0 0 0
2267 0 ▶ if (it->second == gazetteers_info.size()) gazetteers_info.emplace_back();
Branch: 2 branches
BranchTrueFalseTotal
if (it->second == gazetteers_info.size()) gazetteers_info.emplace_back(); 0 0 0
if (it->second == gazetteers_info.size()) gazetteers_info.emplace_back(); 0 0 0
2268 0 auto& info = gazetteers_info[it->second];
2269 0 ▶ if (i + 1 < tokens.size())
Branch: 1 branch
BranchTrueFalseTotal
if (i + 1 < tokens.size()) 0 0 0
2270 0 info.prefix_of_longer |= true;
2271 else
2272 0 ▶ if (find(info.features.begin(), info.features.end(), *total_features + window) == info.features.end())
Branch: 2 branches
BranchTrueFalseTotal
if (find(info.features.begin(), info.features.end(), *total_features + window) == info.features.end()) 0 0 0
if (find(info.features.begin(), info.features.end(), *total_features + window) == info.features.end()) 0 0 0
2273 0 ▶ info.features.emplace_back(*total_features + window);
Branch: 1 branch
BranchTrueFalseTotal
info.features.emplace_back(*total_features + window); 0 0 0
2274 }
2275 }
2276 0 ▶ *total_features += (2*window + 1) * (longest == 0 ? 0 : longest == 1 ? U+1 : longest == 2 ? L+1 : I+1);
Branch: 3 branches
BranchTrueFalseTotal
*total_features += (2*window + 1) * (longest == 0 ? 0 : longest == 1 ? U+1 : longest == 2 ? L+1 : I+1); 0 0 0
*total_features += (2*window + 1) * (longest == 0 ? 0 : longest == 1 ? U+1 : longest == 2 ? L+1 : I+1); 0 0 0
*total_features += (2*window + 1) * (longest == 0 ? 0 : longest == 1 ? U+1 : longest == 2 ? L+1 : I+1); 0 0 0
2277 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
2278  
2279 0 return true;
2280 }
2281  
2282 0 virtual void load(binary_decoder& data, const nlp_pipeline& pipeline) override {
2283 0 feature_processor::load(data, pipeline);
2284  
2285 0 gazetteers_info.resize(data.next_4B());
2286 0 ▶ for (auto&& gazetteer : gazetteers_info) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer : gazetteers_info) { 0 0 0
2287 0 ▶ gazetteer.prefix_of_longer = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer.prefix_of_longer = data.next_1B(); 0 0 0
2288 0 ▶ gazetteer.features.resize(data.next_1B());
Branch: 2 branches
BranchTrueFalseTotal
gazetteer.features.resize(data.next_1B()); 0 0 0
gazetteer.features.resize(data.next_1B()); 0 0 0
2289 0 ▶ for (auto&& feature : gazetteer.features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : gazetteer.features) 0 0 0
2290 0 ▶ feature = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
feature = data.next_4B(); 0 0 0
2291 }
2292 0 }
2293  
2294 0 virtual void save(binary_encoder& enc) override {
2295 0 feature_processor::save(enc);
2296  
2297 0 enc.add_4B(gazetteers_info.size());
2298 0 ▶ for (auto&& gazetteer : gazetteers_info) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer : gazetteers_info) { 0 0 0
2299 0 ▶ enc.add_1B(gazetteer.prefix_of_longer);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_1B(gazetteer.prefix_of_longer); 0 0 0
2300 0 ▶ enc.add_1B(gazetteer.features.size());
Branch: 1 branch
BranchTrueFalseTotal
enc.add_1B(gazetteer.features.size()); 0 0 0
2301 0 ▶ for (auto&& feature : gazetteer.features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : gazetteer.features) 0 0 0
2302 0 ▶ enc.add_4B(feature);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(feature); 0 0 0
2303 }
2304 0 }
2305  
2306 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* /*total_features*/, string& buffer) const override {
2307 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2308 0 ▶ auto it = map.find(sentence.words[i].raw_lemma);
Branch: 1 branch
BranchTrueFalseTotal
auto it = map.find(sentence.words[i].raw_lemma); 0 0 0
2309 0 ▶ if (it == map.end()) continue;
Branch: 1 branch
BranchTrueFalseTotal
if (it == map.end()) continue; 0 0 0
2310  
2311 // Apply regular gazetteer feature G + unigram gazetteer feature U
2312 0 ▶ for (auto&& feature : gazetteers_info[it->second].features) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : gazetteers_info[it->second].features) { 0 0 0
2313 0 ▶ apply_in_window(i, feature + G * (2*window + 1));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, feature + G * (2*window + 1)); 0 0 0
apply_in_window(i, feature + G * (2*window + 1)); 0 0 0
apply_in_window(i, feature + G * (2*window + 1)); 0 0 0
2314 0 ▶ apply_in_window(i, feature + U * (2*window + 1));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, feature + U * (2*window + 1)); 0 0 0
apply_in_window(i, feature + U * (2*window + 1)); 0 0 0
apply_in_window(i, feature + U * (2*window + 1)); 0 0 0
2315 }
2316  
2317 0 ▶ for (unsigned j = i + 1; gazetteers_info[it->second].prefix_of_longer && j < sentence.size; j++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned j = i + 1; gazetteers_info[it->second].prefix_of_longer && j < sentence.size; j++) { 0 0 0
for (unsigned j = i + 1; gazetteers_info[it->second].prefix_of_longer && j < sentence.size; j++) { 0 0 0
for (unsigned j = i + 1; gazetteers_info[it->second].prefix_of_longer && j < sentence.size; j++) { 0 0 0
2318 0 ▶ if (j == i + 1) buffer.assign(sentence.words[i].raw_lemma);
Branch: 2 branches
BranchTrueFalseTotal
if (j == i + 1) buffer.assign(sentence.words[i].raw_lemma); 0 0 0
if (j == i + 1) buffer.assign(sentence.words[i].raw_lemma); 0 0 0
2319 0 ▶ buffer += ' ';
Branch: 1 branch
BranchTrueFalseTotal
buffer += ' '; 0 0 0
2320 0 ▶ buffer += sentence.words[j].raw_lemma;
Branch: 1 branch
BranchTrueFalseTotal
buffer += sentence.words[j].raw_lemma; 0 0 0
2321 0 ▶ it = map.find(buffer);
Branch: 1 branch
BranchTrueFalseTotal
it = map.find(buffer); 0 0 0
2322 0 ▶ if (it == map.end()) break;
Branch: 1 branch
BranchTrueFalseTotal
if (it == map.end()) break; 0 0 0
2323  
2324 // Apply regular gazetteer feature G + position specific gazetteers B, I, L
2325 0 ▶ for (auto&& feature : gazetteers_info[it->second].features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : gazetteers_info[it->second].features) 0 0 0
2326 0 ▶ for (unsigned g = i; g <= j; g++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned g = i; g <= j; g++) { 0 0 0
2327 0 ▶ apply_in_window(g, feature + G * (2*window + 1));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(g, feature + G * (2*window + 1)); 0 0 0
apply_in_window(g, feature + G * (2*window + 1)); 0 0 0
apply_in_window(g, feature + G * (2*window + 1)); 0 0 0
2328 0 ▶ apply_in_window(g, feature + (g == i ? B : g == j ? L : I) * (2*window + 1));
Branch: 5 branches
BranchTrueFalseTotal
apply_in_window(g, feature + (g == i ? B : g == j ? L : I) * (2*window + 1)); 0 0 0
apply_in_window(g, feature + (g == i ? B : g == j ? L : I) * (2*window + 1)); 0 0 0
apply_in_window(g, feature + (g == i ? B : g == j ? L : I) * (2*window + 1)); 0 0 0
apply_in_window(g, feature + (g == i ? B : g == j ? L : I) * (2*window + 1)); 0 0 0
apply_in_window(g, feature + (g == i ? B : g == j ? L : I) * (2*window + 1)); 0 0 0
2329 }
2330 }
2331 }
2332 0 }
2333  
2334 private:
2335 struct gazetteer_info {
2336 vector<ner_feature> features;
2337 bool prefix_of_longer;
2338 };
2339 vector<gazetteer_info> gazetteers_info;
2340 };
2341  
2342 // GazetteersEnhanced
2343 class gazetteers_enhanced : public feature_processor {
2344 public:
2345 enum { G = 0, U = 1, B = 2, L = 3, I = 4, TOTAL = 5 };
2346  
2347 0 virtual bool parse(int window, const vector<string>& args, entity_map& entities,
2348 ner_feature* total_features, const nlp_pipeline& pipeline) override {
2349 0 ▶ if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
2350  
2351 0 gazetteer_metas.clear();
2352 0 gazetteer_lists.clear();
2353  
2354 0 ▶ if (args.size() < 4) return cerr << "Not enough parameters to GazetteersEnhanced!" << endl, false;
Branch: 1 branch
BranchTrueFalseTotal
if (args.size() < 4) return cerr << "Not enough parameters to GazetteersEnhanced!" << endl, false; 0 0 0
2355 0 ▶ if (args.size() & 1) return cerr << "Odd number of parameters to GazetteersEnhanced!" << endl, false;
Branch: 1 branch
BranchTrueFalseTotal
if (args.size() & 1) return cerr << "Odd number of parameters to GazetteersEnhanced!" << endl, false; 0 0 0
2356  
2357 0 ▶ if (args[0] == "form") match = MATCH_FORM;
Branch: 1 branch
BranchTrueFalseTotal
if (args[0] == "form") match = MATCH_FORM; 0 0 0
2358 0 ▶ else if (args[0] == "rawlemma") match = MATCH_RAWLEMMA;
Branch: 1 branch
BranchTrueFalseTotal
else if (args[0] == "rawlemma") match = MATCH_RAWLEMMA; 0 0 0
2359 0 ▶ else if (args[0] == "rawlemmas") match = MATCH_RAWLEMMAS;
Branch: 1 branch
BranchTrueFalseTotal
else if (args[0] == "rawlemmas") match = MATCH_RAWLEMMAS; 0 0 0
2360 0 else return cerr << "First parameter of GazetteersEnhanced not one of form/rawlemma/rawlemmas!" << endl, false;
2361  
2362 0 ▶ if (args[1] == "embed_in_model") embed = EMBED_IN_MODEL;
Branch: 1 branch
BranchTrueFalseTotal
if (args[1] == "embed_in_model") embed = EMBED_IN_MODEL; 0 0 0
2363 0 ▶ else if (args[1] == "out_of_model") embed = OUT_OF_MODEL;
Branch: 1 branch
BranchTrueFalseTotal
else if (args[1] == "out_of_model") embed = OUT_OF_MODEL; 0 0 0
2364 0 else return cerr << "Second parameter of GazetteersEnhanced not one of [embed_in|out_of]_model!" << endl, false;
2365  
2366 0 ▶ for (unsigned i = 2; i < args.size(); i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 2; i < args.size(); i += 2) { 0 0 0
2367 0 gazetteer_metas.emplace_back();
2368 0 gazetteer_metas.back().basename = args[i];
2369 0 gazetteer_metas.back().feature = *total_features + window; *total_features += TOTAL * (2 * window + 1);
2370 0 ▶ gazetteer_metas.back().entity = args[i + 1] == "NONE" ? -1 : entities.parse(args[i + 1].c_str(), true);
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_metas.back().entity = args[i + 1] == "NONE" ? -1 : entities.parse(args[i + 1].c_str(), true); 0 0 0
2371 }
2372  
2373 0 entity_list.clear();
2374 0 ▶ for (entity_type i = 0; i < entities.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (entity_type i = 0; i < entities.size(); i++) 0 0 0
2375 0 entity_list.push_back(entities.name(i));
2376  
2377 0 ▶ if (!load_gazetteer_lists(pipeline, embed == EMBED_IN_MODEL)) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!load_gazetteer_lists(pipeline, embed == EMBED_IN_MODEL)) return false; 0 0 0
2378  
2379 0 return true;
2380 }
2381  
2382 0 virtual void load(binary_decoder& data, const nlp_pipeline& pipeline) override {
2383 0 feature_processor::load(data, pipeline);
2384  
2385 0 match = data.next_4B();
2386 0 embed = OUT_OF_MODEL;
2387  
2388 0 gazetteer_metas.resize(data.next_4B());
2389 0 ▶ for (auto&& gazetteer_meta : gazetteer_metas) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_meta : gazetteer_metas) { 0 0 0
2390 0 ▶ data.next_str(gazetteer_meta.basename);
Branch: 1 branch
BranchTrueFalseTotal
data.next_str(gazetteer_meta.basename); 0 0 0
2391 0 ▶ gazetteer_meta.feature = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_meta.feature = data.next_4B(); 0 0 0
2392 0 ▶ gazetteer_meta.entity = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_meta.entity = data.next_4B(); 0 0 0
2393 }
2394  
2395 0 gazetteer_lists.resize(data.next_4B());
2396 0 ▶ for (auto&& gazetteer_list : gazetteer_lists) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_list : gazetteer_lists) { 0 0 0
2397 0 ▶ gazetteer_list.gazetteers.resize(data.next_4B());
Branch: 2 branches
BranchTrueFalseTotal
gazetteer_list.gazetteers.resize(data.next_4B()); 0 0 0
gazetteer_list.gazetteers.resize(data.next_4B()); 0 0 0
2398 0 ▶ for (auto&& gazetteer : gazetteer_list.gazetteers)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer : gazetteer_list.gazetteers) 0 0 0
2399 0 ▶ data.next_str(gazetteer);
Branch: 1 branch
BranchTrueFalseTotal
data.next_str(gazetteer); 0 0 0
2400 0 ▶ gazetteer_list.feature = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_list.feature = data.next_4B(); 0 0 0
2401 0 ▶ gazetteer_list.entity = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_list.entity = data.next_4B(); 0 0 0
2402 0 ▶ gazetteer_list.mode = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_list.mode = data.next_4B(); 0 0 0
2403 }
2404  
2405 0 entity_list.resize(data.next_4B());
2406 0 ▶ for (auto&& entity : entity_list)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& entity : entity_list) 0 0 0
2407 0 ▶ data.next_str(entity);
Branch: 1 branch
BranchTrueFalseTotal
data.next_str(entity); 0 0 0
2408  
2409 0 load_gazetteer_lists(pipeline, false);
2410 0 }
2411  
2412 0 virtual void save(binary_encoder& enc) override {
2413 0 feature_processor::save(enc);
2414  
2415 0 enc.add_4B(match);
2416  
2417 0 enc.add_4B(gazetteer_metas.size());
2418 0 ▶ for (auto&& gazetteer_meta : gazetteer_metas) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_meta : gazetteer_metas) { 0 0 0
2419 0 ▶ enc.add_str(gazetteer_meta.basename);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_str(gazetteer_meta.basename); 0 0 0
2420 0 ▶ enc.add_4B(gazetteer_meta.feature);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(gazetteer_meta.feature); 0 0 0
2421 0 ▶ enc.add_4B(gazetteer_meta.entity);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(gazetteer_meta.entity); 0 0 0
2422 }
2423  
2424 0 ▶ if (embed == EMBED_IN_MODEL) {
Branch: 1 branch
BranchTrueFalseTotal
if (embed == EMBED_IN_MODEL) { 0 0 0
2425 0 enc.add_4B(gazetteer_lists.size());
2426 0 ▶ for (auto&& gazetteer_list : gazetteer_lists) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_list : gazetteer_lists) { 0 0 0
2427 0 ▶ enc.add_4B(gazetteer_list.gazetteers.size());
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(gazetteer_list.gazetteers.size()); 0 0 0
2428 0 ▶ for (auto&& gazetteer : gazetteer_list.gazetteers)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer : gazetteer_list.gazetteers) 0 0 0
2429 0 ▶ enc.add_str(gazetteer);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_str(gazetteer); 0 0 0
2430 0 ▶ enc.add_4B(gazetteer_list.feature);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(gazetteer_list.feature); 0 0 0
2431 0 ▶ enc.add_4B(gazetteer_list.entity);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(gazetteer_list.entity); 0 0 0
2432 0 ▶ enc.add_4B(gazetteer_list.mode);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_4B(gazetteer_list.mode); 0 0 0
2433 }
2434 } else {
2435 0 enc.add_4B(0);
2436 }
2437  
2438 0 enc.add_4B(entity_list.size());
2439 0 ▶ for (auto&& entity : entity_list)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& entity : entity_list) 0 0 0
2440 0 ▶ enc.add_str(entity);
Branch: 1 branch
BranchTrueFalseTotal
enc.add_str(entity); 0 0 0
2441 0 }
2442  
2443 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* /*total_features*/, string& /*buffer*/) const override {
2444 0 vector<unsigned> nodes, new_nodes;
2445 0 ▶ vector<vector<ner_feature>> features(sentence.size);
Branch: 1 branch
BranchTrueFalseTotal
vector<vector<ner_feature>> features(sentence.size); 0 0 0
2446  
2447 0 ▶ vector<vector<string>> recased_match_sources(sentence.size);
Branch: 1 branch
BranchTrueFalseTotal
vector<vector<string>> recased_match_sources(sentence.size); 0 0 0
2448 0 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 0 0 0
2449 0 ▶ recase_match_source(sentence.words[i], RECASE_ANY, recased_match_sources[i]);
Branch: 1 branch
BranchTrueFalseTotal
recase_match_source(sentence.words[i], RECASE_ANY, recased_match_sources[i]); 0 0 0
2450  
2451 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2452 0 unsigned hard_pre_length = 0, hard_pre_node = -1;
2453 0 bool hard_pre_possible = true;
2454 0 ▶ nodes.assign(1, 0);
Branch: 1 branch
BranchTrueFalseTotal
nodes.assign(1, 0); 0 0 0
2455 0 ▶ for (unsigned j = i; j < sentence.size && !nodes.empty(); j++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned j = i; j < sentence.size && !nodes.empty(); j++) { 0 0 0
for (unsigned j = i; j < sentence.size && !nodes.empty(); j++) { 0 0 0
for (unsigned j = i; j < sentence.size && !nodes.empty(); j++) { 0 0 0
2456 0 new_nodes.clear();
2457 0 ▶ for (auto&& node : nodes)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& node : nodes) 0 0 0
2458 0 ▶ if (!gazetteers_trie[node].children.empty())
Branch: 1 branch
BranchTrueFalseTotal
if (!gazetteers_trie[node].children.empty()) 0 0 0
2459 0 ▶ for (auto&& match_source : recased_match_sources[j]) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& match_source : recased_match_sources[j]) { 0 0 0
2460 0 ▶ auto range = gazetteers_trie[node].children.equal_range(match_source);
Branch: 1 branch
BranchTrueFalseTotal
auto range = gazetteers_trie[node].children.equal_range(match_source); 0 0 0
2461 0 ▶ for (auto&& it = range.first; it != range.second; it++)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& it = range.first; it != range.second; it++) 0 0 0
2462 0 ▶ append_unless_exists(new_nodes, it->second);
Branch: 1 branch
BranchTrueFalseTotal
append_unless_exists(new_nodes, it->second); 0 0 0
2463 }
2464  
2465 0 ▶ hard_pre_possible = hard_pre_possible && !sentence.probabilities[j].local_filled;
Branch: 2 branches
BranchTrueFalseTotal
hard_pre_possible = hard_pre_possible && !sentence.probabilities[j].local_filled; 0 0 0
hard_pre_possible = hard_pre_possible && !sentence.probabilities[j].local_filled; 0 0 0
2466 0 ▶ if (hard_pre_possible)
Branch: 1 branch
BranchTrueFalseTotal
if (hard_pre_possible) 0 0 0
2467 0 ▶ for (auto&& node : new_nodes)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& node : new_nodes) 0 0 0
2468 0 ▶ if (gazetteers_trie[node].mode == HARD_PRE &&
Branch: 2 branches
BranchTrueFalseTotal
if (gazetteers_trie[node].mode == HARD_PRE && 0 0 0
if (gazetteers_trie[node].mode == HARD_PRE && 0 0 0
2469 0 ▶ ((j - i + 1) > hard_pre_length || node < hard_pre_node))
Branch: 2 branches
BranchTrueFalseTotal
((j - i + 1) > hard_pre_length || node < hard_pre_node)) 0 0 0
((j - i + 1) > hard_pre_length || node < hard_pre_node)) 0 0 0
2470 0 hard_pre_length = j - i + 1, hard_pre_node = node;
2471  
2472 // Fill features
2473 0 ▶ for (auto&& node : new_nodes)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& node : new_nodes) 0 0 0
2474 0 ▶ for (auto&& feature : gazetteers_trie[node].features)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : gazetteers_trie[node].features) 0 0 0
2475 0 ▶ for (unsigned k = i; k <= j; k++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned k = i; k <= j; k++) { 0 0 0
2476 0 ▶ bilou_type type = j == i ? bilou_type_U : k == i ? bilou_type_B : k == j ? bilou_type_L : bilou_type_I;
Branch: 3 branches
BranchTrueFalseTotal
bilou_type type = j == i ? bilou_type_U : k == i ? bilou_type_B : k == j ? bilou_type_L : bilou_type_I; 0 0 0
bilou_type type = j == i ? bilou_type_U : k == i ? bilou_type_B : k == j ? bilou_type_L : bilou_type_I; 0 0 0
bilou_type type = j == i ? bilou_type_U : k == i ? bilou_type_B : k == j ? bilou_type_L : bilou_type_I; 0 0 0
2477 0 ▶ append_unless_exists(features[k], feature + G * (2 * window + 1));
Branch: 1 branch
BranchTrueFalseTotal
append_unless_exists(features[k], feature + G * (2 * window + 1)); 0 0 0
2478 0 ▶ append_unless_exists(features[k], feature + type * (2 * window + 1));
Branch: 1 branch
BranchTrueFalseTotal
append_unless_exists(features[k], feature + type * (2 * window + 1)); 0 0 0
2479 }
2480  
2481 0 nodes.swap(new_nodes);
2482 }
2483  
2484 0 ▶ if (hard_pre_length)
Branch: 1 branch
BranchTrueFalseTotal
if (hard_pre_length) 0 0 0
2485 0 ▶ for (unsigned j = i; j < i + hard_pre_length; j++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned j = i; j < i + hard_pre_length; j++) { 0 0 0
2486 0 ▶ for (auto&& bilou : sentence.probabilities[j].local.bilou) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& bilou : sentence.probabilities[j].local.bilou) { 0 0 0
2487 0 bilou.probability = 0.;
2488 0 bilou.entity = entity_type_unknown;
2489 }
2490 0 ▶ bilou_type type = hard_pre_length == 1 ? bilou_type_U :
Branch: 2 branches
BranchTrueFalseTotal
bilou_type type = hard_pre_length == 1 ? bilou_type_U : 0 0 0
bilou_type type = hard_pre_length == 1 ? bilou_type_U : 0 0 0
2491 0 ▶ j == i ? bilou_type_B : j + 1 == i + hard_pre_length ? bilou_type_L : bilou_type_I;
Branch: 1 branch
BranchTrueFalseTotal
j == i ? bilou_type_B : j + 1 == i + hard_pre_length ? bilou_type_L : bilou_type_I; 0 0 0
2492 0 sentence.probabilities[j].local.bilou[type].probability = 1.;
2493 0 sentence.probabilities[j].local.bilou[type].entity = gazetteers_trie[hard_pre_node].entity;
2494 0 sentence.probabilities[j].local_filled = true;
2495 }
2496 }
2497  
2498 // Apply generated features
2499 0 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 0 0 0
2500 0 ▶ for (auto&& feature : features[i])
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& feature : features[i]) 0 0 0
2501 0 ▶ apply_in_window(i, feature);
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, feature); 0 0 0
apply_in_window(i, feature); 0 0 0
apply_in_window(i, feature); 0 0 0
2502 0 }
2503  
2504 0 virtual void process_entities(ner_sentence& sentence, vector<named_entity>& entities, vector<named_entity>& buffer) const override {
2505 0 vector<unsigned> nodes, new_nodes;
2506  
2507 0 ▶ vector<vector<string>> recased_match_sources(sentence.size);
Branch: 1 branch
BranchTrueFalseTotal
vector<vector<string>> recased_match_sources(sentence.size); 0 0 0
2508 0 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 0 0 0
2509 0 ▶ recase_match_source(sentence.words[i], RECASE_ANY, recased_match_sources[i]);
Branch: 1 branch
BranchTrueFalseTotal
recase_match_source(sentence.words[i], RECASE_ANY, recased_match_sources[i]); 0 0 0
2510  
2511 0 buffer.clear();
2512 0 unsigned entity_until = 0;
2513 0 ▶ for (unsigned i = 0, e = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0, e = 0; i < sentence.size; i++) { 0 0 0
2514 0 ▶ while (e < entities.size() && entities[e].start == i) {
Branch: 3 branches
BranchTrueFalseTotal
while (e < entities.size() && entities[e].start == i) { 0 0 0
while (e < entities.size() && entities[e].start == i) { 0 0 0
while (e < entities.size() && entities[e].start == i) { 0 0 0
2515 0 ▶ if (i + entities[e].length > entity_until)
Branch: 1 branch
BranchTrueFalseTotal
if (i + entities[e].length > entity_until) 0 0 0
2516 0 entity_until = i + entities[e].length;
2517 0 ▶ buffer.push_back(entities[e++]);
Branch: 1 branch
BranchTrueFalseTotal
buffer.push_back(entities[e++]); 0 0 0
2518 }
2519  
2520 0 ▶ if (entity_until <= i) {
Branch: 1 branch
BranchTrueFalseTotal
if (entity_until <= i) { 0 0 0
2521 // There is place for a possible POST gazetteer
2522 0 ▶ unsigned free_until = e < entities.size() ? entities[e].start : sentence.size;
Branch: 1 branch
BranchTrueFalseTotal
unsigned free_until = e < entities.size() ? entities[e].start : sentence.size; 0 0 0
2523  
2524 0 unsigned hard_post_length = 0, hard_post_node = -1;
2525 0 ▶ nodes.assign(1, 0);
Branch: 1 branch
BranchTrueFalseTotal
nodes.assign(1, 0); 0 0 0
2526 0 ▶ for (unsigned j = i; j < free_until && !nodes.empty(); j++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned j = i; j < free_until && !nodes.empty(); j++) { 0 0 0
for (unsigned j = i; j < free_until && !nodes.empty(); j++) { 0 0 0
for (unsigned j = i; j < free_until && !nodes.empty(); j++) { 0 0 0
2527 0 new_nodes.clear();
2528 0 ▶ for (auto&& node : nodes)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& node : nodes) 0 0 0
2529 0 ▶ if (!gazetteers_trie[node].children.empty())
Branch: 1 branch
BranchTrueFalseTotal
if (!gazetteers_trie[node].children.empty()) 0 0 0
2530 0 ▶ for (auto&& match_source : recased_match_sources[j]) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& match_source : recased_match_sources[j]) { 0 0 0
2531 0 ▶ auto range = gazetteers_trie[node].children.equal_range(match_source);
Branch: 1 branch
BranchTrueFalseTotal
auto range = gazetteers_trie[node].children.equal_range(match_source); 0 0 0
2532 0 ▶ for (auto&& it = range.first; it != range.second; it++)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& it = range.first; it != range.second; it++) 0 0 0
2533 0 ▶ append_unless_exists(new_nodes, it->second);
Branch: 1 branch
BranchTrueFalseTotal
append_unless_exists(new_nodes, it->second); 0 0 0
2534 }
2535  
2536 0 ▶ for (auto&& node : new_nodes)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& node : new_nodes) 0 0 0
2537 0 ▶ if (gazetteers_trie[node].mode == HARD_POST &&
Branch: 2 branches
BranchTrueFalseTotal
if (gazetteers_trie[node].mode == HARD_POST && 0 0 0
if (gazetteers_trie[node].mode == HARD_POST && 0 0 0
2538 0 ▶ ((j - i + 1) > hard_post_length || node < hard_post_node))
Branch: 2 branches
BranchTrueFalseTotal
((j - i + 1) > hard_post_length || node < hard_post_node)) 0 0 0
((j - i + 1) > hard_post_length || node < hard_post_node)) 0 0 0
2539 0 hard_post_length = j - i + 1, hard_post_node = node;
2540  
2541 0 nodes.swap(new_nodes);
2542 }
2543  
2544 0 ▶ if (hard_post_length) {
Branch: 1 branch
BranchTrueFalseTotal
if (hard_post_length) { 0 0 0
2545 0 ▶ buffer.emplace_back(i, hard_post_length, entity_list[gazetteers_trie[hard_post_node].entity]);
Branch: 1 branch
BranchTrueFalseTotal
buffer.emplace_back(i, hard_post_length, entity_list[gazetteers_trie[hard_post_node].entity]); 0 0 0
2546 0 entity_until = i + hard_post_length;
2547 }
2548 }
2549 }
2550  
2551 0 ▶ if (buffer.size() != entities.size())
Branch: 1 branch
BranchTrueFalseTotal
if (buffer.size() != entities.size()) 0 0 0
2552 0 entities.swap(buffer);
2553 0 }
2554  
2555 0 virtual void gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const override {
2556 0 ▶ for (auto&& gazetteer_list : gazetteer_lists)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_list : gazetteer_lists) 0 0 0
2557 0 ▶ for (auto&& gazetteer : gazetteer_list.gazetteers) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer : gazetteer_list.gazetteers) { 0 0 0
2558 0 ▶ gazetteers.push_back(gazetteer);
Branch: 1 branch
BranchTrueFalseTotal
gazetteers.push_back(gazetteer); 0 0 0
2559 0 ▶ if (gazetteer_types) gazetteer_types->push_back(gazetteer_list.entity);
Branch: 2 branches
BranchTrueFalseTotal
if (gazetteer_types) gazetteer_types->push_back(gazetteer_list.entity); 0 0 0
if (gazetteer_types) gazetteer_types->push_back(gazetteer_list.entity); 0 0 0
2560 }
2561 0 }
2562  
2563 private:
2564 enum { MATCH_FORM = 0, MATCH_RAWLEMMA = 1, MATCH_RAWLEMMAS = 2 };
2565 int match;
2566  
2567 enum { EMBED_IN_MODEL = 0, OUT_OF_MODEL = 1 };
2568 int embed;
2569  
2570 enum { SOFT, HARD_PRE, HARD_POST, MODES_TOTAL };
2571 const static vector<string> basename_suffixes;
2572  
2573 struct gazetteer_meta_info {
2574 string basename;
2575 ner_feature feature;
2576 int entity;
2577 };
2578 vector<gazetteer_meta_info> gazetteer_metas;
2579  
2580 struct gazetteer_list_info {
2581 vector<string> gazetteers;
2582 ner_feature feature;
2583 int entity;
2584 int mode;
2585 };
2586 vector<gazetteer_list_info> gazetteer_lists;
2587  
2588 struct gazetteer_trie_node {
2589 vector<ner_feature> features;
2590 unordered_multimap<string, unsigned> children;
2591 int mode = SOFT, entity = -1;
2592 };
2593 vector<gazetteer_trie_node> gazetteers_trie;
2594  
2595 vector<string> entity_list;
2596  
2597 template <class T>
2598 0 inline static void append_unless_exists(vector<T>& array, T value) {
2599 size_t i;
2600 0 ▶ for (i = array.size(); i; i--)
Branch: 1 branch
BranchTrueFalseTotal
for (i = array.size(); i; i--) 0 0 0
2601 0 ▶ if (array[i - 1] == value)
Branch: 1 branch
BranchTrueFalseTotal
if (array[i - 1] == value) 0 0 0
2602 0 break;
2603  
2604 0 ▶ if (!i)
Branch: 1 branch
BranchTrueFalseTotal
if (!i) 0 0 0
2605 0 array.push_back(value);
2606 0 }
2607  
2608 0 bool load_gazetteer_lists(const nlp_pipeline& pipeline, bool files_must_exist) {
2609 0 string file_name, line;
2610  
2611 // Load raw gazetteers (maybe additional during inference)
2612 0 ▶ for (auto&& gazetteer_meta : gazetteer_metas)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_meta : gazetteer_metas) 0 0 0
2613 0 ▶ for (int mode = 0; mode < MODES_TOTAL; mode++) {
Branch: 1 branch
BranchTrueFalseTotal
for (int mode = 0; mode < MODES_TOTAL; mode++) { 0 0 0
2614 0 ▶ file_name.assign(gazetteer_meta.basename).append(basename_suffixes[mode]);
Branch: 2 branches
BranchTrueFalseTotal
file_name.assign(gazetteer_meta.basename).append(basename_suffixes[mode]); 0 0 0
file_name.assign(gazetteer_meta.basename).append(basename_suffixes[mode]); 0 0 0
2615  
2616 0 ▶ ifstream file(path_from_utf8(file_name).c_str());
Branch: 1 branch
BranchTrueFalseTotal
ifstream file(path_from_utf8(file_name).c_str()); 0 0 0
2617 0 ▶ if (!file.is_open()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!file.is_open()) { 0 0 0
2618 0 ▶ if (mode == SOFT && files_must_exist)
Branch: 2 branches
BranchTrueFalseTotal
if (mode == SOFT && files_must_exist) 0 0 0
if (mode == SOFT && files_must_exist) 0 0 0
2619 0 ▶ return cerr << "Cannot open gazetteers file '" << file_name << "'!" << endl, false;
Branch: 4 branches
BranchTrueFalseTotal
return cerr << "Cannot open gazetteers file '" << file_name << "'!" << endl, false; 0 0 0
return cerr << "Cannot open gazetteers file '" << file_name << "'!" << endl, false; 0 0 0
return cerr << "Cannot open gazetteers file '" << file_name << "'!" << endl, false; 0 0 0
return cerr << "Cannot open gazetteers file '" << file_name << "'!" << endl, false; 0 0 0
2620 0 continue;
2621 }
2622  
2623 0 ▶ gazetteer_lists.emplace_back();
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_lists.emplace_back(); 0 0 0
2624 0 gazetteer_lists.back().feature = gazetteer_meta.feature;
2625 0 gazetteer_lists.back().entity = gazetteer_meta.entity;
2626 0 gazetteer_lists.back().mode = mode;
2627  
2628 0 ▶ while (getline(file, line))
Branch: 3 branches
BranchTrueFalseTotal
while (getline(file, line)) 0 0 0
while (getline(file, line)) 0 0 0
while (getline(file, line)) 0 0 0
2629 0 ▶ if (!line.empty() && line[0] != '#')
Branch: 4 branches
BranchTrueFalseTotal
if (!line.empty() && line[0] != '#') 0 0 0
if (!line.empty() && line[0] != '#') 0 0 0
if (!line.empty() && line[0] != '#') 0 0 0
if (!line.empty() && line[0] != '#') 0 0 0
2630 0 ▶ gazetteer_lists.back().gazetteers.push_back(line);
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_lists.back().gazetteers.push_back(line); 0 0 0
2631 0 }
2632  
2633 // Build the gazetteers_trie
2634 0 unordered_map<string, int> gazetteer_prefixes;
2635 0 ▶ vector<string_piece> gazetteer_tokens, gazetteer_tokens_additional, gazetteer_token(1);
Branch: 1 branch
BranchTrueFalseTotal
vector<string_piece> gazetteer_tokens, gazetteer_tokens_additional, gazetteer_token(1); 0 0 0
2636 0 ner_sentence gazetteer_token_tagged;
2637 0 vector<string> gazetteer_recased_match_sources;
2638  
2639 0 gazetteers_trie.clear();
2640 0 ▶ gazetteers_trie.emplace_back();
Branch: 1 branch
BranchTrueFalseTotal
gazetteers_trie.emplace_back(); 0 0 0
2641 0 ▶ for (auto&& gazetteer_list : gazetteer_lists)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer_list : gazetteer_lists) 0 0 0
2642 0 ▶ for (auto&& gazetteer : gazetteer_list.gazetteers) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& gazetteer : gazetteer_list.gazetteers) { 0 0 0
2643 0 ▶ pipeline.tokenizer->set_text(gazetteer);
Branch: 1 branch
BranchTrueFalseTotal
pipeline.tokenizer->set_text(gazetteer); 0 0 0
2644 0 ▶ if (!pipeline.tokenizer->next_sentence(&gazetteer_tokens, nullptr)) continue;
Branch: 2 branches
BranchTrueFalseTotal
if (!pipeline.tokenizer->next_sentence(&gazetteer_tokens, nullptr)) continue; 0 0 0
if (!pipeline.tokenizer->next_sentence(&gazetteer_tokens, nullptr)) continue; 0 0 0
2645 0 ▶ while (pipeline.tokenizer->next_sentence(&gazetteer_tokens_additional, nullptr))
Branch: 2 branches
BranchTrueFalseTotal
while (pipeline.tokenizer->next_sentence(&gazetteer_tokens_additional, nullptr)) 0 0 0
while (pipeline.tokenizer->next_sentence(&gazetteer_tokens_additional, nullptr)) 0 0 0
2646 0 ▶ gazetteer_tokens.insert(gazetteer_tokens.end(), gazetteer_tokens_additional.begin(), gazetteer_tokens_additional.end());
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_tokens.insert(gazetteer_tokens.end(), gazetteer_tokens_additional.begin(), gazetteer_tokens_additional.end()); 0 0 0
2647  
2648 0 unsigned node = 0;
2649 0 string prefix;
2650 0 ▶ for (unsigned token = 0; token < gazetteer_tokens.size(); token++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned token = 0; token < gazetteer_tokens.size(); token++) { 0 0 0
2651 0 ▶ if (token) prefix.push_back('\t');
Branch: 2 branches
BranchTrueFalseTotal
if (token) prefix.push_back('\t'); 0 0 0
if (token) prefix.push_back('\t'); 0 0 0
2652 0 ▶ prefix.append(gazetteer_tokens[token].str, gazetteer_tokens[token].len);
Branch: 1 branch
BranchTrueFalseTotal
prefix.append(gazetteer_tokens[token].str, gazetteer_tokens[token].len); 0 0 0
2653 0 ▶ auto prefix_it = gazetteer_prefixes.find(prefix);
Branch: 1 branch
BranchTrueFalseTotal
auto prefix_it = gazetteer_prefixes.find(prefix); 0 0 0
2654 0 ▶ if (prefix_it == gazetteer_prefixes.end()) {
Branch: 1 branch
BranchTrueFalseTotal
if (prefix_it == gazetteer_prefixes.end()) { 0 0 0
2655 0 unsigned new_node = gazetteers_trie.size();
2656 0 ▶ gazetteers_trie.emplace_back();
Branch: 1 branch
BranchTrueFalseTotal
gazetteers_trie.emplace_back(); 0 0 0
2657 0 ▶ gazetteer_prefixes.emplace(prefix, new_node);
Branch: 1 branch
BranchTrueFalseTotal
gazetteer_prefixes.emplace(prefix, new_node); 0 0 0
2658  
2659 0 gazetteer_token[0] = string_piece(gazetteer_tokens[token]);
2660 0 ▶ pipeline.tagger->tag(gazetteer_token, gazetteer_token_tagged);
Branch: 1 branch
BranchTrueFalseTotal
pipeline.tagger->tag(gazetteer_token, gazetteer_token_tagged); 0 0 0
2661 0 ▶ recase_match_source(gazetteer_token_tagged.words[0], RECASE_NATIVE, gazetteer_recased_match_sources);
Branch: 1 branch
BranchTrueFalseTotal
recase_match_source(gazetteer_token_tagged.words[0], RECASE_NATIVE, gazetteer_recased_match_sources); 0 0 0
2662 0 ▶ for (auto&& match_source : gazetteer_recased_match_sources)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& match_source : gazetteer_recased_match_sources) 0 0 0
2663 0 ▶ gazetteers_trie[node].children.emplace(match_source, new_node);
Branch: 1 branch
BranchTrueFalseTotal
gazetteers_trie[node].children.emplace(match_source, new_node); 0 0 0
2664  
2665 0 node = new_node;
2666 } else {
2667 0 node = prefix_it->second;
2668 }
2669 }
2670  
2671 0 ▶ append_unless_exists(gazetteers_trie[node].features, gazetteer_list.feature);
Branch: 1 branch
BranchTrueFalseTotal
append_unless_exists(gazetteers_trie[node].features, gazetteer_list.feature); 0 0 0
2672 0 ▶ if ((gazetteer_list.mode == HARD_PRE && gazetteers_trie[node].mode != HARD_PRE) ||
Branch: 3 branches
BranchTrueFalseTotal
if ((gazetteer_list.mode == HARD_PRE && gazetteers_trie[node].mode != HARD_PRE) || 0 0 0
if ((gazetteer_list.mode == HARD_PRE && gazetteers_trie[node].mode != HARD_PRE) || 0 0 0
if ((gazetteer_list.mode == HARD_PRE && gazetteers_trie[node].mode != HARD_PRE) || 0 0 0
2673 0 ▶ (gazetteer_list.mode == HARD_POST && gazetteers_trie[node].mode == SOFT)) {
Branch: 2 branches
BranchTrueFalseTotal
(gazetteer_list.mode == HARD_POST && gazetteers_trie[node].mode == SOFT)) { 0 0 0
(gazetteer_list.mode == HARD_POST && gazetteers_trie[node].mode == SOFT)) { 0 0 0
2674 0 gazetteers_trie[node].mode = gazetteer_list.mode;
2675 0 gazetteers_trie[node].entity = gazetteer_list.entity;
2676 }
2677 0 }
2678  
2679 0 return true;
2680 0 }
2681  
2682 enum { TO_LOWER, TO_TITLE, TO_UPPER, TO_TOTAL };
2683 0 static void recase_text(const string& text, int mode, vector<string>& recased) {
2684 using namespace unilib;
2685  
2686 0 recased.emplace_back();
2687  
2688 0 ▶ if (mode == TO_UPPER)
Branch: 1 branch
BranchTrueFalseTotal
if (mode == TO_UPPER) 0 0 0
2689 0 utf8::map(unicode::uppercase, text, recased.back());
2690 0 ▶ else if (mode == TO_LOWER)
Branch: 1 branch
BranchTrueFalseTotal
else if (mode == TO_LOWER) 0 0 0
2691 0 utf8::map(unicode::lowercase, text, recased.back());
2692 0 ▶ else if (mode == TO_TITLE)
Branch: 1 branch
BranchTrueFalseTotal
else if (mode == TO_TITLE) 0 0 0
2693 0 ▶ for (auto&& chr : utf8::decoder(text))
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& chr : utf8::decoder(text)) 0 0 0
for (auto&& chr : utf8::decoder(text)) 0 0 0
for (auto&& chr : utf8::decoder(text)) 0 0 0
2694 0 ▶ utf8::append(recased.back(), recased.back().empty() ? unicode::uppercase(chr) : unicode::lowercase(chr));
Branch: 2 branches
BranchTrueFalseTotal
utf8::append(recased.back(), recased.back().empty() ? unicode::uppercase(chr) : unicode::lowercase(chr)); 0 0 0
utf8::append(recased.back(), recased.back().empty() ? unicode::uppercase(chr) : unicode::lowercase(chr)); 0 0 0
2695 0 }
2696  
2697 enum { RECASE_NATIVE, RECASE_ANY };
2698 0 void recase_match_source(const ner_word& word, int mode, vector<string>& recased) const {
2699 using namespace unilib;
2700  
2701 0 bool any_lower = false, first_uc = false, first = true;
2702 0 ▶ for (auto&& chr : utf8::decoder(word.form)) {
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& chr : utf8::decoder(word.form)) { 0 0 0
for (auto&& chr : utf8::decoder(word.form)) { 0 0 0
for (auto&& chr : utf8::decoder(word.form)) { 0 0 0
2703 0 ▶ any_lower = any_lower || (unicode::category(chr) & unicode::Ll);
Branch: 2 branches
BranchTrueFalseTotal
any_lower = any_lower || (unicode::category(chr) & unicode::Ll); 0 0 0
any_lower = any_lower || (unicode::category(chr) & unicode::Ll); 0 0 0
2704 0 ▶ if (first) first_uc = unicode::category(chr) & unicode::Lut;
Branch: 1 branch
BranchTrueFalseTotal
if (first) first_uc = unicode::category(chr) & unicode::Lut; 0 0 0
2705 0 first = false;
2706 }
2707  
2708 0 recased.clear();
2709  
2710 0 ▶ for (int perform = 0; perform < TO_TOTAL; perform++) {
Branch: 1 branch
BranchTrueFalseTotal
for (int perform = 0; perform < TO_TOTAL; perform++) { 0 0 0
2711 0 ▶ if (mode == RECASE_NATIVE) {
Branch: 1 branch
BranchTrueFalseTotal
if (mode == RECASE_NATIVE) { 0 0 0
2712 0 ▶ if (perform == TO_UPPER && !(first_uc && !any_lower)) continue;
Branch: 3 branches
BranchTrueFalseTotal
if (perform == TO_UPPER && !(first_uc && !any_lower)) continue; 0 0 0
if (perform == TO_UPPER && !(first_uc && !any_lower)) continue; 0 0 0
if (perform == TO_UPPER && !(first_uc && !any_lower)) continue; 0 0 0
2713 0 ▶ if (perform == TO_TITLE && !(first_uc && any_lower)) continue;
Branch: 3 branches
BranchTrueFalseTotal
if (perform == TO_TITLE && !(first_uc && any_lower)) continue; 0 0 0
if (perform == TO_TITLE && !(first_uc && any_lower)) continue; 0 0 0
if (perform == TO_TITLE && !(first_uc && any_lower)) continue; 0 0 0
2714 0 ▶ if (perform == TO_LOWER && first_uc) continue;
Branch: 2 branches
BranchTrueFalseTotal
if (perform == TO_LOWER && first_uc) continue; 0 0 0
if (perform == TO_LOWER && first_uc) continue; 0 0 0
2715 }
2716 0 ▶ if (mode == RECASE_ANY) {
Branch: 1 branch
BranchTrueFalseTotal
if (mode == RECASE_ANY) { 0 0 0
2717 0 ▶ if (perform == TO_UPPER && !(first_uc && !any_lower)) continue;
Branch: 3 branches
BranchTrueFalseTotal
if (perform == TO_UPPER && !(first_uc && !any_lower)) continue; 0 0 0
if (perform == TO_UPPER && !(first_uc && !any_lower)) continue; 0 0 0
if (perform == TO_UPPER && !(first_uc && !any_lower)) continue; 0 0 0
2718 0 ▶ if (perform == TO_TITLE && !first_uc) continue;
Branch: 2 branches
BranchTrueFalseTotal
if (perform == TO_TITLE && !first_uc) continue; 0 0 0
if (perform == TO_TITLE && !first_uc) continue; 0 0 0
2719 }
2720  
2721 0 ▶ if (match == MATCH_FORM)
Branch: 1 branch
BranchTrueFalseTotal
if (match == MATCH_FORM) 0 0 0
2722 0 recase_text(word.form, perform, recased);
2723 0 ▶ else if (match == MATCH_RAWLEMMA)
Branch: 1 branch
BranchTrueFalseTotal
else if (match == MATCH_RAWLEMMA) 0 0 0
2724 0 recase_text(word.raw_lemma, perform, recased);
2725 0 ▶ else if (match == MATCH_RAWLEMMAS)
Branch: 1 branch
BranchTrueFalseTotal
else if (match == MATCH_RAWLEMMAS) 0 0 0
2726 0 ▶ for (auto&& raw_lemma : word.raw_lemmas_all)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& raw_lemma : word.raw_lemmas_all) 0 0 0
2727 0 ▶ recase_text(raw_lemma, perform, recased);
Branch: 1 branch
BranchTrueFalseTotal
recase_text(raw_lemma, perform, recased); 0 0 0
2728 }
2729 0 }
2730 };
2731 const vector<string> gazetteers_enhanced::basename_suffixes = {".txt", ".hard_pre.txt", ".hard_post.txt"};
2732  
2733 // Lemma
2734 class lemma : public feature_processor {
2735 public:
2736 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& /*buffer*/) const override {
2737 18 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 14 4 18
2738 60 ▶ apply_in_window(i, lookup(sentence.words[i].lemma_id, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(sentence.words[i].lemma_id, total_features)); 14 0 14
apply_in_window(i, lookup(sentence.words[i].lemma_id, total_features)); 46 0 46
apply_in_window(i, lookup(sentence.words[i].lemma_id, total_features)); 46 14 60
2739  
2740 36 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 4 0 4
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 4 12
2741 4 }
2742 };
2743  
2744 // NumericTimeValue
2745 class number_time_value : public feature_processor {
2746 public:
2747 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2748 4 ner_feature hour = lookup(buffer.assign("H"), total_features);
2749 4 ner_feature minute = lookup(buffer.assign("M"), total_features);
2750 4 ner_feature time = lookup(buffer.assign("t"), total_features);
2751 4 ner_feature day = lookup(buffer.assign("d"), total_features);
2752 4 ner_feature month = lookup(buffer.assign("m"), total_features);
2753 4 ner_feature year = lookup(buffer.assign("y"), total_features);
2754  
2755 18 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 14 4 18
2756 14 const char* form = sentence.words[i].form.c_str();
2757 unsigned num;
2758 bool digit;
2759  
2760 14 ▶ for (digit = false, num = 0; *form; form++) {
Branch: 1 branch
BranchTrueFalseTotal
for (digit = false, num = 0; *form; form++) { 14 0 14
2761 14 ▶ if (*form < '0' || *form > '9') break;
Branch: 2 branches
BranchTrueFalseTotal
if (*form < '0' || *form > '9') break; 10 4 14
if (*form < '0' || *form > '9') break; 0 10 10
2762 0 digit = true;
2763 0 num = num * 10 + *form - '0';
2764 }
2765 14 ▶ if (digit && !*form) {
Branch: 2 branches
BranchTrueFalseTotal
if (digit && !*form) { 0 14 14
if (digit && !*form) { 0 0 0
2766 // We have a number
2767 0 ▶ if (num < 24) apply_in_window(i, hour);
Branch: 4 branches
BranchTrueFalseTotal
if (num < 24) apply_in_window(i, hour); 0 0 0
if (num < 24) apply_in_window(i, hour); 0 0 0
if (num < 24) apply_in_window(i, hour); 0 0 0
if (num < 24) apply_in_window(i, hour); 0 0 0
2768 0 ▶ if (num < 60) apply_in_window(i, minute);
Branch: 4 branches
BranchTrueFalseTotal
if (num < 60) apply_in_window(i, minute); 0 0 0
if (num < 60) apply_in_window(i, minute); 0 0 0
if (num < 60) apply_in_window(i, minute); 0 0 0
if (num < 60) apply_in_window(i, minute); 0 0 0
2769 0 ▶ if (num >= 1 && num <= 31) apply_in_window(i, day);
Branch: 5 branches
BranchTrueFalseTotal
if (num >= 1 && num <= 31) apply_in_window(i, day); 0 0 0
if (num >= 1 && num <= 31) apply_in_window(i, day); 0 0 0
if (num >= 1 && num <= 31) apply_in_window(i, day); 0 0 0
if (num >= 1 && num <= 31) apply_in_window(i, day); 0 0 0
if (num >= 1 && num <= 31) apply_in_window(i, day); 0 0 0
2770 0 ▶ if (num >= 1 && num <= 12) apply_in_window(i, month);
Branch: 5 branches
BranchTrueFalseTotal
if (num >= 1 && num <= 12) apply_in_window(i, month); 0 0 0
if (num >= 1 && num <= 12) apply_in_window(i, month); 0 0 0
if (num >= 1 && num <= 12) apply_in_window(i, month); 0 0 0
if (num >= 1 && num <= 12) apply_in_window(i, month); 0 0 0
if (num >= 1 && num <= 12) apply_in_window(i, month); 0 0 0
2771 0 ▶ if (num >= 1000 && num <= 2200) apply_in_window(i, year);;
Branch: 5 branches
BranchTrueFalseTotal
if (num >= 1000 && num <= 2200) apply_in_window(i, year);; 0 0 0
if (num >= 1000 && num <= 2200) apply_in_window(i, year);; 0 0 0
if (num >= 1000 && num <= 2200) apply_in_window(i, year);; 0 0 0
if (num >= 1000 && num <= 2200) apply_in_window(i, year);; 0 0 0
if (num >= 1000 && num <= 2200) apply_in_window(i, year);; 0 0 0
2772 }
2773 14 ▶ if (digit && num < 24 && (*form == '.' || *form == ':')) {
Branch: 4 branches
BranchTrueFalseTotal
if (digit && num < 24 && (*form == '.' || *form == ':')) { 0 14 14
if (digit && num < 24 && (*form == '.' || *form == ':')) { 0 0 0
if (digit && num < 24 && (*form == '.' || *form == ':')) { 0 0 0
if (digit && num < 24 && (*form == '.' || *form == ':')) { 0 0 0
2774 // Maybe time
2775 0 ▶ for (digit = false, num = 0, form++; *form; form++) {
Branch: 1 branch
BranchTrueFalseTotal
for (digit = false, num = 0, form++; *form; form++) { 0 0 0
2776 0 ▶ if (*form < '0' || *form > '9') break;
Branch: 2 branches
BranchTrueFalseTotal
if (*form < '0' || *form > '9') break; 0 0 0
if (*form < '0' || *form > '9') break; 0 0 0
2777 0 digit = true;
2778 0 num = num * 10 + *form - '0';
2779 }
2780 0 ▶ if (digit && !*form && num < 60) apply_in_window(i, time);
Branch: 6 branches
BranchTrueFalseTotal
if (digit && !*form && num < 60) apply_in_window(i, time); 0 0 0
if (digit && !*form && num < 60) apply_in_window(i, time); 0 0 0
if (digit && !*form && num < 60) apply_in_window(i, time); 0 0 0
if (digit && !*form && num < 60) apply_in_window(i, time); 0 0 0
if (digit && !*form && num < 60) apply_in_window(i, time); 0 0 0
if (digit && !*form && num < 60) apply_in_window(i, time); 0 0 0
2781 }
2782 }
2783 4 }
2784 };
2785  
2786 // PreviousStage
2787 class previous_stage : public feature_processor {
2788 public:
2789 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2790 18 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 14 4 18
2791 14 ▶ if (sentence.previous_stage[i].bilou != bilou_type_unknown) {
Branch: 1 branch
BranchTrueFalseTotal
if (sentence.previous_stage[i].bilou != bilou_type_unknown) { 7 7 14
2792 7 buffer.clear();
2793 7 append_encoded(buffer, sentence.previous_stage[i].bilou);
2794 7 buffer.push_back(' ');
2795 7 append_encoded(buffer, sentence.previous_stage[i].entity);
2796 16 ▶ apply_in_range(i, lookup(buffer, total_features), 1, window);
Branch: 3 branches
BranchTrueFalseTotal
apply_in_range(i, lookup(buffer, total_features), 1, window); 7 0 7
apply_in_range(i, lookup(buffer, total_features), 1, window); 9 0 9
apply_in_range(i, lookup(buffer, total_features), 1, window); 9 7 16
2797 }
2798 4 }
2799  
2800 private:
2801 14 static void append_encoded(string& str, int value) {
2802 14 ▶ if (value < 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (value < 0) { 4 10 14
2803 4 str.push_back('-');
2804 4 value = -value;
2805 }
2806 25 ▶ for (; value; value >>= 4)
Branch: 1 branch
BranchTrueFalseTotal
for (; value; value >>= 4) 11 14 25
2807 11 str.push_back("0123456789abcdef"[value & 0xF]);
2808 14 }
2809 };
2810  
2811 // RawLemma
2812 class raw_lemma : public feature_processor {
2813 public:
2814 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& /*buffer*/) const override {
2815 18 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 14 4 18
2816 60 ▶ apply_in_window(i, lookup(sentence.words[i].raw_lemma, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(sentence.words[i].raw_lemma, total_features)); 14 0 14
apply_in_window(i, lookup(sentence.words[i].raw_lemma, total_features)); 46 0 46
apply_in_window(i, lookup(sentence.words[i].raw_lemma, total_features)); 46 14 60
2817  
2818 36 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 4 0 4
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 4 12
2819 4 }
2820 };
2821  
2822 // RawLemmaCapitalization
2823 class raw_lemma_capitalization : public feature_processor {
2824 public:
2825 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2826 using namespace unilib;
2827  
2828 4 ner_feature fst_cap = lookup(buffer.assign("f"), total_features);
2829 4 ner_feature all_cap = lookup(buffer.assign("a"), total_features);
2830 4 ner_feature mixed_cap = lookup(buffer.assign("m"), total_features);
2831  
2832 18 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 14 4 18
2833 14 bool was_upper = false, was_lower = false;
2834  
2835 14 auto* raw_lemma = sentence.words[i].raw_lemma.c_str();
2836 char32_t chr;
2837 68 ▶ for (bool first = true; (chr = utf8::decode(raw_lemma)); first = false) {
Branch: 1 branch
BranchTrueFalseTotal
for (bool first = true; (chr = utf8::decode(raw_lemma)); first = false) { 54 14 68
2838 54 auto category = unicode::category(chr);
2839 54 ▶ was_upper = was_upper || category & unicode::Lut;
Branch: 2 branches
BranchTrueFalseTotal
was_upper = was_upper || category & unicode::Lut; 54 0 54
was_upper = was_upper || category & unicode::Lut; 0 54 54
2840 54 ▶ was_lower = was_lower || category & unicode::Ll;
Branch: 2 branches
BranchTrueFalseTotal
was_lower = was_lower || category & unicode::Ll; 14 40 54
was_lower = was_lower || category & unicode::Ll; 10 4 14
2841  
2842 54 ▶ if (first && was_upper) apply_in_window(i, fst_cap);
Branch: 5 branches
BranchTrueFalseTotal
if (first && was_upper) apply_in_window(i, fst_cap); 14 40 54
if (first && was_upper) apply_in_window(i, fst_cap); 0 14 14
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
if (first && was_upper) apply_in_window(i, fst_cap); 0 0 0
2843 }
2844 14 ▶ if (was_upper && !was_lower) apply_in_window(i, all_cap);
Branch: 5 branches
BranchTrueFalseTotal
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 14 14
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
if (was_upper && !was_lower) apply_in_window(i, all_cap); 0 0 0
2845 14 ▶ if (was_upper && was_lower) apply_in_window(i, mixed_cap);
Branch: 5 branches
BranchTrueFalseTotal
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 14 14
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
if (was_upper && was_lower) apply_in_window(i, mixed_cap); 0 0 0
2846 }
2847 4 }
2848 };
2849  
2850 // RawLemmaCaseNormalized
2851 class raw_lemma_case_normalized : public feature_processor {
2852 public:
2853 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2854 using namespace unilib;
2855  
2856 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2857 0 buffer.clear();
2858 0 ▶ for (auto&& chr : utf8::decoder(sentence.words[i].raw_lemma))
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& chr : utf8::decoder(sentence.words[i].raw_lemma)) 0 0 0
for (auto&& chr : utf8::decoder(sentence.words[i].raw_lemma)) 0 0 0
for (auto&& chr : utf8::decoder(sentence.words[i].raw_lemma)) 0 0 0
2859 0 ▶ utf8::append(buffer, buffer.empty() ? chr : unicode::lowercase(chr));
Branch: 2 branches
BranchTrueFalseTotal
utf8::append(buffer, buffer.empty() ? chr : unicode::lowercase(chr)); 0 0 0
utf8::append(buffer, buffer.empty() ? chr : unicode::lowercase(chr)); 0 0 0
2860 0 ▶ apply_in_window(i, lookup(buffer, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
2861 }
2862  
2863 0 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
2864 0 }
2865 };
2866  
2867 // *Suffix
2868 enum { SUFFIX_SOURCE_FORM, SUFFIX_SOURCE_RAWLEMMA };
2869 enum { SUFFIX_CASE_ORIGINAL, SUFFIX_CASE_NORMALIZED };
2870 class suffix : public feature_processor {
2871 public:
2872 0 suffix(int source, int casing) : source(source), casing(casing) {}
2873  
2874 0 virtual bool parse(int window, const vector<string>& args, entity_map& entities,
2875 ner_feature* total_features, const nlp_pipeline& pipeline) override {
2876 0 ▶ if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
2877 0 ▶ if (args.size() != 2) return cerr << "*Suffix features require exactly two arguments -- shortest and longest suffix length!" << endl, false;
Branch: 3 branches
BranchTrueFalseTotal
if (args.size() != 2) return cerr << "*Suffix features require exactly two arguments -- shortest and longest suffix length!" << endl, false; 0 0 0
if (args.size() != 2) return cerr << "*Suffix features require exactly two arguments -- shortest and longest suffix length!" << endl, false; 0 0 0
if (args.size() != 2) return cerr << "*Suffix features require exactly two arguments -- shortest and longest suffix length!" << endl, false; 0 0 0
2878  
2879 0 string error;
2880 0 ▶ if (!parse_int(args[0], "*Suffix shortest length", shortest, error)) return cerr << error << endl, false;
Branch: 4 branches
BranchTrueFalseTotal
if (!parse_int(args[0], "*Suffix shortest length", shortest, error)) return cerr << error << endl, false; 0 0 0
if (!parse_int(args[0], "*Suffix shortest length", shortest, error)) return cerr << error << endl, false; 0 0 0
if (!parse_int(args[0], "*Suffix shortest length", shortest, error)) return cerr << error << endl, false; 0 0 0
if (!parse_int(args[0], "*Suffix shortest length", shortest, error)) return cerr << error << endl, false; 0 0 0
2881 0 ▶ if (!parse_int(args[1], "*Suffix longest length", longest, error)) return cerr << error << endl, false;
Branch: 4 branches
BranchTrueFalseTotal
if (!parse_int(args[1], "*Suffix longest length", longest, error)) return cerr << error << endl, false; 0 0 0
if (!parse_int(args[1], "*Suffix longest length", longest, error)) return cerr << error << endl, false; 0 0 0
if (!parse_int(args[1], "*Suffix longest length", longest, error)) return cerr << error << endl, false; 0 0 0
if (!parse_int(args[1], "*Suffix longest length", longest, error)) return cerr << error << endl, false; 0 0 0
2882 0 return true;
2883 0 }
2884  
2885 0 virtual void load(binary_decoder& data, const nlp_pipeline& pipeline) override {
2886 0 feature_processor::load(data, pipeline);
2887  
2888 0 shortest = data.next_4B();
2889 0 longest = data.next_4B();
2890 0 }
2891  
2892 0 virtual void save(binary_encoder& enc) override {
2893 0 feature_processor::save(enc);
2894  
2895 0 enc.add_4B(shortest);
2896 0 enc.add_4B(longest);
2897 0 }
2898  
2899 0 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& buffer) const override {
2900 using namespace unilib;
2901  
2902 0 vector<char32_t> chrs;
2903 0 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 0 0 0
2904 0 chrs.clear();
2905 0 ▶ for (auto&& chr : utf8::decoder(source == SUFFIX_SOURCE_FORM ? sentence.words[i].form : sentence.words[i].raw_lemma))
Branch: 4 branches
BranchTrueFalseTotal
for (auto&& chr : utf8::decoder(source == SUFFIX_SOURCE_FORM ? sentence.words[i].form : sentence.words[i].raw_lemma)) 0 0 0
for (auto&& chr : utf8::decoder(source == SUFFIX_SOURCE_FORM ? sentence.words[i].form : sentence.words[i].raw_lemma)) 0 0 0
for (auto&& chr : utf8::decoder(source == SUFFIX_SOURCE_FORM ? sentence.words[i].form : sentence.words[i].raw_lemma)) 0 0 0
for (auto&& chr : utf8::decoder(source == SUFFIX_SOURCE_FORM ? sentence.words[i].form : sentence.words[i].raw_lemma)) 0 0 0
2906 0 ▶ chrs.push_back((casing == SUFFIX_CASE_ORIGINAL || chrs.empty()) ? chr : unicode::lowercase(chr));
Branch: 3 branches
BranchTrueFalseTotal
chrs.push_back((casing == SUFFIX_CASE_ORIGINAL || chrs.empty()) ? chr : unicode::lowercase(chr)); 0 0 0
chrs.push_back((casing == SUFFIX_CASE_ORIGINAL || chrs.empty()) ? chr : unicode::lowercase(chr)); 0 0 0
chrs.push_back((casing == SUFFIX_CASE_ORIGINAL || chrs.empty()) ? chr : unicode::lowercase(chr)); 0 0 0
2907  
2908 0 buffer.clear();
2909 0 ▶ for (int s = 1; s <= longest && s <= int(chrs.size()); s++) {
Branch: 3 branches
BranchTrueFalseTotal
for (int s = 1; s <= longest && s <= int(chrs.size()); s++) { 0 0 0
for (int s = 1; s <= longest && s <= int(chrs.size()); s++) { 0 0 0
for (int s = 1; s <= longest && s <= int(chrs.size()); s++) { 0 0 0
2910 0 ▶ utf8::append(buffer, chrs[chrs.size() - s]);
Branch: 1 branch
BranchTrueFalseTotal
utf8::append(buffer, chrs[chrs.size() - s]); 0 0 0
2911 0 ▶ if (s >= shortest) {
Branch: 1 branch
BranchTrueFalseTotal
if (s >= shortest) { 0 0 0
2912 0 ▶ apply_in_window(i, lookup(buffer, total_features));
Branch: 4 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
apply_in_window(i, lookup(buffer, total_features)); 0 0 0
2913 }
2914 }
2915 }
2916  
2917 0 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
apply_outer_words_in_window(lookup_empty()); 0 0 0
2918 0 }
2919  
2920 private:
2921 int shortest, longest;
2922 int source, casing;
2923 };
2924  
2925 // Tag
2926 class tag : public feature_processor {
2927 public:
2928 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* total_features, string& /*buffer*/) const override {
2929 18 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 14 4 18
2930 54 ▶ apply_in_window(i, lookup(sentence.words[i].tag, total_features));
Branch: 3 branches
BranchTrueFalseTotal
apply_in_window(i, lookup(sentence.words[i].tag, total_features)); 12 2 14
apply_in_window(i, lookup(sentence.words[i].tag, total_features)); 40 0 40
apply_in_window(i, lookup(sentence.words[i].tag, total_features)); 40 12 52
2931  
2932 36 ▶ apply_outer_words_in_window(lookup_empty());
Branch: 8 branches
BranchTrueFalseTotal
apply_outer_words_in_window(lookup_empty()); 4 0 4
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 0 8
apply_outer_words_in_window(lookup_empty()); 12 0 12
apply_outer_words_in_window(lookup_empty()); 12 8 20
apply_outer_words_in_window(lookup_empty()); 8 4 12
2933 4 }
2934 };
2935  
2936 // URLEmailDetector
2937 class url_email_detector : public feature_processor {
2938 public:
2939 0 virtual bool parse(int window, const vector<string>& args, entity_map& entities,
2940 ner_feature* total_features, const nlp_pipeline& pipeline) override {
2941 0 ▶ if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!feature_processor::parse(window, args, entities, total_features, pipeline)) return false; 0 0 0
2942 0 ▶ if (args.size() != 2) return cerr << "URLEmailDetector requires exactly two arguments -- named entity types for URL and email!" << endl, false;
Branch: 1 branch
BranchTrueFalseTotal
if (args.size() != 2) return cerr << "URLEmailDetector requires exactly two arguments -- named entity types for URL and email!" << endl, false; 0 0 0
2943  
2944 0 url = entities.parse(args[0].c_str(), true);
2945 0 email = entities.parse(args[1].c_str(), true);
2946  
2947 0 ▶ if (url == entity_type_unknown || email == entity_type_unknown)
Branch: 2 branches
BranchTrueFalseTotal
if (url == entity_type_unknown || email == entity_type_unknown) 0 0 0
if (url == entity_type_unknown || email == entity_type_unknown) 0 0 0
2948 0 return cerr << "Cannot create entities '" << args[0] << "' and '" << args[1] << "' in URLEmailDetector!" << endl, false;
2949 0 return true;
2950 }
2951  
2952 1 virtual void load(binary_decoder& data, const nlp_pipeline& pipeline) override {
2953 1 feature_processor::load(data, pipeline);
2954  
2955 1 url = data.next_4B();
2956 1 email = data.next_4B();
2957 1 }
2958  
2959 0 virtual void save(binary_encoder& enc) override {
2960 0 feature_processor::save(enc);
2961  
2962 0 enc.add_4B(url);
2963 0 enc.add_4B(email);
2964 0 }
2965  
2966 4 virtual void process_sentence(ner_sentence& sentence, ner_feature* /*total_features*/, string& /*buffer*/) const override {
2967 18 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 14 4 18
2968 14 auto type = url_detector::detect(sentence.words[i].form);
2969 14 ▶ if (type == url_detector::NO_URL || sentence.probabilities[i].local_filled) continue;
Branch: 3 branches
BranchTrueFalseTotal
if (type == url_detector::NO_URL || sentence.probabilities[i].local_filled) continue; 0 14 14
if (type == url_detector::NO_URL || sentence.probabilities[i].local_filled) continue; 0 0 0
if (type == url_detector::NO_URL || sentence.probabilities[i].local_filled) continue; 14 0 14
2970  
2971 // We have found URL or email and the word has not yet been determined
2972 0 ▶ for (auto&& bilou : sentence.probabilities[i].local.bilou) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& bilou : sentence.probabilities[i].local.bilou) { 0 0 0
2973 0 bilou.probability = 0.;
2974 0 bilou.entity = entity_type_unknown;
2975 }
2976 0 sentence.probabilities[i].local.bilou[bilou_type_U].probability = 1.;
2977 0 ▶ sentence.probabilities[i].local.bilou[bilou_type_U].entity = type == url_detector::EMAIL ? email : url;
Branch: 1 branch
BranchTrueFalseTotal
sentence.probabilities[i].local.bilou[bilou_type_U].entity = type == url_detector::EMAIL ? email : url; 0 0 0
2978 0 sentence.probabilities[i].local_filled = true;
2979 }
2980 4 }
2981  
2982 private:
2983 entity_type url, email;
2984 };
2985  
2986 } // namespace feature_processors
2987  
2988 // Feature processor factory method
2989 8 feature_processor* feature_processor::create(const string& name) {
2990 using namespace feature_processors;
2991  
2992 8 ▶ if (name.compare("BrownClusters") == 0) return new brown_clusters();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("BrownClusters") == 0) return new brown_clusters(); 0 8 8
2993 8 ▶ if (name.compare("CzechAddContainers") == 0) return new czech_add_containers();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("CzechAddContainers") == 0) return new czech_add_containers(); 0 8 8
2994 8 ▶ if (name.compare("CzechLemmaTerm") == 0) return new czech_lemma_term();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("CzechLemmaTerm") == 0) return new czech_lemma_term(); 0 8 8
2995 8 ▶ if (name.compare("Form") == 0) return new form();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("Form") == 0) return new form(); 1 7 8
2996 7 ▶ if (name.compare("FormCapitalization") == 0) return new form_capitalization();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("FormCapitalization") == 0) return new form_capitalization(); 0 7 7
2997 7 ▶ if (name.compare("FormCaseNormalized") == 0) return new form_case_normalized();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("FormCaseNormalized") == 0) return new form_case_normalized(); 0 7 7
2998 7 ▶ if (name.compare("FormCaseNormalizedSuffix") == 0) return new suffix(SUFFIX_SOURCE_FORM, SUFFIX_CASE_NORMALIZED);
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("FormCaseNormalizedSuffix") == 0) return new suffix(SUFFIX_SOURCE_FORM, SUFFIX_CASE_NORMALIZED); 0 7 7
2999 7 ▶ if (name.compare("FormSuffix") == 0) return new suffix(SUFFIX_SOURCE_FORM, SUFFIX_CASE_ORIGINAL);
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("FormSuffix") == 0) return new suffix(SUFFIX_SOURCE_FORM, SUFFIX_CASE_ORIGINAL); 0 7 7
3000 7 ▶ if (name.compare("Gazetteers") == 0) return new feature_processors::gazetteers();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("Gazetteers") == 0) return new feature_processors::gazetteers(); 0 7 7
3001 7 ▶ if (name.compare("GazetteersEnhanced") == 0) return new gazetteers_enhanced();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("GazetteersEnhanced") == 0) return new gazetteers_enhanced(); 0 7 7
3002 7 ▶ if (name.compare("Lemma") == 0) return new lemma();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("Lemma") == 0) return new lemma(); 1 6 7
3003 6 ▶ if (name.compare("NumericTimeValue") == 0) return new number_time_value();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("NumericTimeValue") == 0) return new number_time_value(); 1 5 6
3004 5 ▶ if (name.compare("PreviousStage") == 0) return new previous_stage();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("PreviousStage") == 0) return new previous_stage(); 1 4 5
3005 4 ▶ if (name.compare("RawLemma") == 0) return new raw_lemma();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("RawLemma") == 0) return new raw_lemma(); 1 3 4
3006 3 ▶ if (name.compare("RawLemmaCapitalization") == 0) return new raw_lemma_capitalization();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("RawLemmaCapitalization") == 0) return new raw_lemma_capitalization(); 1 2 3
3007 2 ▶ if (name.compare("RawLemmaCaseNormalized") == 0) return new raw_lemma_case_normalized();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("RawLemmaCaseNormalized") == 0) return new raw_lemma_case_normalized(); 0 2 2
3008 2 ▶ if (name.compare("RawLemmaCaseNormalizedSuffix") == 0) return new suffix(SUFFIX_SOURCE_RAWLEMMA, SUFFIX_CASE_NORMALIZED);
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("RawLemmaCaseNormalizedSuffix") == 0) return new suffix(SUFFIX_SOURCE_RAWLEMMA, SUFFIX_CASE_NORMALIZED); 0 2 2
3009 2 ▶ if (name.compare("RawLemmaSuffix") == 0) return new suffix(SUFFIX_SOURCE_RAWLEMMA, SUFFIX_CASE_ORIGINAL);
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("RawLemmaSuffix") == 0) return new suffix(SUFFIX_SOURCE_RAWLEMMA, SUFFIX_CASE_ORIGINAL); 0 2 2
3010 2 ▶ if (name.compare("Tag") == 0) return new tag();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("Tag") == 0) return new tag(); 1 1 2
3011 1 ▶ if (name.compare("URLEmailDetector") == 0) return new url_email_detector();
Branch: 1 branch
BranchTrueFalseTotal
if (name.compare("URLEmailDetector") == 0) return new url_email_detector(); 1 0 1
3012 0 return nullptr;
3013 }
3014  
3015 /////////
3016 // File: features/feature_templates.h
3017 /////////
3018  
3019 // This file is part of NameTag <http://github.com/ufal/nametag/>.
3020 //
3021 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3022 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3023 //
3024 // This Source Code Form is subject to the terms of the Mozilla Public
3025 // License, v. 2.0. If a copy of the MPL was not distributed with this
3026 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3027  
3028 class feature_templates {
3029 public:
3030 void parse(istream& is, entity_map& entities, const nlp_pipeline& pipeline);
3031  
3032 bool load(istream& is, const nlp_pipeline& pipeline);
3033 bool save(ostream& os);
3034  
3035 void process_sentence(ner_sentence& sentence, string& buffer, bool add_features = false) const;
3036 void process_entities(ner_sentence& sentence, vector<named_entity>& entities, vector<named_entity>& buffer) const;
3037 ner_feature get_total_features() const;
3038  
3039 void gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const;
3040  
3041 private:
3042 mutable ner_feature total_features;
3043  
3044 struct feature_processor_info {
3045 string name;
3046 unique_ptr<feature_processor> processor;
3047  
3048 8 feature_processor_info(const string& name, feature_processor* processor) : name(name), processor(processor) {}
3049 };
3050 vector<feature_processor_info> processors;
3051 };
3052  
3053 /////////
3054 // File: features/feature_templates.cpp
3055 /////////
3056  
3057 // This file is part of NameTag <http://github.com/ufal/nametag/>.
3058 //
3059 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3060 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3061 //
3062 // This Source Code Form is subject to the terms of the Mozilla Public
3063 // License, v. 2.0. If a copy of the MPL was not distributed with this
3064 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3065  
3066 1 bool feature_templates::load(istream& is, const nlp_pipeline& pipeline) {
3067 1 binary_decoder data;
3068 1 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 1 0 1
if (!compressor::load(is, data)) return false; 0 1 1
3069  
3070 try {
3071 1 ▶ total_features = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
total_features = data.next_4B(); 1 0 1
3072  
3073 1 processors.clear();
3074 9 ▶ for (unsigned i = data.next_4B(); i; i--) {
Branch: 2 branches
BranchTrueFalseTotal
for (unsigned i = data.next_4B(); i; i--) { 1 0 1
for (unsigned i = data.next_4B(); i; i--) { 8 1 9
3075 8 string name;
3076 8 ▶ data.next_str(name);
Branch: 1 branch
BranchTrueFalseTotal
data.next_str(name); 8 0 8
3077  
3078 // Try creating the processor
3079 8 ▶ auto* processor = feature_processor::create(name);
Branch: 1 branch
BranchTrueFalseTotal
auto* processor = feature_processor::create(name); 8 0 8
3080 8 ▶ if (processor) {
Branch: 1 branch
BranchTrueFalseTotal
if (processor) { 8 0 8
3081 8 ▶ processor->load(data, pipeline);
Branch: 1 branch
BranchTrueFalseTotal
processor->load(data, pipeline); 8 0 8
3082 8 ▶ processors.emplace_back(name, processor);
Branch: 1 branch
BranchTrueFalseTotal
processors.emplace_back(name, processor); 8 0 8
3083 8 continue;
3084 }
3085  
3086 // Could not find processor with specified name
3087 0 return false;
3088 8 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 8 0 8
} 0 0 0
3089 } catch (binary_decoder_error&) {
3090 return false;
3091 }
3092  
3093 1 return data.is_end();
3094 1 }
3095  
3096 4 void feature_templates::process_sentence(ner_sentence& sentence, string& buffer, bool adding_features) const {
3097 // Start with omnipresent feature
3098 18 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 14 4 18
3099 14 sentence.features[i].clear();
3100 14 ▶ sentence.features[i].emplace_back(0);
Branch: 1 branch
BranchTrueFalseTotal
sentence.features[i].emplace_back(0); 14 0 14
3101 }
3102  
3103 // Add features from feature processors
3104 36 ▶ for (auto&& processor : processors)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& processor : processors) 32 4 36
3105 32 ▶ processor.processor->process_sentence(sentence, adding_features ? &total_features : nullptr, buffer);
Branch: 2 branches
BranchTrueFalseTotal
processor.processor->process_sentence(sentence, adding_features ? &total_features : nullptr, buffer); 0 32 32
processor.processor->process_sentence(sentence, adding_features ? &total_features : nullptr, buffer); 32 0 32
3106 4 }
3107  
3108 2 void feature_templates::process_entities(ner_sentence& sentence, vector<named_entity>& entities, vector<named_entity>& buffer) const {
3109 18 ▶ for (auto&& processor : processors)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& processor : processors) 16 2 18
3110 16 ▶ processor.processor->process_entities(sentence, entities, buffer);
Branch: 1 branch
BranchTrueFalseTotal
processor.processor->process_entities(sentence, entities, buffer); 16 0 16
3111 2 }
3112  
3113 0 ner_feature feature_templates::get_total_features() const {
3114 0 return total_features;
3115 }
3116  
3117 0 void feature_templates::gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const {
3118 0 ▶ for (auto&& processor : processors)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& processor : processors) 0 0 0
3119 0 ▶ processor.processor->gazetteers(gazetteers, gazetteer_types);
Branch: 1 branch
BranchTrueFalseTotal
processor.processor->gazetteers(gazetteers, gazetteer_types); 0 0 0
3120 0 }
3121  
3122 /////////
3123 // File: morphodita/derivator/derivator.h
3124 /////////
3125  
3126 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3127 //
3128 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3129 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3130 //
3131 // This Source Code Form is subject to the terms of the Mozilla Public
3132 // License, v. 2.0. If a copy of the MPL was not distributed with this
3133 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3134  
3135 namespace morphodita {
3136  
3137 struct derivated_lemma {
3138 string lemma;
3139 };
3140  
3141 class derivator {
3142 public:
3143 0 virtual ~derivator() {}
3144  
3145 // For given lemma, return the parent in the derivation graph.
3146 // The lemma is assumed to be lemma id and any lemma comments are ignored.
3147 virtual bool parent(string_piece lemma, derivated_lemma& parent) const = 0;
3148  
3149 // For given lemma, return the children in the derivation graph.
3150 // The lemma is assumed to be lemma id and any lemma comments are ignored.
3151 virtual bool children(string_piece lemma, vector<derivated_lemma>& children) const = 0;
3152 };
3153  
3154 } // namespace morphodita
3155  
3156 /////////
3157 // File: morphodita/tokenizer/tokenizer.h
3158 /////////
3159  
3160 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3161 //
3162 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
3163 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3164 //
3165 // This Source Code Form is subject to the terms of the Mozilla Public
3166 // License, v. 2.0. If a copy of the MPL was not distributed with this
3167 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3168  
3169 namespace morphodita {
3170  
3171 // Range of a token, measured in Unicode characters, not UTF8 bytes.
3172 struct token_range {
3173 size_t start;
3174 size_t length;
3175  
3176 0 token_range() {}
3177 33 token_range(size_t start, size_t length) : start(start), length(length) {}
3178 };
3179  
3180 class tokenizer {
3181 public:
3182 0 virtual ~tokenizer() {}
3183  
3184 virtual void set_text(string_piece text, bool make_copy = false) = 0;
3185 virtual bool next_sentence(vector<string_piece>* forms, vector<token_range>* tokens) = 0;
3186  
3187 // Static factory methods
3188 static tokenizer* new_vertical_tokenizer();
3189  
3190 static tokenizer* new_czech_tokenizer();
3191 static tokenizer* new_english_tokenizer();
3192 static tokenizer* new_generic_tokenizer();
3193 };
3194  
3195 } // namespace morphodita
3196  
3197 /////////
3198 // File: morphodita/morpho/morpho.h
3199 /////////
3200  
3201 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3202 //
3203 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
3204 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3205 //
3206 // This Source Code Form is subject to the terms of the Mozilla Public
3207 // License, v. 2.0. If a copy of the MPL was not distributed with this
3208 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3209  
3210 namespace morphodita {
3211  
3212 struct tagged_form {
3213 string form;
3214 string tag;
3215  
3216 0 tagged_form() {}
3217 0 ▶ tagged_form(const string& form, const string& tag) : form(form), tag(tag) {}
Branch: 1 branch
BranchTrueFalseTotal
tagged_form(const string& form, const string& tag) : form(form), tag(tag) {} 0 0 0
3218 };
3219  
3220 struct tagged_lemma {
3221 string lemma;
3222 string tag;
3223  
3224 0 tagged_lemma() {}
3225 22 ▶ tagged_lemma(const string& lemma, const string& tag) : lemma(lemma), tag(tag) {}
Branch: 1 branch
BranchTrueFalseTotal
tagged_lemma(const string& lemma, const string& tag) : lemma(lemma), tag(tag) {} 22 0 22
3226 };
3227  
3228 struct tagged_lemma_forms {
3229 string lemma;
3230 vector<tagged_form> forms;
3231  
3232 tagged_lemma_forms() {}
3233 0 tagged_lemma_forms(const string& lemma) : lemma(lemma) {}
3234 };
3235  
3236 class morpho {
3237 public:
3238 0 virtual ~morpho() {}
3239  
3240 static morpho* load(istream& is);
3241 static morpho* load(const char* fname);
3242  
3243 enum guesser_mode { NO_GUESSER = 0, GUESSER = 1, GUESSER_UNSPECIFIED = -1 };
3244  
3245 // Perform morphologic analysis of a form. The form is given by a pointer and
3246 // length and therefore does not need to be '\0' terminated. The guesser
3247 // parameter specifies whether a guesser can be used if the form is not found
3248 // in the dictionary. Output is assigned to the lemmas vector.
3249 //
3250 // If the form is found in the dictionary, analyses are assigned to lemmas
3251 // and NO_GUESSER returned. If guesser == GUESSER and the form analyses are
3252 // found using a guesser, they are assigned to lemmas and GUESSER is
3253 // returned. Otherwise <0 is returned and lemmas are filled with one
3254 // analysis containing given form as lemma and a tag for unknown word.
3255 virtual int analyze(string_piece form, guesser_mode guesser, vector<tagged_lemma>& lemmas) const = 0;
3256  
3257 // Perform morphologic generation of a lemma. The lemma is given by a pointer
3258 // and length and therefore does not need to be '\0' terminated. Optionally
3259 // a tag_wildcard can be specified (or be NULL) and if so, results are
3260 // filtered using this wildcard. The guesser parameter speficies whether
3261 // a guesser can be used if the lemma is not found in the dictionary. Output
3262 // is assigned to the forms vector.
3263 //
3264 // Tag_wildcard can be either NULL or a wildcard applied to the results.
3265 // A ? in the wildcard matches any character, [bytes] matches any of the
3266 // bytes and [^bytes] matches any byte different from the specified ones.
3267 // A - has no special meaning inside the bytes and if ] is first in bytes, it
3268 // does not end the bytes group.
3269 //
3270 // If the given lemma is only a raw lemma, all lemma ids with this raw lemma
3271 // are returned. Otherwise only matching lemma ids are returned, ignoring any
3272 // lemma comments. For every found lemma, matching forms are filtered using
3273 // the tag_wildcard. If at least one lemma is found in the dictionary,
3274 // NO_GUESSER is returned. If guesser == GUESSER and the lemma is found by
3275 // the guesser, GUESSER is returned. Otherwise, forms are cleared and <0 is
3276 // returned.
3277 virtual int generate(string_piece lemma, const char* tag_wildcard, guesser_mode guesser, vector<tagged_lemma_forms>& forms) const = 0;
3278  
3279 // Rawlemma and lemma id identification
3280 virtual int raw_lemma_len(string_piece lemma) const = 0;
3281 virtual int lemma_id_len(string_piece lemma) const = 0;
3282  
3283 // Rawform identification
3284 virtual int raw_form_len(string_piece form) const = 0;
3285  
3286 // Construct a new tokenizer instance appropriate for this morphology.
3287 // Can return NULL if no such tokenizer exists.
3288 virtual tokenizer* new_tokenizer() const = 0;
3289  
3290 // Return a derivator for this morphology, or NULL if it does not exist.
3291 // The returned instance is owned by the morphology and should not be deleted.
3292 virtual const derivator* get_derivator() const;
3293  
3294 protected:
3295 unique_ptr<derivator> derinet;
3296 };
3297  
3298 } // namespace morphodita
3299  
3300 /////////
3301 // File: morphodita/tagset_converter/tagset_converter.h
3302 /////////
3303  
3304 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3305 //
3306 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
3307 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3308 //
3309 // This Source Code Form is subject to the terms of the Mozilla Public
3310 // License, v. 2.0. If a copy of the MPL was not distributed with this
3311 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3312  
3313 namespace morphodita {
3314  
3315 class tagset_converter {
3316 public:
3317 0 virtual ~tagset_converter() {}
3318  
3319 // Convert a tag-lemma pair to a different tag set.
3320 virtual void convert(tagged_lemma& tagged_lemma) const = 0;
3321 // Convert a result of analysis to a different tag set. Apart from calling
3322 // convert, any repeated entry is removed.
3323 virtual void convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const = 0;
3324 // Convert a result of generation to a different tag set. Apart from calling
3325 // convert, any repeated entry is removed.
3326 virtual void convert_generated(vector<tagged_lemma_forms>& forms) const = 0;
3327  
3328 // Static factory methods
3329 static tagset_converter* new_identity_converter();
3330  
3331 static tagset_converter* new_pdt_to_conll2009_converter();
3332 static tagset_converter* new_strip_lemma_comment_converter(const morpho& dictionary);
3333 static tagset_converter* new_strip_lemma_id_converter(const morpho& dictionary);
3334 };
3335  
3336 // Helper method for creating tagset_converter from instance name.
3337 tagset_converter* new_tagset_converter(const string& name, const morpho& dictionary);
3338  
3339 // Helper methods making sure remapped results are unique.
3340 void tagset_converter_unique_analyzed(vector<tagged_lemma>& tagged_lemmas);
3341 void tagset_converter_unique_generated(vector<tagged_lemma_forms>& forms);
3342  
3343 } // namespace morphodita
3344  
3345 /////////
3346 // File: morphodita/derivator/derivation_formatter.h
3347 /////////
3348  
3349 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3350 //
3351 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3352 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3353 //
3354 // This Source Code Form is subject to the terms of the Mozilla Public
3355 // License, v. 2.0. If a copy of the MPL was not distributed with this
3356 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3357  
3358 namespace morphodita {
3359  
3360 class derivation_formatter {
3361 public:
3362 0 virtual ~derivation_formatter() {}
3363  
3364 // Perform the required derivation and store it directly in the lemma.
3365 virtual void format_derivation(string& lemma) const;
3366  
3367 // Perform the required derivation and store it directly in the tagged_lemma.
3368 // If a tagset_converter is given, it is also applied.
3369 virtual void format_tagged_lemma(tagged_lemma& lemma, const tagset_converter* converter = nullptr) const = 0;
3370  
3371 // Perform the required derivation on a list of tagged_lemmas.
3372 // If a tagset_converter is given, it is also applied.
3373 // Either way, only unique entries are returned.
3374 virtual void format_tagged_lemmas(vector<tagged_lemma>& lemmas, const tagset_converter* converter = nullptr) const;
3375  
3376 // Static factory methods.
3377 static derivation_formatter* new_none_derivation_formatter();
3378 static derivation_formatter* new_root_derivation_formatter(const derivator* derinet);
3379 static derivation_formatter* new_path_derivation_formatter(const derivator* derinet);
3380 static derivation_formatter* new_tree_derivation_formatter(const derivator* derinet);
3381 // String version of static factory method.
3382 static derivation_formatter* new_derivation_formatter(string_piece name, const derivator* derinet);
3383 };
3384  
3385 } // namespace morphodita
3386  
3387 /////////
3388 // File: morphodita/derivator/derivation_formatter.cpp
3389 /////////
3390  
3391 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3392 //
3393 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3394 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3395 //
3396 // This Source Code Form is subject to the terms of the Mozilla Public
3397 // License, v. 2.0. If a copy of the MPL was not distributed with this
3398 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3399  
3400 namespace morphodita {
3401  
3402 0 void derivation_formatter::format_derivation(string& lemma) const {
3403 0 tagged_lemma result;
3404 0 result.lemma.swap(lemma);
3405 0 ▶ format_tagged_lemma(result);
Branch: 1 branch
BranchTrueFalseTotal
format_tagged_lemma(result); 0 0 0
3406 0 lemma.swap(result.lemma);
3407 0 }
3408  
3409 0 void derivation_formatter::format_tagged_lemmas(vector<tagged_lemma>& lemmas, const tagset_converter* converter) const {
3410 0 ▶ for (auto&& lemma : lemmas)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& lemma : lemmas) 0 0 0
3411 0 ▶ format_tagged_lemma(lemma, converter);
Branch: 1 branch
BranchTrueFalseTotal
format_tagged_lemma(lemma, converter); 0 0 0
3412  
3413 0 ▶ if (lemmas.size() > 1)
Branch: 1 branch
BranchTrueFalseTotal
if (lemmas.size() > 1) 0 0 0
3414 0 tagset_converter_unique_analyzed(lemmas);
3415 0 }
3416  
3417 class none_derivation_formatter : public derivation_formatter {
3418 0 virtual void format_derivation(string& /*lemma*/) const override {}
3419  
3420 0 virtual void format_tagged_lemma(tagged_lemma& lemma, const tagset_converter* converter) const override {
3421 0 ▶ if (converter) converter->convert(lemma);
Branch: 1 branch
BranchTrueFalseTotal
if (converter) converter->convert(lemma); 0 0 0
3422 0 }
3423  
3424 0 virtual void format_tagged_lemmas(vector<tagged_lemma>& lemmas, const tagset_converter* converter) const override {
3425 0 ▶ if (converter) converter->convert_analyzed(lemmas);
Branch: 1 branch
BranchTrueFalseTotal
if (converter) converter->convert_analyzed(lemmas); 0 0 0
3426 0 }
3427 };
3428  
3429 0 derivation_formatter* derivation_formatter::new_none_derivation_formatter() {
3430 0 return new none_derivation_formatter();
3431 }
3432  
3433 class root_derivation_formatter : public derivation_formatter {
3434 public:
3435 0 root_derivation_formatter(const derivator* derinet) : derinet(derinet) {}
3436  
3437 0 virtual void format_tagged_lemma(tagged_lemma& lemma, const tagset_converter* converter) const override {
3438 0 ▶ for (derivated_lemma parent; derinet->parent(lemma.lemma, parent); )
Branch: 2 branches
BranchTrueFalseTotal
for (derivated_lemma parent; derinet->parent(lemma.lemma, parent); ) 0 0 0
for (derivated_lemma parent; derinet->parent(lemma.lemma, parent); ) 0 0 0
3439 0 ▶ lemma.lemma.assign(parent.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma.lemma.assign(parent.lemma); 0 0 0
3440 0 ▶ if (converter) converter->convert(lemma);
Branch: 1 branch
BranchTrueFalseTotal
if (converter) converter->convert(lemma); 0 0 0
3441 0 }
3442  
3443 private:
3444 const derivator* derinet;
3445 };
3446  
3447 0 derivation_formatter* derivation_formatter::new_root_derivation_formatter(const derivator* derinet) {
3448 0 ▶ return derinet ? new root_derivation_formatter(derinet) : nullptr;
Branch: 4 branches
BranchTrueFalseTotal
return derinet ? new root_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new root_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new root_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new root_derivation_formatter(derinet) : nullptr; 0 0 0
3449 }
3450  
3451 class path_derivation_formatter : public derivation_formatter {
3452 public:
3453 0 path_derivation_formatter(const derivator* derinet) : derinet(derinet) {}
3454  
3455 0 virtual void format_tagged_lemma(tagged_lemma& lemma, const tagset_converter* converter) const override {
3456 0 ▶ tagged_lemma current(lemma);
Branch: 1 branch
BranchTrueFalseTotal
tagged_lemma current(lemma); 0 0 0
3457 0 ▶ if (converter) converter->convert(lemma);
Branch: 2 branches
BranchTrueFalseTotal
if (converter) converter->convert(lemma); 0 0 0
if (converter) converter->convert(lemma); 0 0 0
3458 0 ▶ for (derivated_lemma parent; derinet->parent(current.lemma, parent); current.lemma.swap(parent.lemma)) {
Branch: 2 branches
BranchTrueFalseTotal
for (derivated_lemma parent; derinet->parent(current.lemma, parent); current.lemma.swap(parent.lemma)) { 0 0 0
for (derivated_lemma parent; derinet->parent(current.lemma, parent); current.lemma.swap(parent.lemma)) { 0 0 0
3459 0 ▶ tagged_lemma parrent_lemma(parent.lemma, current.tag);
Branch: 1 branch
BranchTrueFalseTotal
tagged_lemma parrent_lemma(parent.lemma, current.tag); 0 0 0
3460 0 ▶ if (converter) converter->convert(parrent_lemma);
Branch: 2 branches
BranchTrueFalseTotal
if (converter) converter->convert(parrent_lemma); 0 0 0
if (converter) converter->convert(parrent_lemma); 0 0 0
3461 0 ▶ lemma.lemma.append(" ").append(parrent_lemma.lemma);
Branch: 2 branches
BranchTrueFalseTotal
lemma.lemma.append(" ").append(parrent_lemma.lemma); 0 0 0
lemma.lemma.append(" ").append(parrent_lemma.lemma); 0 0 0
3462 0 }
3463 0 }
3464  
3465 private:
3466 const derivator* derinet;
3467 };
3468  
3469 0 derivation_formatter* derivation_formatter::new_path_derivation_formatter(const derivator* derinet) {
3470 0 ▶ return derinet ? new path_derivation_formatter(derinet) : nullptr;
Branch: 4 branches
BranchTrueFalseTotal
return derinet ? new path_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new path_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new path_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new path_derivation_formatter(derinet) : nullptr; 0 0 0
3471 }
3472  
3473 class tree_derivation_formatter : public derivation_formatter {
3474 public:
3475 0 tree_derivation_formatter(const derivator* derinet) : derinet(derinet) {}
3476  
3477 0 virtual void format_tagged_lemma(tagged_lemma& lemma, const tagset_converter* converter) const override {
3478 0 ▶ string root(lemma.lemma), tag(lemma.tag);
Branch: 2 branches
BranchTrueFalseTotal
string root(lemma.lemma), tag(lemma.tag); 0 0 0
string root(lemma.lemma), tag(lemma.tag); 0 0 0
3479 0 ▶ if (converter) converter->convert(lemma);
Branch: 2 branches
BranchTrueFalseTotal
if (converter) converter->convert(lemma); 0 0 0
if (converter) converter->convert(lemma); 0 0 0
3480 0 ▶ for (derivated_lemma parent; derinet->parent(root, parent); root.swap(parent.lemma)) {}
Branch: 2 branches
BranchTrueFalseTotal
for (derivated_lemma parent; derinet->parent(root, parent); root.swap(parent.lemma)) {} 0 0 0
for (derivated_lemma parent; derinet->parent(root, parent); root.swap(parent.lemma)) {} 0 0 0
3481 0 ▶ format_tree(root, tag, lemma, converter);
Branch: 1 branch
BranchTrueFalseTotal
format_tree(root, tag, lemma, converter); 0 0 0
3482 0 }
3483  
3484 0 void format_tree(const string& root, const string& tag, tagged_lemma& tree, const tagset_converter* converter) const {
3485 0 vector<derivated_lemma> children;
3486  
3487 0 ▶ if (converter) {
Branch: 1 branch
BranchTrueFalseTotal
if (converter) { 0 0 0
3488 0 ▶ tagged_lemma current(root, tag);
Branch: 1 branch
BranchTrueFalseTotal
tagged_lemma current(root, tag); 0 0 0
3489 0 ▶ converter->convert(current);
Branch: 1 branch
BranchTrueFalseTotal
converter->convert(current); 0 0 0
3490 0 ▶ tree.lemma.append(" ").append(current.lemma);
Branch: 2 branches
BranchTrueFalseTotal
tree.lemma.append(" ").append(current.lemma); 0 0 0
tree.lemma.append(" ").append(current.lemma); 0 0 0
3491 0 } else {
3492 0 ▶ tree.lemma.append(" ").append(root);
Branch: 2 branches
BranchTrueFalseTotal
tree.lemma.append(" ").append(root); 0 0 0
tree.lemma.append(" ").append(root); 0 0 0
3493 }
3494  
3495 0 ▶ if (derinet->children(root, children))
Branch: 2 branches
BranchTrueFalseTotal
if (derinet->children(root, children)) 0 0 0
if (derinet->children(root, children)) 0 0 0
3496 0 ▶ for (auto&& child : children)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& child : children) 0 0 0
3497 0 ▶ format_tree(child.lemma, tag, tree, converter);
Branch: 1 branch
BranchTrueFalseTotal
format_tree(child.lemma, tag, tree, converter); 0 0 0
3498 0 ▶ tree.lemma.push_back(' ');
Branch: 1 branch
BranchTrueFalseTotal
tree.lemma.push_back(' '); 0 0 0
3499 0 }
3500  
3501 private:
3502 const derivator* derinet;
3503 };
3504  
3505 0 derivation_formatter* derivation_formatter::new_tree_derivation_formatter(const derivator* derinet) {
3506 0 ▶ return derinet ? new tree_derivation_formatter(derinet) : nullptr;
Branch: 4 branches
BranchTrueFalseTotal
return derinet ? new tree_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new tree_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new tree_derivation_formatter(derinet) : nullptr; 0 0 0
return derinet ? new tree_derivation_formatter(derinet) : nullptr; 0 0 0
3507 }
3508  
3509 0 derivation_formatter* derivation_formatter::new_derivation_formatter(string_piece name, const derivator* derinet) {
3510 0 ▶ if (name == "none") return new_none_derivation_formatter();
Branch: 1 branch
BranchTrueFalseTotal
if (name == "none") return new_none_derivation_formatter(); 0 0 0
3511 0 ▶ if (name == "root") return new_root_derivation_formatter(derinet);
Branch: 1 branch
BranchTrueFalseTotal
if (name == "root") return new_root_derivation_formatter(derinet); 0 0 0
3512 0 ▶ if (name == "path") return new_path_derivation_formatter(derinet);
Branch: 1 branch
BranchTrueFalseTotal
if (name == "path") return new_path_derivation_formatter(derinet); 0 0 0
3513 0 ▶ if (name == "tree") return new_tree_derivation_formatter(derinet);
Branch: 1 branch
BranchTrueFalseTotal
if (name == "tree") return new_tree_derivation_formatter(derinet); 0 0 0
3514 0 return nullptr;
3515 }
3516  
3517 } // namespace morphodita
3518  
3519 /////////
3520 // File: morphodita/morpho/small_stringops.h
3521 /////////
3522  
3523 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3524 //
3525 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
3526 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3527 //
3528 // This Source Code Form is subject to the terms of the Mozilla Public
3529 // License, v. 2.0. If a copy of the MPL was not distributed with this
3530 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3531  
3532 namespace morphodita {
3533  
3534 // Declarations
3535 inline bool small_memeq(const void* a, const void* b, size_t len);
3536 inline void small_memcpy(void* dest, const void* src, size_t len);
3537  
3538 // Definitions
3539 172 bool small_memeq(const void* a_void, const void* b_void, size_t len) {
3540 172 const char* a = (const char*)a_void;
3541 172 const char* b = (const char*)b_void;
3542  
3543 438 ▶ while (len--)
Branch: 1 branch
BranchTrueFalseTotal
while (len--) 393 45 438
3544 393 ▶ if (*a++ != *b++)
Branch: 1 branch
BranchTrueFalseTotal
if (*a++ != *b++) 127 266 393
3545 127 return false;
3546 45 return true;
3547 }
3548  
3549 121 void small_memcpy(void* dest_void, const void* src_void, size_t len) {
3550 121 char* dest = (char*)dest_void;
3551 121 const char* src = (const char*)src_void;
3552  
3553 437 ▶ while (len--)
Branch: 1 branch
BranchTrueFalseTotal
while (len--) 316 121 437
3554 316 *dest++ = *src++;
3555 121 }
3556  
3557 } // namespace morphodita
3558  
3559 /////////
3560 // File: utils/pointer_decoder.h
3561 /////////
3562  
3563 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
3564 //
3565 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
3566 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3567 //
3568 // This Source Code Form is subject to the terms of the Mozilla Public
3569 // License, v. 2.0. If a copy of the MPL was not distributed with this
3570 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3571  
3572 namespace utils {
3573  
3574 //
3575 // Declarations
3576 //
3577  
3578 class pointer_decoder {
3579 public:
3580 inline pointer_decoder(const unsigned char*& data);
3581 inline unsigned next_1B();
3582 inline unsigned next_2B();
3583 inline unsigned next_4B();
3584 inline void next_str(string& str);
3585 template <class T> inline const T* next(unsigned elements);
3586  
3587 private:
3588 const unsigned char*& data;
3589 };
3590  
3591 //
3592 // Definitions
3593 //
3594  
3595 43 pointer_decoder::pointer_decoder(const unsigned char*& data) : data(data) {}
3596  
3597 30 unsigned pointer_decoder::next_1B() {
3598 30 return *data++;
3599 }
3600  
3601 56 unsigned pointer_decoder::next_2B() {
3602 uint16_t result;
3603 56 memcpy(&result, data, sizeof(uint16_t));
3604 56 data += sizeof(uint16_t);
3605 56 return result;
3606 }
3607  
3608 30 unsigned pointer_decoder::next_4B() {
3609 uint32_t result;
3610 30 memcpy(&result, data, sizeof(uint32_t));
3611 30 data += sizeof(uint32_t);
3612 30 return result;
3613 }
3614  
3615 void pointer_decoder::next_str(string& str) {
3616 unsigned len = next_1B();
3617 if (len == 255) len = next_4B();
3618 str.assign(next<char>(len), len);
3619 }
3620  
3621 0 template <class T> const T* pointer_decoder::next(unsigned elements) {
3622 0 const T* result = (const T*) data;
3623 0 data += sizeof(T) * elements;
3624 0 return result;
3625 }
3626  
3627 } // namespace utils
3628  
3629 /////////
3630 // File: morphodita/morpho/persistent_unordered_map.h
3631 /////////
3632  
3633 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3634 //
3635 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
3636 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3637 //
3638 // This Source Code Form is subject to the terms of the Mozilla Public
3639 // License, v. 2.0. If a copy of the MPL was not distributed with this
3640 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3641  
3642 namespace morphodita {
3643  
3644 // Declarations
3645 class persistent_unordered_map {
3646 public:
3647 // Accessing function
3648 template <class EntrySize>
3649 inline const unsigned char* at(const char* str, int len, EntrySize entry_size) const;
3650  
3651 template <class T>
3652 inline const T* at_typed(const char* str, int len) const;
3653  
3654 template <class EntryProcess>
3655 inline void iter(const char* str, int len, EntryProcess entry_process) const;
3656  
3657 template <class EntryProcess>
3658 inline void iter_all(EntryProcess entry_process) const;
3659  
3660 // Two helper functions accessing some internals
3661 inline int max_length() const;
3662 inline const unsigned char* data_start(int len) const;
3663  
3664 // Creation functions
3665 50 persistent_unordered_map() {}
3666 template <class Entry, class EntryEncode>
3667 persistent_unordered_map(const unordered_map<string, Entry>& map, double load_factor, EntryEncode entry_encode);
3668 template <class Entry, class EntryEncode>
3669 persistent_unordered_map(const unordered_map<string, Entry>& map, double load_factor, bool add_prefixes, bool add_suffixes, EntryEncode entry_encode);
3670  
3671 // Manual creation functions
3672 inline void resize(unsigned elems);
3673 inline void add(const char* str, int str_len, int data_len);
3674 inline void done_adding();
3675 inline unsigned char* fill(const char* str, int str_len, int data_len);
3676 inline void done_filling();
3677  
3678 // Serialization
3679 inline void load(binary_decoder& data);
3680 inline void save(binary_encoder& enc);
3681  
3682 private:
3683 struct fnv_hash;
3684 vector<fnv_hash> hashes;
3685  
3686 template <class Entry, class EntryEncode>
3687 void construct(const map<string, Entry>& map, double load_factor, EntryEncode entry_encode);
3688 };
3689  
3690 // Definitions
3691 struct persistent_unordered_map::fnv_hash {
3692 16 fnv_hash(unsigned num) {
3693 16 mask = 1;
3694 68 ▶ while (mask < num)
Branch: 1 branch
BranchTrueFalseTotal
while (mask < num) 52 16 68
3695 52 mask <<= 1;
3696 16 ▶ hash.resize(mask + 1);
Branch: 1 branch
BranchTrueFalseTotal
hash.resize(mask + 1); 16 0 16
3697 16 mask--;
3698 16 }
3699 137 fnv_hash(binary_decoder& data) {
3700 137 ▶ uint32_t size = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
uint32_t size = data.next_4B(); 137 0 137
3701 137 mask = size - 2;
3702 137 ▶ hash.resize(size);
Branch: 1 branch
BranchTrueFalseTotal
hash.resize(size); 137 0 137
3703 137 ▶ memcpy(hash.data(), data.next<uint32_t>(size), size * sizeof(uint32_t));
Branch: 1 branch
BranchTrueFalseTotal
memcpy(hash.data(), data.next<uint32_t>(size), size * sizeof(uint32_t)); 137 0 137
3704  
3705 137 ▶ size = data.next_4B();
Branch: 1 branch
BranchTrueFalseTotal
size = data.next_4B(); 137 0 137
3706 137 ▶ this->data.resize(size);
Branch: 1 branch
BranchTrueFalseTotal
this->data.resize(size); 137 0 137
3707 137 ▶ if (size) memcpy(this->data.data(), data.next<char>(size), size);
Branch: 2 branches
BranchTrueFalseTotal
if (size) memcpy(this->data.data(), data.next<char>(size), size); 68 69 137
if (size) memcpy(this->data.data(), data.next<char>(size), size); 68 0 68
3708 137 }
3709  
3710 245 inline uint32_t index(const char* data, int len) const {
3711 245 ▶ if (len <= 0) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (len <= 0) return 0; 18 227 245
3712 227 ▶ if (len == 1) return unaligned_load<uint8_t>(data);
Branch: 1 branch
BranchTrueFalseTotal
if (len == 1) return unaligned_load<uint8_t>(data); 29 198 227
3713 198 ▶ if (len == 2) return unaligned_load<uint16_t>(data);
Branch: 1 branch
BranchTrueFalseTotal
if (len == 2) return unaligned_load<uint16_t>(data); 104 94 198
3714  
3715 94 uint32_t hash = 2166136261U;
3716 540 ▶ while (len--)
Branch: 1 branch
BranchTrueFalseTotal
while (len--) 446 94 540
3717 446 hash = (hash ^ unsigned((signed char)*data++)) * 16777619U;
3718 94 return hash & mask;
3719 }
3720  
3721 inline void save(binary_encoder& enc);
3722  
3723 unsigned mask;
3724 vector<uint32_t> hash;
3725 vector<unsigned char> data;
3726 };
3727  
3728 template <class EntrySize>
3729 0 const unsigned char* persistent_unordered_map::at(const char* str, int len, EntrySize entry_size) const {
3730 0 ▶ if (unsigned(len) >= hashes.size()) return nullptr;
Branch: 11 branches
BranchTrueFalseTotal
if (unsigned(len) >= hashes.size()) return nullptr; 0 48 48
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
if (unsigned(len) >= hashes.size()) return nullptr; 0 0 0
3731  
3732 0 ▶ unsigned index = hashes[len].index(str, len);
Branch: 11 branches
BranchTrueFalseTotal
unsigned index = hashes[len].index(str, len); 48 0 48
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
3733 0 const unsigned char* data = hashes[len].data.data() + hashes[len].hash[index];
3734 0 const unsigned char* end = hashes[len].data.data() + hashes[len].hash[index+1];
3735  
3736 0 ▶ if (len <= 2)
Branch: 11 branches
BranchTrueFalseTotal
if (len <= 2) 48 0 48
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
if (len <= 2) 0 0 0
3737 0 ▶ return data != end ? data + len : nullptr;
Branch: 11 branches
BranchTrueFalseTotal
return data != end ? data + len : nullptr; 30 18 48
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
return data != end ? data + len : nullptr; 0 0 0
3738  
3739 0 ▶ while (data < end) {
Branch: 11 branches
BranchTrueFalseTotal
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
3740 0 ▶ if (small_memeq(str, data, len)) return data + len;
Branch: 11 branches
BranchTrueFalseTotal
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
if (small_memeq(str, data, len)) return data + len; 0 0 0
3741 0 data += len;
3742 0 pointer_decoder decoder(data);
3743 0 ▶ entry_size(decoder);
Branch: 10 branches
BranchTrueFalseTotal
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
entry_size(decoder); 0 0 0
3744 }
3745  
3746 0 return nullptr;
3747 }
3748  
3749 template <class T>
3750 204 const T* persistent_unordered_map::at_typed(const char* str, int len) const {
3751 204 ▶ if (unsigned(len) >= hashes.size()) return nullptr;
Branch: 2 branches
BranchTrueFalseTotal
if (unsigned(len) >= hashes.size()) return nullptr; 0 108 108
if (unsigned(len) >= hashes.size()) return nullptr; 55 41 96
3752  
3753 149 unsigned index = hashes[len].index(str, len);
3754 149 const unsigned char* data = hashes[len].data.data() + hashes[len].hash[index];
3755 149 const unsigned char* end = hashes[len].data.data() + hashes[len].hash[index+1];
3756  
3757 149 ▶ if (len <= 2)
Branch: 2 branches
BranchTrueFalseTotal
if (len <= 2) 88 20 108
if (len <= 2) 11 30 41
3758 99 ▶ return data != end ? (const T*)(data + len) : nullptr;
Branch: 2 branches
BranchTrueFalseTotal
return data != end ? (const T*)(data + len) : nullptr; 52 36 88
return data != end ? (const T*)(data + len) : nullptr; 11 0 11
3759  
3760 79 ▶ while (data < end) {
Branch: 2 branches
BranchTrueFalseTotal
while (data < end) { 20 17 37
while (data < end) { 38 4 42
3761 58 ▶ if (small_memeq(str, data, len)) return (const T*)(data + len);
Branch: 2 branches
BranchTrueFalseTotal
if (small_memeq(str, data, len)) return (const T*)(data + len); 3 17 20
if (small_memeq(str, data, len)) return (const T*)(data + len); 26 12 38
3762 29 data += len + sizeof(T);
3763 }
3764  
3765 21 return nullptr;
3766 }
3767  
3768 template <class EntryProcess>
3769 0 void persistent_unordered_map::iter(const char* str, int len, EntryProcess entry_process) const {
3770 0 ▶ if (unsigned(len) >= hashes.size()) return;
Branch: 6 branches
BranchTrueFalseTotal
if (unsigned(len) >= hashes.size()) return; 0 0 0
if (unsigned(len) >= hashes.size()) return; 0 30 30
if (unsigned(len) >= hashes.size()) return; 0 0 0
if (unsigned(len) >= hashes.size()) return; 0 0 0
if (unsigned(len) >= hashes.size()) return; 0 0 0
if (unsigned(len) >= hashes.size()) return; 0 0 0
3771  
3772 0 ▶ unsigned index = hashes[len].index(str, len);
Branch: 6 branches
BranchTrueFalseTotal
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 30 0 30
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
unsigned index = hashes[len].index(str, len); 0 0 0
3773 0 const unsigned char* data = hashes[len].data.data() + hashes[len].hash[index];
3774 0 const unsigned char* end = hashes[len].data.data() + hashes[len].hash[index+1];
3775  
3776 0 ▶ while (data < end) {
Branch: 6 branches
BranchTrueFalseTotal
while (data < end) { 0 0 0
while (data < end) { 30 30 60
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
while (data < end) { 0 0 0
3777 0 auto start = (const char*) data;
3778 0 data += len;
3779 0 pointer_decoder decoder(data);
3780 0 ▶ entry_process(start, decoder);
Branch: 6 branches
BranchTrueFalseTotal
entry_process(start, decoder); 0 0 0
entry_process(start, decoder); 30 0 30
entry_process(start, decoder); 0 0 0
entry_process(start, decoder); 0 0 0
entry_process(start, decoder); 0 0 0
entry_process(start, decoder); 0 0 0
3781 }
3782 }
3783  
3784 template <class EntryProcess>
3785 0 void persistent_unordered_map::iter_all(EntryProcess entry_process) const {
3786 0 ▶ for (unsigned len = 0; len < hashes.size(); len++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned len = 0; len < hashes.size(); len++) { 3 1 4
for (unsigned len = 0; len < hashes.size(); len++) { 0 0 0
for (unsigned len = 0; len < hashes.size(); len++) { 0 0 0
3787 0 const unsigned char* data = hashes[len].data.data();
3788 0 const unsigned char* end = data + hashes[len].data.size();
3789  
3790 0 ▶ while (data < end) {
Branch: 3 branches
BranchTrueFalseTotal
while (data < end) { 13 3 16
while (data < end) { 0 0 0
while (data < end) { 0 0 0
3791 0 auto start = (const char*) data;
3792 0 data += len;
3793 0 pointer_decoder decoder(data);
3794 0 ▶ entry_process(start, len, decoder);
Branch: 3 branches
BranchTrueFalseTotal
entry_process(start, len, decoder); 13 0 13
entry_process(start, len, decoder); 0 0 0
entry_process(start, len, decoder); 0 0 0
3795 }
3796 }
3797 0 }
3798  
3799 52 int persistent_unordered_map::max_length() const {
3800 52 return hashes.size();
3801 }
3802  
3803 19 const unsigned char* persistent_unordered_map::data_start(int len) const {
3804 19 ▶ return unsigned(len) < hashes.size() ? hashes[len].data.data() : nullptr;
Branch: 1 branch
BranchTrueFalseTotal
return unsigned(len) < hashes.size() ? hashes[len].data.data() : nullptr; 19 0 19
3805 }
3806  
3807 16 void persistent_unordered_map::resize(unsigned elems) {
3808 16 ▶ if (hashes.size() == 0) hashes.emplace_back(1);
Branch: 2 branches
BranchTrueFalseTotal
if (hashes.size() == 0) hashes.emplace_back(1); 2 14 16
if (hashes.size() == 0) hashes.emplace_back(1); 2 0 2
3809 14 ▶ else if (hashes.size() == 1) hashes.emplace_back(1<<8);
Branch: 2 branches
BranchTrueFalseTotal
else if (hashes.size() == 1) hashes.emplace_back(1<<8); 2 12 14
else if (hashes.size() == 1) hashes.emplace_back(1<<8); 2 0 2
3810 12 ▶ else if (hashes.size() == 2) hashes.emplace_back(1<<16);
Branch: 2 branches
BranchTrueFalseTotal
else if (hashes.size() == 2) hashes.emplace_back(1<<16); 2 10 12
else if (hashes.size() == 2) hashes.emplace_back(1<<16); 2 0 2
3811 10 else hashes.emplace_back(elems);
3812 16 }
3813  
3814 9 void persistent_unordered_map::add(const char* str, int str_len, int data_len) {
3815 9 ▶ if (unsigned(str_len) < hashes.size())
Branch: 1 branch
BranchTrueFalseTotal
if (unsigned(str_len) < hashes.size()) 9 0 9
3816 9 hashes[str_len].hash[hashes[str_len].index(str, str_len)] += str_len + data_len;
3817 9 }
3818  
3819 2 void persistent_unordered_map::done_adding() {
3820 18 ▶ for (auto&& hash : hashes) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& hash : hashes) { 16 2 18
3821 16 int total = 0;
3822 131632 ▶ for (auto&& len : hash.hash) total += len, len = total - len;
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& len : hash.hash) total += len, len = total - len; 131616 16 131632
3823 16 ▶ hash.data.resize(total);
Branch: 1 branch
BranchTrueFalseTotal
hash.data.resize(total); 16 0 16
3824 }
3825 2 }
3826  
3827 9 unsigned char* persistent_unordered_map::fill(const char* str, int str_len, int data_len) {
3828 9 ▶ if (unsigned(str_len) < hashes.size()) {
Branch: 1 branch
BranchTrueFalseTotal
if (unsigned(str_len) < hashes.size()) { 9 0 9
3829 9 unsigned index = hashes[str_len].index(str, str_len);
3830 9 unsigned offset = hashes[str_len].hash[index];
3831 9 small_memcpy(hashes[str_len].data.data() + offset, str, str_len);
3832 9 hashes[str_len].hash[index] += str_len + data_len;
3833 9 return hashes[str_len].data.data() + offset + str_len;
3834 }
3835 0 return nullptr;
3836 }
3837  
3838 2 void persistent_unordered_map::done_filling() {
3839 18 ▶ for (auto&& hash : hashes)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& hash : hashes) 16 2 18
3840 131632 ▶ for (int i = hash.hash.size() - 1; i >= 0; i--)
Branch: 1 branch
BranchTrueFalseTotal
for (int i = hash.hash.size() - 1; i >= 0; i--) 131616 16 131632
3841 131616 ▶ hash.hash[i] = i > 0 ? hash.hash[i-1] : 0;
Branch: 1 branch
BranchTrueFalseTotal
hash.hash[i] = i > 0 ? hash.hash[i-1] : 0; 131600 16 131616
3842 2 }
3843  
3844 48 void persistent_unordered_map::load(binary_decoder& data) {
3845 48 unsigned sizes = data.next_1B();
3846  
3847 48 hashes.clear();
3848 185 ▶ for (unsigned i = 0; i < sizes; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sizes; i++) 137 48 185
3849 137 hashes.emplace_back(data);
3850 48 }
3851  
3852 } // namespace morphodita
3853  
3854 /////////
3855 // File: morphodita/derivator/derivator_dictionary.h
3856 /////////
3857  
3858 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3859 //
3860 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3861 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3862 //
3863 // This Source Code Form is subject to the terms of the Mozilla Public
3864 // License, v. 2.0. If a copy of the MPL was not distributed with this
3865 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3866  
3867 namespace morphodita {
3868  
3869 class derivator_dictionary : public derivator {
3870 public:
3871 virtual bool parent(string_piece lemma, derivated_lemma& parent) const override;
3872 virtual bool children(string_piece lemma, vector<derivated_lemma>& children) const override;
3873  
3874 bool load(istream& is);
3875  
3876 private:
3877 friend class morpho;
3878 const morpho* dictionary;
3879 persistent_unordered_map derinet;
3880 };
3881  
3882 } // namespace morphodita
3883  
3884 /////////
3885 // File: morphodita/derivator/derivator_dictionary.cpp
3886 /////////
3887  
3888 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
3889 //
3890 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
3891 // Mathematics and Physics, Charles University in Prague, Czech Republic.
3892 //
3893 // This Source Code Form is subject to the terms of the Mozilla Public
3894 // License, v. 2.0. If a copy of the MPL was not distributed with this
3895 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
3896  
3897 namespace morphodita {
3898  
3899 0 bool derivator_dictionary::parent(string_piece lemma, derivated_lemma& parent) const {
3900 0 ▶ if (dictionary) lemma.len = dictionary->lemma_id_len(lemma);
Branch: 1 branch
BranchTrueFalseTotal
if (dictionary) lemma.len = dictionary->lemma_id_len(lemma); 0 0 0
3901  
3902 0 auto lemma_data = derinet.at(lemma.str, lemma.len, [](pointer_decoder& data) {
3903 0 data.next<char>(data.next_1B());
3904 0 data.next_4B();
3905 0 data.next<uint32_t>(data.next_2B());
3906 0 });
3907 0 ▶ if (lemma_data) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma_data) { 0 0 0
3908 0 auto parent_encoded = *(uint32_t*)(lemma_data + 1 + *lemma_data);
3909 0 ▶ if (parent_encoded) {
Branch: 1 branch
BranchTrueFalseTotal
if (parent_encoded) { 0 0 0
3910 0 unsigned parent_len = parent_encoded & 0xFF;
3911 0 auto parent_data = derinet.data_start(parent_len) + (parent_encoded >> 8);
3912 0 parent.lemma.assign((const char*) parent_data, parent_len);
3913 0 ▶ if (parent_data[parent_len])
Branch: 1 branch
BranchTrueFalseTotal
if (parent_data[parent_len]) 0 0 0
3914 0 parent.lemma.append((const char*) parent_data + parent_len + 1, parent_data[parent_len]);
3915 0 return true;
3916 }
3917 }
3918 0 parent.lemma.clear();
3919 0 return false;
3920 }
3921  
3922 0 bool derivator_dictionary::children(string_piece lemma, vector<derivated_lemma>& children) const {
3923 0 ▶ if (dictionary) lemma.len = dictionary->lemma_id_len(lemma);
Branch: 1 branch
BranchTrueFalseTotal
if (dictionary) lemma.len = dictionary->lemma_id_len(lemma); 0 0 0
3924  
3925 0 auto lemma_data = derinet.at(lemma.str, lemma.len, [](pointer_decoder& data) {
3926 0 data.next<char>(data.next_1B());
3927 0 data.next_4B();
3928 0 data.next<uint32_t>(data.next_2B());
3929 0 });
3930 0 ▶ if (lemma_data) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma_data) { 0 0 0
3931 0 auto children_len = *(uint16_t*)(lemma_data + 1 + *lemma_data + 4);
3932 0 auto children_encoded = (uint32_t*)(lemma_data + 1 + *lemma_data + 4 + 2);
3933 0 ▶ if (children_len) {
Branch: 1 branch
BranchTrueFalseTotal
if (children_len) { 0 0 0
3934 0 children.resize(children_len);
3935 0 ▶ for (unsigned i = 0; i < children_len; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < children_len; i++) { 0 0 0
3936 0 unsigned child_len = children_encoded[i] & 0xFF;
3937 0 auto child_data = derinet.data_start(child_len) + (children_encoded[i] >> 8);
3938 0 children[i].lemma.assign((const char*) child_data, child_len);
3939 0 ▶ if (child_data[child_len])
Branch: 1 branch
BranchTrueFalseTotal
if (child_data[child_len]) 0 0 0
3940 0 children[i].lemma.append((const char*) child_data + child_len + 1, child_data[child_len]);
3941 }
3942 0 return true;
3943 }
3944 }
3945 0 children.clear();
3946 0 return false;
3947 }
3948  
3949 0 bool derivator_dictionary::load(istream& is) {
3950 0 binary_decoder data;
3951 0 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 0 0 0
3952  
3953 try {
3954 0 ▶ for (int i = data.next_1B(); i > 0; i--)
Branch: 2 branches
BranchTrueFalseTotal
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
3955 0 ▶ derinet.resize(data.next_4B());
Branch: 2 branches
BranchTrueFalseTotal
derinet.resize(data.next_4B()); 0 0 0
derinet.resize(data.next_4B()); 0 0 0
3956  
3957 0 unsigned data_position = data.tell();
3958 0 vector<char> lemma, parent;
3959 0 ▶ for (int pass = 1; pass <= 3; pass++) {
Branch: 1 branch
BranchTrueFalseTotal
for (int pass = 1; pass <= 3; pass++) { 0 0 0
3960 0 ▶ if (pass > 1) data.seek(data_position);
Branch: 2 branches
BranchTrueFalseTotal
if (pass > 1) data.seek(data_position); 0 0 0
if (pass > 1) data.seek(data_position); 0 0 0
3961  
3962 0 lemma.clear();
3963 0 ▶ for (int i = data.next_4B(); i > 0; i--) {
Branch: 2 branches
BranchTrueFalseTotal
for (int i = data.next_4B(); i > 0; i--) { 0 0 0
for (int i = data.next_4B(); i > 0; i--) { 0 0 0
3964 0 ▶ lemma.resize(lemma.size() - data.next_1B());
Branch: 2 branches
BranchTrueFalseTotal
lemma.resize(lemma.size() - data.next_1B()); 0 0 0
lemma.resize(lemma.size() - data.next_1B()); 0 0 0
3965 0 ▶ for (int i = data.next_1B(); i > 0; i--)
Branch: 2 branches
BranchTrueFalseTotal
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
3966 0 ▶ lemma.push_back(data.next_1B());
Branch: 2 branches
BranchTrueFalseTotal
lemma.push_back(data.next_1B()); 0 0 0
lemma.push_back(data.next_1B()); 0 0 0
3967  
3968 0 ▶ unsigned char lemma_comment_len = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned char lemma_comment_len = data.next_1B(); 0 0 0
3969 0 ▶ const char* lemma_comment = lemma_comment_len ? data.next<char>(lemma_comment_len) : nullptr;
Branch: 2 branches
BranchTrueFalseTotal
const char* lemma_comment = lemma_comment_len ? data.next<char>(lemma_comment_len) : nullptr; 0 0 0
const char* lemma_comment = lemma_comment_len ? data.next<char>(lemma_comment_len) : nullptr; 0 0 0
3970  
3971 0 ▶ unsigned children = data.next_2B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned children = data.next_2B(); 0 0 0
3972  
3973 0 ▶ if (pass == 3) parent.clear();
Branch: 1 branch
BranchTrueFalseTotal
if (pass == 3) parent.clear(); 0 0 0
3974 enum { REMOVE_START = 1, REMOVE_END = 2, ADD_START = 4, ADD_END = 8 };
3975 0 ▶ int operations = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
int operations = data.next_1B(); 0 0 0
3976 0 ▶ if (operations) {
Branch: 1 branch
BranchTrueFalseTotal
if (operations) { 0 0 0
3977 0 ▶ int remove_start = operations & REMOVE_START ? data.next_1B() : 0;
Branch: 2 branches
BranchTrueFalseTotal
int remove_start = operations & REMOVE_START ? data.next_1B() : 0; 0 0 0
int remove_start = operations & REMOVE_START ? data.next_1B() : 0; 0 0 0
3978 0 ▶ int remove_end = operations & REMOVE_END ? data.next_1B() : 0;
Branch: 2 branches
BranchTrueFalseTotal
int remove_end = operations & REMOVE_END ? data.next_1B() : 0; 0 0 0
int remove_end = operations & REMOVE_END ? data.next_1B() : 0; 0 0 0
3979 0 ▶ if (operations & ADD_START) {
Branch: 1 branch
BranchTrueFalseTotal
if (operations & ADD_START) { 0 0 0
3980 0 ▶ int add_start = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
int add_start = data.next_1B(); 0 0 0
3981 0 ▶ const char* str = data.next<char>(add_start);
Branch: 1 branch
BranchTrueFalseTotal
const char* str = data.next<char>(add_start); 0 0 0
3982 0 ▶ if (pass == 3) parent.assign(str, str + add_start);
Branch: 2 branches
BranchTrueFalseTotal
if (pass == 3) parent.assign(str, str + add_start); 0 0 0
if (pass == 3) parent.assign(str, str + add_start); 0 0 0
3983 }
3984 0 ▶ if (pass == 3) parent.insert(parent.end(), lemma.begin() + remove_start, lemma.end() - remove_end);
Branch: 2 branches
BranchTrueFalseTotal
if (pass == 3) parent.insert(parent.end(), lemma.begin() + remove_start, lemma.end() - remove_end); 0 0 0
if (pass == 3) parent.insert(parent.end(), lemma.begin() + remove_start, lemma.end() - remove_end); 0 0 0
3985 0 ▶ if (operations & ADD_END) {
Branch: 1 branch
BranchTrueFalseTotal
if (operations & ADD_END) { 0 0 0
3986 0 ▶ int add_end = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
int add_end = data.next_1B(); 0 0 0
3987 0 ▶ const char* str = data.next<char>(add_end);
Branch: 1 branch
BranchTrueFalseTotal
const char* str = data.next<char>(add_end); 0 0 0
3988 0 ▶ if (pass == 3) parent.insert(parent.end(), str, str + add_end);
Branch: 2 branches
BranchTrueFalseTotal
if (pass == 3) parent.insert(parent.end(), str, str + add_end); 0 0 0
if (pass == 3) parent.insert(parent.end(), str, str + add_end); 0 0 0
3989 }
3990 }
3991  
3992 0 ▶ if (pass == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (pass == 1) { 0 0 0
3993 0 ▶ derinet.add(lemma.data(), lemma.size(), 1 + lemma_comment_len + 4 + 2 + 4 * children);
Branch: 1 branch
BranchTrueFalseTotal
derinet.add(lemma.data(), lemma.size(), 1 + lemma_comment_len + 4 + 2 + 4 * children); 0 0 0
3994 0 ▶ } else if (pass == 2) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (pass == 2) { 0 0 0
3995 0 ▶ unsigned char* lemma_data = derinet.fill(lemma.data(), lemma.size(), 1 + lemma_comment_len + 4 + 2 + 4 * children);
Branch: 1 branch
BranchTrueFalseTotal
unsigned char* lemma_data = derinet.fill(lemma.data(), lemma.size(), 1 + lemma_comment_len + 4 + 2 + 4 * children); 0 0 0
3996 0 *lemma_data++ = lemma_comment_len;
3997 0 ▶ while (lemma_comment_len--) *lemma_data++ = *lemma_comment++;
Branch: 1 branch
BranchTrueFalseTotal
while (lemma_comment_len--) *lemma_data++ = *lemma_comment++; 0 0 0
3998 0 unaligned_store_inc<uint32_t>(lemma_data, 0);
3999 0 unaligned_store_inc<uint16_t>(lemma_data, children);
4000 0 ▶ if (children) unaligned_store<uint32_t>(((uint32_t*)lemma_data) + children - 1, 0);
Branch: 1 branch
BranchTrueFalseTotal
if (children) unaligned_store<uint32_t>(((uint32_t*)lemma_data) + children - 1, 0); 0 0 0
4001 0 ▶ } else if (pass == 3 && !parent.empty()) {
Branch: 3 branches
BranchTrueFalseTotal
} else if (pass == 3 && !parent.empty()) { 0 0 0
} else if (pass == 3 && !parent.empty()) { 0 0 0
} else if (pass == 3 && !parent.empty()) { 0 0 0
4002 0 ▶ auto lemma_data = derinet.at(lemma.data(), lemma.size(), [](pointer_decoder& data) {
Branch: 1 branch
BranchTrueFalseTotal
auto lemma_data = derinet.at(lemma.data(), lemma.size(), [](pointer_decoder& data) { 0 0 0
4003 0 data.next<char>(data.next_1B());
4004 0 data.next_4B();
4005 0 data.next<uint32_t>(data.next_2B());
4006 0 });
4007 0 ▶ auto parent_data = derinet.at(parent.data(), parent.size(), [](pointer_decoder& data) {
Branch: 1 branch
BranchTrueFalseTotal
auto parent_data = derinet.at(parent.data(), parent.size(), [](pointer_decoder& data) { 0 0 0
4008 0 data.next<char>(data.next_1B());
4009 0 data.next_4B();
4010 0 data.next<uint32_t>(data.next_2B());
4011 0 });
4012 0 ▶ assert(lemma_data && parent_data);
Branch: 2 branches
BranchTrueFalseTotal
assert(lemma_data && parent_data); 0 0 0
assert(lemma_data && parent_data); 0 0 0
4013  
4014 0 unsigned parent_offset = parent_data - parent.size() - derinet.data_start(parent.size());
4015 0 ▶ assert(parent.size() < (1<<8) && parent_offset < (1<<24));
Branch: 2 branches
BranchTrueFalseTotal
assert(parent.size() < (1<<8) && parent_offset < (1<<24)); 0 0 0
assert(parent.size() < (1<<8) && parent_offset < (1<<24)); 0 0 0
4016 0 unaligned_store<uint32_t>((void *)(lemma_data + 1 + *lemma_data), (parent_offset << 8) | parent.size());
4017  
4018 0 unsigned lemma_offset = lemma_data - lemma.size() - derinet.data_start(lemma.size());
4019 0 ▶ assert(lemma.size() < (1<<8) && lemma_offset < (1<<24));
Branch: 2 branches
BranchTrueFalseTotal
assert(lemma.size() < (1<<8) && lemma_offset < (1<<24)); 0 0 0
assert(lemma.size() < (1<<8) && lemma_offset < (1<<24)); 0 0 0
4020 0 auto children_len = unaligned_load<uint16_t>(parent_data + 1 + *parent_data + 4);
4021 0 auto children = (uint32_t*)(parent_data + 1 + *parent_data + 4 + 2);
4022 0 auto child_index = unaligned_load<uint32_t>(children + children_len - 1);
4023 0 unaligned_store<uint32_t>(children + child_index, (lemma_offset << 8) | lemma.size());
4024 0 ▶ if (child_index+1 < children_len)
Branch: 1 branch
BranchTrueFalseTotal
if (child_index+1 < children_len) 0 0 0
4025 0 unaligned_store<uint32_t>(children + children_len - 1, unaligned_load<uint32_t>(children + children_len - 1) + 1);
4026 }
4027 }
4028  
4029 0 ▶ if (pass == 1)
Branch: 1 branch
BranchTrueFalseTotal
if (pass == 1) 0 0 0
4030 0 ▶ derinet.done_adding();
Branch: 1 branch
BranchTrueFalseTotal
derinet.done_adding(); 0 0 0
4031 0 ▶ if (pass == 2)
Branch: 1 branch
BranchTrueFalseTotal
if (pass == 2) 0 0 0
4032 0 derinet.done_filling();
4033 }
4034 0 ▶ } catch (binary_decoder_error&) {
Branch: 1 branch
BranchTrueFalseTotal
} catch (binary_decoder_error&) { 0 0 0
4035 return false;
4036 }
4037 0 return true;
4038 0 }
4039  
4040 } // namespace morphodita
4041  
4042 /////////
4043 // File: morphodita/morpho/casing_variants.h
4044 /////////
4045  
4046 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4047 //
4048 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4049 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4050 //
4051 // This Source Code Form is subject to the terms of the Mozilla Public
4052 // License, v. 2.0. If a copy of the MPL was not distributed with this
4053 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4054  
4055 namespace morphodita {
4056  
4057 14 inline void generate_casing_variants(string_piece form, string& form_uclc, string& form_lc) {
4058 using namespace unilib;
4059  
4060 // Detect uppercase+titlecase characters.
4061 14 bool first_Lut = false; // first character is uppercase or titlecase
4062 14 bool rest_has_Lut = false; // any character but first is uppercase or titlecase
4063 {
4064 14 string_piece form_tmp = form;
4065 14 first_Lut = unicode::category(utf8::decode(form_tmp.str, form_tmp.len)) & unicode::Lut;
4066 52 ▶ while (form_tmp.len && !rest_has_Lut)
Branch: 2 branches
BranchTrueFalseTotal
while (form_tmp.len && !rest_has_Lut) 38 14 52
while (form_tmp.len && !rest_has_Lut) 38 0 38
4067 38 rest_has_Lut = unicode::category(utf8::decode(form_tmp.str, form_tmp.len)) & unicode::Lut;
4068 }
4069  
4070 // Generate all casing variants if needed (they are different than given form).
4071 // We only replace letters with their lowercase variants.
4072 // - form_uclc: first uppercase, rest lowercase
4073 // - form_lc: all lowercase
4074  
4075 14 ▶ if (first_Lut && !rest_has_Lut) { // common case allowing fast execution
Branch: 2 branches
BranchTrueFalseTotal
if (first_Lut && !rest_has_Lut) { // common case allowing fast execution 4 10 14
if (first_Lut && !rest_has_Lut) { // common case allowing fast execution 4 0 4
4076 4 ▶ form_lc.reserve(form.len);
Branch: 1 branch
BranchTrueFalseTotal
form_lc.reserve(form.len); 4 0 4
4077 4 string_piece form_tmp = form;
4078 4 ▶ utf8::append(form_lc, unicode::lowercase(utf8::decode(form_tmp.str, form_tmp.len)));
Branch: 1 branch
BranchTrueFalseTotal
utf8::append(form_lc, unicode::lowercase(utf8::decode(form_tmp.str, form_tmp.len))); 4 0 4
4079 4 ▶ form_lc.append(form_tmp.str, form_tmp.len);
Branch: 1 branch
BranchTrueFalseTotal
form_lc.append(form_tmp.str, form_tmp.len); 4 0 4
4080 14 ▶ } else if (!first_Lut && rest_has_Lut) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (!first_Lut && rest_has_Lut) { 10 0 10
} else if (!first_Lut && rest_has_Lut) { 0 10 10
4081 0 form_lc.reserve(form.len);
4082 0 utf8::map(unicode::lowercase, form.str, form.len, form_lc);
4083 10 ▶ } else if (first_Lut && rest_has_Lut) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (first_Lut && rest_has_Lut) { 0 10 10
} else if (first_Lut && rest_has_Lut) { 0 0 0
4084 0 ▶ form_lc.reserve(form.len);
Branch: 1 branch
BranchTrueFalseTotal
form_lc.reserve(form.len); 0 0 0
4085 0 ▶ form_uclc.reserve(form.len);
Branch: 1 branch
BranchTrueFalseTotal
form_uclc.reserve(form.len); 0 0 0
4086 0 string_piece form_tmp = form;
4087 0 char32_t first = utf8::decode(form_tmp.str, form_tmp.len);
4088 0 ▶ utf8::append(form_lc, unicode::lowercase(first));
Branch: 1 branch
BranchTrueFalseTotal
utf8::append(form_lc, unicode::lowercase(first)); 0 0 0
4089 0 ▶ utf8::append(form_uclc, first);
Branch: 1 branch
BranchTrueFalseTotal
utf8::append(form_uclc, first); 0 0 0
4090 0 ▶ while (form_tmp.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (form_tmp.len) { 0 0 0
4091 0 char32_t lowercase = unicode::lowercase(utf8::decode(form_tmp.str, form_tmp.len));
4092 0 ▶ utf8::append(form_lc, lowercase);
Branch: 1 branch
BranchTrueFalseTotal
utf8::append(form_lc, lowercase); 0 0 0
4093 0 ▶ utf8::append(form_uclc, lowercase);
Branch: 1 branch
BranchTrueFalseTotal
utf8::append(form_uclc, lowercase); 0 0 0
4094 }
4095 }
4096 14 }
4097  
4098 } // namespace morphodita
4099  
4100 /////////
4101 // File: morphodita/morpho/czech_lemma_addinfo.h
4102 /////////
4103  
4104 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4105 //
4106 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4107 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4108 //
4109 // This Source Code Form is subject to the terms of the Mozilla Public
4110 // License, v. 2.0. If a copy of the MPL was not distributed with this
4111 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4112  
4113 namespace morphodita {
4114  
4115 // Declarations
4116 struct czech_lemma_addinfo {
4117 inline static int raw_lemma_len(string_piece lemma);
4118 inline static int lemma_id_len(string_piece lemma);
4119 inline static string format(const unsigned char* addinfo, int addinfo_len);
4120 inline static bool generatable(const unsigned char* addinfo, int addinfo_len);
4121  
4122 inline int parse(string_piece lemma, bool die_on_failure = false);
4123 inline bool match_lemma_id(const unsigned char* other_addinfo, int other_addinfo_len);
4124  
4125 vector<unsigned char> data;
4126 };
4127  
4128 // Definitions
4129 0 int czech_lemma_addinfo::raw_lemma_len(string_piece lemma) {
4130 // Lemma ends by a '-[0-9]', '`' or '_' on non-first position.
4131 0 ▶ for (unsigned len = 1; len < lemma.len; len++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned len = 1; len < lemma.len; len++) 0 0 0
4132 0 ▶ if (lemma.str[len] == '`' || lemma.str[len] == '_' ||
Branch: 2 branches
BranchTrueFalseTotal
if (lemma.str[len] == '`' || lemma.str[len] == '_' || 0 0 0
if (lemma.str[len] == '`' || lemma.str[len] == '_' || 0 0 0
4133 0 ▶ (lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9'))
Branch: 4 branches
BranchTrueFalseTotal
(lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9')) 0 0 0
(lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9')) 0 0 0
(lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9')) 0 0 0
(lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9')) 0 0 0
4134 0 return len;
4135 0 return lemma.len;
4136 }
4137  
4138 0 int czech_lemma_addinfo::lemma_id_len(string_piece lemma) {
4139 // Lemma ends by a '-[0-9]', '`' or '_' on non-first position.
4140 0 ▶ for (unsigned len = 1; len < lemma.len; len++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned len = 1; len < lemma.len; len++) { 0 0 0
4141 0 ▶ if (lemma.str[len] == '`' || lemma.str[len] == '_')
Branch: 2 branches
BranchTrueFalseTotal
if (lemma.str[len] == '`' || lemma.str[len] == '_') 0 0 0
if (lemma.str[len] == '`' || lemma.str[len] == '_') 0 0 0
4142 0 return len;
4143 0 ▶ if (lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9') {
Branch: 4 branches
BranchTrueFalseTotal
if (lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9') { 0 0 0
if (lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9') { 0 0 0
if (lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9') { 0 0 0
if (lemma.str[len] == '-' && len+1 < lemma.len && lemma.str[len+1] >= '0' && lemma.str[len+1] <= '9') { 0 0 0
4144 0 len += 2;
4145 0 ▶ while (len < lemma.len && lemma.str[len] >= '0' && lemma.str[len] <= '9') len++;
Branch: 3 branches
BranchTrueFalseTotal
while (len < lemma.len && lemma.str[len] >= '0' && lemma.str[len] <= '9') len++; 0 0 0
while (len < lemma.len && lemma.str[len] >= '0' && lemma.str[len] <= '9') len++; 0 0 0
while (len < lemma.len && lemma.str[len] >= '0' && lemma.str[len] <= '9') len++; 0 0 0
4146 0 return len;
4147 }
4148 }
4149 0 return lemma.len;
4150 }
4151  
4152 0 string czech_lemma_addinfo::format(const unsigned char* addinfo, int addinfo_len) {
4153 0 string res;
4154  
4155 0 ▶ if (addinfo_len) {
Branch: 1 branch
BranchTrueFalseTotal
if (addinfo_len) { 0 0 0
4156 0 ▶ res.reserve(addinfo_len + 4);
Branch: 1 branch
BranchTrueFalseTotal
res.reserve(addinfo_len + 4); 0 0 0
4157 0 ▶ if (addinfo[0] != 255) {
Branch: 1 branch
BranchTrueFalseTotal
if (addinfo[0] != 255) { 0 0 0
4158 char num[5];
4159 0 snprintf(num, sizeof(num), "-%u", addinfo[0]);
4160 0 ▶ res += num;
Branch: 1 branch
BranchTrueFalseTotal
res += num; 0 0 0
4161 }
4162 0 ▶ for (int i = 1; i < addinfo_len; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (int i = 1; i < addinfo_len; i++) 0 0 0
4163 0 ▶ res += addinfo[i];
Branch: 1 branch
BranchTrueFalseTotal
res += addinfo[i]; 0 0 0
4164 }
4165  
4166 0 return res;
4167 }
4168  
4169 0 bool czech_lemma_addinfo::generatable(const unsigned char* addinfo, int addinfo_len) {
4170 0 ▶ for (int i = 1; i + 2 < addinfo_len; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (int i = 1; i + 2 < addinfo_len; i++) 0 0 0
4171 0 ▶ if (addinfo[i] == '_' && addinfo[i+1] == ',' && addinfo[i+2] == 'x')
Branch: 3 branches
BranchTrueFalseTotal
if (addinfo[i] == '_' && addinfo[i+1] == ',' && addinfo[i+2] == 'x') 0 0 0
if (addinfo[i] == '_' && addinfo[i+1] == ',' && addinfo[i+2] == 'x') 0 0 0
if (addinfo[i] == '_' && addinfo[i+1] == ',' && addinfo[i+2] == 'x') 0 0 0
4172 0 return false;
4173  
4174 0 return true;
4175 }
4176  
4177 0 int czech_lemma_addinfo::parse(string_piece lemma, bool die_on_failure) {
4178 0 data.clear();
4179  
4180 0 const char* lemma_info = lemma.str + raw_lemma_len(lemma);
4181 0 ▶ if (lemma_info < lemma.str + lemma.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma_info < lemma.str + lemma.len) { 0 0 0
4182 0 int lemma_num = 255;
4183 0 const char* lemma_additional_info = lemma_info;
4184  
4185 0 ▶ if (*lemma_info == '-') {
Branch: 1 branch
BranchTrueFalseTotal
if (*lemma_info == '-') { 0 0 0
4186 0 lemma_num = 0;
4187 0 for (lemma_additional_info = lemma_info + 1;
4188 0 ▶ lemma_additional_info < lemma.str + lemma.len && (*lemma_additional_info >= '0' && *lemma_additional_info <= '9');
Branch: 3 branches
BranchTrueFalseTotal
lemma_additional_info < lemma.str + lemma.len && (*lemma_additional_info >= '0' && *lemma_additional_info <= '9'); 0 0 0
lemma_additional_info < lemma.str + lemma.len && (*lemma_additional_info >= '0' && *lemma_additional_info <= '9'); 0 0 0
lemma_additional_info < lemma.str + lemma.len && (*lemma_additional_info >= '0' && *lemma_additional_info <= '9'); 0 0 0
4189 lemma_additional_info++)
4190 0 lemma_num = 10 * lemma_num + (*lemma_additional_info - '0');
4191  
4192 0 ▶ if (lemma_additional_info == lemma_info + 1 || (lemma_additional_info < lemma.str + lemma.len && *lemma_additional_info != '`' && *lemma_additional_info != '_') || lemma_num >= 255) {
Branch: 5 branches
BranchTrueFalseTotal
if (lemma_additional_info == lemma_info + 1 || (lemma_additional_info < lemma.str + lemma.len && *lemma_additional_info != '`' && *lemma_additional_info != '_') || lemma_num >= 255) { 0 0 0
if (lemma_additional_info == lemma_info + 1 || (lemma_additional_info < lemma.str + lemma.len && *lemma_additional_info != '`' && *lemma_additional_info != '_') || lemma_num >= 255) { 0 0 0
if (lemma_additional_info == lemma_info + 1 || (lemma_additional_info < lemma.str + lemma.len && *lemma_additional_info != '`' && *lemma_additional_info != '_') || lemma_num >= 255) { 0 0 0
if (lemma_additional_info == lemma_info + 1 || (lemma_additional_info < lemma.str + lemma.len && *lemma_additional_info != '`' && *lemma_additional_info != '_') || lemma_num >= 255) { 0 0 0
if (lemma_additional_info == lemma_info + 1 || (lemma_additional_info < lemma.str + lemma.len && *lemma_additional_info != '`' && *lemma_additional_info != '_') || lemma_num >= 255) { 0 0 0
4193 0 ▶ if (die_on_failure)
Branch: 1 branch
BranchTrueFalseTotal
if (die_on_failure) 0 0 0
4194 0 ▶ runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!");
Branch: 6 branches
BranchTrueFalseTotal
runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!"); 0 0 0
runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!"); 0 0 0
runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!"); 0 0 0
runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!"); 0 0 0
runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!"); 0 0 0
runtime_failure("Lemma number " << lemma_num << " in lemma " << lemma << " out of range!"); 0 0 0
4195 else
4196 0 lemma_num = 255;
4197 }
4198 }
4199 0 ▶ data.emplace_back(lemma_num);
Branch: 1 branch
BranchTrueFalseTotal
data.emplace_back(lemma_num); 0 0 0
4200 0 ▶ while (lemma_additional_info < lemma.str + lemma.len)
Branch: 1 branch
BranchTrueFalseTotal
while (lemma_additional_info < lemma.str + lemma.len) 0 0 0
4201 0 ▶ data.push_back(*(unsigned char*)lemma_additional_info++);
Branch: 1 branch
BranchTrueFalseTotal
data.push_back(*(unsigned char*)lemma_additional_info++); 0 0 0
4202  
4203 0 ▶ if (data.size() > 255) {
Branch: 1 branch
BranchTrueFalseTotal
if (data.size() > 255) { 0 0 0
4204 0 ▶ if (die_on_failure)
Branch: 1 branch
BranchTrueFalseTotal
if (die_on_failure) 0 0 0
4205 0 ▶ runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!');
Branch: 6 branches
BranchTrueFalseTotal
runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!'); 0 0 0
runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!'); 0 0 0
runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!'); 0 0 0
runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!'); 0 0 0
runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!'); 0 0 0
runtime_failure("Too long lemma info " << lemma_info << " in lemma " << lemma << '!'); 0 0 0
4206 else
4207 0 ▶ data.resize(255);
Branch: 1 branch
BranchTrueFalseTotal
data.resize(255); 0 0 0
4208 }
4209 }
4210  
4211 0 return lemma_info - lemma.str;
4212 }
4213  
4214 0 bool czech_lemma_addinfo::match_lemma_id(const unsigned char* other_addinfo, int other_addinfo_len) {
4215 0 ▶ if (data.empty()) return true;
Branch: 1 branch
BranchTrueFalseTotal
if (data.empty()) return true; 0 0 0
4216 0 ▶ if (data[0] != 255 && (!other_addinfo_len || other_addinfo[0] != data[0])) return false;
Branch: 4 branches
BranchTrueFalseTotal
if (data[0] != 255 && (!other_addinfo_len || other_addinfo[0] != data[0])) return false; 0 0 0
if (data[0] != 255 && (!other_addinfo_len || other_addinfo[0] != data[0])) return false; 0 0 0
if (data[0] != 255 && (!other_addinfo_len || other_addinfo[0] != data[0])) return false; 0 0 0
if (data[0] != 255 && (!other_addinfo_len || other_addinfo[0] != data[0])) return false; 0 0 0
4217 0 return true;
4218 }
4219  
4220 } // namespace morphodita
4221  
4222 /////////
4223 // File: morphodita/morpho/tag_filter.h
4224 /////////
4225  
4226 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4227 //
4228 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4229 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4230 //
4231 // This Source Code Form is subject to the terms of the Mozilla Public
4232 // License, v. 2.0. If a copy of the MPL was not distributed with this
4233 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4234  
4235 namespace morphodita {
4236  
4237 // Declarations
4238 class tag_filter {
4239 public:
4240 tag_filter(const char* filter = nullptr);
4241  
4242 inline bool matches(const char* tag) const;
4243  
4244 private:
4245 struct char_filter {
4246 0 char_filter(int pos, bool negate, int chars_offset, int chars_len)
4247 0 : pos(pos), negate(negate), chars_offset(chars_offset), chars_len(chars_len) {}
4248  
4249 int pos;
4250 bool negate;
4251 int chars_offset, chars_len;
4252 };
4253  
4254 string wildcard;
4255 std::vector<char_filter> filters;
4256 };
4257  
4258 // Definitions
4259 0 inline bool tag_filter::matches(const char* tag) const {
4260 0 ▶ if (filters.empty()) return true;
Branch: 1 branch
BranchTrueFalseTotal
if (filters.empty()) return true; 0 0 0
4261  
4262 0 int tag_pos = 0;
4263 0 ▶ for (auto&& filter : filters) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& filter : filters) { 0 0 0
4264 // Skip until next filter position. If the tag ends prematurely, accept.
4265 0 ▶ while (tag_pos < filter.pos)
Branch: 1 branch
BranchTrueFalseTotal
while (tag_pos < filter.pos) 0 0 0
4266 0 ▶ if (!tag[tag_pos++])
Branch: 1 branch
BranchTrueFalseTotal
if (!tag[tag_pos++]) 0 0 0
4267 0 return true;
4268 0 ▶ if (!tag[tag_pos])
Branch: 1 branch
BranchTrueFalseTotal
if (!tag[tag_pos]) 0 0 0
4269 0 return true;
4270  
4271 // We assume filter.chars_len >= 1.
4272 0 bool matched = (wildcard[filter.chars_offset] == tag[tag_pos]) ^ filter.negate;
4273 0 ▶ for (int i = 1; i < filter.chars_len && ((!matched) ^ filter.negate); i++)
Branch: 2 branches
BranchTrueFalseTotal
for (int i = 1; i < filter.chars_len && ((!matched) ^ filter.negate); i++) 0 0 0
for (int i = 1; i < filter.chars_len && ((!matched) ^ filter.negate); i++) 0 0 0
4274 0 matched = (wildcard[filter.chars_offset + i] == tag[tag_pos]) ^ filter.negate;
4275 0 ▶ if (!matched) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!matched) return false; 0 0 0
4276 }
4277 0 return true;
4278 }
4279  
4280 } // namespace morphodita
4281  
4282 /////////
4283 // File: morphodita/morpho/morpho_dictionary.h
4284 /////////
4285  
4286 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4287 //
4288 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4289 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4290 //
4291 // This Source Code Form is subject to the terms of the Mozilla Public
4292 // License, v. 2.0. If a copy of the MPL was not distributed with this
4293 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4294  
4295 namespace morphodita {
4296  
4297 // Declarations
4298 template <class LemmaAddinfo>
4299 class morpho_dictionary {
4300 public:
4301 void load(binary_decoder& data);
4302 void analyze(string_piece form, vector<tagged_lemma>& lemmas) const;
4303 bool generate(string_piece lemma, const tag_filter& filter, vector<tagged_lemma_forms>& lemmas_forms) const;
4304 private:
4305 persistent_unordered_map lemmas, roots, suffixes;
4306  
4307 vector<string> tags;
4308 vector<vector<pair<string, vector<uint16_t>>>> classes;
4309 };
4310  
4311 // Definitions
4312 template <class LemmaAddinfo>
4313 0 void morpho_dictionary<LemmaAddinfo>::load(binary_decoder& data) {
4314 // Prepare lemmas and roots hashes
4315 0 ▶ for (int i = data.next_1B(); i > 0; i--)
Branch: 6 branches
BranchTrueFalseTotal
for (int i = data.next_1B(); i > 0; i--) 1 0 1
for (int i = data.next_1B(); i > 0; i--) 7 1 8
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
4316 0 ▶ lemmas.resize(data.next_4B());
Branch: 6 branches
BranchTrueFalseTotal
lemmas.resize(data.next_4B()); 7 0 7
lemmas.resize(data.next_4B()); 7 0 7
lemmas.resize(data.next_4B()); 0 0 0
lemmas.resize(data.next_4B()); 0 0 0
lemmas.resize(data.next_4B()); 0 0 0
lemmas.resize(data.next_4B()); 0 0 0
4317 0 ▶ for (int i = data.next_1B(); i > 0; i--)
Branch: 6 branches
BranchTrueFalseTotal
for (int i = data.next_1B(); i > 0; i--) 1 0 1
for (int i = data.next_1B(); i > 0; i--) 9 1 10
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
4318 0 ▶ roots.resize(data.next_4B());
Branch: 6 branches
BranchTrueFalseTotal
roots.resize(data.next_4B()); 9 0 9
roots.resize(data.next_4B()); 9 0 9
roots.resize(data.next_4B()); 0 0 0
roots.resize(data.next_4B()); 0 0 0
roots.resize(data.next_4B()); 0 0 0
roots.resize(data.next_4B()); 0 0 0
4319  
4320 // Perform two pass over the lemmas and roots data, filling the hashes.
4321  
4322 0 ▶ vector<char> lemma(max(lemmas.max_length(), roots.max_length()));
Branch: 3 branches
BranchTrueFalseTotal
vector<char> lemma(max(lemmas.max_length(), roots.max_length())); 1 0 1
vector<char> lemma(max(lemmas.max_length(), roots.max_length())); 0 0 0
vector<char> lemma(max(lemmas.max_length(), roots.max_length())); 0 0 0
4323 0 ▶ vector<char> root(max(lemmas.max_length(), roots.max_length()));
Branch: 3 branches
BranchTrueFalseTotal
vector<char> root(max(lemmas.max_length(), roots.max_length())); 1 0 1
vector<char> root(max(lemmas.max_length(), roots.max_length())); 0 0 0
vector<char> root(max(lemmas.max_length(), roots.max_length())); 0 0 0
4324 0 unsigned data_position = data.tell();
4325 0 ▶ for (int pass = 1; pass <= 2; pass++) {
Branch: 3 branches
BranchTrueFalseTotal
for (int pass = 1; pass <= 2; pass++) { 2 1 3
for (int pass = 1; pass <= 2; pass++) { 0 0 0
for (int pass = 1; pass <= 2; pass++) { 0 0 0
4326 0 ▶ if (pass > 1) data.seek(data_position);
Branch: 6 branches
BranchTrueFalseTotal
if (pass > 1) data.seek(data_position); 1 1 2
if (pass > 1) data.seek(data_position); 1 0 1
if (pass > 1) data.seek(data_position); 0 0 0
if (pass > 1) data.seek(data_position); 0 0 0
if (pass > 1) data.seek(data_position); 0 0 0
if (pass > 1) data.seek(data_position); 0 0 0
4327  
4328 0 int lemma_len = 0;
4329 0 int root_len = 0;
4330  
4331 0 ▶ for (int i = data.next_4B(); i > 0; i--) {
Branch: 6 branches
BranchTrueFalseTotal
for (int i = data.next_4B(); i > 0; i--) { 2 0 2
for (int i = data.next_4B(); i > 0; i--) { 4 2 6
for (int i = data.next_4B(); i > 0; i--) { 0 0 0
for (int i = data.next_4B(); i > 0; i--) { 0 0 0
for (int i = data.next_4B(); i > 0; i--) { 0 0 0
for (int i = data.next_4B(); i > 0; i--) { 0 0 0
4332 0 ▶ lemma_len -= data.next_1B();
Branch: 3 branches
BranchTrueFalseTotal
lemma_len -= data.next_1B(); 4 0 4
lemma_len -= data.next_1B(); 0 0 0
lemma_len -= data.next_1B(); 0 0 0
4333 0 ▶ for (int i = data.next_1B(); i > 0; i--)
Branch: 6 branches
BranchTrueFalseTotal
for (int i = data.next_1B(); i > 0; i--) 4 0 4
for (int i = data.next_1B(); i > 0; i--) 24 4 28
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
for (int i = data.next_1B(); i > 0; i--) 0 0 0
4334 0 ▶ lemma[lemma_len++] = data.next_1B();
Branch: 3 branches
BranchTrueFalseTotal
lemma[lemma_len++] = data.next_1B(); 24 0 24
lemma[lemma_len++] = data.next_1B(); 0 0 0
lemma[lemma_len++] = data.next_1B(); 0 0 0
4335 0 ▶ unsigned char lemma_info_len = data.next_1B();
Branch: 3 branches
BranchTrueFalseTotal
unsigned char lemma_info_len = data.next_1B(); 4 0 4
unsigned char lemma_info_len = data.next_1B(); 0 0 0
unsigned char lemma_info_len = data.next_1B(); 0 0 0
4336 0 ▶ const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr;
Branch: 6 branches
BranchTrueFalseTotal
const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr; 0 4 4
const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr; 0 0 0
const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr; 0 0 0
const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr; 0 0 0
const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr; 0 0 0
const char* lemma_info = lemma_info_len ? data.next<char>(lemma_info_len) : nullptr; 0 0 0
4337 0 ▶ unsigned lemma_roots = data.next_1B();
Branch: 3 branches
BranchTrueFalseTotal
unsigned lemma_roots = data.next_1B(); 4 0 4
unsigned lemma_roots = data.next_1B(); 0 0 0
unsigned lemma_roots = data.next_1B(); 0 0 0
4338  
4339 0 unsigned char* lemma_data /* to keep compiler happy */ = nullptr;
4340 0 unsigned lemma_offset /* to keep compiler happy */ = 0;
4341  
4342 0 ▶ if (pass == 1) {
Branch: 3 branches
BranchTrueFalseTotal
if (pass == 1) { 2 2 4
if (pass == 1) { 0 0 0
if (pass == 1) { 0 0 0
4343 0 ▶ lemmas.add(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t)));
Branch: 3 branches
BranchTrueFalseTotal
lemmas.add(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t))); 2 0 2
lemmas.add(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t))); 0 0 0
lemmas.add(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t))); 0 0 0
4344 } else /*if (pass == 2)*/ {
4345 0 ▶ lemma_data = lemmas.fill(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t)));
Branch: 3 branches
BranchTrueFalseTotal
lemma_data = lemmas.fill(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t))); 2 0 2
lemma_data = lemmas.fill(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t))); 0 0 0
lemma_data = lemmas.fill(lemma.data(), lemma_len, 1 + lemma_info_len + 1 + lemma_roots * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t))); 0 0 0
4346 0 lemma_offset = lemma_data - lemma_len - lemmas.data_start(lemma_len);
4347  
4348 0 *lemma_data++ = lemma_info_len;
4349 0 ▶ if (lemma_info_len) small_memcpy(lemma_data, lemma_info, lemma_info_len), lemma_data += lemma_info_len;
Branch: 3 branches
BranchTrueFalseTotal
if (lemma_info_len) small_memcpy(lemma_data, lemma_info, lemma_info_len), lemma_data += lemma_info_len; 0 2 2
if (lemma_info_len) small_memcpy(lemma_data, lemma_info, lemma_info_len), lemma_data += lemma_info_len; 0 0 0
if (lemma_info_len) small_memcpy(lemma_data, lemma_info, lemma_info_len), lemma_data += lemma_info_len; 0 0 0
4350 0 *lemma_data++ = lemma_roots;
4351 }
4352  
4353 0 small_memcpy(root.data(), lemma.data(), lemma_len); root_len = lemma_len;
4354 0 ▶ for (unsigned i = 0; i < lemma_roots; i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < lemma_roots; i++) { 14 4 18
for (unsigned i = 0; i < lemma_roots; i++) { 0 0 0
for (unsigned i = 0; i < lemma_roots; i++) { 0 0 0
4355 enum { REMOVE_START = 1, REMOVE_END = 2, ADD_START = 4, ADD_END = 8 };
4356 0 ▶ int operations = data.next_1B();
Branch: 3 branches
BranchTrueFalseTotal
int operations = data.next_1B(); 14 0 14
int operations = data.next_1B(); 0 0 0
int operations = data.next_1B(); 0 0 0
4357 0 ▶ if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; }
Branch: 9 branches
BranchTrueFalseTotal
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 14 14
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
if (operations & REMOVE_START) { int from = data.next_1B(), to = 0; while (from < root_len) root[to++] = root[from++]; root_len = to; } 0 0 0
4358 0 ▶ if (operations & REMOVE_END) root_len -= data.next_1B();
Branch: 6 branches
BranchTrueFalseTotal
if (operations & REMOVE_END) root_len -= data.next_1B(); 12 2 14
if (operations & REMOVE_END) root_len -= data.next_1B(); 12 0 12
if (operations & REMOVE_END) root_len -= data.next_1B(); 0 0 0
if (operations & REMOVE_END) root_len -= data.next_1B(); 0 0 0
if (operations & REMOVE_END) root_len -= data.next_1B(); 0 0 0
if (operations & REMOVE_END) root_len -= data.next_1B(); 0 0 0
4359 0 ▶ if (operations & ADD_START) {
Branch: 3 branches
BranchTrueFalseTotal
if (operations & ADD_START) { 0 14 14
if (operations & ADD_START) { 0 0 0
if (operations & ADD_START) { 0 0 0
4360 0 ▶ int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to;
Branch: 6 branches
BranchTrueFalseTotal
int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to; 0 0 0
int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to; 0 0 0
int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to; 0 0 0
int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to; 0 0 0
int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to; 0 0 0
int from = root_len, to = from + data.next_1B(); while (from > 0) root[--to] = root[--from]; root_len += to; 0 0 0
4361 0 ▶ for (int i = 0; i < to; i++) root[i] = data.next_1B();
Branch: 6 branches
BranchTrueFalseTotal
for (int i = 0; i < to; i++) root[i] = data.next_1B(); 0 0 0
for (int i = 0; i < to; i++) root[i] = data.next_1B(); 0 0 0
for (int i = 0; i < to; i++) root[i] = data.next_1B(); 0 0 0
for (int i = 0; i < to; i++) root[i] = data.next_1B(); 0 0 0
for (int i = 0; i < to; i++) root[i] = data.next_1B(); 0 0 0
for (int i = 0; i < to; i++) root[i] = data.next_1B(); 0 0 0
4362 }
4363 0 ▶ if (operations & ADD_END)
Branch: 3 branches
BranchTrueFalseTotal
if (operations & ADD_END) 14 0 14
if (operations & ADD_END) 0 0 0
if (operations & ADD_END) 0 0 0
4364 0 ▶ for (int len = data.next_1B(); len > 0; len--)
Branch: 6 branches
BranchTrueFalseTotal
for (int len = data.next_1B(); len > 0; len--) 14 0 14
for (int len = data.next_1B(); len > 0; len--) 28 14 42
for (int len = data.next_1B(); len > 0; len--) 0 0 0
for (int len = data.next_1B(); len > 0; len--) 0 0 0
for (int len = data.next_1B(); len > 0; len--) 0 0 0
for (int len = data.next_1B(); len > 0; len--) 0 0 0
4365 0 ▶ root[root_len++] = data.next_1B();
Branch: 3 branches
BranchTrueFalseTotal
root[root_len++] = data.next_1B(); 28 0 28
root[root_len++] = data.next_1B(); 0 0 0
root[root_len++] = data.next_1B(); 0 0 0
4366 0 ▶ uint16_t clas = data.next_2B();
Branch: 3 branches
BranchTrueFalseTotal
uint16_t clas = data.next_2B(); 14 0 14
uint16_t clas = data.next_2B(); 0 0 0
uint16_t clas = data.next_2B(); 0 0 0
4367  
4368 0 ▶ if (pass == 1) { // for each root
Branch: 3 branches
BranchTrueFalseTotal
if (pass == 1) { // for each root 7 7 14
if (pass == 1) { // for each root 0 0 0
if (pass == 1) { // for each root 0 0 0
4369 0 ▶ roots.add(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t));
Branch: 3 branches
BranchTrueFalseTotal
roots.add(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t)); 7 0 7
roots.add(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t)); 0 0 0
roots.add(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t)); 0 0 0
4370 } else /*if (pass == 2)*/ {
4371 0 ▶ unsigned char* root_data = roots.fill(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t));
Branch: 3 branches
BranchTrueFalseTotal
unsigned char* root_data = roots.fill(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t)); 7 0 7
unsigned char* root_data = roots.fill(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t)); 0 0 0
unsigned char* root_data = roots.fill(root.data(), root_len, sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t)); 0 0 0
4372 0 unsigned root_offset = root_data - root_len - roots.data_start(root_len);
4373  
4374 0 unaligned_store_inc<uint16_t>(root_data, clas);
4375 0 unaligned_store_inc<uint32_t>(root_data, lemma_offset);
4376 0 unaligned_store_inc<uint8_t>(root_data, lemma_len);
4377 0 ▶ assert(uint8_t(lemma_len) == lemma_len);
Branch: 3 branches
BranchTrueFalseTotal
assert(uint8_t(lemma_len) == lemma_len); 0 7 7
assert(uint8_t(lemma_len) == lemma_len); 0 0 0
assert(uint8_t(lemma_len) == lemma_len); 0 0 0
4378  
4379 0 unaligned_store_inc<uint32_t>(lemma_data, root_offset);
4380 0 unaligned_store_inc<uint8_t>(lemma_data, root_len);
4381 0 unaligned_store_inc<uint16_t>(lemma_data, clas);
4382 0 ▶ assert(uint8_t(root_len) == root_len);
Branch: 3 branches
BranchTrueFalseTotal
assert(uint8_t(root_len) == root_len); 0 7 7
assert(uint8_t(root_len) == root_len); 0 0 0
assert(uint8_t(root_len) == root_len); 0 0 0
4383 }
4384 }
4385 }
4386  
4387 0 ▶ if (pass == 1) { // after the whole pass
Branch: 3 branches
BranchTrueFalseTotal
if (pass == 1) { // after the whole pass 1 1 2
if (pass == 1) { // after the whole pass 0 0 0
if (pass == 1) { // after the whole pass 0 0 0
4388 0 ▶ lemmas.done_adding();
Branch: 3 branches
BranchTrueFalseTotal
lemmas.done_adding(); 1 0 1
lemmas.done_adding(); 0 0 0
lemmas.done_adding(); 0 0 0
4389 0 ▶ roots.done_adding();
Branch: 3 branches
BranchTrueFalseTotal
roots.done_adding(); 1 0 1
roots.done_adding(); 0 0 0
roots.done_adding(); 0 0 0
4390 } else /*if (pass == 2)*/ {
4391 0 lemmas.done_filling();
4392 0 roots.done_filling();
4393 }
4394 }
4395  
4396 // Load tags
4397 0 ▶ tags.resize(data.next_2B());
Branch: 6 branches
BranchTrueFalseTotal
tags.resize(data.next_2B()); 1 0 1
tags.resize(data.next_2B()); 1 0 1
tags.resize(data.next_2B()); 0 0 0
tags.resize(data.next_2B()); 0 0 0
tags.resize(data.next_2B()); 0 0 0
tags.resize(data.next_2B()); 0 0 0
4398 0 ▶ for (auto&& tag : tags) {
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& tag : tags) { 20 1 21
for (auto&& tag : tags) { 0 0 0
for (auto&& tag : tags) { 0 0 0
4399 0 ▶ tag.resize(data.next_1B());
Branch: 6 branches
BranchTrueFalseTotal
tag.resize(data.next_1B()); 20 0 20
tag.resize(data.next_1B()); 20 0 20
tag.resize(data.next_1B()); 0 0 0
tag.resize(data.next_1B()); 0 0 0
tag.resize(data.next_1B()); 0 0 0
tag.resize(data.next_1B()); 0 0 0
4400 0 ▶ for (unsigned i = 0; i < tag.size(); i++)
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < tag.size(); i++) 60 20 80
for (unsigned i = 0; i < tag.size(); i++) 0 0 0
for (unsigned i = 0; i < tag.size(); i++) 0 0 0
4401 0 ▶ tag[i] = data.next_1B();
Branch: 6 branches
BranchTrueFalseTotal
tag[i] = data.next_1B(); 60 0 60
tag[i] = data.next_1B(); 60 0 60
tag[i] = data.next_1B(); 0 0 0
tag[i] = data.next_1B(); 0 0 0
tag[i] = data.next_1B(); 0 0 0
tag[i] = data.next_1B(); 0 0 0
4402 }
4403  
4404 // Load suffixes
4405 0 ▶ suffixes.load(data);
Branch: 3 branches
BranchTrueFalseTotal
suffixes.load(data); 1 0 1
suffixes.load(data); 0 0 0
suffixes.load(data); 0 0 0
4406  
4407 // Fill classes from suffixes
4408 0 ▶ suffixes.iter_all([this](const char* suffix, int len, pointer_decoder& data) mutable {
Branch: 3 branches
BranchTrueFalseTotal
suffixes.iter_all([this](const char* suffix, int len, pointer_decoder& data) mutable { 1 0 1
suffixes.iter_all([this](const char* suffix, int len, pointer_decoder& data) mutable { 0 0 0
suffixes.iter_all([this](const char* suffix, int len, pointer_decoder& data) mutable { 0 0 0
4409 13 unsigned classes_len = data.next_2B();
4410 13 const uint16_t* classes_ptr = data.next<uint16_t>(classes_len);
4411 13 const uint16_t* indices_ptr = data.next<uint16_t>(classes_len);
4412 13 const uint16_t* tags_ptr = data.next<uint16_t>(data.next_2B());
4413  
4414 13 ▶ string suffix_str(suffix, len);
Branch: 3 branches
BranchTrueFalseTotal
string suffix_str(suffix, len); 13 0 13
string suffix_str(suffix, len); 0 0 0
string suffix_str(suffix, len); 0 0 0
4415 28 ▶ for (unsigned i = 0; i < classes_len; i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < classes_len; i++) { 15 13 28
for (unsigned i = 0; i < classes_len; i++) { 0 0 0
for (unsigned i = 0; i < classes_len; i++) { 0 0 0
4416 15 auto classes_ptr_i = unaligned_load<uint16_t>(classes_ptr + i);
4417 15 ▶ if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1);
Branch: 6 branches
BranchTrueFalseTotal
if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1); 5 10 15
if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1); 5 0 5
if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1); 0 0 0
if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1); 0 0 0
if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1); 0 0 0
if (classes_ptr_i >= classes.size()) classes.resize(classes_ptr_i + 1); 0 0 0
4418 15 ▶ classes[classes_ptr_i].emplace_back(suffix_str, vector<uint16_t>());
Branch: 3 branches
BranchTrueFalseTotal
classes[classes_ptr_i].emplace_back(suffix_str, vector<uint16_t>()); 15 0 15
classes[classes_ptr_i].emplace_back(suffix_str, vector<uint16_t>()); 0 0 0
classes[classes_ptr_i].emplace_back(suffix_str, vector<uint16_t>()); 0 0 0
4419 15 for (const uint16_t* ptr = tags_ptr + unaligned_load<uint16_t>(indices_ptr + i),
4420 15 * end = tags_ptr + unaligned_load<uint16_t>(indices_ptr + i + 1);
4421 35 ▶ ptr < end; ptr++)
Branch: 3 branches
BranchTrueFalseTotal
ptr < end; ptr++) 20 15 35
ptr < end; ptr++) 0 0 0
ptr < end; ptr++) 0 0 0
4422 20 ▶ classes[classes_ptr_i].back().second.emplace_back(unaligned_load<uint16_t>(ptr));
Branch: 3 branches
BranchTrueFalseTotal
classes[classes_ptr_i].back().second.emplace_back(unaligned_load<uint16_t>(ptr)); 20 0 20
classes[classes_ptr_i].back().second.emplace_back(unaligned_load<uint16_t>(ptr)); 0 0 0
classes[classes_ptr_i].back().second.emplace_back(unaligned_load<uint16_t>(ptr)); 0 0 0
4423 }
4424 13 });
4425 0 }
4426  
4427 template <class LemmaAddinfo>
4428 0 void morpho_dictionary<LemmaAddinfo>::analyze(string_piece form, vector<tagged_lemma>& lemmas) const {
4429 0 int max_suffix_len = suffixes.max_length();
4430  
4431 0 uint16_t* suff_stack[16]; vector<uint16_t*> suff_heap;
4432 0 ▶ uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data());
Branch: 6 branches
BranchTrueFalseTotal
uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data()); 18 0 18
uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data()); 0 0 0
uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data()); 0 0 0
uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data()); 0 0 0
uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data()); 0 0 0
uint16_t** suff = max_suffix_len <= 16 ? suff_stack : (suff_heap.resize(max_suffix_len), suff_heap.data()); 0 0 0
4433 0 int suff_len = 0;
4434 0 ▶ for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) {
Branch: 6 branches
BranchTrueFalseTotal
for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) { 48 0 48
for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) { 48 0 48
for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) { 0 0 0
for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) { 0 0 0
for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) { 0 0 0
for (int i = form.len; i >= 0 && suff_len < max_suffix_len; i--, suff_len++) { 0 0 0
4435 0 ▶ suff[suff_len] = (uint16_t*) suffixes.at(form.str + i, suff_len, [](pointer_decoder& data) {
Branch: 3 branches
BranchTrueFalseTotal
suff[suff_len] = (uint16_t*) suffixes.at(form.str + i, suff_len, [](pointer_decoder& data) { 48 0 48
suff[suff_len] = (uint16_t*) suffixes.at(form.str + i, suff_len, [](pointer_decoder& data) { 0 0 0
suff[suff_len] = (uint16_t*) suffixes.at(form.str + i, suff_len, [](pointer_decoder& data) { 0 0 0
4436 0 data.next<uint16_t>(2 * data.next_2B());
4437 0 data.next<uint16_t>(data.next_2B());
4438 });
4439 0 ▶ if (!suff[suff_len]) break;
Branch: 3 branches
BranchTrueFalseTotal
if (!suff[suff_len]) break; 18 30 48
if (!suff[suff_len]) break; 0 0 0
if (!suff[suff_len]) break; 0 0 0
4440 }
4441  
4442 0 ▶ for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++)
Branch: 9 branches
BranchTrueFalseTotal
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 30 18 48
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 30 0 30
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 30 18 48
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 0 0 0
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 0 0 0
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 0 0 0
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 0 0 0
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 0 0 0
for (int root_len = int(form.len) - --suff_len; suff_len >= 0 && root_len < int(roots.max_length()); suff_len--, root_len++) 0 0 0
4443 0 ▶ if (unaligned_load<uint16_t>(suff[suff_len])) {
Branch: 3 branches
BranchTrueFalseTotal
if (unaligned_load<uint16_t>(suff[suff_len])) { 30 0 30
if (unaligned_load<uint16_t>(suff[suff_len])) { 0 0 0
if (unaligned_load<uint16_t>(suff[suff_len])) { 0 0 0
4444 0 unsigned suff_classes = unaligned_load<uint16_t>(suff[suff_len]);
4445 0 uint16_t* suff_data = suff[suff_len] + 1;
4446  
4447 0 ▶ roots.iter(form.str, root_len, [&](const char* root, pointer_decoder& root_data) {
Branch: 3 branches
BranchTrueFalseTotal
roots.iter(form.str, root_len, [&](const char* root, pointer_decoder& root_data) { 30 0 30
roots.iter(form.str, root_len, [&](const char* root, pointer_decoder& root_data) { 0 0 0
roots.iter(form.str, root_len, [&](const char* root, pointer_decoder& root_data) { 0 0 0
4448 30 uint16_t root_class = root_data.next_2B();
4449 30 unsigned lemma_offset = root_data.next_4B();
4450 30 unsigned lemma_len = root_data.next_1B();
4451  
4452 30 ▶ if (small_memeq(form.str, root, root_len)) {
Branch: 3 branches
BranchTrueFalseTotal
if (small_memeq(form.str, root, root_len)) { 10 20 30
if (small_memeq(form.str, root, root_len)) { 0 0 0
if (small_memeq(form.str, root, root_len)) { 0 0 0
4453 10 uint16_t* suffix_class_ptr = unaligned_lower_bound(suff_data, suff_classes, root_class);
4454 10 ▶ if (suffix_class_ptr < suff_data + suff_classes && unaligned_load<uint16_t>(suffix_class_ptr) == root_class) {
Branch: 5 branches
BranchTrueFalseTotal
if (suffix_class_ptr < suff_data + suff_classes && unaligned_load<uint16_t>(suffix_class_ptr) == root_class) { 10 0 10
if (suffix_class_ptr < suff_data + suff_classes && unaligned_load<uint16_t>(suffix_class_ptr) == root_class) { 10 0 10
if (suffix_class_ptr < suff_data + suff_classes && unaligned_load<uint16_t>(suffix_class_ptr) == root_class) { 0 0 0
if (suffix_class_ptr < suff_data + suff_classes && unaligned_load<uint16_t>(suffix_class_ptr) == root_class) { 0 0 0
if (suffix_class_ptr < suff_data + suff_classes && unaligned_load<uint16_t>(suffix_class_ptr) == root_class) { 0 0 0
4455 10 const unsigned char* lemma_data = this->lemmas.data_start(lemma_len) + lemma_offset;
4456 10 ▶ string lemma((const char*)lemma_data, lemma_len);
Branch: 3 branches
BranchTrueFalseTotal
string lemma((const char*)lemma_data, lemma_len); 10 0 10
string lemma((const char*)lemma_data, lemma_len); 0 0 0
string lemma((const char*)lemma_data, lemma_len); 0 0 0
4457 10 ▶ if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]);
Branch: 8 branches
BranchTrueFalseTotal
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 10 10
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
if (lemma_data[lemma_len]) lemma += LemmaAddinfo::format(lemma_data + lemma_len + 1, lemma_data[lemma_len]); 0 0 0
4458  
4459 10 uint16_t* suff_tag_indices = suff_data + suff_classes;
4460 10 uint16_t* suff_tags = suff_tag_indices + suff_classes + 1;
4461 28 for (unsigned i = unaligned_load<uint16_t>(suff_tag_indices + (suffix_class_ptr - suff_data));
4462 28 ▶ i < unaligned_load<uint16_t>(suff_tag_indices + (suffix_class_ptr - suff_data) + 1); i++)
Branch: 3 branches
BranchTrueFalseTotal
i < unaligned_load<uint16_t>(suff_tag_indices + (suffix_class_ptr - suff_data) + 1); i++) 18 10 28
i < unaligned_load<uint16_t>(suff_tag_indices + (suffix_class_ptr - suff_data) + 1); i++) 0 0 0
i < unaligned_load<uint16_t>(suff_tag_indices + (suffix_class_ptr - suff_data) + 1); i++) 0 0 0
4463 18 ▶ lemmas.emplace_back(lemma, tags[unaligned_load<uint16_t>(suff_tags + i)]);
Branch: 3 branches
BranchTrueFalseTotal
lemmas.emplace_back(lemma, tags[unaligned_load<uint16_t>(suff_tags + i)]); 18 0 18
lemmas.emplace_back(lemma, tags[unaligned_load<uint16_t>(suff_tags + i)]); 0 0 0
lemmas.emplace_back(lemma, tags[unaligned_load<uint16_t>(suff_tags + i)]); 0 0 0
4464 10 }
4465 }
4466 });
4467 }
4468 0 }
4469  
4470 template <class LemmaAddinfo>
4471 0 bool morpho_dictionary<LemmaAddinfo>::generate(string_piece lemma, const tag_filter& filter, vector<tagged_lemma_forms>& lemmas_forms) const {
4472 0 LemmaAddinfo addinfo;
4473 0 ▶ int raw_lemma_len = addinfo.parse(lemma);
Branch: 2 branches
BranchTrueFalseTotal
int raw_lemma_len = addinfo.parse(lemma); 0 0 0
int raw_lemma_len = addinfo.parse(lemma); 0 0 0
4474 0 bool matched_lemma = false;
4475  
4476 0 ▶ lemmas.iter(lemma.str, raw_lemma_len, [&](const char* lemma_str, pointer_decoder& data) {
Branch: 3 branches
BranchTrueFalseTotal
lemmas.iter(lemma.str, raw_lemma_len, [&](const char* lemma_str, pointer_decoder& data) { 0 0 0
lemmas.iter(lemma.str, raw_lemma_len, [&](const char* lemma_str, pointer_decoder& data) { 0 0 0
lemmas.iter(lemma.str, raw_lemma_len, [&](const char* lemma_str, pointer_decoder& data) { 0 0 0
4477 0 unsigned lemma_info_len = data.next_1B();
4478 0 const auto* lemma_info = data.next<unsigned char>(lemma_info_len);
4479 0 unsigned lemma_roots_len = data.next_1B();
4480 0 auto* lemma_roots_ptr = data.next<unsigned char>(lemma_roots_len * (sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t)));
4481  
4482 0 ▶ if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) {
Branch: 12 branches
BranchTrueFalseTotal
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
if (small_memeq(lemma.str, lemma_str, raw_lemma_len) && addinfo.match_lemma_id(lemma_info, lemma_info_len) && LemmaAddinfo::generatable(lemma_info, lemma_info_len)) { 0 0 0
4483 0 matched_lemma = true;
4484  
4485 0 vector<tagged_form>* forms = nullptr;
4486 0 pointer_decoder lemma_roots(lemma_roots_ptr);
4487 0 ▶ for (unsigned i = 0; i < lemma_roots_len; i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < lemma_roots_len; i++) { 0 0 0
for (unsigned i = 0; i < lemma_roots_len; i++) { 0 0 0
for (unsigned i = 0; i < lemma_roots_len; i++) { 0 0 0
4488 0 unsigned root_offset = lemma_roots.next_4B();
4489 0 unsigned root_len = lemma_roots.next_1B();
4490 0 unsigned clas = lemma_roots.next_2B();
4491  
4492 0 const unsigned char* root_data = roots.data_start(root_len) + root_offset;
4493 0 ▶ for (auto&& suffix : classes[clas]) {
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& suffix : classes[clas]) { 0 0 0
for (auto&& suffix : classes[clas]) { 0 0 0
for (auto&& suffix : classes[clas]) { 0 0 0
4494 0 string root_with_suffix;
4495 0 ▶ for (auto&& tag : suffix.second)
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& tag : suffix.second) 0 0 0
for (auto&& tag : suffix.second) 0 0 0
for (auto&& tag : suffix.second) 0 0 0
4496 0 ▶ if (filter.matches(tags[tag].c_str())) {
Branch: 3 branches
BranchTrueFalseTotal
if (filter.matches(tags[tag].c_str())) { 0 0 0
if (filter.matches(tags[tag].c_str())) { 0 0 0
if (filter.matches(tags[tag].c_str())) { 0 0 0
4497 0 ▶ if (!forms) {
Branch: 3 branches
BranchTrueFalseTotal
if (!forms) { 0 0 0
if (!forms) { 0 0 0
if (!forms) { 0 0 0
4498 0 ▶ lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len));
Branch: 11 branches
BranchTrueFalseTotal
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
lemmas_forms.emplace_back(string(lemma.str, raw_lemma_len) + LemmaAddinfo::format(lemma_info, lemma_info_len)); 0 0 0
4499 0 forms = &lemmas_forms.back().forms;
4500 }
4501  
4502 0 ▶ if (root_with_suffix.empty() && root_len + suffix.first.size()) {
Branch: 9 branches
BranchTrueFalseTotal
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
if (root_with_suffix.empty() && root_len + suffix.first.size()) { 0 0 0
4503 0 ▶ root_with_suffix.reserve(root_len + suffix.first.size());
Branch: 3 branches
BranchTrueFalseTotal
root_with_suffix.reserve(root_len + suffix.first.size()); 0 0 0
root_with_suffix.reserve(root_len + suffix.first.size()); 0 0 0
root_with_suffix.reserve(root_len + suffix.first.size()); 0 0 0
4504 0 ▶ root_with_suffix.assign((const char*)root_data, root_len);
Branch: 3 branches
BranchTrueFalseTotal
root_with_suffix.assign((const char*)root_data, root_len); 0 0 0
root_with_suffix.assign((const char*)root_data, root_len); 0 0 0
root_with_suffix.assign((const char*)root_data, root_len); 0 0 0
4505 0 ▶ root_with_suffix.append(suffix.first);
Branch: 3 branches
BranchTrueFalseTotal
root_with_suffix.append(suffix.first); 0 0 0
root_with_suffix.append(suffix.first); 0 0 0
root_with_suffix.append(suffix.first); 0 0 0
4506 }
4507  
4508 0 ▶ forms->emplace_back(root_with_suffix, tags[tag]);
Branch: 3 branches
BranchTrueFalseTotal
forms->emplace_back(root_with_suffix, tags[tag]); 0 0 0
forms->emplace_back(root_with_suffix, tags[tag]); 0 0 0
forms->emplace_back(root_with_suffix, tags[tag]); 0 0 0
4509 }
4510 }
4511 }
4512 }
4513 });
4514  
4515 0 return matched_lemma;
4516 0 }
4517  
4518 } // namespace morphodita
4519  
4520 /////////
4521 // File: morphodita/morpho/morpho_prefix_guesser.h
4522 /////////
4523  
4524 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4525 //
4526 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4527 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4528 //
4529 // This Source Code Form is subject to the terms of the Mozilla Public
4530 // License, v. 2.0. If a copy of the MPL was not distributed with this
4531 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4532  
4533 namespace morphodita {
4534  
4535 // Declarations
4536 template <class MorphoDictionary>
4537 class morpho_prefix_guesser {
4538 public:
4539 0 morpho_prefix_guesser(const MorphoDictionary& dictionary) : dictionary(dictionary) {}
4540  
4541 void load(binary_decoder& data);
4542 void analyze(string_piece form, vector<tagged_lemma>& lemmas);
4543 bool generate(string_piece lemma, const tag_filter& filter, vector<tagged_lemma_forms>& lemmas_forms);
4544  
4545 private:
4546 const MorphoDictionary& dictionary;
4547 vector<tag_filter> tag_filters;
4548 persistent_unordered_map prefixes_initial, prefixes_middle;
4549 };
4550  
4551 // Definitions
4552 template <class MorphoDictionary>
4553 0 void morpho_prefix_guesser<MorphoDictionary>::load(binary_decoder& data) {
4554 // Load and construct tag filters
4555 0 ▶ for (unsigned tag_filters_len = data.next_1B(); tag_filters_len; tag_filters_len--) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned tag_filters_len = data.next_1B(); tag_filters_len; tag_filters_len--) { 0 0 0
4556 0 ▶ unsigned tag_filter_len = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned tag_filter_len = data.next_1B(); 0 0 0
4557 0 ▶ string tag_filter(data.next<char>(tag_filter_len), tag_filter_len);
Branch: 2 branches
BranchTrueFalseTotal
string tag_filter(data.next<char>(tag_filter_len), tag_filter_len); 0 0 0
string tag_filter(data.next<char>(tag_filter_len), tag_filter_len); 0 0 0
4558  
4559 0 ▶ tag_filters.emplace_back(tag_filter.c_str());
Branch: 1 branch
BranchTrueFalseTotal
tag_filters.emplace_back(tag_filter.c_str()); 0 0 0
4560 }
4561  
4562 // Load prefixes
4563 0 prefixes_initial.load(data);
4564 0 prefixes_middle.load(data);
4565 0 }
4566  
4567 // Analyze can return non-unique lemma-tag pairs.
4568 template <class MorphoDictionary>
4569 0 void morpho_prefix_guesser<MorphoDictionary>::analyze(string_piece form, vector<tagged_lemma>& lemmas) {
4570 0 ▶ if (!form.len) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!form.len) return; 0 0 0
4571  
4572 0 vector<char> form_tmp;
4573 0 vector<unsigned> middle_masks;
4574 0 ▶ middle_masks.reserve(form.len);
Branch: 1 branch
BranchTrueFalseTotal
middle_masks.reserve(form.len); 0 0 0
4575  
4576 0 ▶ for (unsigned initial = 0; initial < form.len; initial++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned initial = 0; initial < form.len; initial++) { 0 0 0
4577 // Match the initial prefix.
4578 0 unsigned initial_mask = (1<<tag_filters.size()) - 1; // full mask for empty initial prefix
4579 0 ▶ if (initial) {
Branch: 1 branch
BranchTrueFalseTotal
if (initial) { 0 0 0
4580 0 ▶ auto found = prefixes_initial.at_typed<uint32_t>(form.str, initial);
Branch: 1 branch
BranchTrueFalseTotal
auto found = prefixes_initial.at_typed<uint32_t>(form.str, initial); 0 0 0
4581 0 ▶ if (!found) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!found) break; 0 0 0
4582 0 initial_mask = unaligned_load<uint32_t>(found);
4583 }
4584  
4585 // If we have found an initial prefix (including the empty one), match middle prefixes.
4586 0 ▶ if (initial_mask) {
Branch: 1 branch
BranchTrueFalseTotal
if (initial_mask) { 0 0 0
4587 0 ▶ middle_masks.resize(initial);
Branch: 1 branch
BranchTrueFalseTotal
middle_masks.resize(initial); 0 0 0
4588 0 ▶ middle_masks.emplace_back(initial_mask);
Branch: 1 branch
BranchTrueFalseTotal
middle_masks.emplace_back(initial_mask); 0 0 0
4589 0 ▶ for (unsigned middle = initial; middle < middle_masks.size(); middle++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned middle = initial; middle < middle_masks.size(); middle++) { 0 0 0
4590 0 ▶ if (!middle_masks[middle]) continue;
Branch: 1 branch
BranchTrueFalseTotal
if (!middle_masks[middle]) continue; 0 0 0
4591 // Try matching middle prefixes from current index.
4592 0 ▶ for (unsigned i = middle + 1; i < form.len; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = middle + 1; i < form.len; i++) { 0 0 0
4593 0 ▶ auto found = prefixes_middle.at_typed<uint32_t>(form.str + middle, i - middle);
Branch: 1 branch
BranchTrueFalseTotal
auto found = prefixes_middle.at_typed<uint32_t>(form.str + middle, i - middle); 0 0 0
4594 0 ▶ if (!found) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!found) break; 0 0 0
4595 0 ▶ if (unaligned_load<uint32_t>(found)) {
Branch: 1 branch
BranchTrueFalseTotal
if (unaligned_load<uint32_t>(found)) { 0 0 0
4596 0 ▶ if (i + 1 > middle_masks.size()) middle_masks.resize(i + 1);
Branch: 2 branches
BranchTrueFalseTotal
if (i + 1 > middle_masks.size()) middle_masks.resize(i + 1); 0 0 0
if (i + 1 > middle_masks.size()) middle_masks.resize(i + 1); 0 0 0
4597 0 middle_masks[i] |= middle_masks[middle] & unaligned_load<uint32_t>(found);
4598 }
4599 }
4600  
4601 // Try matching word forms if at least one middle prefix was found.
4602 0 ▶ if (middle > initial && middle < form.len ) {
Branch: 2 branches
BranchTrueFalseTotal
if (middle > initial && middle < form.len ) { 0 0 0
if (middle > initial && middle < form.len ) { 0 0 0
4603 0 ▶ if (initial) {
Branch: 1 branch
BranchTrueFalseTotal
if (initial) { 0 0 0
4604 0 ▶ if (form_tmp.empty()) form_tmp.assign(form.str, form.str + form.len);
Branch: 2 branches
BranchTrueFalseTotal
if (form_tmp.empty()) form_tmp.assign(form.str, form.str + form.len); 0 0 0
if (form_tmp.empty()) form_tmp.assign(form.str, form.str + form.len); 0 0 0
4605 0 small_memcpy(form_tmp.data() + middle - initial, form.str, initial);
4606 }
4607 0 unsigned lemmas_ori_size = lemmas.size();
4608 0 ▶ dictionary.analyze(string_piece((initial ? form_tmp.data() : form.str) + middle - initial, form.len - middle + initial), lemmas);
Branch: 2 branches
BranchTrueFalseTotal
dictionary.analyze(string_piece((initial ? form_tmp.data() : form.str) + middle - initial, form.len - middle + initial), lemmas); 0 0 0
dictionary.analyze(string_piece((initial ? form_tmp.data() : form.str) + middle - initial, form.len - middle + initial), lemmas); 0 0 0
4609 0 unsigned lemmas_new_size = lemmas_ori_size;
4610 0 ▶ for (unsigned i = lemmas_ori_size; i < lemmas.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = lemmas_ori_size; i < lemmas.size(); i++) { 0 0 0
4611 0 ▶ for (unsigned filter = 0; filter < tag_filters.size(); filter++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned filter = 0; filter < tag_filters.size(); filter++) 0 0 0
4612 0 ▶ if ((middle_masks[middle] & (1<<filter)) && tag_filters[filter].matches(lemmas[i].tag.c_str())) {
Branch: 3 branches
BranchTrueFalseTotal
if ((middle_masks[middle] & (1<<filter)) && tag_filters[filter].matches(lemmas[i].tag.c_str())) { 0 0 0
if ((middle_masks[middle] & (1<<filter)) && tag_filters[filter].matches(lemmas[i].tag.c_str())) { 0 0 0
if ((middle_masks[middle] & (1<<filter)) && tag_filters[filter].matches(lemmas[i].tag.c_str())) { 0 0 0
4613 0 ▶ if (i == lemmas_new_size) {
Branch: 1 branch
BranchTrueFalseTotal
if (i == lemmas_new_size) { 0 0 0
4614 0 ▶ lemmas[lemmas_new_size].lemma.insert(0, form.str + initial, middle - initial);
Branch: 1 branch
BranchTrueFalseTotal
lemmas[lemmas_new_size].lemma.insert(0, form.str + initial, middle - initial); 0 0 0
4615 } else {
4616 0 ▶ lemmas[lemmas_new_size].lemma.reserve(lemmas[i].lemma.size() + middle - initial);
Branch: 1 branch
BranchTrueFalseTotal
lemmas[lemmas_new_size].lemma.reserve(lemmas[i].lemma.size() + middle - initial); 0 0 0
4617 0 ▶ lemmas[lemmas_new_size].lemma.assign(form.str + initial, middle - initial);
Branch: 1 branch
BranchTrueFalseTotal
lemmas[lemmas_new_size].lemma.assign(form.str + initial, middle - initial); 0 0 0
4618 0 ▶ lemmas[lemmas_new_size].lemma.append(lemmas[i].lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemmas[lemmas_new_size].lemma.append(lemmas[i].lemma); 0 0 0
4619 0 ▶ lemmas[lemmas_new_size].tag = lemmas[i].tag;
Branch: 1 branch
BranchTrueFalseTotal
lemmas[lemmas_new_size].tag = lemmas[i].tag; 0 0 0
4620 }
4621 0 lemmas_new_size++;
4622 0 break;
4623 }
4624 }
4625 0 ▶ if (lemmas_new_size < lemmas.size()) lemmas.erase(lemmas.begin() + lemmas_new_size, lemmas.end());
Branch: 2 branches
BranchTrueFalseTotal
if (lemmas_new_size < lemmas.size()) lemmas.erase(lemmas.begin() + lemmas_new_size, lemmas.end()); 0 0 0
if (lemmas_new_size < lemmas.size()) lemmas.erase(lemmas.begin() + lemmas_new_size, lemmas.end()); 0 0 0
4626 }
4627 }
4628 }
4629 }
4630 0 }
4631  
4632 template <class MorphoDictionary>
4633 0 bool morpho_prefix_guesser<MorphoDictionary>::generate(string_piece /*lemma*/, const tag_filter& /*filter*/, vector<tagged_lemma_forms>& /*lemmas_forms*/) {
4634 // Not implemented yet. Is it actually needed?
4635 0 return false;
4636 }
4637 } // namespace morphodita
4638  
4639 /////////
4640 // File: morphodita/morpho/morpho_statistical_guesser.h
4641 /////////
4642  
4643 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4644 //
4645 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4646 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4647 //
4648 // This Source Code Form is subject to the terms of the Mozilla Public
4649 // License, v. 2.0. If a copy of the MPL was not distributed with this
4650 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4651  
4652 namespace morphodita {
4653  
4654 class morpho_statistical_guesser {
4655 public:
4656 void load(binary_decoder& data);
4657 typedef vector<string> used_rules;
4658 void analyze(string_piece form, vector<tagged_lemma>& lemmas, used_rules* used);
4659  
4660 private:
4661 vector<string> tags;
4662 unsigned default_tag;
4663 persistent_unordered_map rules;
4664 };
4665  
4666 } // namespace morphodita
4667  
4668 /////////
4669 // File: morphodita/tokenizer/unicode_tokenizer.h
4670 /////////
4671  
4672 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4673 //
4674 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4675 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4676 //
4677 // This Source Code Form is subject to the terms of the Mozilla Public
4678 // License, v. 2.0. If a copy of the MPL was not distributed with this
4679 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4680  
4681 namespace morphodita {
4682  
4683 class unicode_tokenizer : public tokenizer {
4684 public:
4685 enum { URL_EMAIL_LATEST = 2 };
4686 unicode_tokenizer(unsigned url_email_tokenizer);
4687  
4688 virtual void set_text(string_piece text, bool make_copy = false) override;
4689 virtual bool next_sentence(vector<string_piece>* forms, vector<token_range>* tokens) override;
4690  
4691 virtual bool next_sentence(vector<token_range>& tokens) = 0;
4692  
4693 protected:
4694 struct char_info {
4695 char32_t chr;
4696 unilib::unicode::category_t cat;
4697 const char* str;
4698  
4699 152 char_info(char32_t chr, const char* str) : chr(chr), cat(unilib::unicode::category(chr)), str(str) {}
4700 };
4701 vector<char_info> chars;
4702 size_t current;
4703  
4704 bool tokenize_url_email(vector<token_range>& tokens);
4705 bool emergency_sentence_split(const vector<token_range>& tokens);
4706 bool is_eos(const vector<token_range>& tokens, char32_t eos_chr, const unordered_set<string>* abbreviations);
4707  
4708 private:
4709 unsigned url_email_tokenizer;
4710 string text_buffer;
4711 vector<token_range> tokens_buffer;
4712 string eos_buffer;
4713 };
4714  
4715 } // namespace morphodita
4716  
4717 /////////
4718 // File: morphodita/tokenizer/ragel_tokenizer.h
4719 /////////
4720  
4721 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4722 //
4723 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4724 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4725 //
4726 // This Source Code Form is subject to the terms of the Mozilla Public
4727 // License, v. 2.0. If a copy of the MPL was not distributed with this
4728 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4729  
4730 namespace morphodita {
4731  
4732 class ragel_tokenizer : public unicode_tokenizer {
4733 public:
4734 ragel_tokenizer(unsigned url_email_tokenizer);
4735  
4736 protected:
4737 static inline uint8_t ragel_char(const char_info& chr);
4738  
4739 private:
4740 static void initialize_ragel_map();
4741 static vector<uint8_t> ragel_map;
4742 static atomic_flag ragel_map_flag;
4743 static void ragel_map_add(char32_t chr, uint8_t mapping);
4744  
4745 friend class unicode_tokenizer;
4746 static bool ragel_url_email(unsigned version, const vector<char_info>& chars, size_t& current_char, vector<token_range>& tokens);
4747 };
4748  
4749 59 uint8_t ragel_tokenizer::ragel_char(const char_info& chr) {
4750 59 ▶ return chr.chr < ragel_map.size() && ragel_map[chr.chr] != 128 ? ragel_map[chr.chr] : 128 + (uint32_t(chr.cat) * uint32_t(0x077CB531U) >> 27);
Branch: 2 branches
BranchTrueFalseTotal
return chr.chr < ragel_map.size() && ragel_map[chr.chr] != 128 ? ragel_map[chr.chr] : 128 + (uint32_t(chr.cat) * uint32_t(0x077CB531U) >> 27); 59 0 59
return chr.chr < ragel_map.size() && ragel_map[chr.chr] != 128 ? ragel_map[chr.chr] : 128 + (uint32_t(chr.cat) * uint32_t(0x077CB531U) >> 27); 49 10 59
4751 }
4752  
4753 } // namespace morphodita
4754  
4755 /////////
4756 // File: morphodita/tokenizer/czech_tokenizer.h
4757 /////////
4758  
4759 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4760 //
4761 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4762 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4763 //
4764 // This Source Code Form is subject to the terms of the Mozilla Public
4765 // License, v. 2.0. If a copy of the MPL was not distributed with this
4766 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4767  
4768 namespace morphodita {
4769  
4770 class czech_tokenizer : public ragel_tokenizer {
4771 public:
4772 enum tokenizer_language { CZECH = 0, SLOVAK = 1 };
4773 enum { LATEST = 2 };
4774 czech_tokenizer(tokenizer_language language, unsigned version, const morpho* m = nullptr);
4775  
4776 virtual bool next_sentence(vector<token_range>& tokens) override;
4777  
4778 private:
4779 const morpho* m;
4780 const unordered_set<string>* abbreviations;
4781 vector<tagged_lemma> lemmas;
4782  
4783 void merge_hyphenated(vector<token_range>& tokens);
4784  
4785 static const unordered_set<string> abbreviations_czech;
4786 static const unordered_set<string> abbreviations_slovak;
4787 };
4788  
4789 } // namespace morphodita
4790  
4791 /////////
4792 // File: morphodita/morpho/czech_morpho.h
4793 /////////
4794  
4795 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4796 //
4797 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4798 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4799 //
4800 // This Source Code Form is subject to the terms of the Mozilla Public
4801 // License, v. 2.0. If a copy of the MPL was not distributed with this
4802 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4803  
4804 namespace morphodita {
4805  
4806 class czech_morpho : public morpho {
4807 public:
4808 using morpho_language = czech_tokenizer::tokenizer_language;
4809  
4810 0 ▶ czech_morpho(morpho_language language, unsigned version) : language(language), version(version) {}
Branch: 3 branches
BranchTrueFalseTotal
czech_morpho(morpho_language language, unsigned version) : language(language), version(version) {} 0 0 0
czech_morpho(morpho_language language, unsigned version) : language(language), version(version) {} 0 0 0
czech_morpho(morpho_language language, unsigned version) : language(language), version(version) {} 0 0 0
4811  
4812 virtual int analyze(string_piece form, morpho::guesser_mode guesser, vector<tagged_lemma>& lemmas) const override;
4813 virtual int generate(string_piece lemma, const char* tag_wildcard, guesser_mode guesser, vector<tagged_lemma_forms>& forms) const override;
4814 virtual int raw_lemma_len(string_piece lemma) const override;
4815 virtual int lemma_id_len(string_piece lemma) const override;
4816 virtual int raw_form_len(string_piece form) const override;
4817 virtual tokenizer* new_tokenizer() const override;
4818  
4819 bool load(istream& is);
4820 private:
4821 inline void analyze_special(string_piece form, vector<tagged_lemma>& lemmas) const;
4822  
4823 morpho_language language;
4824 unsigned version;
4825 morpho_dictionary<czech_lemma_addinfo> dictionary;
4826 unique_ptr<morpho_prefix_guesser<decltype(dictionary)>> prefix_guesser;
4827 unique_ptr<morpho_statistical_guesser> statistical_guesser;
4828  
4829 string unknown_tag = "X@-------------";
4830 string number_tag = "C=-------------";
4831 string punctuation_tag = "Z:-------------";
4832 };
4833  
4834 } // namespace morphodita
4835  
4836 /////////
4837 // File: morphodita/morpho/czech_morpho.cpp
4838 /////////
4839  
4840 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
4841 //
4842 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
4843 // Mathematics and Physics, Charles University in Prague, Czech Republic.
4844 //
4845 // This Source Code Form is subject to the terms of the Mozilla Public
4846 // License, v. 2.0. If a copy of the MPL was not distributed with this
4847 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4848  
4849 namespace morphodita {
4850  
4851 0 bool czech_morpho::load(istream& is) {
4852 0 binary_decoder data;
4853 0 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 0 0 0
4854  
4855 try {
4856 // Load tag length
4857 0 ▶ unsigned tag_length = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned tag_length = data.next_1B(); 0 0 0
4858 0 ▶ if (tag_length < unknown_tag.size()) unknown_tag.erase(tag_length);
Branch: 2 branches
BranchTrueFalseTotal
if (tag_length < unknown_tag.size()) unknown_tag.erase(tag_length); 0 0 0
if (tag_length < unknown_tag.size()) unknown_tag.erase(tag_length); 0 0 0
4859 0 ▶ if (tag_length < number_tag.size()) number_tag.erase(tag_length);
Branch: 2 branches
BranchTrueFalseTotal
if (tag_length < number_tag.size()) number_tag.erase(tag_length); 0 0 0
if (tag_length < number_tag.size()) number_tag.erase(tag_length); 0 0 0
4860 0 ▶ if (tag_length < punctuation_tag.size()) punctuation_tag.erase(tag_length);
Branch: 2 branches
BranchTrueFalseTotal
if (tag_length < punctuation_tag.size()) punctuation_tag.erase(tag_length); 0 0 0
if (tag_length < punctuation_tag.size()) punctuation_tag.erase(tag_length); 0 0 0
4861  
4862 // Load dictionary
4863 0 ▶ dictionary.load(data);
Branch: 1 branch
BranchTrueFalseTotal
dictionary.load(data); 0 0 0
4864  
4865 // Optionally prefix guesser if present
4866 0 prefix_guesser.reset();
4867 0 ▶ if (data.next_1B()) {
Branch: 2 branches
BranchTrueFalseTotal
if (data.next_1B()) { 0 0 0
if (data.next_1B()) { 0 0 0
4868 0 ▶ prefix_guesser.reset(new morpho_prefix_guesser<decltype(dictionary)>(dictionary));
Branch: 1 branch
BranchTrueFalseTotal
prefix_guesser.reset(new morpho_prefix_guesser<decltype(dictionary)>(dictionary)); 0 0 0
4869 0 ▶ prefix_guesser->load(data);
Branch: 1 branch
BranchTrueFalseTotal
prefix_guesser->load(data); 0 0 0
4870 }
4871  
4872 // Optionally statistical guesser if present
4873 0 statistical_guesser.reset();
4874 0 ▶ if (data.next_1B()) {
Branch: 2 branches
BranchTrueFalseTotal
if (data.next_1B()) { 0 0 0
if (data.next_1B()) { 0 0 0
4875 0 ▶ statistical_guesser.reset(new morpho_statistical_guesser());
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser.reset(new morpho_statistical_guesser()); 0 0 0
4876 0 ▶ statistical_guesser->load(data);
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser->load(data); 0 0 0
4877 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
4878 } catch (binary_decoder_error&) {
4879 return false;
4880 }
4881  
4882 0 return data.is_end();
4883 0 }
4884  
4885 0 int czech_morpho::analyze(string_piece form, guesser_mode guesser, vector<tagged_lemma>& lemmas) const {
4886 0 lemmas.clear();
4887  
4888 0 ▶ if (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (form.len) { 0 0 0
4889 // Generate all casing variants if needed (they are different than given form).
4890 0 string form_uclc; // first uppercase, rest lowercase
4891 0 string form_lc; // all lowercase
4892 0 ▶ generate_casing_variants(form, form_uclc, form_lc);
Branch: 1 branch
BranchTrueFalseTotal
generate_casing_variants(form, form_uclc, form_lc); 0 0 0
4893  
4894 // Start by analysing using the dictionary and all casing variants.
4895 0 ▶ dictionary.analyze(form, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
dictionary.analyze(form, lemmas); 0 0 0
4896 0 ▶ if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas); 0 0 0
if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas); 0 0 0
4897 0 ▶ if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas); 0 0 0
if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas); 0 0 0
4898 0 ▶ if (!lemmas.empty()) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return NO_GUESSER; 0 0 0
4899  
4900 // Then call analyze_special to handle numbers and punctuation.
4901 0 ▶ analyze_special(form, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
analyze_special(form, lemmas); 0 0 0
4902 0 ▶ if (!lemmas.empty()) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return NO_GUESSER; 0 0 0
4903  
4904 // For the prefix guesser, use only form_lc.
4905 0 ▶ if (guesser == GUESSER && prefix_guesser)
Branch: 3 branches
BranchTrueFalseTotal
if (guesser == GUESSER && prefix_guesser) 0 0 0
if (guesser == GUESSER && prefix_guesser) 0 0 0
if (guesser == GUESSER && prefix_guesser) 0 0 0
4906 0 ▶ prefix_guesser->analyze(form_lc.empty() ? form : form_lc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
prefix_guesser->analyze(form_lc.empty() ? form : form_lc, lemmas); 0 0 0
prefix_guesser->analyze(form_lc.empty() ? form : form_lc, lemmas); 0 0 0
4907 0 bool prefix_guesser_guesses = !lemmas.empty();
4908  
4909 // For the statistical guesser, use all casing variants.
4910 0 ▶ if (guesser == GUESSER && statistical_guesser) {
Branch: 3 branches
BranchTrueFalseTotal
if (guesser == GUESSER && statistical_guesser) { 0 0 0
if (guesser == GUESSER && statistical_guesser) { 0 0 0
if (guesser == GUESSER && statistical_guesser) { 0 0 0
4911 0 ▶ if (form_uclc.empty() && form_lc.empty())
Branch: 3 branches
BranchTrueFalseTotal
if (form_uclc.empty() && form_lc.empty()) 0 0 0
if (form_uclc.empty() && form_lc.empty()) 0 0 0
if (form_uclc.empty() && form_lc.empty()) 0 0 0
4912 0 ▶ statistical_guesser->analyze(form, lemmas, nullptr);
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser->analyze(form, lemmas, nullptr); 0 0 0
4913 else {
4914 0 ▶ morpho_statistical_guesser::used_rules used_rules; used_rules.reserve(3);
Branch: 1 branch
BranchTrueFalseTotal
morpho_statistical_guesser::used_rules used_rules; used_rules.reserve(3); 0 0 0
4915 0 ▶ statistical_guesser->analyze(form, lemmas, &used_rules);
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser->analyze(form, lemmas, &used_rules); 0 0 0
4916 0 ▶ if (!form_uclc.empty()) statistical_guesser->analyze(form_uclc, lemmas, &used_rules);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_uclc.empty()) statistical_guesser->analyze(form_uclc, lemmas, &used_rules); 0 0 0
if (!form_uclc.empty()) statistical_guesser->analyze(form_uclc, lemmas, &used_rules); 0 0 0
4917 0 ▶ if (!form_lc.empty()) statistical_guesser->analyze(form_lc, lemmas, &used_rules);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_lc.empty()) statistical_guesser->analyze(form_lc, lemmas, &used_rules); 0 0 0
if (!form_lc.empty()) statistical_guesser->analyze(form_lc, lemmas, &used_rules); 0 0 0
4918 0 }
4919 }
4920  
4921 // Make sure results are unique lemma-tag pairs. Statistical guesser produces
4922 // unique lemma-tag pairs, but prefix guesser does not.
4923 0 ▶ if (prefix_guesser_guesses) {
Branch: 1 branch
BranchTrueFalseTotal
if (prefix_guesser_guesses) { 0 0 0
4924 0 ▶ sort(lemmas.begin(), lemmas.end(), [](const tagged_lemma& a, const tagged_lemma& b) {
Branch: 1 branch
BranchTrueFalseTotal
sort(lemmas.begin(), lemmas.end(), [](const tagged_lemma& a, const tagged_lemma& b) { 0 0 0
4925 0 int lemma_compare = a.lemma.compare(b.lemma);
4926 0 ▶ return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag);
Branch: 3 branches
BranchTrueFalseTotal
return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); 0 0 0
return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); 0 0 0
return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); 0 0 0
4927 });
4928 0 ▶ auto lemmas_end = unique(lemmas.begin(), lemmas.end(), [](const tagged_lemma& a, const tagged_lemma& b) {
Branch: 1 branch
BranchTrueFalseTotal
auto lemmas_end = unique(lemmas.begin(), lemmas.end(), [](const tagged_lemma& a, const tagged_lemma& b) { 0 0 0
4929 0 ▶ return a.lemma == b.lemma && a.tag == b.tag;
Branch: 2 branches
BranchTrueFalseTotal
return a.lemma == b.lemma && a.tag == b.tag; 0 0 0
return a.lemma == b.lemma && a.tag == b.tag; 0 0 0
4930 });
4931 0 ▶ if (lemmas_end != lemmas.end()) lemmas.erase(lemmas_end, lemmas.end());
Branch: 2 branches
BranchTrueFalseTotal
if (lemmas_end != lemmas.end()) lemmas.erase(lemmas_end, lemmas.end()); 0 0 0
if (lemmas_end != lemmas.end()) lemmas.erase(lemmas_end, lemmas.end()); 0 0 0
4932 }
4933  
4934 0 ▶ if (!lemmas.empty()) return GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return GUESSER; 0 0 0
4935 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
4936  
4937 0 ▶ lemmas.emplace_back(string(form.str, form.len), unknown_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
4938 0 return -1;
4939 }
4940  
4941 0 int czech_morpho::generate(string_piece lemma, const char* tag_wildcard, morpho::guesser_mode guesser, vector<tagged_lemma_forms>& forms) const {
4942 0 forms.clear();
4943  
4944 0 ▶ tag_filter filter(tag_wildcard);
Branch: 1 branch
BranchTrueFalseTotal
tag_filter filter(tag_wildcard); 0 0 0
4945  
4946 0 ▶ if (lemma.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma.len) { 0 0 0
4947 0 ▶ if (dictionary.generate(lemma, filter, forms))
Branch: 2 branches
BranchTrueFalseTotal
if (dictionary.generate(lemma, filter, forms)) 0 0 0
if (dictionary.generate(lemma, filter, forms)) 0 0 0
4948 0 return NO_GUESSER;
4949  
4950 0 ▶ if (guesser == GUESSER && prefix_guesser)
Branch: 3 branches
BranchTrueFalseTotal
if (guesser == GUESSER && prefix_guesser) 0 0 0
if (guesser == GUESSER && prefix_guesser) 0 0 0
if (guesser == GUESSER && prefix_guesser) 0 0 0
4951 0 ▶ if (prefix_guesser->generate(lemma, filter, forms))
Branch: 1 branch
BranchTrueFalseTotal
if (prefix_guesser->generate(lemma, filter, forms)) 0 0 0
4952 0 return GUESSER;
4953 }
4954  
4955 0 return -1;
4956 0 }
4957  
4958 0 int czech_morpho::raw_lemma_len(string_piece lemma) const {
4959 0 return czech_lemma_addinfo::raw_lemma_len(lemma);
4960 }
4961  
4962 0 int czech_morpho::lemma_id_len(string_piece lemma) const {
4963 0 return czech_lemma_addinfo::lemma_id_len(lemma);
4964 }
4965  
4966 0 int czech_morpho::raw_form_len(string_piece form) const {
4967 0 return form.len;
4968 }
4969  
4970 0 tokenizer* czech_morpho::new_tokenizer() const {
4971 0 ▶ return new czech_tokenizer(language, version, this);
Branch: 2 branches
BranchTrueFalseTotal
return new czech_tokenizer(language, version, this); 0 0 0
return new czech_tokenizer(language, version, this); 0 0 0
4972 }
4973  
4974 // What characters are considered punctuation except for the ones in unicode Punctuation category.
4975 static bool punctuation_additional[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1/*$*/,
4976 0,0,0,0,0,0,1/*+*/,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1/*<*/,1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,0,0,0,0,0,
4985 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4986 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4987 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1/*caron*/};
4988  
4989 // What characters of unicode Punctuation category are not considered punctuation.
4990 static bool punctuation_exceptions[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4991 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4992 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4993 0,0,0,0,0,0,0,0,0,1/*paragraph*/};
4994  
4995 0 void czech_morpho::analyze_special(string_piece form, vector<tagged_lemma>& lemmas) const {
4996 using namespace unilib;
4997  
4998 // Analyzer for numbers and punctuation.
4999 // Number is anything matching [+-]? is_Pn* ([.,] is_Pn*)? ([Ee] [+-]? is_Pn+)? for at least one is_Pn* nonempty.
5000 // Punctuation is any form beginning with either unicode punctuation or punctuation_exceptions character.
5001 // Beware that numbers takes precedence, so - is punctuation, -3 is number, -. is punctuation, -.3 is number.
5002 0 ▶ if (!form.len) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!form.len) return; 0 0 0
5003  
5004 0 string_piece form_ori = form;
5005 0 char32_t first = utf8::decode(form.str, form.len);
5006  
5007 // Try matching a number.
5008 0 char32_t codepoint = first;
5009 0 bool any_digit = false;
5010 0 ▶ if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(form.str, form.len);
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(form.str, form.len); 0 0 0
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(form.str, form.len); 0 0 0
5011 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(form.str, form.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(form.str, form.len); 0 0 0
5012 0 ▶ if ((codepoint == '.' && form.len) || codepoint == ',') codepoint = utf8::decode(form.str, form.len);
Branch: 3 branches
BranchTrueFalseTotal
if ((codepoint == '.' && form.len) || codepoint == ',') codepoint = utf8::decode(form.str, form.len); 0 0 0
if ((codepoint == '.' && form.len) || codepoint == ',') codepoint = utf8::decode(form.str, form.len); 0 0 0
if ((codepoint == '.' && form.len) || codepoint == ',') codepoint = utf8::decode(form.str, form.len); 0 0 0
5013 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(form.str, form.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(form.str, form.len); 0 0 0
5014 0 ▶ if (any_digit && (codepoint == 'e' || codepoint == 'E')) {
Branch: 3 branches
BranchTrueFalseTotal
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
5015 0 codepoint = utf8::decode(form.str, form.len);
5016 0 ▶ if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(form.str, form.len);
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(form.str, form.len); 0 0 0
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(form.str, form.len); 0 0 0
5017 0 any_digit = false;
5018 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(form.str, form.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(form.str, form.len); 0 0 0
5019 }
5020  
5021 0 ▶ if (any_digit && !form.len && (!codepoint || codepoint == '.')) {
Branch: 4 branches
BranchTrueFalseTotal
if (any_digit && !form.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !form.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !form.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !form.len && (!codepoint || codepoint == '.')) { 0 0 0
5022 0 ▶ lemmas.emplace_back(string(form_ori.str, form_ori.len), number_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form_ori.str, form_ori.len), number_tag); 0 0 0
lemmas.emplace_back(string(form_ori.str, form_ori.len), number_tag); 0 0 0
5023 0 ▶ } else if ((first < sizeof(punctuation_additional) && punctuation_additional[first]) ||
Branch: 3 branches
BranchTrueFalseTotal
} else if ((first < sizeof(punctuation_additional) && punctuation_additional[first]) || 0 0 0
} else if ((first < sizeof(punctuation_additional) && punctuation_additional[first]) || 0 0 0
} else if ((first < sizeof(punctuation_additional) && punctuation_additional[first]) || 0 0 0
5024 0 ▶ ((unicode::category(first) & unicode::P) && (first >= sizeof(punctuation_exceptions) || !punctuation_exceptions[first])))
Branch: 3 branches
BranchTrueFalseTotal
((unicode::category(first) & unicode::P) && (first >= sizeof(punctuation_exceptions) || !punctuation_exceptions[first]))) 0 0 0
((unicode::category(first) & unicode::P) && (first >= sizeof(punctuation_exceptions) || !punctuation_exceptions[first]))) 0 0 0
((unicode::category(first) & unicode::P) && (first >= sizeof(punctuation_exceptions) || !punctuation_exceptions[first]))) 0 0 0
5025 0 ▶ lemmas.emplace_back(string(form_ori.str, form_ori.len), punctuation_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form_ori.str, form_ori.len), punctuation_tag); 0 0 0
lemmas.emplace_back(string(form_ori.str, form_ori.len), punctuation_tag); 0 0 0
5026 }
5027  
5028 } // namespace morphodita
5029  
5030 /////////
5031 // File: morphodita/morpho/english_lemma_addinfo.h
5032 /////////
5033  
5034 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
5035 //
5036 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
5037 // Mathematics and Physics, Charles University in Prague, Czech Republic.
5038 //
5039 // This Source Code Form is subject to the terms of the Mozilla Public
5040 // License, v. 2.0. If a copy of the MPL was not distributed with this
5041 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5042  
5043 namespace morphodita {
5044  
5045 // Declarations
5046 struct english_lemma_addinfo {
5047 inline static int raw_lemma_len(string_piece lemma);
5048 inline static int lemma_id_len(string_piece lemma);
5049 inline static string format(const unsigned char* addinfo, int addinfo_len);
5050 inline static bool generatable(const unsigned char* addinfo, int addinfo_len);
5051  
5052 inline int parse(string_piece lemma, bool die_on_failure = false);
5053 inline bool match_lemma_id(const unsigned char* other_addinfo, int other_addinfo_len);
5054  
5055 vector<unsigned char> data;
5056 };
5057  
5058 // Definitions
5059 0 int english_lemma_addinfo::raw_lemma_len(string_piece lemma) {
5060 // Lemma ends either by
5061 // - '^' on non-first position followed by nothing or [A-Za-z][-A-Za-z]*
5062 // - '+' on non-first position followed by nothing
5063 0 ▶ for (unsigned len = 1; len < lemma.len; len++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned len = 1; len < lemma.len; len++) { 0 0 0
5064 0 ▶ if (len + 1 == lemma.len && (lemma.str[len] == '^' || lemma.str[len] == '+'))
Branch: 3 branches
BranchTrueFalseTotal
if (len + 1 == lemma.len && (lemma.str[len] == '^' || lemma.str[len] == '+')) 0 0 0
if (len + 1 == lemma.len && (lemma.str[len] == '^' || lemma.str[len] == '+')) 0 0 0
if (len + 1 == lemma.len && (lemma.str[len] == '^' || lemma.str[len] == '+')) 0 0 0
5065 0 return len;
5066 0 ▶ if (len + 1 < lemma.len && lemma.str[len] == '^') {
Branch: 2 branches
BranchTrueFalseTotal
if (len + 1 < lemma.len && lemma.str[len] == '^') { 0 0 0
if (len + 1 < lemma.len && lemma.str[len] == '^') { 0 0 0
5067 0 bool ok = true;
5068 0 ▶ for (unsigned i = len + 1; ok && i < lemma.len; i++)
Branch: 2 branches
BranchTrueFalseTotal
for (unsigned i = len + 1; ok && i < lemma.len; i++) 0 0 0
for (unsigned i = len + 1; ok && i < lemma.len; i++) 0 0 0
5069 0 ▶ ok &= (lemma.str[i] >= 'A' && lemma.str[i] <= 'Z') ||
Branch: 1 branch
BranchTrueFalseTotal
ok &= (lemma.str[i] >= 'A' && lemma.str[i] <= 'Z') || 0 0 0
5070 0 ▶ (lemma.str[i] >= 'a' && lemma.str[i] <= 'z') ||
Branch: 3 branches
BranchTrueFalseTotal
(lemma.str[i] >= 'a' && lemma.str[i] <= 'z') || 0 0 0
(lemma.str[i] >= 'a' && lemma.str[i] <= 'z') || 0 0 0
(lemma.str[i] >= 'a' && lemma.str[i] <= 'z') || 0 0 0
5071 0 ▶ (i > len + 1 && lemma.str[i] == '-');
Branch: 2 branches
BranchTrueFalseTotal
(i > len + 1 && lemma.str[i] == '-'); 0 0 0
(i > len + 1 && lemma.str[i] == '-'); 0 0 0
5072 0 ▶ if (ok) return len;
Branch: 1 branch
BranchTrueFalseTotal
if (ok) return len; 0 0 0
5073 }
5074 }
5075 0 return lemma.len;
5076 }
5077  
5078 0 int english_lemma_addinfo::lemma_id_len(string_piece lemma) {
5079 // No lemma comments.
5080 0 return lemma.len;
5081 }
5082  
5083 0 string english_lemma_addinfo::format(const unsigned char* addinfo, int addinfo_len) {
5084 0 ▶ return string((const char*) addinfo, addinfo_len);
Branch: 1 branch
BranchTrueFalseTotal
return string((const char*) addinfo, addinfo_len); 0 0 0
5085 }
5086  
5087 0 bool english_lemma_addinfo::generatable(const unsigned char* /*addinfo*/, int /*addinfo_len*/) {
5088 0 return true;
5089 }
5090  
5091 0 int english_lemma_addinfo::parse(string_piece lemma, bool /*die_on_failure*/) {
5092 0 data.clear();
5093  
5094 0 size_t len = raw_lemma_len(lemma);
5095 0 ▶ for (size_t i = len; i < lemma.len; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (size_t i = len; i < lemma.len; i++) 0 0 0
5096 0 ▶ data.push_back(lemma.str[i]);
Branch: 1 branch
BranchTrueFalseTotal
data.push_back(lemma.str[i]); 0 0 0
5097  
5098 0 return len;
5099 }
5100  
5101 0 bool english_lemma_addinfo::match_lemma_id(const unsigned char* other_addinfo, int other_addinfo_len) {
5102 0 ▶ if (data.empty()) return true;
Branch: 1 branch
BranchTrueFalseTotal
if (data.empty()) return true; 0 0 0
5103 0 ▶ if (data.size() == 1 && data[0] == '^') return other_addinfo_len > 0 && other_addinfo[0] == '^';
Branch: 5 branches
BranchTrueFalseTotal
if (data.size() == 1 && data[0] == '^') return other_addinfo_len > 0 && other_addinfo[0] == '^'; 0 0 0
if (data.size() == 1 && data[0] == '^') return other_addinfo_len > 0 && other_addinfo[0] == '^'; 0 0 0
if (data.size() == 1 && data[0] == '^') return other_addinfo_len > 0 && other_addinfo[0] == '^'; 0 0 0
if (data.size() == 1 && data[0] == '^') return other_addinfo_len > 0 && other_addinfo[0] == '^'; 0 0 0
if (data.size() == 1 && data[0] == '^') return other_addinfo_len > 0 && other_addinfo[0] == '^'; 0 0 0
5104 0 ▶ if (data.size() == 1 && data[0] == '+') return other_addinfo_len == 0;
Branch: 3 branches
BranchTrueFalseTotal
if (data.size() == 1 && data[0] == '+') return other_addinfo_len == 0; 0 0 0
if (data.size() == 1 && data[0] == '+') return other_addinfo_len == 0; 0 0 0
if (data.size() == 1 && data[0] == '+') return other_addinfo_len == 0; 0 0 0
5105 0 ▶ return data.size() == size_t(other_addinfo_len) && small_memeq(data.data(), other_addinfo, other_addinfo_len);
Branch: 2 branches
BranchTrueFalseTotal
return data.size() == size_t(other_addinfo_len) && small_memeq(data.data(), other_addinfo, other_addinfo_len); 0 0 0
return data.size() == size_t(other_addinfo_len) && small_memeq(data.data(), other_addinfo, other_addinfo_len); 0 0 0
5106 }
5107  
5108 } // namespace morphodita
5109  
5110 /////////
5111 // File: morphodita/morpho/english_morpho_guesser.h
5112 /////////
5113  
5114 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
5115 //
5116 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
5117 // Mathematics and Physics, Charles University in Prague, Czech Republic.
5118 //
5119 // This Source Code Form is subject to the terms of the Mozilla Public
5120 // License, v. 2.0. If a copy of the MPL was not distributed with this
5121 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5122  
5123 namespace morphodita {
5124  
5125 class english_morpho_guesser {
5126 public:
5127 void load(binary_decoder& data);
5128 void analyze(string_piece form, string_piece form_lc, vector<tagged_lemma>& lemmas) const;
5129 bool analyze_proper_names(string_piece form, string_piece form_lc, vector<tagged_lemma>& lemmas) const;
5130  
5131 private:
5132 inline void add(const string& tag, const string& form, vector<tagged_lemma>& lemmas) const;
5133 inline void add(const string& tag, const string& tag2, const string& form, vector<tagged_lemma>& lemmas) const;
5134 inline void add(const string& tag, const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const;
5135 inline void add(const string& tag, const string& tag2, const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const;
5136 void add_NNS(const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const;
5137 void add_NNPS(const string& form, vector<tagged_lemma>& lemmas) const;
5138 void add_VBG(const string& form, vector<tagged_lemma>& lemmas) const;
5139 void add_VBD_VBN(const string& form, vector<tagged_lemma>& lemmas) const;
5140 void add_VBZ(const string& form, vector<tagged_lemma>& lemmas) const;
5141 void add_JJR_RBR(const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const;
5142 void add_JJS_RBS(const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const;
5143  
5144 enum { NEGATION_LEN = 0, TO_FOLLOW = 1, TOTAL = 2 };
5145 vector<string> exceptions_tags;
5146 persistent_unordered_map exceptions;
5147 persistent_unordered_map negations;
5148 string CD = "CD", FW = "FW", JJ = "JJ", JJR = "JJR", JJS = "JJS",
5149 NN = "NN", NNP = "NNP", NNPS = "NNPS", NNS = "NNS", RB = "RB",
5150 RBR = "RBR", RBS = "RBS", SYM = "SYM", VB = "VB", VBD = "VBD",
5151 VBG = "VBG", VBN = "VBN", VBP = "VBP", VBZ = "VBZ";
5152 };
5153  
5154 } // namespace morphodita
5155  
5156 /////////
5157 // File: morphodita/morpho/english_morpho.h
5158 /////////
5159  
5160 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
5161 //
5162 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
5163 // Mathematics and Physics, Charles University in Prague, Czech Republic.
5164 //
5165 // This Source Code Form is subject to the terms of the Mozilla Public
5166 // License, v. 2.0. If a copy of the MPL was not distributed with this
5167 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5168  
5169 namespace morphodita {
5170  
5171 class english_morpho : public morpho {
5172 public:
5173 0 ▶ english_morpho(unsigned version) : version(version) {}
Branch: 21 branches
BranchTrueFalseTotal
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
english_morpho(unsigned version) : version(version) {} 0 0 0
5174  
5175 virtual int analyze(string_piece form, morpho::guesser_mode guesser, vector<tagged_lemma>& lemmas) const override;
5176 virtual int generate(string_piece lemma, const char* tag_wildcard, guesser_mode guesser, vector<tagged_lemma_forms>& forms) const override;
5177 virtual int raw_lemma_len(string_piece lemma) const override;
5178 virtual int lemma_id_len(string_piece lemma) const override;
5179 virtual int raw_form_len(string_piece form) const override;
5180 virtual tokenizer* new_tokenizer() const override;
5181  
5182 bool load(istream& is);
5183 private:
5184 inline void analyze_special(string_piece form, vector<tagged_lemma>& lemmas) const;
5185  
5186 unsigned version;
5187 morpho_dictionary<english_lemma_addinfo> dictionary;
5188 english_morpho_guesser morpho_guesser;
5189  
5190 string unknown_tag = "UNK";
5191 string number_tag = "CD", nnp_tag = "NNP", ls_tag = "LS";
5192 string open_quotation_tag = "``", close_quotation_tag = "''";
5193 string open_parenthesis_tag = "(", close_parenthesis_tag = ")";
5194 string comma_tag = ",", dot_tag = ".", punctuation_tag = ":", hash_tag = "#", dollar_tag = "$";
5195 string sym_tag = "SYM", jj_tag = "JJ", nn_tag = "NN", nns_tag = "NNS", cc_tag = "CC", pos_tag = "POS", in_tag = "IN";
5196 };
5197  
5198 } // namespace morphodita
5199  
5200 /////////
5201 // File: morphodita/tokenizer/english_tokenizer.h
5202 /////////
5203  
5204 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
5205 //
5206 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
5207 // Mathematics and Physics, Charles University in Prague, Czech Republic.
5208 //
5209 // This Source Code Form is subject to the terms of the Mozilla Public
5210 // License, v. 2.0. If a copy of the MPL was not distributed with this
5211 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5212  
5213 namespace morphodita {
5214  
5215 class english_tokenizer : public ragel_tokenizer {
5216 public:
5217 enum { LATEST = 2 };
5218 english_tokenizer(unsigned version);
5219  
5220 virtual bool next_sentence(vector<token_range>& tokens) override;
5221  
5222 private:
5223 void split_token(vector<token_range>& tokens);
5224  
5225 static const unordered_set<string> abbreviations;
5226 };
5227  
5228 } // namespace morphodita
5229  
5230 /////////
5231 // File: morphodita/morpho/english_morpho.cpp
5232 /////////
5233  
5234 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
5235 //
5236 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
5237 // Mathematics and Physics, Charles University in Prague, Czech Republic.
5238 //
5239 // This Source Code Form is subject to the terms of the Mozilla Public
5240 // License, v. 2.0. If a copy of the MPL was not distributed with this
5241 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5242  
5243 namespace morphodita {
5244  
5245 0 bool english_morpho::load(istream& is) {
5246 0 binary_decoder data;
5247 0 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 0 0 0
5248  
5249 try {
5250 0 ▶ dictionary.load(data);
Branch: 1 branch
BranchTrueFalseTotal
dictionary.load(data); 0 0 0
5251 0 ▶ morpho_guesser.load(data);
Branch: 2 branches
BranchTrueFalseTotal
morpho_guesser.load(data); 0 0 0
morpho_guesser.load(data); 0 0 0
5252 } catch (binary_decoder_error&) {
5253 return false;
5254 }
5255  
5256 0 return data.is_end();
5257 0 }
5258  
5259 0 int english_morpho::analyze(string_piece form, guesser_mode guesser, vector<tagged_lemma>& lemmas) const {
5260 0 lemmas.clear();
5261  
5262 0 ▶ if (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (form.len) { 0 0 0
5263 // Generate all casing variants if needed (they are different than given form).
5264 0 string form_uclc; // first uppercase, rest lowercase
5265 0 string form_lc; // all lowercase
5266 0 ▶ generate_casing_variants(form, form_uclc, form_lc);
Branch: 1 branch
BranchTrueFalseTotal
generate_casing_variants(form, form_uclc, form_lc); 0 0 0
5267  
5268 // Start by analysing using the dictionary and all casing variants.
5269 0 ▶ dictionary.analyze(form, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
dictionary.analyze(form, lemmas); 0 0 0
5270 0 ▶ if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas); 0 0 0
if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas); 0 0 0
5271 0 ▶ if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas); 0 0 0
if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas); 0 0 0
5272 0 ▶ if (!lemmas.empty())
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) 0 0 0
5273 0 ▶ return guesser == NO_GUESSER || !morpho_guesser.analyze_proper_names(form, form_lc.empty() ? form : form_lc, lemmas) ? NO_GUESSER : GUESSER;
Branch: 4 branches
BranchTrueFalseTotal
return guesser == NO_GUESSER || !morpho_guesser.analyze_proper_names(form, form_lc.empty() ? form : form_lc, lemmas) ? NO_GUESSER : GUESSER; 0 0 0
return guesser == NO_GUESSER || !morpho_guesser.analyze_proper_names(form, form_lc.empty() ? form : form_lc, lemmas) ? NO_GUESSER : GUESSER; 0 0 0
return guesser == NO_GUESSER || !morpho_guesser.analyze_proper_names(form, form_lc.empty() ? form : form_lc, lemmas) ? NO_GUESSER : GUESSER; 0 0 0
return guesser == NO_GUESSER || !morpho_guesser.analyze_proper_names(form, form_lc.empty() ? form : form_lc, lemmas) ? NO_GUESSER : GUESSER; 0 0 0
5274  
5275 // Then call analyze_special to handle numbers, punctuation and symbols.
5276 0 ▶ analyze_special(form, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
analyze_special(form, lemmas); 0 0 0
5277 0 ▶ if (!lemmas.empty()) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return NO_GUESSER; 0 0 0
5278  
5279 // Use English guesser on form_lc if allowed.
5280 0 ▶ if (guesser == GUESSER)
Branch: 1 branch
BranchTrueFalseTotal
if (guesser == GUESSER) 0 0 0
5281 0 ▶ morpho_guesser.analyze(form, form_lc.empty() ? form : form_lc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
morpho_guesser.analyze(form, form_lc.empty() ? form : form_lc, lemmas); 0 0 0
morpho_guesser.analyze(form, form_lc.empty() ? form : form_lc, lemmas); 0 0 0
5282 0 ▶ if (!lemmas.empty()) return GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return GUESSER; 0 0 0
5283 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
5284  
5285 0 ▶ lemmas.emplace_back(string(form.str, form.len), unknown_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
5286 0 return -1;
5287 }
5288  
5289 0 int english_morpho::generate(string_piece lemma, const char* tag_wildcard, morpho::guesser_mode /*guesser*/, vector<tagged_lemma_forms>& forms) const {
5290 0 forms.clear();
5291  
5292 0 ▶ tag_filter filter(tag_wildcard);
Branch: 1 branch
BranchTrueFalseTotal
tag_filter filter(tag_wildcard); 0 0 0
5293  
5294 0 ▶ if (lemma.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma.len) { 0 0 0
5295 0 ▶ if (dictionary.generate(lemma, filter, forms))
Branch: 2 branches
BranchTrueFalseTotal
if (dictionary.generate(lemma, filter, forms)) 0 0 0
if (dictionary.generate(lemma, filter, forms)) 0 0 0
5296 0 return NO_GUESSER;
5297 }
5298  
5299 0 return -1;
5300 0 }
5301  
5302 0 int english_morpho::raw_lemma_len(string_piece lemma) const {
5303 0 return english_lemma_addinfo::raw_lemma_len(lemma);
5304 }
5305  
5306 0 int english_morpho::lemma_id_len(string_piece lemma) const {
5307 0 return english_lemma_addinfo::lemma_id_len(lemma);
5308 }
5309  
5310 0 int english_morpho::raw_form_len(string_piece form) const {
5311 0 return form.len;
5312 }
5313  
5314 0 tokenizer* english_morpho::new_tokenizer() const {
5315 0 ▶ return new english_tokenizer(version <= 2 ? 1 : 2);
Branch: 3 branches
BranchTrueFalseTotal
return new english_tokenizer(version <= 2 ? 1 : 2); 0 0 0
return new english_tokenizer(version <= 2 ? 1 : 2); 0 0 0
return new english_tokenizer(version <= 2 ? 1 : 2); 0 0 0
5316 }
5317  
5318 0 void english_morpho::analyze_special(string_piece form, vector<tagged_lemma>& lemmas) const {
5319 using namespace unilib;
5320  
5321 // Analyzer for numbers and punctuation.
5322 0 ▶ if (!form.len) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!form.len) return; 0 0 0
5323  
5324 // One-letter punctuation exceptions.
5325 0 ▶ if (form.len == 1)
Branch: 1 branch
BranchTrueFalseTotal
if (form.len == 1) 0 0 0
5326 0 switch(*form.str) {
5327 0 case '.':
5328 case '!':
5329 0 ▶ case '?': lemmas.emplace_back(string(form.str, form.len), dot_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
case '?': lemmas.emplace_back(string(form.str, form.len), dot_tag); return; 0 0 0
case '?': lemmas.emplace_back(string(form.str, form.len), dot_tag); return; 0 0 0
5330 0 ▶ case ',': lemmas.emplace_back(string(form.str, form.len), comma_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
case ',': lemmas.emplace_back(string(form.str, form.len), comma_tag); return; 0 0 0
case ',': lemmas.emplace_back(string(form.str, form.len), comma_tag); return; 0 0 0
5331 0 ▶ case '#': lemmas.emplace_back(string(form.str, form.len), hash_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
case '#': lemmas.emplace_back(string(form.str, form.len), hash_tag); return; 0 0 0
case '#': lemmas.emplace_back(string(form.str, form.len), hash_tag); return; 0 0 0
5332 0 ▶ case '$': lemmas.emplace_back(string(form.str, form.len), dollar_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
case '$': lemmas.emplace_back(string(form.str, form.len), dollar_tag); return; 0 0 0
case '$': lemmas.emplace_back(string(form.str, form.len), dollar_tag); return; 0 0 0
5333 0 ▶ case '[': lemmas.emplace_back(string(form.str, form.len), sym_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
case '[': lemmas.emplace_back(string(form.str, form.len), sym_tag); return; 0 0 0
case '[': lemmas.emplace_back(string(form.str, form.len), sym_tag); return; 0 0 0
5334 0 ▶ case ']': lemmas.emplace_back(string(form.str, form.len), sym_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
case ']': lemmas.emplace_back(string(form.str, form.len), sym_tag); return; 0 0 0
case ']': lemmas.emplace_back(string(form.str, form.len), sym_tag); return; 0 0 0
5335 0 ▶ case '%': lemmas.emplace_back(string(form.str, form.len), jj_tag);
Branch: 2 branches
BranchTrueFalseTotal
case '%': lemmas.emplace_back(string(form.str, form.len), jj_tag); 0 0 0
case '%': lemmas.emplace_back(string(form.str, form.len), jj_tag); 0 0 0
5336 0 ▶ lemmas.emplace_back(string(form.str, form.len), nn_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), nn_tag); return; 0 0 0
lemmas.emplace_back(string(form.str, form.len), nn_tag); return; 0 0 0
5337 0 ▶ case '&': lemmas.emplace_back(string(form.str, form.len), cc_tag);
Branch: 2 branches
BranchTrueFalseTotal
case '&': lemmas.emplace_back(string(form.str, form.len), cc_tag); 0 0 0
case '&': lemmas.emplace_back(string(form.str, form.len), cc_tag); 0 0 0
5338 0 ▶ lemmas.emplace_back(string(form.str, form.len), sym_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), sym_tag); return; 0 0 0
lemmas.emplace_back(string(form.str, form.len), sym_tag); return; 0 0 0
5339 0 ▶ case '*': lemmas.emplace_back(string(form.str, form.len), sym_tag);
Branch: 2 branches
BranchTrueFalseTotal
case '*': lemmas.emplace_back(string(form.str, form.len), sym_tag); 0 0 0
case '*': lemmas.emplace_back(string(form.str, form.len), sym_tag); 0 0 0
5340 0 ▶ lemmas.emplace_back(string(form.str, form.len), nn_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), nn_tag); return; 0 0 0
lemmas.emplace_back(string(form.str, form.len), nn_tag); return; 0 0 0
5341 0 ▶ case '@': lemmas.emplace_back(string(form.str, form.len), sym_tag);
Branch: 2 branches
BranchTrueFalseTotal
case '@': lemmas.emplace_back(string(form.str, form.len), sym_tag); 0 0 0
case '@': lemmas.emplace_back(string(form.str, form.len), sym_tag); 0 0 0
5342 0 ▶ lemmas.emplace_back(string(form.str, form.len), in_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), in_tag); return; 0 0 0
lemmas.emplace_back(string(form.str, form.len), in_tag); return; 0 0 0
5343 0 ▶ case '\'': lemmas.emplace_back(string(form.str, form.len), close_quotation_tag);
Branch: 2 branches
BranchTrueFalseTotal
case '\'': lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); 0 0 0
case '\'': lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); 0 0 0
5344 0 ▶ lemmas.emplace_back(string(form.str, form.len), pos_tag); return;
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), pos_tag); return; 0 0 0
lemmas.emplace_back(string(form.str, form.len), pos_tag); return; 0 0 0
5345 }
5346  
5347 // Try matching a number: [+-]? is_Pn* (, is_Pn{3})? (. is_Pn*)? (s | [Ee] [+-]? is_Pn+)? with at least one digit
5348 0 string_piece number = form;
5349 0 char32_t codepoint = utf8::decode(number.str, number.len);
5350 0 bool any_digit = false;
5351 0 ▶ if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len);
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 0 0
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 0 0
5352 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len); 0 0 0
5353 0 ▶ while (codepoint == ',') {
Branch: 1 branch
BranchTrueFalseTotal
while (codepoint == ',') { 0 0 0
5354 0 string_piece group = number;
5355 0 ▶ if (unicode::category(utf8::decode(group.str, group.len) & ~unicode::N)) break;
Branch: 1 branch
BranchTrueFalseTotal
if (unicode::category(utf8::decode(group.str, group.len) & ~unicode::N)) break; 0 0 0
5356 0 ▶ if (unicode::category(utf8::decode(group.str, group.len) & ~unicode::N)) break;
Branch: 1 branch
BranchTrueFalseTotal
if (unicode::category(utf8::decode(group.str, group.len) & ~unicode::N)) break; 0 0 0
5357 0 ▶ if (unicode::category(utf8::decode(group.str, group.len) & ~unicode::N)) break;
Branch: 1 branch
BranchTrueFalseTotal
if (unicode::category(utf8::decode(group.str, group.len) & ~unicode::N)) break; 0 0 0
5358 0 any_digit = true;
5359 0 number = group;
5360 0 codepoint = utf8::decode(number.str, number.len);
5361 }
5362 0 ▶ if (codepoint == '.' && number.len) {
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '.' && number.len) { 0 0 0
if (codepoint == '.' && number.len) { 0 0 0
5363 0 codepoint = utf8::decode(number.str, number.len);
5364 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len); 0 0 0
5365 }
5366 0 ▶ if (version >= 2 && any_digit && codepoint == 's' && !number.len) {
Branch: 4 branches
BranchTrueFalseTotal
if (version >= 2 && any_digit && codepoint == 's' && !number.len) { 0 0 0
if (version >= 2 && any_digit && codepoint == 's' && !number.len) { 0 0 0
if (version >= 2 && any_digit && codepoint == 's' && !number.len) { 0 0 0
if (version >= 2 && any_digit && codepoint == 's' && !number.len) { 0 0 0
5367 0 ▶ lemmas.emplace_back(string(form.str, form.len), number_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), number_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), number_tag); 0 0 0
5368 0 ▶ lemmas.emplace_back(string(form.str, form.len - 1), nns_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len - 1), nns_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len - 1), nns_tag); 0 0 0
5369 0 return;
5370 }
5371 0 ▶ if (any_digit && (codepoint == 'e' || codepoint == 'E')) {
Branch: 3 branches
BranchTrueFalseTotal
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
5372 0 codepoint = utf8::decode(number.str, number.len);
5373 0 ▶ if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len);
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 0 0
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 0 0
5374 0 any_digit = false;
5375 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len); 0 0 0
5376 }
5377 0 ▶ if (any_digit && !number.len && (!codepoint || codepoint == '.')) {
Branch: 4 branches
BranchTrueFalseTotal
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
5378 0 ▶ lemmas.emplace_back(string(form.str, form.len), number_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), number_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), number_tag); 0 0 0
5379 0 ▶ lemmas.emplace_back(string(form.str, form.len), nnp_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), nnp_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), nnp_tag); 0 0 0
5380 0 ▶ if (form.len == 1 + (codepoint == '.') && *form.str >= '1' && *form.str <= '9')
Branch: 4 branches
BranchTrueFalseTotal
if (form.len == 1 + (codepoint == '.') && *form.str >= '1' && *form.str <= '9') 0 0 0
if (form.len == 1 + (codepoint == '.') && *form.str >= '1' && *form.str <= '9') 0 0 0
if (form.len == 1 + (codepoint == '.') && *form.str >= '1' && *form.str <= '9') 0 0 0
if (form.len == 1 + (codepoint == '.') && *form.str >= '1' && *form.str <= '9') 0 0 0
5381 0 ▶ lemmas.emplace_back(string(form.str, form.len), ls_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), ls_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), ls_tag); 0 0 0
5382 0 return;
5383 }
5384  
5385 // Open quotation, end quotation, open parentheses, end parentheses, symbol, or other
5386 0 string_piece punctuation = form;
5387 0 bool open_quotation = true, close_quotation = true, open_parenthesis = true, close_parenthesis = true, any_punctuation = true, symbol = true;
5388 0 ▶ while ((symbol || any_punctuation) && punctuation.len) {
Branch: 3 branches
BranchTrueFalseTotal
while ((symbol || any_punctuation) && punctuation.len) { 0 0 0
while ((symbol || any_punctuation) && punctuation.len) { 0 0 0
while ((symbol || any_punctuation) && punctuation.len) { 0 0 0
5389 0 codepoint = utf8::decode(punctuation.str, punctuation.len);
5390 0 ▶ if (open_quotation) open_quotation = codepoint == '`' || unicode::category(codepoint) & unicode::Pi;
Branch: 3 branches
BranchTrueFalseTotal
if (open_quotation) open_quotation = codepoint == '`' || unicode::category(codepoint) & unicode::Pi; 0 0 0
if (open_quotation) open_quotation = codepoint == '`' || unicode::category(codepoint) & unicode::Pi; 0 0 0
if (open_quotation) open_quotation = codepoint == '`' || unicode::category(codepoint) & unicode::Pi; 0 0 0
5391 0 ▶ if (close_quotation) close_quotation = codepoint == '\'' || codepoint == '"' || unicode::category(codepoint) & unicode::Pf;
Branch: 4 branches
BranchTrueFalseTotal
if (close_quotation) close_quotation = codepoint == '\'' || codepoint == '"' || unicode::category(codepoint) & unicode::Pf; 0 0 0
if (close_quotation) close_quotation = codepoint == '\'' || codepoint == '"' || unicode::category(codepoint) & unicode::Pf; 0 0 0
if (close_quotation) close_quotation = codepoint == '\'' || codepoint == '"' || unicode::category(codepoint) & unicode::Pf; 0 0 0
if (close_quotation) close_quotation = codepoint == '\'' || codepoint == '"' || unicode::category(codepoint) & unicode::Pf; 0 0 0
5392 0 ▶ if (open_parenthesis) open_parenthesis = unicode::category(codepoint) & unicode::Ps;
Branch: 1 branch
BranchTrueFalseTotal
if (open_parenthesis) open_parenthesis = unicode::category(codepoint) & unicode::Ps; 0 0 0
5393 0 ▶ if (close_parenthesis) close_parenthesis = unicode::category(codepoint) & unicode::Pe;
Branch: 1 branch
BranchTrueFalseTotal
if (close_parenthesis) close_parenthesis = unicode::category(codepoint) & unicode::Pe; 0 0 0
5394 0 ▶ if (any_punctuation) any_punctuation = unicode::category(codepoint) & unicode::P;
Branch: 1 branch
BranchTrueFalseTotal
if (any_punctuation) any_punctuation = unicode::category(codepoint) & unicode::P; 0 0 0
5395 0 ▶ if (symbol) symbol = codepoint == '*' || unicode::category(codepoint) & unicode::S;
Branch: 3 branches
BranchTrueFalseTotal
if (symbol) symbol = codepoint == '*' || unicode::category(codepoint) & unicode::S; 0 0 0
if (symbol) symbol = codepoint == '*' || unicode::category(codepoint) & unicode::S; 0 0 0
if (symbol) symbol = codepoint == '*' || unicode::category(codepoint) & unicode::S; 0 0 0
5396 }
5397 0 ▶ if (!punctuation.len && open_quotation) { lemmas.emplace_back(string(form.str, form.len), open_quotation_tag); return; }
Branch: 4 branches
BranchTrueFalseTotal
if (!punctuation.len && open_quotation) { lemmas.emplace_back(string(form.str, form.len), open_quotation_tag); return; } 0 0 0
if (!punctuation.len && open_quotation) { lemmas.emplace_back(string(form.str, form.len), open_quotation_tag); return; } 0 0 0
if (!punctuation.len && open_quotation) { lemmas.emplace_back(string(form.str, form.len), open_quotation_tag); return; } 0 0 0
if (!punctuation.len && open_quotation) { lemmas.emplace_back(string(form.str, form.len), open_quotation_tag); return; } 0 0 0
5398 0 ▶ if (!punctuation.len && close_quotation) { lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); return; }
Branch: 4 branches
BranchTrueFalseTotal
if (!punctuation.len && close_quotation) { lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); return; } 0 0 0
if (!punctuation.len && close_quotation) { lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); return; } 0 0 0
if (!punctuation.len && close_quotation) { lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); return; } 0 0 0
if (!punctuation.len && close_quotation) { lemmas.emplace_back(string(form.str, form.len), close_quotation_tag); return; } 0 0 0
5399 0 ▶ if (!punctuation.len && open_parenthesis) { lemmas.emplace_back(string(form.str, form.len), open_parenthesis_tag); return; }
Branch: 4 branches
BranchTrueFalseTotal
if (!punctuation.len && open_parenthesis) { lemmas.emplace_back(string(form.str, form.len), open_parenthesis_tag); return; } 0 0 0
if (!punctuation.len && open_parenthesis) { lemmas.emplace_back(string(form.str, form.len), open_parenthesis_tag); return; } 0 0 0
if (!punctuation.len && open_parenthesis) { lemmas.emplace_back(string(form.str, form.len), open_parenthesis_tag); return; } 0 0 0
if (!punctuation.len && open_parenthesis) { lemmas.emplace_back(string(form.str, form.len), open_parenthesis_tag); return; } 0 0 0
5400 0 ▶ if (!punctuation.len && close_parenthesis) { lemmas.emplace_back(string(form.str, form.len), close_parenthesis_tag); return; }
Branch: 4 branches
BranchTrueFalseTotal
if (!punctuation.len && close_parenthesis) { lemmas.emplace_back(string(form.str, form.len), close_parenthesis_tag); return; } 0 0 0
if (!punctuation.len && close_parenthesis) { lemmas.emplace_back(string(form.str, form.len), close_parenthesis_tag); return; } 0 0 0
if (!punctuation.len && close_parenthesis) { lemmas.emplace_back(string(form.str, form.len), close_parenthesis_tag); return; } 0 0 0
if (!punctuation.len && close_parenthesis) { lemmas.emplace_back(string(form.str, form.len), close_parenthesis_tag); return; } 0 0 0
5401 0 ▶ if (!punctuation.len && symbol) { lemmas.emplace_back(string(form.str, form.len), sym_tag); return; }
Branch: 4 branches
BranchTrueFalseTotal
if (!punctuation.len && symbol) { lemmas.emplace_back(string(form.str, form.len), sym_tag); return; } 0 0 0
if (!punctuation.len && symbol) { lemmas.emplace_back(string(form.str, form.len), sym_tag); return; } 0 0 0
if (!punctuation.len && symbol) { lemmas.emplace_back(string(form.str, form.len), sym_tag); return; } 0 0 0
if (!punctuation.len && symbol) { lemmas.emplace_back(string(form.str, form.len), sym_tag); return; } 0 0 0
5402 0 ▶ if (!punctuation.len && any_punctuation) { lemmas.emplace_back(string(form.str, form.len), punctuation_tag); return; }
Branch: 4 branches
BranchTrueFalseTotal
if (!punctuation.len && any_punctuation) { lemmas.emplace_back(string(form.str, form.len), punctuation_tag); return; } 0 0 0
if (!punctuation.len && any_punctuation) { lemmas.emplace_back(string(form.str, form.len), punctuation_tag); return; } 0 0 0
if (!punctuation.len && any_punctuation) { lemmas.emplace_back(string(form.str, form.len), punctuation_tag); return; } 0 0 0
if (!punctuation.len && any_punctuation) { lemmas.emplace_back(string(form.str, form.len), punctuation_tag); return; } 0 0 0
5403 }
5404  
5405 } // namespace morphodita
5406  
5407 /////////
5408 // File: morphodita/morpho/english_morpho_guesser.cpp
5409 /////////
5410  
5411 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
5412 //
5413 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
5414 // Mathematics and Physics, Charles University in Prague, Czech Republic.
5415 //
5416 // This Source Code Form is subject to the terms of the Mozilla Public
5417 // License, v. 2.0. If a copy of the MPL was not distributed with this
5418 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5419  
5420 // This code is a reimplementation of morphologic analyzer Morphium
5421 // by Johanka Spoustova (Treex::Tool::EnglishMorpho::Analysis Perl module)
5422 // and reimplementation of morphologic lemmatizer by Martin Popel
5423 // (Treex::Tool::EnglishMorpho::Lemmatizer Perl module). The latter is based
5424 // on morpha:
5425 // Minnen, G., J. Carroll and D. Pearce (2001). Applied morphological
5426 // processing of English, Natural Language Engineering, 7(3). 207-223.
5427 // Morpha has been released under LGPL as a part of RASP system
5428 // http://ilexir.co.uk/applications/rasp/.
5429  
5430 namespace morphodita {
5431  
5432 0 void english_morpho_guesser::load(binary_decoder& data) {
5433 0 unsigned tags = data.next_2B();
5434 0 exceptions_tags.clear();
5435 0 exceptions_tags.reserve(tags);
5436 0 ▶ while (tags--) {
Branch: 1 branch
BranchTrueFalseTotal
while (tags--) { 0 0 0
5437 0 unsigned len = data.next_1B();
5438 0 ▶ exceptions_tags.emplace_back(string(data.next<char>(len), len));
Branch: 3 branches
BranchTrueFalseTotal
exceptions_tags.emplace_back(string(data.next<char>(len), len)); 0 0 0
exceptions_tags.emplace_back(string(data.next<char>(len), len)); 0 0 0
exceptions_tags.emplace_back(string(data.next<char>(len), len)); 0 0 0
5439 }
5440  
5441 0 exceptions.load(data);
5442 0 negations.load(data);
5443 0 }
5444  
5445 static const char _tag_guesser_actions[] = {
5446 0, 1, 0, 1, 1, 1, 2, 1,
5447 3, 1, 4, 1, 5, 1, 6, 1,
5448 7, 2, 2, 6, 2, 2, 7, 2,
5449 4, 6, 2, 4, 7, 2, 5, 6,
5450 2, 5, 7, 2, 6, 7, 3, 2,
5451 6, 7, 3, 4, 6, 7, 3, 5,
5452 6, 7
5453 };
5454  
5455 static const unsigned char _tag_guesser_key_offsets[] = {
5456 0, 19, 26, 34, 42, 50, 58, 66,
5457 74, 82, 90, 100, 108, 116, 124, 132,
5458 145, 153, 161, 168, 179, 195, 212, 220,
5459 228, 236
5460 };
5461  
5462 static const char _tag_guesser_trans_keys[] = {
5463 45, 46, 99, 100, 103, 105, 109, 110,
5464 114, 115, 116, 118, 120, 48, 57, 65,
5465 90, 97, 122, 45, 48, 57, 65, 90,
5466 97, 122, 45, 114, 48, 57, 65, 90,
5467 97, 122, 45, 111, 48, 57, 65, 90,
5468 97, 122, 45, 109, 48, 57, 65, 90,
5469 97, 122, 45, 101, 48, 57, 65, 90,
5470 97, 122, 45, 115, 48, 57, 65, 90,
5471 97, 122, 45, 101, 48, 57, 65, 90,
5472 97, 122, 45, 108, 48, 57, 65, 90,
5473 97, 122, 45, 115, 48, 57, 65, 90,
5474 97, 122, 45, 97, 101, 111, 48, 57,
5475 65, 90, 98, 122, 45, 101, 48, 57,
5476 65, 90, 97, 122, 45, 108, 48, 57,
5477 65, 90, 97, 122, 45, 109, 48, 57,
5478 65, 90, 97, 122, 45, 105, 48, 57,
5479 65, 90, 97, 122, 45, 97, 101, 105,
5480 111, 117, 121, 48, 57, 65, 90, 98,
5481 122, 45, 115, 48, 57, 65, 90, 97,
5482 122, 45, 101, 48, 57, 65, 90, 97,
5483 122, 45, 48, 57, 65, 90, 97, 122,
5484 45, 101, 114, 115, 116, 48, 57, 65,
5485 90, 97, 122, 45, 46, 105, 109, 118,
5486 120, 48, 57, 65, 90, 97, 98, 99,
5487 100, 101, 122, 45, 46, 101, 105, 109,
5488 118, 120, 48, 57, 65, 90, 97, 98,
5489 99, 100, 102, 122, 45, 110, 48, 57,
5490 65, 90, 97, 122, 45, 105, 48, 57,
5491 65, 90, 97, 122, 45, 101, 48, 57,
5492 65, 90, 97, 122, 45, 115, 48, 57,
5493 65, 90, 97, 122, 0
5494 };
5495  
5496 static const char _tag_guesser_single_lengths[] = {
5497 13, 1, 2, 2, 2, 2, 2, 2,
5498 2, 2, 4, 2, 2, 2, 2, 7,
5499 2, 2, 1, 5, 6, 7, 2, 2,
5500 2, 2
5501 };
5502  
5503 static const char _tag_guesser_range_lengths[] = {
5504 3, 3, 3, 3, 3, 3, 3, 3,
5505 3, 3, 3, 3, 3, 3, 3, 3,
5506 3, 3, 3, 3, 5, 5, 3, 3,
5507 3, 3
5508 };
5509  
5510 static const unsigned char _tag_guesser_index_offsets[] = {
5511 0, 17, 22, 28, 34, 40, 46, 52,
5512 58, 64, 70, 78, 84, 90, 96, 102,
5513 113, 119, 125, 130, 139, 151, 164, 170,
5514 176, 182
5515 };
5516  
5517 static const char _tag_guesser_indicies[] = {
5518 1, 2, 5, 6, 7, 5, 5, 8,
5519 9, 10, 11, 5, 5, 3, 4, 4,
5520 0, 13, 14, 15, 15, 12, 13, 16,
5521 14, 15, 15, 12, 13, 17, 14, 15,
5522 15, 12, 13, 18, 14, 15, 15, 12,
5523 13, 18, 14, 15, 15, 12, 13, 19,
5524 14, 15, 15, 12, 13, 20, 14, 15,
5525 15, 12, 13, 18, 14, 15, 15, 12,
5526 13, 21, 14, 15, 15, 12, 13, 22,
5527 23, 24, 14, 15, 15, 12, 13, 25,
5528 14, 15, 15, 12, 13, 23, 14, 15,
5529 15, 12, 13, 23, 14, 15, 15, 12,
5530 13, 26, 14, 15, 15, 12, 28, 15,
5531 15, 15, 15, 15, 15, 29, 26, 26,
5532 27, 31, 4, 32, 33, 33, 30, 13,
5533 23, 14, 15, 15, 12, 13, 14, 15,
5534 15, 12, 13, 34, 35, 36, 37, 14,
5535 15, 15, 12, 13, 38, 39, 39, 39,
5536 39, 14, 15, 15, 39, 15, 12, 13,
5537 38, 40, 39, 39, 39, 39, 14, 15,
5538 15, 39, 15, 12, 13, 41, 14, 15,
5539 15, 12, 13, 42, 14, 15, 15, 12,
5540 13, 18, 14, 15, 15, 12, 13, 43,
5541 14, 15, 15, 12, 0
5542 };
5543  
5544 static const char _tag_guesser_trans_targs[] = {
5545 18, 19, 20, 18, 18, 20, 21, 22,
5546 23, 24, 16, 25, 18, 19, 18, 1,
5547 3, 4, 18, 7, 8, 10, 11, 18,
5548 13, 12, 18, 18, 19, 18, 18, 19,
5549 18, 18, 2, 5, 6, 9, 20, 20,
5550 18, 14, 15, 17
5551 };
5552  
5553 static const char _tag_guesser_trans_actions[] = {
5554 29, 46, 29, 32, 11, 11, 11, 11,
5555 11, 11, 0, 11, 13, 35, 15, 0,
5556 0, 0, 1, 0, 0, 0, 0, 3,
5557 0, 0, 5, 17, 38, 20, 23, 42,
5558 26, 9, 0, 0, 0, 0, 13, 0,
5559 7, 0, 0, 0
5560 };
5561  
5562 static const char _tag_guesser_eof_actions[] = {
5563 0, 0, 0, 0, 0, 0, 0, 0,
5564 0, 0, 0, 0, 0, 0, 0, 0,
5565 0, 0, 0, 0, 15, 15, 0, 0,
5566 0, 0
5567 };
5568  
5569 static const int tag_guesser_start = 0;
5570  
5571 0 void english_morpho_guesser::analyze(string_piece form, string_piece form_lc, vector<tagged_lemma>& lemmas) const {
5572 // Try exceptions list
5573 0 ▶ auto* exception = exceptions.at(form_lc.str, form_lc.len, [](pointer_decoder& data){
Branch: 1 branch
BranchTrueFalseTotal
auto* exception = exceptions.at(form_lc.str, form_lc.len, [](pointer_decoder& data){ 0 0 0
5574 0 ▶ for (unsigned len = data.next_1B(); len; len--) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned len = data.next_1B(); len; len--) { 0 0 0
5575 0 data.next<char>(data.next_1B());
5576 0 data.next<uint16_t>(data.next_1B());
5577 }
5578 0 });
5579  
5580 0 ▶ if (exception) {
Branch: 1 branch
BranchTrueFalseTotal
if (exception) { 0 0 0
5581 // Found in exceptions list
5582 0 pointer_decoder data(exception);
5583 0 ▶ for (unsigned len = data.next_1B(); len; len--) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned len = data.next_1B(); len; len--) { 0 0 0
5584 0 unsigned lemma_len = data.next_1B();
5585 0 ▶ string lemma(data.next<char>(lemma_len), lemma_len);
Branch: 1 branch
BranchTrueFalseTotal
string lemma(data.next<char>(lemma_len), lemma_len); 0 0 0
5586 0 ▶ for (unsigned tags = data.next_1B(); tags; tags--)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned tags = data.next_1B(); tags; tags--) 0 0 0
5587 0 ▶ lemmas.emplace_back(lemma, exceptions_tags[data.next_2B()]);
Branch: 1 branch
BranchTrueFalseTotal
lemmas.emplace_back(lemma, exceptions_tags[data.next_2B()]); 0 0 0
5588 0 }
5589 } else {
5590 // Try stripping negative prefix and use rule guesser
5591 0 ▶ string lemma_lc(form_lc.str, form_lc.len);
Branch: 1 branch
BranchTrueFalseTotal
string lemma_lc(form_lc.str, form_lc.len); 0 0 0
5592 // Try finding negative prefix
5593 0 unsigned negation_len = 0;
5594 0 ▶ for (unsigned prefix = 1; prefix <= form_lc.len; prefix++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned prefix = 1; prefix <= form_lc.len; prefix++) { 0 0 0
5595 0 ▶ auto found = negations.at(form_lc.str, prefix, [](pointer_decoder& data){ data.next<unsigned char>(TOTAL); });
Branch: 1 branch
BranchTrueFalseTotal
auto found = negations.at(form_lc.str, prefix, [](pointer_decoder& data){ data.next<unsigned char>(TOTAL); }); 0 0 0
5596 0 ▶ if (!found) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!found) break; 0 0 0
5597 0 ▶ if (found[NEGATION_LEN]) {
Branch: 1 branch
BranchTrueFalseTotal
if (found[NEGATION_LEN]) { 0 0 0
5598 0 ▶ if (form_lc.len - prefix >= found[TO_FOLLOW]) negation_len = found[NEGATION_LEN];
Branch: 1 branch
BranchTrueFalseTotal
if (form_lc.len - prefix >= found[TO_FOLLOW]) negation_len = found[NEGATION_LEN]; 0 0 0
5599 }
5600 }
5601  
5602 // Add default tags
5603 0 ▶ add(FW, lemma_lc, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
add(FW, lemma_lc, lemmas); 0 0 0
5604 0 ▶ add(JJ, lemma_lc, negation_len, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
add(JJ, lemma_lc, negation_len, lemmas); 0 0 0
5605 0 ▶ add(RB, lemma_lc, negation_len, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
add(RB, lemma_lc, negation_len, lemmas); 0 0 0
5606 0 ▶ add(NN, lemma_lc, negation_len, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
add(NN, lemma_lc, negation_len, lemmas); 0 0 0
5607 0 ▶ add_NNS(lemma_lc, negation_len, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
add_NNS(lemma_lc, negation_len, lemmas); 0 0 0
5608  
5609 // Add specialized tags
5610 0 const char* p = form_lc.str; int cs;
5611 0 bool added_JJR_RBR = false, added_JJS_RBS = false, added_SYM = false, added_CD = false;
5612
5613 {
5614 0 cs = tag_guesser_start;
5615 }
5616  
5617 {
5618 int _klen;
5619 unsigned int _trans;
5620 const char *_acts;
5621 unsigned int _nacts;
5622 const char *_keys;
5623  
5624 0 ▶ if ( p == ( (form_lc.str + form_lc.len)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form_lc.str + form_lc.len)) ) 0 0 0
5625 0 goto _test_eof;
5626 0 _resume:
5627 0 _keys = _tag_guesser_trans_keys + _tag_guesser_key_offsets[cs];
5628 0 _trans = _tag_guesser_index_offsets[cs];
5629  
5630 0 _klen = _tag_guesser_single_lengths[cs];
5631 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
5632 0 const char *_lower = _keys;
5633 const char *_mid;
5634 0 const char *_upper = _keys + _klen - 1;
5635 while (1) {
5636 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
5637 0 break;
5638  
5639 0 _mid = _lower + ((_upper-_lower) >> 1);
5640 0 ▶ if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) < *_mid ) 0 0 0
5641 0 _upper = _mid - 1;
5642 0 ▶ else if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) > *_mid ) 0 0 0
5643 0 _lower = _mid + 1;
5644 else {
5645 0 _trans += (unsigned int)(_mid - _keys);
5646 0 goto _match;
5647 }
5648 }
5649 0 _keys += _klen;
5650 0 _trans += _klen;
5651 }
5652  
5653 0 _klen = _tag_guesser_range_lengths[cs];
5654 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
5655 0 const char *_lower = _keys;
5656 const char *_mid;
5657 0 const char *_upper = _keys + (_klen<<1) - 2;
5658 while (1) {
5659 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
5660 0 break;
5661  
5662 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
5663 0 ▶ if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) < _mid[0] ) 0 0 0
5664 0 _upper = _mid - 2;
5665 0 ▶ else if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form_lc.str[form_lc.len - 1 - (p - form_lc.str)]) > _mid[1] ) 0 0 0
5666 0 _lower = _mid + 2;
5667 else {
5668 0 _trans += (unsigned int)((_mid - _keys)>>1);
5669 0 goto _match;
5670 }
5671 }
5672 0 _trans += _klen;
5673 }
5674  
5675 0 _match:
5676 0 _trans = _tag_guesser_indicies[_trans];
5677 0 cs = _tag_guesser_trans_targs[_trans];
5678  
5679 0 ▶ if ( _tag_guesser_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _tag_guesser_trans_actions[_trans] == 0 ) 0 0 0
5680 0 goto _again;
5681  
5682 0 _acts = _tag_guesser_actions + _tag_guesser_trans_actions[_trans];
5683 0 _nacts = (unsigned int) *_acts++;
5684 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
5685 {
5686 0 switch ( *_acts++ )
5687 {
5688 0 case 0:
5689 0 ▶ { if (!added_JJR_RBR) added_JJR_RBR = true, add_JJR_RBR(lemma_lc, negation_len, lemmas); }
Branch: 2 branches
BranchTrueFalseTotal
{ if (!added_JJR_RBR) added_JJR_RBR = true, add_JJR_RBR(lemma_lc, negation_len, lemmas); } 0 0 0
{ if (!added_JJR_RBR) added_JJR_RBR = true, add_JJR_RBR(lemma_lc, negation_len, lemmas); } 0 0 0
5690 0 break;
5691 0 case 1:
5692 0 ▶ { if (!added_JJS_RBS) added_JJS_RBS = true, add_JJS_RBS(lemma_lc, negation_len, lemmas); }
Branch: 2 branches
BranchTrueFalseTotal
{ if (!added_JJS_RBS) added_JJS_RBS = true, add_JJS_RBS(lemma_lc, negation_len, lemmas); } 0 0 0
{ if (!added_JJS_RBS) added_JJS_RBS = true, add_JJS_RBS(lemma_lc, negation_len, lemmas); } 0 0 0
5693 0 break;
5694 0 case 2:
5695 0 ▶ { add_VBG(lemma_lc, lemmas); }
Branch: 1 branch
BranchTrueFalseTotal
{ add_VBG(lemma_lc, lemmas); } 0 0 0
5696 0 break;
5697 0 case 3:
5698 0 ▶ { add_VBD_VBN(lemma_lc, lemmas); }
Branch: 1 branch
BranchTrueFalseTotal
{ add_VBD_VBN(lemma_lc, lemmas); } 0 0 0
5699 0 break;
5700 0 case 4:
5701 0 ▶ { add_VBZ(lemma_lc, lemmas); }
Branch: 1 branch
BranchTrueFalseTotal
{ add_VBZ(lemma_lc, lemmas); } 0 0 0
5702 0 break;
5703 0 case 5:
5704 0 ▶ { add(VB, lemma_lc, lemmas); add(VBP, lemma_lc, lemmas); }
Branch: 2 branches
BranchTrueFalseTotal
{ add(VB, lemma_lc, lemmas); add(VBP, lemma_lc, lemmas); } 0 0 0
{ add(VB, lemma_lc, lemmas); add(VBP, lemma_lc, lemmas); } 0 0 0
5705 0 break;
5706 0 case 6:
5707 0 ▶ { if (!added_SYM) added_SYM = true, add(SYM, lemma_lc, lemmas); }
Branch: 2 branches
BranchTrueFalseTotal
{ if (!added_SYM) added_SYM = true, add(SYM, lemma_lc, lemmas); } 0 0 0
{ if (!added_SYM) added_SYM = true, add(SYM, lemma_lc, lemmas); } 0 0 0
5708 0 break;
5709 0 case 7:
5710 0 ▶ { if (!added_CD) added_CD = true, add(CD, lemma_lc, lemmas); }
Branch: 2 branches
BranchTrueFalseTotal
{ if (!added_CD) added_CD = true, add(CD, lemma_lc, lemmas); } 0 0 0
{ if (!added_CD) added_CD = true, add(CD, lemma_lc, lemmas); } 0 0 0
5711 0 break;
5712 }
5713 }
5714  
5715 0 _again:
5716 0 ▶ if ( ++p != ( (form_lc.str + form_lc.len)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form_lc.str + form_lc.len)) ) 0 0 0
5717 0 goto _resume;
5718 0 _test_eof: {}
5719 0 ▶ if ( p == ( (form_lc.str + form_lc.len)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form_lc.str + form_lc.len)) ) 0 0 0
5720 {
5721 0 const char *__acts = _tag_guesser_actions + _tag_guesser_eof_actions[cs];
5722 0 unsigned int __nacts = (unsigned int) *__acts++;
5723 0 ▶ while ( __nacts-- > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
while ( __nacts-- > 0 ) { 0 0 0
5724 0 ▶ switch ( *__acts++ ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( *__acts++ ) { 0 0 0
5725 0 case 7:
5726 0 ▶ { if (!added_CD) added_CD = true, add(CD, lemma_lc, lemmas); }
Branch: 2 branches
BranchTrueFalseTotal
{ if (!added_CD) added_CD = true, add(CD, lemma_lc, lemmas); } 0 0 0
{ if (!added_CD) added_CD = true, add(CD, lemma_lc, lemmas); } 0 0 0
5727 0 break;
5728 }
5729 }
5730 }
5731  
5732 }
5733  
5734 0 }
5735  
5736 // Add proper names
5737 0 ▶ analyze_proper_names(form, form_lc, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
analyze_proper_names(form, form_lc, lemmas); 0 0 0
5738 0 }
5739  
5740 0 bool english_morpho_guesser::analyze_proper_names(string_piece form, string_piece form_lc, vector<tagged_lemma>& lemmas) const {
5741 // NNP if form_lc != form or form.str[0] =~ /[0-9']/, NNPS if form_lc != form
5742 0 ▶ bool is_NNP = form.str != form_lc.str || (form.len && (*form.str == '\'' || (*form.str >= '0' && *form.str <= '9')));
Branch: 5 branches
BranchTrueFalseTotal
bool is_NNP = form.str != form_lc.str || (form.len && (*form.str == '\'' || (*form.str >= '0' && *form.str <= '9'))); 0 0 0
bool is_NNP = form.str != form_lc.str || (form.len && (*form.str == '\'' || (*form.str >= '0' && *form.str <= '9'))); 0 0 0
bool is_NNP = form.str != form_lc.str || (form.len && (*form.str == '\'' || (*form.str >= '0' && *form.str <= '9'))); 0 0 0
bool is_NNP = form.str != form_lc.str || (form.len && (*form.str == '\'' || (*form.str >= '0' && *form.str <= '9'))); 0 0 0
bool is_NNP = form.str != form_lc.str || (form.len && (*form.str == '\'' || (*form.str >= '0' && *form.str <= '9'))); 0 0 0
5743 0 bool is_NNPS = form.str != form_lc.str;
5744 0 ▶ if (!is_NNP && !is_NNPS) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!is_NNP && !is_NNPS) return false; 0 0 0
if (!is_NNP && !is_NNPS) return false; 0 0 0
5745  
5746 0 bool was_NNP = false, was_NNPS = false;
5747 0 ▶ for (auto&& lemma : lemmas) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& lemma : lemmas) { 0 0 0
5748 0 was_NNP |= lemma.tag == NNP;
5749 0 was_NNPS |= lemma.tag == NNPS;
5750 }
5751 0 ▶ if (!((is_NNP && !was_NNP) || (is_NNPS && !was_NNPS))) return false;
Branch: 4 branches
BranchTrueFalseTotal
if (!((is_NNP && !was_NNP) || (is_NNPS && !was_NNPS))) return false; 0 0 0
if (!((is_NNP && !was_NNP) || (is_NNPS && !was_NNPS))) return false; 0 0 0
if (!((is_NNP && !was_NNP) || (is_NNPS && !was_NNPS))) return false; 0 0 0
if (!((is_NNP && !was_NNP) || (is_NNPS && !was_NNPS))) return false; 0 0 0
5752  
5753 0 ▶ string lemma(form.str, form.len);
Branch: 1 branch
BranchTrueFalseTotal
string lemma(form.str, form.len); 0 0 0
5754 0 ▶ if (is_NNP && !was_NNP) add(NNP, lemma, lemmas);
Branch: 3 branches
BranchTrueFalseTotal
if (is_NNP && !was_NNP) add(NNP, lemma, lemmas); 0 0 0
if (is_NNP && !was_NNP) add(NNP, lemma, lemmas); 0 0 0
if (is_NNP && !was_NNP) add(NNP, lemma, lemmas); 0 0 0
5755 0 ▶ if (is_NNPS && !was_NNPS) add_NNPS(lemma, lemmas);
Branch: 3 branches
BranchTrueFalseTotal
if (is_NNPS && !was_NNPS) add_NNPS(lemma, lemmas); 0 0 0
if (is_NNPS && !was_NNPS) add_NNPS(lemma, lemmas); 0 0 0
if (is_NNPS && !was_NNPS) add_NNPS(lemma, lemmas); 0 0 0
5756 0 return true;
5757 0 }
5758  
5759 0 inline void english_morpho_guesser::add(const string& tag, const string& form, vector<tagged_lemma>& lemmas) const {
5760 0 lemmas.emplace_back(form, tag);
5761 0 }
5762  
5763 0 inline void english_morpho_guesser::add(const string& tag, const string& tag2, const string& form, vector<tagged_lemma>& lemmas) const {
5764 0 add(tag, form, lemmas);
5765 0 add(tag2, form, lemmas);
5766 0 }
5767  
5768 0 inline void english_morpho_guesser::add(const string& tag, const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const {
5769 0 ▶ lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag);
Branch: 13 branches
BranchTrueFalseTotal
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
lemmas.emplace_back(negation_len ? form.substr(negation_len) + "^" + form.substr(0, negation_len) : form, tag); 0 0 0
5770 0 }
5771  
5772 0 inline void english_morpho_guesser::add(const string& tag, const string& tag2, const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const {
5773 0 add(tag, form, negation_len, lemmas);
5774 0 add(tag2, form, negation_len, lemmas);
5775 0 }
5776  
5777 // Common definitions (written backwards)
5778 #define REM(str, len) (str.substr(0, str.size() - len))
5779 #define REM_ADD(str, len, add) (str.substr(0, str.size() - len).append(add))
5780  
5781 static const char _NNS_actions[] = {
5782 0, 1, 0, 1, 1, 1, 2, 1,
5783 3, 1, 4, 1, 5, 1, 6, 1,
5784 7, 1, 8, 1, 9, 1, 10, 1,
5785 11, 1, 12, 1, 13
5786 };
5787  
5788 static const char _NNS_key_offsets[] = {
5789 0, 0, 2, 3, 4, 5, 7, 17,
5790 17, 29, 30, 35, 35, 36, 37, 37,
5791 37, 44, 45, 53, 63, 72
5792 };
5793  
5794 static const char _NNS_trans_keys[] = {
5795 110, 115, 101, 109, 101, 99, 115, 98,
5796 100, 102, 104, 106, 110, 112, 116, 118,
5797 122, 104, 122, 98, 100, 102, 103, 106,
5798 110, 112, 116, 118, 120, 111, 97, 101,
5799 105, 111, 117, 105, 119, 104, 105, 111,
5800 115, 118, 120, 122, 115, 97, 101, 105,
5801 110, 111, 114, 115, 117, 98, 100, 102,
5802 104, 106, 110, 112, 116, 118, 122, 97,
5803 101, 105, 111, 117, 121, 122, 98, 120,
5804 0
5805 };
5806  
5807 static const char _NNS_single_lengths[] = {
5808 0, 2, 1, 1, 1, 2, 0, 0,
5809 2, 1, 5, 0, 1, 1, 0, 0,
5810 7, 1, 8, 0, 7, 0
5811 };
5812  
5813 static const char _NNS_range_lengths[] = {
5814 0, 0, 0, 0, 0, 0, 5, 0,
5815 5, 0, 0, 0, 0, 0, 0, 0,
5816 0, 0, 0, 5, 1, 0
5817 };
5818  
5819 static const char _NNS_index_offsets[] = {
5820 0, 0, 3, 5, 7, 9, 12, 18,
5821 19, 27, 29, 35, 36, 38, 40, 41,
5822 42, 50, 52, 61, 67, 76
5823 };
5824  
5825 static const char _NNS_indicies[] = {
5826 0, 2, 1, 3, 1, 4, 1, 6,
5827 5, 7, 7, 1, 8, 8, 8, 8,
5828 8, 1, 9, 11, 10, 10, 10, 10,
5829 10, 10, 1, 12, 1, 13, 13, 13,
5830 13, 13, 1, 14, 15, 1, 16, 1,
5831 17, 1, 18, 19, 20, 21, 22, 7,
5832 23, 1, 24, 1, 25, 25, 25, 26,
5833 25, 27, 28, 29, 1, 30, 30, 30,
5834 30, 30, 1, 31, 31, 31, 31, 31,
5835 31, 33, 32, 1, 17, 0
5836 };
5837  
5838 static const char _NNS_trans_targs[] = {
5839 2, 0, 4, 3, 15, 15, 16, 15,
5840 7, 15, 15, 17, 15, 11, 15, 13,
5841 15, 15, 5, 6, 8, 18, 12, 20,
5842 15, 15, 9, 10, 15, 19, 15, 15,
5843 14, 21
5844 };
5845  
5846 static const char _NNS_trans_actions[] = {
5847 0, 0, 0, 0, 1, 27, 27, 21,
5848 0, 23, 25, 25, 19, 0, 17, 0,
5849 5, 11, 0, 0, 0, 21, 0, 21,
5850 3, 9, 0, 0, 15, 9, 7, 13,
5851 0, 15
5852 };
5853  
5854 static const int NNS_start = 1;
5855  
5856 0 void english_morpho_guesser::add_NNS(const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const {
5857 0 const char* p = form.c_str() + negation_len; int cs;
5858 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
5859
5860 {
5861 0 cs = NNS_start;
5862 }
5863  
5864 {
5865 int _klen;
5866 unsigned int _trans;
5867 const char *_acts;
5868 unsigned int _nacts;
5869 const char *_keys;
5870  
5871 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
5872 0 goto _test_eof;
5873 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
5874 0 goto _out;
5875 0 _resume:
5876 0 _keys = _NNS_trans_keys + _NNS_key_offsets[cs];
5877 0 _trans = _NNS_index_offsets[cs];
5878  
5879 0 _klen = _NNS_single_lengths[cs];
5880 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
5881 0 const char *_lower = _keys;
5882 const char *_mid;
5883 0 const char *_upper = _keys + _klen - 1;
5884 while (1) {
5885 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
5886 0 break;
5887  
5888 0 _mid = _lower + ((_upper-_lower) >> 1);
5889 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < *_mid ) 0 0 0
5890 0 _upper = _mid - 1;
5891 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > *_mid ) 0 0 0
5892 0 _lower = _mid + 1;
5893 else {
5894 0 _trans += (unsigned int)(_mid - _keys);
5895 0 goto _match;
5896 }
5897 }
5898 0 _keys += _klen;
5899 0 _trans += _klen;
5900 }
5901  
5902 0 _klen = _NNS_range_lengths[cs];
5903 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
5904 0 const char *_lower = _keys;
5905 const char *_mid;
5906 0 const char *_upper = _keys + (_klen<<1) - 2;
5907 while (1) {
5908 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
5909 0 break;
5910  
5911 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
5912 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < _mid[0] ) 0 0 0
5913 0 _upper = _mid - 2;
5914 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > _mid[1] ) 0 0 0
5915 0 _lower = _mid + 2;
5916 else {
5917 0 _trans += (unsigned int)((_mid - _keys)>>1);
5918 0 goto _match;
5919 }
5920 }
5921 0 _trans += _klen;
5922 }
5923  
5924 0 _match:
5925 0 _trans = _NNS_indicies[_trans];
5926 0 cs = _NNS_trans_targs[_trans];
5927  
5928 0 ▶ if ( _NNS_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _NNS_trans_actions[_trans] == 0 ) 0 0 0
5929 0 goto _again;
5930  
5931 0 _acts = _NNS_actions + _NNS_trans_actions[_trans];
5932 0 _nacts = (unsigned int) *_acts++;
5933 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
5934 {
5935 0 switch ( *_acts++ )
5936 {
5937 0 case 0:
5938 0 ▶ { if (best > 'a') best = 'a', remove = 2, append = "an"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 2, append = "an"; } 0 0 0
5939 0 break;
5940 0 case 1:
5941 0 ▶ { if (best > 'b') best = 'b', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 1, append = nullptr; } 0 0 0
5942 0 break;
5943 0 case 2:
5944 0 ▶ { if (best > 'c') best = 'c', remove = 3, append = "fe"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 3, append = "fe"; } 0 0 0
5945 0 break;
5946 0 case 3:
5947 0 ▶ { if (best > 'd') best = 'd', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 2, append = nullptr; } 0 0 0
5948 0 break;
5949 0 case 4:
5950 0 ▶ { if (best > 'e') best = 'e', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 1, append = nullptr; } 0 0 0
5951 0 break;
5952 0 case 5:
5953 0 ▶ { if (best > 'f') best = 'f', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 2, append = nullptr; } 0 0 0
5954 0 break;
5955 0 case 6:
5956 0 ▶ { if (best > 'g') best = 'g', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'g') best = 'g', remove = 1, append = nullptr; } 0 0 0
5957 0 break;
5958 0 case 7:
5959 0 ▶ { if (best > 'h') best = 'h', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'h') best = 'h', remove = 2, append = nullptr; } 0 0 0
5960 0 break;
5961 0 case 8:
5962 0 ▶ { if (best > 'i') best = 'i', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'i') best = 'i', remove = 1, append = nullptr; } 0 0 0
5963 0 break;
5964 0 case 9:
5965 0 ▶ { if (best > 'j') best = 'j', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'j') best = 'j', remove = 1, append = nullptr; } 0 0 0
5966 0 break;
5967 0 case 10:
5968 0 ▶ { if (best > 'k') best = 'k', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'k') best = 'k', remove = 2, append = nullptr; } 0 0 0
5969 0 break;
5970 0 case 11:
5971 0 ▶ { if (best > 'l') best = 'l', remove = 3, append = "y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'l') best = 'l', remove = 3, append = "y"; } 0 0 0
5972 0 break;
5973 0 case 12:
5974 0 ▶ { if (best > 'm') best = 'm', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'm') best = 'm', remove = 2, append = nullptr; } 0 0 0
5975 0 break;
5976 0 case 13:
5977 0 ▶ { if (best > 'n') best = 'n', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'n') best = 'n', remove = 1, append = nullptr; } 0 0 0
5978 0 break;
5979 }
5980 }
5981  
5982 0 _again:
5983 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
5984 0 goto _out;
5985 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
5986 0 goto _resume;
5987 0 _test_eof: {}
5988 0 _out: {}
5989 }
5990  
5991 0 ▶ add(NNS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(NNS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(NNS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(NNS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(NNS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
5992 0 }
5993  
5994 static const char _NNPS_actions[] = {
5995 0, 1, 1, 1, 2, 1, 4, 1,
5996 5, 1, 6, 1, 7, 1, 8, 1,
5997 9, 1, 10, 1, 11, 1, 12, 1,
5998 14, 1, 15, 1, 16, 2, 0, 1,
5999 2, 3, 4, 2, 13, 14
6000 };
6001  
6002 static const unsigned char _NNPS_key_offsets[] = {
6003 0, 0, 4, 6, 8, 10, 12, 16,
6004 36, 36, 60, 62, 72, 72, 74, 76,
6005 78, 78, 98, 98, 100, 102, 104, 104,
6006 118, 120, 136, 156, 174, 174
6007 };
6008  
6009 static const char _NNPS_trans_keys[] = {
6010 78, 83, 110, 115, 69, 101, 77, 109,
6011 77, 109, 69, 101, 67, 83, 99, 115,
6012 66, 68, 70, 72, 74, 78, 80, 84,
6013 86, 90, 98, 100, 102, 104, 106, 110,
6014 112, 116, 118, 122, 72, 90, 104, 122,
6015 66, 68, 70, 71, 74, 78, 80, 84,
6016 86, 88, 98, 100, 102, 103, 106, 110,
6017 112, 116, 118, 120, 79, 111, 65, 69,
6018 73, 79, 85, 97, 101, 105, 111, 117,
6019 73, 105, 87, 119, 87, 119, 66, 68,
6020 70, 72, 74, 78, 80, 84, 86, 90,
6021 98, 100, 102, 104, 106, 110, 112, 116,
6022 118, 122, 73, 105, 69, 101, 69, 101,
6023 72, 73, 79, 83, 86, 88, 90, 104,
6024 105, 111, 115, 118, 120, 122, 83, 115,
6025 65, 69, 73, 78, 79, 82, 83, 85,
6026 97, 101, 105, 110, 111, 114, 115, 117,
6027 66, 68, 70, 72, 74, 78, 80, 84,
6028 86, 90, 98, 100, 102, 104, 106, 110,
6029 112, 116, 118, 122, 65, 69, 73, 79,
6030 85, 89, 90, 97, 101, 105, 111, 117,
6031 121, 122, 66, 88, 98, 120, 72, 73,
6032 79, 83, 86, 88, 90, 104, 105, 111,
6033 115, 118, 120, 122, 0
6034 };
6035  
6036 static const char _NNPS_single_lengths[] = {
6037 0, 4, 2, 2, 2, 2, 4, 0,
6038 0, 4, 2, 10, 0, 2, 2, 2,
6039 0, 0, 0, 2, 2, 2, 0, 14,
6040 2, 16, 0, 14, 0, 14
6041 };
6042  
6043 static const char _NNPS_range_lengths[] = {
6044 0, 0, 0, 0, 0, 0, 0, 10,
6045 0, 10, 0, 0, 0, 0, 0, 0,
6046 0, 10, 0, 0, 0, 0, 0, 0,
6047 0, 0, 10, 2, 0, 0
6048 };
6049  
6050 static const unsigned char _NNPS_index_offsets[] = {
6051 0, 0, 5, 8, 11, 14, 17, 22,
6052 33, 34, 49, 52, 63, 64, 67, 70,
6053 73, 74, 85, 86, 89, 92, 95, 96,
6054 111, 114, 131, 142, 159, 160
6055 };
6056  
6057 static const char _NNPS_indicies[] = {
6058 0, 2, 3, 4, 1, 5, 6, 1,
6059 7, 8, 1, 8, 8, 1, 10, 11,
6060 9, 12, 12, 12, 12, 1, 13, 13,
6061 13, 13, 13, 13, 13, 13, 13, 13,
6062 1, 14, 16, 15, 16, 15, 15, 15,
6063 15, 15, 15, 15, 15, 15, 15, 15,
6064 1, 17, 17, 1, 18, 18, 18, 18,
6065 18, 18, 18, 18, 18, 18, 1, 19,
6066 20, 21, 1, 22, 23, 1, 23, 23,
6067 1, 24, 25, 25, 25, 25, 25, 25,
6068 25, 25, 25, 25, 1, 26, 21, 21,
6069 1, 6, 6, 1, 11, 11, 9, 1,
6070 27, 28, 29, 30, 31, 12, 32, 27,
6071 33, 29, 30, 34, 12, 32, 1, 35,
6072 35, 1, 36, 36, 36, 37, 36, 38,
6073 39, 40, 36, 36, 36, 37, 36, 38,
6074 39, 40, 1, 41, 41, 41, 41, 41,
6075 41, 41, 41, 41, 41, 1, 42, 42,
6076 42, 42, 42, 42, 44, 42, 42, 42,
6077 42, 42, 42, 44, 43, 43, 1, 24,
6078 27, 33, 29, 30, 34, 12, 32, 27,
6079 33, 29, 30, 34, 12, 32, 1, 0
6080 };
6081  
6082 static const char _NNPS_trans_targs[] = {
6083 2, 0, 5, 20, 21, 3, 4, 22,
6084 22, 22, 23, 29, 22, 8, 22, 22,
6085 24, 22, 12, 22, 14, 15, 22, 22,
6086 22, 18, 22, 6, 7, 9, 25, 13,
6087 27, 17, 19, 22, 22, 10, 11, 22,
6088 26, 22, 22, 16, 28
6089 };
6090  
6091 static const char _NNPS_trans_actions[] = {
6092 0, 0, 0, 0, 0, 0, 0, 29,
6093 1, 27, 27, 27, 21, 0, 35, 25,
6094 25, 19, 0, 17, 0, 0, 32, 5,
6095 11, 0, 23, 0, 0, 0, 21, 0,
6096 21, 0, 0, 3, 9, 0, 0, 15,
6097 9, 7, 13, 0, 15
6098 };
6099  
6100 static const int NNPS_start = 1;
6101  
6102 0 void english_morpho_guesser::add_NNPS(const string& form, vector<tagged_lemma>& lemmas) const {
6103 0 const char* p = form.c_str(); int cs;
6104 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
6105
6106 {
6107 0 cs = NNPS_start;
6108 }
6109  
6110 {
6111 int _klen;
6112 unsigned int _trans;
6113 const char *_acts;
6114 unsigned int _nacts;
6115 const char *_keys;
6116  
6117 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
6118 0 goto _test_eof;
6119 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
6120 0 goto _out;
6121 0 _resume:
6122 0 _keys = _NNPS_trans_keys + _NNPS_key_offsets[cs];
6123 0 _trans = _NNPS_index_offsets[cs];
6124  
6125 0 _klen = _NNPS_single_lengths[cs];
6126 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
6127 0 const char *_lower = _keys;
6128 const char *_mid;
6129 0 const char *_upper = _keys + _klen - 1;
6130 while (1) {
6131 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
6132 0 break;
6133  
6134 0 _mid = _lower + ((_upper-_lower) >> 1);
6135 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid ) 0 0 0
6136 0 _upper = _mid - 1;
6137 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid ) 0 0 0
6138 0 _lower = _mid + 1;
6139 else {
6140 0 _trans += (unsigned int)(_mid - _keys);
6141 0 goto _match;
6142 }
6143 }
6144 0 _keys += _klen;
6145 0 _trans += _klen;
6146 }
6147  
6148 0 _klen = _NNPS_range_lengths[cs];
6149 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
6150 0 const char *_lower = _keys;
6151 const char *_mid;
6152 0 const char *_upper = _keys + (_klen<<1) - 2;
6153 while (1) {
6154 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
6155 0 break;
6156  
6157 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
6158 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] ) 0 0 0
6159 0 _upper = _mid - 2;
6160 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] ) 0 0 0
6161 0 _lower = _mid + 2;
6162 else {
6163 0 _trans += (unsigned int)((_mid - _keys)>>1);
6164 0 goto _match;
6165 }
6166 }
6167 0 _trans += _klen;
6168 }
6169  
6170 0 _match:
6171 0 _trans = _NNPS_indicies[_trans];
6172 0 cs = _NNPS_trans_targs[_trans];
6173  
6174 0 ▶ if ( _NNPS_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _NNPS_trans_actions[_trans] == 0 ) 0 0 0
6175 0 goto _again;
6176  
6177 0 _acts = _NNPS_actions + _NNPS_trans_actions[_trans];
6178 0 _nacts = (unsigned int) *_acts++;
6179 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
6180 {
6181 0 switch ( *_acts++ )
6182 {
6183 0 case 0:
6184 0 ▶ { if (best > 'a') best = 'a', remove = 2, append = "AN"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 2, append = "AN"; } 0 0 0
6185 0 break;
6186 0 case 1:
6187 0 ▶ { if (best > 'b') best = 'b', remove = 2, append = "an"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 2, append = "an"; } 0 0 0
6188 0 break;
6189 0 case 2:
6190 0 ▶ { if (best > 'c') best = 'c', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 1, append = nullptr; } 0 0 0
6191 0 break;
6192 0 case 3:
6193 0 ▶ { if (best > 'd') best = 'd', remove = 3, append = "FE"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 3, append = "FE"; } 0 0 0
6194 0 break;
6195 0 case 4:
6196 0 ▶ { if (best > 'e') best = 'e', remove = 3, append = "fe"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 3, append = "fe"; } 0 0 0
6197 0 break;
6198 0 case 5:
6199 0 ▶ { if (best > 'f') best = 'f', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 2, append = nullptr; } 0 0 0
6200 0 break;
6201 0 case 6:
6202 0 ▶ { if (best > 'g') best = 'g', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'g') best = 'g', remove = 1, append = nullptr; } 0 0 0
6203 0 break;
6204 0 case 7:
6205 0 ▶ { if (best > 'h') best = 'h', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'h') best = 'h', remove = 2, append = nullptr; } 0 0 0
6206 0 break;
6207 0 case 8:
6208 0 ▶ { if (best > 'i') best = 'i', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'i') best = 'i', remove = 1, append = nullptr; } 0 0 0
6209 0 break;
6210 0 case 9:
6211 0 ▶ { if (best > 'j') best = 'j', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'j') best = 'j', remove = 2, append = nullptr; } 0 0 0
6212 0 break;
6213 0 case 10:
6214 0 ▶ { if (best > 'k') best = 'k', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'k') best = 'k', remove = 1, append = nullptr; } 0 0 0
6215 0 break;
6216 0 case 11:
6217 0 ▶ { if (best > 'l') best = 'l', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'l') best = 'l', remove = 1, append = nullptr; } 0 0 0
6218 0 break;
6219 0 case 12:
6220 0 ▶ { if (best > 'm') best = 'm', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'm') best = 'm', remove = 2, append = nullptr; } 0 0 0
6221 0 break;
6222 0 case 13:
6223 0 ▶ { if (best > 'n') best = 'n', remove = 3, append = "Y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'n') best = 'n', remove = 3, append = "Y"; } 0 0 0
6224 0 break;
6225 0 case 14:
6226 0 ▶ { if (best > 'o') best = 'o', remove = 3, append = "y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'o') best = 'o', remove = 3, append = "y"; } 0 0 0
6227 0 break;
6228 0 case 15:
6229 0 ▶ { if (best > 'p') best = 'p', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'p') best = 'p', remove = 2, append = nullptr; } 0 0 0
6230 0 break;
6231 0 case 16:
6232 0 ▶ { if (best > 'q') best = 'q', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'q') best = 'q', remove = 1, append = nullptr; } 0 0 0
6233 0 break;
6234 }
6235 }
6236  
6237 0 _again:
6238 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
6239 0 goto _out;
6240 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
6241 0 goto _resume;
6242 0 _test_eof: {}
6243 0 _out: {}
6244 }
6245  
6246 0 ▶ add(NNPS, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(NNPS, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(NNPS, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(NNPS, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(NNPS, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
6247 0 }
6248  
6249 static const char _VBG_actions[] = {
6250 0, 1, 1, 1, 2, 1, 4, 1,
6251 5, 1, 6, 1, 7, 1, 9, 1,
6252 10, 1, 11, 1, 12, 1, 13, 1,
6253 14, 1, 15, 1, 16, 1, 17, 2,
6254 0, 12, 2, 3, 4, 2, 5, 9,
6255 2, 5, 10, 2, 8, 9, 2, 9,
6256 10, 2, 11, 12, 3, 0, 2, 12,
6257 3, 2, 11, 12
6258 };
6259  
6260 static const short _VBG_key_offsets[] = {
6261 0, 0, 1, 2, 3, 9, 14, 24,
6262 29, 34, 44, 46, 47, 48, 49, 50,
6263 51, 52, 59, 66, 68, 70, 71, 72,
6264 73, 74, 75, 76, 81, 89, 90, 91,
6265 92, 93, 94, 96, 97, 98, 99, 100,
6266 101, 102, 127, 127, 136, 137, 142, 153,
6267 162, 171, 181, 186, 191, 197, 207, 207,
6268 216, 228, 229, 240, 240, 249, 258, 267,
6269 276, 285, 290, 302, 313, 318, 324, 334,
6270 344, 355, 362, 373, 382, 391, 391, 402,
6271 413, 415, 416, 417, 417, 418, 426, 437,
6272 442, 448, 458, 468, 479, 486, 497, 504,
6273 510, 519, 528, 537, 543
6274 };
6275  
6276 static const char _VBG_trans_keys[] = {
6277 103, 110, 105, 97, 101, 105, 111, 117,
6278 121, 97, 101, 105, 111, 117, 98, 100,
6279 102, 104, 106, 110, 112, 116, 118, 122,
6280 97, 101, 105, 111, 117, 97, 101, 105,
6281 111, 117, 98, 100, 102, 104, 106, 110,
6282 112, 116, 118, 122, 98, 114, 105, 114,
6283 112, 105, 109, 101, 97, 101, 105, 111,
6284 117, 98, 122, 97, 101, 105, 111, 117,
6285 98, 122, 97, 122, 98, 114, 105, 114,
6286 112, 105, 109, 101, 97, 101, 105, 111,
6287 117, 97, 101, 105, 110, 111, 115, 117,
6288 120, 105, 112, 105, 109, 101, 98, 114,
6289 105, 114, 112, 105, 109, 101, 98, 99,
6290 100, 102, 103, 104, 106, 107, 108, 109,
6291 110, 111, 112, 113, 114, 115, 116, 117,
6292 118, 119, 120, 121, 122, 97, 105, 97,
6293 98, 101, 105, 111, 117, 122, 99, 120,
6294 113, 97, 101, 105, 111, 117, 98, 99,
6295 100, 105, 111, 117, 122, 97, 101, 102,
6296 120, 97, 100, 101, 105, 111, 117, 122,
6297 98, 120, 97, 101, 102, 105, 111, 117,
6298 122, 98, 120, 97, 101, 103, 105, 110,
6299 111, 117, 122, 98, 120, 97, 101, 105,
6300 111, 117, 101, 110, 111, 115, 120, 101,
6301 110, 111, 112, 115, 120, 97, 101, 104,
6302 105, 111, 116, 117, 122, 98, 120, 97,
6303 101, 105, 106, 111, 117, 122, 98, 120,
6304 98, 99, 100, 105, 107, 111, 117, 122,
6305 97, 101, 102, 120, 105, 97, 101, 105,
6306 108, 111, 114, 117, 119, 122, 98, 120,
6307 97, 101, 105, 109, 111, 117, 122, 98,
6308 120, 97, 101, 105, 110, 111, 117, 122,
6309 98, 120, 97, 101, 105, 111, 112, 117,
6310 122, 98, 120, 97, 101, 105, 111, 113,
6311 117, 122, 98, 120, 97, 101, 105, 111,
6312 114, 117, 122, 98, 120, 97, 101, 105,
6313 111, 117, 98, 99, 100, 105, 108, 111,
6314 116, 117, 97, 101, 102, 122, 101, 110,
6315 111, 115, 120, 98, 104, 106, 116, 118,
6316 122, 101, 110, 111, 115, 120, 101, 110,
6317 111, 112, 115, 120, 101, 105, 110, 111,
6318 115, 120, 98, 116, 118, 122, 101, 105,
6319 110, 111, 115, 120, 98, 116, 118, 122,
6320 101, 110, 111, 115, 120, 98, 104, 106,
6321 116, 118, 122, 98, 101, 110, 111, 114,
6322 115, 120, 101, 110, 111, 115, 120, 98,
6323 104, 106, 116, 118, 122, 97, 101, 105,
6324 111, 115, 117, 122, 98, 120, 97, 101,
6325 105, 111, 116, 117, 122, 98, 120, 122,
6326 98, 100, 102, 104, 106, 110, 112, 116,
6327 118, 120, 122, 98, 100, 102, 104, 106,
6328 110, 112, 116, 118, 120, 98, 114, 112,
6329 114, 113, 97, 101, 105, 108, 111, 117,
6330 98, 122, 101, 110, 111, 115, 120, 98,
6331 104, 106, 116, 118, 122, 101, 110, 111,
6332 115, 120, 101, 110, 111, 112, 115, 120,
6333 101, 105, 110, 111, 115, 120, 98, 116,
6334 118, 122, 101, 105, 110, 111, 115, 120,
6335 98, 116, 118, 122, 101, 110, 111, 115,
6336 120, 98, 104, 106, 116, 118, 122, 98,
6337 101, 110, 111, 114, 115, 120, 101, 110,
6338 111, 115, 120, 98, 104, 106, 116, 118,
6339 122, 97, 101, 105, 111, 117, 98, 122,
6340 97, 101, 105, 111, 117, 121, 97, 101,
6341 105, 111, 117, 118, 122, 98, 120, 97,
6342 101, 105, 111, 117, 119, 122, 98, 120,
6343 97, 101, 105, 111, 117, 120, 122, 98,
6344 119, 97, 101, 105, 111, 117, 121, 97,
6345 101, 105, 111, 117, 121, 122, 98, 120,
6346 0
6347 };
6348  
6349 static const char _VBG_single_lengths[] = {
6350 0, 1, 1, 1, 6, 5, 0, 5,
6351 5, 0, 2, 1, 1, 1, 1, 1,
6352 1, 5, 5, 0, 2, 1, 1, 1,
6353 1, 1, 1, 5, 8, 1, 1, 1,
6354 1, 1, 2, 1, 1, 1, 1, 1,
6355 1, 23, 0, 7, 1, 5, 7, 7,
6356 7, 8, 5, 5, 6, 8, 0, 7,
6357 8, 1, 9, 0, 7, 7, 7, 7,
6358 7, 5, 8, 5, 5, 6, 6, 6,
6359 5, 7, 5, 7, 7, 0, 1, 1,
6360 2, 1, 1, 0, 1, 6, 5, 5,
6361 6, 6, 6, 5, 7, 5, 5, 6,
6362 7, 7, 7, 6, 7
6363 };
6364  
6365 static const char _VBG_range_lengths[] = {
6366 0, 0, 0, 0, 0, 0, 5, 0,
6367 0, 5, 0, 0, 0, 0, 0, 0,
6368 0, 1, 1, 1, 0, 0, 0, 0,
6369 0, 0, 0, 0, 0, 0, 0, 0,
6370 0, 0, 0, 0, 0, 0, 0, 0,
6371 0, 1, 0, 1, 0, 0, 2, 1,
6372 1, 1, 0, 0, 0, 1, 0, 1,
6373 2, 0, 1, 0, 1, 1, 1, 1,
6374 1, 0, 2, 3, 0, 0, 2, 2,
6375 3, 0, 3, 1, 1, 0, 5, 5,
6376 0, 0, 0, 0, 0, 1, 3, 0,
6377 0, 2, 2, 3, 0, 3, 1, 0,
6378 1, 1, 1, 0, 1
6379 };
6380  
6381 static const short _VBG_index_offsets[] = {
6382 0, 0, 2, 4, 6, 13, 19, 25,
6383 31, 37, 43, 46, 48, 50, 52, 54,
6384 56, 58, 65, 72, 74, 77, 79, 81,
6385 83, 85, 87, 89, 95, 104, 106, 108,
6386 110, 112, 114, 117, 119, 121, 123, 125,
6387 127, 129, 154, 155, 164, 166, 172, 182,
6388 191, 200, 210, 216, 222, 229, 239, 240,
6389 249, 260, 262, 273, 274, 283, 292, 301,
6390 310, 319, 325, 336, 345, 351, 358, 367,
6391 376, 385, 393, 402, 411, 420, 421, 428,
6392 435, 438, 440, 442, 443, 445, 453, 462,
6393 468, 475, 484, 493, 502, 510, 519, 526,
6394 533, 542, 551, 560, 567
6395 };
6396  
6397 static const unsigned char _VBG_indicies[] = {
6398 0, 1, 2, 1, 3, 1, 4, 4,
6399 4, 4, 4, 4, 1, 5, 5, 5,
6400 5, 6, 1, 7, 7, 7, 7, 7,
6401 1, 8, 8, 8, 8, 9, 1, 5,
6402 5, 5, 5, 10, 1, 11, 11, 11,
6403 11, 11, 1, 11, 12, 1, 11, 1,
6404 13, 1, 11, 1, 14, 1, 11, 1,
6405 11, 1, 5, 5, 5, 5, 6, 15,
6406 1, 5, 5, 5, 5, 6, 16, 1,
6407 4, 1, 17, 18, 1, 17, 1, 19,
6408 1, 17, 1, 20, 1, 17, 1, 17,
6409 1, 21, 22, 21, 23, 24, 1, 25,
6410 26, 25, 27, 28, 29, 25, 30, 1,
6411 31, 1, 31, 1, 32, 1, 31, 1,
6412 31, 1, 33, 34, 1, 33, 1, 35,
6413 1, 33, 1, 36, 1, 33, 1, 33,
6414 1, 38, 39, 40, 41, 42, 43, 44,
6415 45, 46, 47, 48, 49, 50, 51, 52,
6416 53, 54, 55, 56, 57, 58, 59, 60,
6417 37, 1, 1, 61, 62, 61, 61, 61,
6418 61, 63, 63, 1, 64, 1, 65, 65,
6419 65, 65, 65, 1, 67, 68, 67, 66,
6420 66, 66, 67, 66, 67, 1, 69, 62,
6421 69, 69, 69, 69, 63, 63, 1, 61,
6422 61, 62, 61, 61, 61, 63, 63, 1,
6423 66, 66, 68, 66, 70, 66, 66, 67,
6424 67, 1, 71, 71, 71, 71, 71, 1,
6425 72, 73, 74, 75, 76, 1, 72, 73,
6426 74, 11, 75, 76, 1, 61, 61, 62,
6427 61, 61, 77, 61, 63, 63, 1, 78,
6428 61, 61, 61, 62, 61, 61, 63, 63,
6429 1, 63, 79, 63, 61, 62, 61, 61,
6430 63, 61, 63, 1, 7, 1, 61, 61,
6431 61, 68, 61, 80, 61, 80, 67, 67,
6432 1, 5, 61, 61, 61, 62, 61, 61,
6433 63, 63, 1, 81, 81, 82, 62, 81,
6434 81, 63, 63, 1, 81, 81, 81, 81,
6435 62, 81, 63, 63, 1, 61, 61, 61,
6436 61, 62, 61, 63, 63, 1, 61, 83,
6437 61, 84, 62, 61, 63, 63, 1, 5,
6438 5, 5, 5, 6, 1, 85, 86, 85,
6439 5, 86, 5, 86, 6, 5, 85, 1,
6440 87, 88, 89, 90, 91, 85, 85, 85,
6441 1, 87, 92, 89, 93, 94, 1, 87,
6442 92, 89, 17, 93, 94, 1, 87, 17,
6443 88, 89, 90, 91, 85, 85, 1, 87,
6444 20, 88, 89, 90, 91, 85, 85, 1,
6445 95, 88, 89, 90, 91, 85, 85, 85,
6446 1, 17, 87, 92, 89, 18, 93, 94,
6447 1, 87, 97, 89, 98, 99, 96, 96,
6448 96, 1, 66, 66, 66, 66, 100, 66,
6449 67, 67, 1, 101, 102, 103, 61, 62,
6450 61, 63, 63, 1, 104, 106, 106, 106,
6451 106, 106, 106, 105, 107, 107, 107, 107,
6452 107, 107, 1, 31, 108, 1, 31, 1,
6453 109, 1, 105, 110, 104, 5, 5, 5,
6454 112, 5, 6, 111, 1, 113, 114, 115,
6455 116, 117, 111, 111, 111, 1, 113, 118,
6456 115, 119, 120, 1, 113, 118, 115, 33,
6457 119, 120, 1, 113, 33, 114, 115, 116,
6458 117, 111, 111, 1, 113, 36, 114, 115,
6459 116, 117, 111, 111, 1, 121, 114, 115,
6460 116, 117, 111, 111, 111, 1, 33, 113,
6461 118, 115, 34, 119, 120, 1, 113, 123,
6462 115, 124, 125, 122, 122, 122, 1, 5,
6463 5, 5, 5, 6, 111, 1, 4, 4,
6464 4, 4, 4, 4, 1, 66, 66, 66,
6465 66, 66, 68, 67, 67, 1, 81, 81,
6466 81, 81, 81, 62, 63, 63, 1, 81,
6467 81, 81, 81, 81, 62, 63, 63, 1,
6468 126, 126, 126, 126, 126, 4, 1, 127,
6469 127, 127, 127, 127, 129, 130, 128, 1,
6470 0
6471 };
6472  
6473 static const char _VBG_trans_targs[] = {
6474 2, 0, 3, 41, 42, 42, 44, 42,
6475 42, 44, 44, 51, 52, 13, 15, 42,
6476 42, 68, 69, 23, 25, 77, 78, 83,
6477 84, 42, 80, 29, 82, 31, 33, 42,
6478 32, 87, 88, 37, 39, 4, 43, 46,
6479 47, 48, 49, 53, 55, 56, 58, 60,
6480 61, 19, 62, 63, 64, 75, 76, 95,
6481 96, 97, 98, 99, 100, 5, 45, 42,
6482 42, 6, 7, 42, 45, 8, 50, 9,
6483 10, 11, 12, 14, 16, 54, 42, 57,
6484 59, 17, 18, 65, 66, 67, 74, 20,
6485 70, 22, 71, 72, 21, 24, 26, 73,
6486 67, 70, 71, 72, 45, 27, 85, 94,
6487 42, 42, 79, 28, 81, 30, 42, 86,
6488 93, 34, 89, 36, 90, 91, 35, 38,
6489 40, 92, 86, 89, 90, 91, 65, 65,
6490 42, 42, 45
6491 };
6492  
6493 static const char _VBG_trans_actions[] = {
6494 0, 0, 0, 29, 23, 15, 15, 3,
6495 46, 46, 40, 0, 0, 0, 0, 5,
6496 34, 0, 0, 0, 0, 15, 15, 15,
6497 15, 11, 11, 0, 11, 0, 0, 9,
6498 0, 0, 0, 0, 0, 0, 0, 0,
6499 0, 0, 0, 0, 0, 0, 0, 0,
6500 0, 0, 0, 0, 0, 0, 0, 21,
6501 0, 0, 0, 23, 0, 0, 19, 19,
6502 7, 0, 0, 49, 49, 0, 49, 0,
6503 0, 0, 0, 0, 0, 19, 17, 19,
6504 49, 0, 0, 27, 27, 0, 0, 0,
6505 0, 0, 0, 0, 0, 0, 0, 0,
6506 25, 25, 25, 25, 56, 0, 9, 9,
6507 13, 43, 43, 0, 9, 0, 37, 0,
6508 0, 0, 0, 0, 0, 0, 0, 0,
6509 0, 0, 7, 7, 7, 7, 23, 1,
6510 31, 1, 52
6511 };
6512  
6513 static const char _VBG_eof_actions[] = {
6514 0, 0, 0, 0, 0, 0, 0, 0,
6515 0, 0, 0, 0, 0, 0, 0, 0,
6516 0, 0, 0, 0, 0, 0, 0, 0,
6517 0, 0, 0, 0, 0, 0, 0, 0,
6518 0, 0, 0, 0, 0, 0, 0, 0,
6519 0, 0, 0, 3, 0, 0, 3, 3,
6520 3, 3, 0, 3, 3, 3, 0, 3,
6521 3, 0, 3, 0, 3, 3, 3, 3,
6522 3, 0, 0, 25, 25, 25, 25, 25,
6523 25, 25, 25, 3, 3, 0, 0, 0,
6524 0, 0, 0, 0, 0, 0, 7, 7,
6525 7, 7, 7, 7, 7, 7, 0, 0,
6526 3, 3, 3, 0, 3
6527 };
6528  
6529 static const int VBG_start = 1;
6530  
6531 0 void english_morpho_guesser::add_VBG(const string& form, vector<tagged_lemma>& lemmas) const {
6532 0 const char* p = form.c_str(); int cs;
6533 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
6534
6535 {
6536 0 cs = VBG_start;
6537 }
6538  
6539 {
6540 int _klen;
6541 unsigned int _trans;
6542 const char *_acts;
6543 unsigned int _nacts;
6544 const char *_keys;
6545  
6546 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
6547 0 goto _test_eof;
6548 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
6549 0 goto _out;
6550 0 _resume:
6551 0 _keys = _VBG_trans_keys + _VBG_key_offsets[cs];
6552 0 _trans = _VBG_index_offsets[cs];
6553  
6554 0 _klen = _VBG_single_lengths[cs];
6555 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
6556 0 const char *_lower = _keys;
6557 const char *_mid;
6558 0 const char *_upper = _keys + _klen - 1;
6559 while (1) {
6560 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
6561 0 break;
6562  
6563 0 _mid = _lower + ((_upper-_lower) >> 1);
6564 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid ) 0 0 0
6565 0 _upper = _mid - 1;
6566 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid ) 0 0 0
6567 0 _lower = _mid + 1;
6568 else {
6569 0 _trans += (unsigned int)(_mid - _keys);
6570 0 goto _match;
6571 }
6572 }
6573 0 _keys += _klen;
6574 0 _trans += _klen;
6575 }
6576  
6577 0 _klen = _VBG_range_lengths[cs];
6578 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
6579 0 const char *_lower = _keys;
6580 const char *_mid;
6581 0 const char *_upper = _keys + (_klen<<1) - 2;
6582 while (1) {
6583 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
6584 0 break;
6585  
6586 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
6587 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] ) 0 0 0
6588 0 _upper = _mid - 2;
6589 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] ) 0 0 0
6590 0 _lower = _mid + 2;
6591 else {
6592 0 _trans += (unsigned int)((_mid - _keys)>>1);
6593 0 goto _match;
6594 }
6595 }
6596 0 _trans += _klen;
6597 }
6598  
6599 0 _match:
6600 0 _trans = _VBG_indicies[_trans];
6601 0 cs = _VBG_trans_targs[_trans];
6602  
6603 0 ▶ if ( _VBG_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _VBG_trans_actions[_trans] == 0 ) 0 0 0
6604 0 goto _again;
6605  
6606 0 _acts = _VBG_actions + _VBG_trans_actions[_trans];
6607 0 _nacts = (unsigned int) *_acts++;
6608 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
6609 {
6610 0 switch ( *_acts++ )
6611 {
6612 0 case 0:
6613 0 ▶ { if (best > 'a') best = 'a', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 3, append = nullptr; } 0 0 0
6614 0 break;
6615 0 case 1:
6616 0 ▶ { if (best > 'b') best = 'b', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 3, append = "e"; } 0 0 0
6617 0 break;
6618 0 case 2:
6619 0 ▶ { if (best > 'c') best = 'c', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 3, append = nullptr; } 0 0 0
6620 0 break;
6621 0 case 3:
6622 0 ▶ { if (best > 'd') best = 'd', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 3, append = "e"; } 0 0 0
6623 0 break;
6624 0 case 4:
6625 0 ▶ { if (best > 'e') best = 'e', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 3, append = nullptr; } 0 0 0
6626 0 break;
6627 0 case 5:
6628 0 ▶ { if (best > 'f') best = 'f', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 3, append = "e"; } 0 0 0
6629 0 break;
6630 0 case 6:
6631 0 ▶ { if (best > 'g') best = 'g', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'g') best = 'g', remove = 3, append = nullptr; } 0 0 0
6632 0 break;
6633 0 case 7:
6634 0 ▶ { if (best > 'h') best = 'h', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'h') best = 'h', remove = 3, append = "e"; } 0 0 0
6635 0 break;
6636 0 case 8:
6637 0 ▶ { if (best > 'i') best = 'i', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'i') best = 'i', remove = 3, append = nullptr; } 0 0 0
6638 0 break;
6639 0 case 9:
6640 0 ▶ { if (best > 'j') best = 'j', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'j') best = 'j', remove = 3, append = "e"; } 0 0 0
6641 0 break;
6642 0 case 10:
6643 0 ▶ { if (best > 'k') best = 'k', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'k') best = 'k', remove = 3, append = nullptr; } 0 0 0
6644 0 break;
6645 0 case 11:
6646 0 ▶ { if (best > 'l') best = 'l', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'l') best = 'l', remove = 3, append = "e"; } 0 0 0
6647 0 break;
6648 0 case 12:
6649 0 ▶ { if (best > 'm') best = 'm', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'm') best = 'm', remove = 3, append = nullptr; } 0 0 0
6650 0 break;
6651 0 case 13:
6652 0 ▶ { if (best > 'n') best = 'n', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'n') best = 'n', remove = 3, append = "e"; } 0 0 0
6653 0 break;
6654 0 case 14:
6655 0 ▶ { if (best > 'o') best = 'o', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'o') best = 'o', remove = 3, append = nullptr; } 0 0 0
6656 0 break;
6657 0 case 15:
6658 0 ▶ { if (best > 'p') best = 'p', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'p') best = 'p', remove = 3, append = "e"; } 0 0 0
6659 0 break;
6660 0 case 16:
6661 0 ▶ { if (best > 'q') best = 'q', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'q') best = 'q', remove = 3, append = nullptr; } 0 0 0
6662 0 break;
6663 0 case 17:
6664 0 ▶ { if (best > 'r') best = 'r', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'r') best = 'r', remove = 3, append = "e"; } 0 0 0
6665 0 break;
6666 }
6667 }
6668  
6669 0 _again:
6670 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
6671 0 goto _out;
6672 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
6673 0 goto _resume;
6674 0 _test_eof: {}
6675 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
6676 {
6677 0 const char *__acts = _VBG_actions + _VBG_eof_actions[cs];
6678 0 unsigned int __nacts = (unsigned int) *__acts++;
6679 0 ▶ while ( __nacts-- > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
while ( __nacts-- > 0 ) { 0 0 0
6680 0 switch ( *__acts++ ) {
6681 0 case 2:
6682 0 ▶ { if (best > 'c') best = 'c', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 3, append = nullptr; } 0 0 0
6683 0 break;
6684 0 case 5:
6685 0 ▶ { if (best > 'f') best = 'f', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 3, append = "e"; } 0 0 0
6686 0 break;
6687 0 case 15:
6688 0 ▶ { if (best > 'p') best = 'p', remove = 3, append = "e"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'p') best = 'p', remove = 3, append = "e"; } 0 0 0
6689 0 break;
6690 }
6691 }
6692 }
6693  
6694 0 _out: {}
6695 }
6696  
6697 0 ▶ add(VBG, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(VBG, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBG, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBG, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBG, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
6698 0 }
6699  
6700 static const char _VBD_VBN_actions[] = {
6701 0, 1, 0, 1, 2, 1, 3, 1,
6702 4, 1, 5, 1, 6, 1, 7, 1,
6703 8, 1, 9, 1, 10, 1, 11, 1,
6704 13, 1, 14, 1, 15, 1, 16, 1,
6705 17, 2, 1, 16, 2, 4, 5, 2,
6706 8, 16, 2, 9, 13, 2, 9, 14,
6707 2, 12, 13, 2, 13, 14, 2, 15,
6708 16, 3, 1, 3, 16, 3, 3, 15,
6709 16
6710 };
6711  
6712 static const short _VBD_VBN_key_offsets[] = {
6713 0, 0, 2, 3, 9, 14, 24, 29,
6714 34, 44, 46, 47, 48, 49, 50, 51,
6715 52, 60, 67, 74, 76, 77, 78, 79,
6716 80, 81, 82, 87, 95, 96, 97, 98,
6717 99, 100, 102, 103, 104, 105, 106, 107,
6718 108, 114, 115, 140, 140, 149, 150, 155,
6719 166, 175, 184, 194, 199, 204, 210, 220,
6720 220, 229, 241, 242, 253, 253, 262, 271,
6721 280, 289, 298, 303, 316, 327, 332, 338,
6722 348, 358, 369, 376, 387, 396, 405, 405,
6723 416, 427, 429, 430, 431, 431, 432, 440,
6724 451, 456, 462, 472, 482, 493, 500, 511,
6725 518, 524, 533, 542, 551
6726 };
6727  
6728 static const char _VBD_VBN_trans_keys[] = {
6729 100, 110, 101, 97, 101, 105, 111, 117,
6730 121, 97, 101, 105, 111, 117, 98, 100,
6731 102, 104, 106, 110, 112, 116, 118, 122,
6732 97, 101, 105, 111, 117, 97, 101, 105,
6733 111, 117, 98, 100, 102, 104, 106, 110,
6734 112, 116, 118, 122, 98, 114, 105, 114,
6735 112, 105, 109, 101, 97, 101, 105, 111,
6736 117, 121, 98, 122, 97, 101, 105, 111,
6737 117, 98, 122, 97, 101, 105, 111, 117,
6738 98, 122, 98, 114, 105, 114, 112, 105,
6739 109, 101, 97, 101, 105, 111, 117, 97,
6740 101, 105, 110, 111, 115, 117, 120, 105,
6741 112, 105, 109, 101, 98, 114, 105, 114,
6742 112, 105, 109, 101, 97, 101, 105, 111,
6743 117, 121, 101, 98, 99, 100, 102, 103,
6744 104, 105, 106, 107, 108, 109, 110, 112,
6745 113, 114, 115, 116, 117, 118, 119, 120,
6746 121, 122, 97, 111, 97, 98, 101, 105,
6747 111, 117, 122, 99, 120, 113, 97, 101,
6748 105, 111, 117, 98, 99, 100, 105, 111,
6749 117, 122, 97, 101, 102, 120, 97, 100,
6750 101, 105, 111, 117, 122, 98, 120, 97,
6751 101, 102, 105, 111, 117, 122, 98, 120,
6752 97, 101, 103, 105, 110, 111, 117, 122,
6753 98, 120, 97, 101, 105, 111, 117, 101,
6754 110, 111, 115, 120, 101, 110, 111, 112,
6755 115, 120, 97, 101, 104, 105, 111, 116,
6756 117, 122, 98, 120, 97, 101, 105, 106,
6757 111, 117, 122, 98, 120, 98, 99, 100,
6758 105, 107, 111, 117, 122, 97, 101, 102,
6759 120, 105, 97, 101, 105, 108, 111, 114,
6760 117, 119, 122, 98, 120, 97, 101, 105,
6761 109, 111, 117, 122, 98, 120, 97, 101,
6762 105, 110, 111, 117, 122, 98, 120, 97,
6763 101, 105, 111, 112, 117, 122, 98, 120,
6764 97, 101, 105, 111, 113, 117, 122, 98,
6765 120, 97, 101, 105, 111, 114, 117, 122,
6766 98, 120, 97, 101, 105, 111, 117, 98,
6767 99, 100, 105, 108, 110, 111, 116, 117,
6768 97, 101, 102, 122, 101, 110, 111, 115,
6769 120, 98, 104, 106, 116, 118, 122, 101,
6770 110, 111, 115, 120, 101, 110, 111, 112,
6771 115, 120, 101, 105, 110, 111, 115, 120,
6772 98, 116, 118, 122, 101, 105, 110, 111,
6773 115, 120, 98, 116, 118, 122, 101, 110,
6774 111, 115, 120, 98, 104, 106, 116, 118,
6775 122, 98, 101, 110, 111, 114, 115, 120,
6776 101, 110, 111, 115, 120, 98, 104, 106,
6777 116, 118, 122, 97, 101, 105, 111, 115,
6778 117, 122, 98, 120, 97, 101, 105, 111,
6779 116, 117, 122, 98, 120, 122, 98, 100,
6780 102, 104, 106, 110, 112, 116, 118, 120,
6781 122, 98, 100, 102, 104, 106, 110, 112,
6782 116, 118, 120, 98, 114, 112, 114, 113,
6783 97, 101, 105, 108, 111, 117, 98, 122,
6784 101, 110, 111, 115, 120, 98, 104, 106,
6785 116, 118, 122, 101, 110, 111, 115, 120,
6786 101, 110, 111, 112, 115, 120, 101, 105,
6787 110, 111, 115, 120, 98, 116, 118, 122,
6788 101, 105, 110, 111, 115, 120, 98, 116,
6789 118, 122, 101, 110, 111, 115, 120, 98,
6790 104, 106, 116, 118, 122, 98, 101, 110,
6791 111, 114, 115, 120, 101, 110, 111, 115,
6792 120, 98, 104, 106, 116, 118, 122, 97,
6793 101, 105, 111, 117, 98, 122, 97, 101,
6794 105, 111, 117, 121, 97, 101, 105, 111,
6795 117, 118, 122, 98, 120, 97, 101, 105,
6796 111, 117, 119, 122, 98, 120, 97, 101,
6797 105, 111, 117, 120, 122, 98, 119, 97,
6798 101, 105, 111, 117, 121, 122, 98, 120,
6799 0
6800 };
6801  
6802 static const char _VBD_VBN_single_lengths[] = {
6803 0, 2, 1, 6, 5, 0, 5, 5,
6804 0, 2, 1, 1, 1, 1, 1, 1,
6805 6, 5, 5, 2, 1, 1, 1, 1,
6806 1, 1, 5, 8, 1, 1, 1, 1,
6807 1, 2, 1, 1, 1, 1, 1, 1,
6808 6, 1, 23, 0, 7, 1, 5, 7,
6809 7, 7, 8, 5, 5, 6, 8, 0,
6810 7, 8, 1, 9, 0, 7, 7, 7,
6811 7, 7, 5, 9, 5, 5, 6, 6,
6812 6, 5, 7, 5, 7, 7, 0, 1,
6813 1, 2, 1, 1, 0, 1, 6, 5,
6814 5, 6, 6, 6, 5, 7, 5, 5,
6815 6, 7, 7, 7, 7
6816 };
6817  
6818 static const char _VBD_VBN_range_lengths[] = {
6819 0, 0, 0, 0, 0, 5, 0, 0,
6820 5, 0, 0, 0, 0, 0, 0, 0,
6821 1, 1, 1, 0, 0, 0, 0, 0,
6822 0, 0, 0, 0, 0, 0, 0, 0,
6823 0, 0, 0, 0, 0, 0, 0, 0,
6824 0, 0, 1, 0, 1, 0, 0, 2,
6825 1, 1, 1, 0, 0, 0, 1, 0,
6826 1, 2, 0, 1, 0, 1, 1, 1,
6827 1, 1, 0, 2, 3, 0, 0, 2,
6828 2, 3, 0, 3, 1, 1, 0, 5,
6829 5, 0, 0, 0, 0, 0, 1, 3,
6830 0, 0, 2, 2, 3, 0, 3, 1,
6831 0, 1, 1, 1, 1
6832 };
6833  
6834 static const short _VBD_VBN_index_offsets[] = {
6835 0, 0, 3, 5, 12, 18, 24, 30,
6836 36, 42, 45, 47, 49, 51, 53, 55,
6837 57, 65, 72, 79, 82, 84, 86, 88,
6838 90, 92, 94, 100, 109, 111, 113, 115,
6839 117, 119, 122, 124, 126, 128, 130, 132,
6840 134, 141, 143, 168, 169, 178, 180, 186,
6841 196, 205, 214, 224, 230, 236, 243, 253,
6842 254, 263, 274, 276, 287, 288, 297, 306,
6843 315, 324, 333, 339, 351, 360, 366, 373,
6844 382, 391, 400, 408, 417, 426, 435, 436,
6845 443, 450, 453, 455, 457, 458, 460, 468,
6846 477, 483, 490, 499, 508, 517, 525, 534,
6847 541, 548, 557, 566, 575
6848 };
6849  
6850 static const unsigned char _VBD_VBN_indicies[] = {
6851 0, 2, 1, 3, 1, 4, 4, 4,
6852 4, 4, 4, 1, 5, 5, 5, 5,
6853 6, 1, 7, 7, 7, 7, 7, 1,
6854 8, 8, 8, 8, 9, 1, 5, 5,
6855 5, 5, 10, 1, 11, 11, 11, 11,
6856 11, 1, 11, 12, 1, 11, 1, 13,
6857 1, 11, 1, 14, 1, 11, 1, 11,
6858 1, 4, 4, 4, 4, 4, 16, 15,
6859 1, 5, 5, 5, 5, 6, 17, 1,
6860 5, 5, 5, 5, 6, 18, 1, 19,
6861 20, 1, 19, 1, 21, 1, 19, 1,
6862 22, 1, 19, 1, 19, 1, 23, 24,
6863 23, 25, 26, 1, 27, 28, 27, 29,
6864 30, 31, 27, 32, 1, 33, 1, 33,
6865 1, 34, 1, 33, 1, 33, 1, 35,
6866 36, 1, 35, 1, 37, 1, 35, 1,
6867 38, 1, 35, 1, 35, 1, 39, 39,
6868 39, 39, 39, 4, 1, 40, 1, 42,
6869 43, 44, 45, 46, 47, 48, 49, 50,
6870 51, 52, 53, 54, 55, 56, 57, 58,
6871 59, 60, 61, 62, 63, 64, 41, 1,
6872 1, 65, 66, 65, 65, 65, 65, 4,
6873 4, 1, 67, 1, 68, 68, 68, 68,
6874 68, 1, 70, 71, 70, 69, 69, 69,
6875 70, 69, 70, 1, 72, 66, 72, 72,
6876 72, 72, 4, 4, 1, 65, 65, 66,
6877 65, 65, 65, 4, 4, 1, 69, 69,
6878 71, 69, 73, 69, 69, 70, 70, 1,
6879 74, 74, 74, 74, 74, 1, 75, 76,
6880 77, 78, 79, 1, 75, 76, 77, 11,
6881 78, 79, 1, 65, 65, 66, 65, 65,
6882 80, 65, 4, 4, 1, 81, 65, 65,
6883 65, 66, 65, 65, 4, 4, 1, 4,
6884 82, 4, 65, 66, 65, 65, 4, 65,
6885 4, 1, 7, 1, 65, 65, 65, 71,
6886 65, 83, 65, 83, 70, 70, 1, 5,
6887 65, 65, 65, 66, 65, 65, 4, 4,
6888 1, 84, 84, 85, 66, 84, 84, 4,
6889 4, 1, 84, 84, 84, 84, 66, 84,
6890 4, 4, 1, 65, 65, 65, 65, 66,
6891 65, 4, 4, 1, 65, 86, 65, 87,
6892 66, 65, 4, 4, 1, 5, 5, 5,
6893 5, 6, 1, 88, 89, 88, 5, 89,
6894 89, 5, 89, 6, 5, 88, 1, 90,
6895 91, 92, 93, 94, 88, 88, 88, 1,
6896 90, 95, 92, 96, 97, 1, 90, 95,
6897 92, 19, 96, 97, 1, 90, 19, 91,
6898 92, 93, 94, 88, 88, 1, 90, 22,
6899 91, 92, 93, 94, 88, 88, 1, 98,
6900 91, 92, 93, 94, 88, 88, 88, 1,
6901 19, 90, 95, 92, 20, 96, 97, 1,
6902 90, 100, 92, 101, 102, 99, 99, 99,
6903 1, 69, 69, 69, 69, 103, 69, 70,
6904 70, 1, 104, 105, 106, 65, 66, 65,
6905 4, 4, 1, 107, 109, 109, 109, 109,
6906 109, 109, 108, 110, 110, 110, 110, 110,
6907 110, 1, 33, 111, 1, 33, 1, 112,
6908 1, 108, 113, 107, 5, 5, 5, 115,
6909 5, 6, 114, 1, 116, 117, 118, 119,
6910 120, 114, 114, 114, 1, 116, 121, 118,
6911 122, 123, 1, 116, 121, 118, 35, 122,
6912 123, 1, 116, 35, 117, 118, 119, 120,
6913 114, 114, 1, 116, 38, 117, 118, 119,
6914 120, 114, 114, 1, 124, 117, 118, 119,
6915 120, 114, 114, 114, 1, 35, 116, 121,
6916 118, 36, 122, 123, 1, 116, 126, 118,
6917 127, 128, 125, 125, 125, 1, 5, 5,
6918 5, 5, 6, 114, 1, 4, 4, 4,
6919 4, 4, 4, 1, 69, 69, 69, 69,
6920 69, 71, 70, 70, 1, 84, 84, 84,
6921 84, 84, 66, 4, 4, 1, 84, 84,
6922 84, 84, 84, 66, 4, 4, 1, 129,
6923 129, 129, 129, 129, 131, 132, 130, 1,
6924 0
6925 };
6926  
6927 static const char _VBD_VBN_trans_targs[] = {
6928 2, 0, 41, 42, 43, 43, 45, 43,
6929 43, 45, 45, 52, 53, 12, 14, 43,
6930 43, 43, 43, 69, 70, 22, 24, 78,
6931 79, 84, 85, 43, 81, 28, 83, 30,
6932 32, 43, 31, 88, 89, 36, 38, 66,
6933 43, 3, 44, 47, 48, 49, 50, 54,
6934 16, 56, 57, 59, 61, 62, 63, 64,
6935 65, 76, 77, 96, 97, 98, 99, 40,
6936 100, 4, 46, 43, 5, 6, 43, 46,
6937 7, 51, 8, 9, 10, 11, 13, 15,
6938 55, 43, 58, 60, 17, 18, 66, 67,
6939 68, 75, 19, 71, 21, 72, 73, 20,
6940 23, 25, 74, 68, 71, 72, 73, 46,
6941 26, 86, 95, 43, 43, 80, 27, 82,
6942 29, 43, 87, 94, 33, 90, 35, 91,
6943 92, 34, 37, 39, 93, 87, 90, 91,
6944 92, 66, 43, 43, 46
6945 };
6946  
6947 static const char _VBD_VBN_trans_actions[] = {
6948 0, 0, 0, 31, 29, 25, 25, 5,
6949 51, 51, 45, 0, 0, 0, 0, 15,
6950 39, 9, 36, 0, 0, 0, 0, 25,
6951 25, 25, 25, 21, 21, 0, 21, 0,
6952 0, 19, 0, 0, 0, 0, 0, 29,
6953 1, 0, 0, 0, 0, 0, 0, 0,
6954 0, 0, 0, 0, 0, 0, 0, 0,
6955 0, 0, 0, 27, 0, 0, 0, 0,
6956 0, 0, 29, 17, 0, 0, 54, 54,
6957 0, 54, 0, 0, 0, 0, 0, 0,
6958 29, 27, 29, 54, 0, 0, 13, 13,
6959 0, 0, 0, 0, 0, 0, 0, 0,
6960 0, 0, 0, 7, 7, 7, 7, 61,
6961 0, 19, 19, 23, 48, 48, 0, 19,
6962 0, 42, 0, 0, 0, 0, 0, 0,
6963 0, 0, 0, 0, 0, 17, 17, 17,
6964 17, 3, 33, 3, 57
6965 };
6966  
6967 static const char _VBD_VBN_eof_actions[] = {
6968 0, 0, 0, 0, 0, 0, 0, 0,
6969 0, 0, 0, 0, 0, 0, 0, 0,
6970 0, 0, 0, 0, 0, 0, 0, 0,
6971 0, 0, 0, 0, 0, 0, 0, 0,
6972 0, 0, 0, 0, 0, 0, 0, 0,
6973 0, 0, 0, 0, 5, 0, 0, 5,
6974 5, 5, 5, 0, 5, 5, 5, 0,
6975 5, 5, 0, 5, 0, 5, 5, 5,
6976 5, 5, 0, 0, 11, 11, 11, 11,
6977 11, 11, 11, 11, 5, 5, 0, 0,
6978 0, 0, 0, 0, 0, 0, 0, 17,
6979 17, 17, 17, 17, 17, 17, 17, 0,
6980 0, 5, 5, 5, 5
6981 };
6982  
6983 static const int VBD_VBN_start = 1;
6984  
6985 0 void english_morpho_guesser::add_VBD_VBN(const string& form, vector<tagged_lemma>& lemmas) const {
6986 0 const char* p = form.c_str(); int cs;
6987 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
6988
6989 {
6990 0 cs = VBD_VBN_start;
6991 }
6992  
6993 {
6994 int _klen;
6995 unsigned int _trans;
6996 const char *_acts;
6997 unsigned int _nacts;
6998 const char *_keys;
6999  
7000 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
7001 0 goto _test_eof;
7002 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7003 0 goto _out;
7004 0 _resume:
7005 0 _keys = _VBD_VBN_trans_keys + _VBD_VBN_key_offsets[cs];
7006 0 _trans = _VBD_VBN_index_offsets[cs];
7007  
7008 0 _klen = _VBD_VBN_single_lengths[cs];
7009 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7010 0 const char *_lower = _keys;
7011 const char *_mid;
7012 0 const char *_upper = _keys + _klen - 1;
7013 while (1) {
7014 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7015 0 break;
7016  
7017 0 _mid = _lower + ((_upper-_lower) >> 1);
7018 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid ) 0 0 0
7019 0 _upper = _mid - 1;
7020 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid ) 0 0 0
7021 0 _lower = _mid + 1;
7022 else {
7023 0 _trans += (unsigned int)(_mid - _keys);
7024 0 goto _match;
7025 }
7026 }
7027 0 _keys += _klen;
7028 0 _trans += _klen;
7029 }
7030  
7031 0 _klen = _VBD_VBN_range_lengths[cs];
7032 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7033 0 const char *_lower = _keys;
7034 const char *_mid;
7035 0 const char *_upper = _keys + (_klen<<1) - 2;
7036 while (1) {
7037 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7038 0 break;
7039  
7040 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
7041 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] ) 0 0 0
7042 0 _upper = _mid - 2;
7043 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] ) 0 0 0
7044 0 _lower = _mid + 2;
7045 else {
7046 0 _trans += (unsigned int)((_mid - _keys)>>1);
7047 0 goto _match;
7048 }
7049 }
7050 0 _trans += _klen;
7051 }
7052  
7053 0 _match:
7054 0 _trans = _VBD_VBN_indicies[_trans];
7055 0 cs = _VBD_VBN_trans_targs[_trans];
7056  
7057 0 ▶ if ( _VBD_VBN_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _VBD_VBN_trans_actions[_trans] == 0 ) 0 0 0
7058 0 goto _again;
7059  
7060 0 _acts = _VBD_VBN_actions + _VBD_VBN_trans_actions[_trans];
7061 0 _nacts = (unsigned int) *_acts++;
7062 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
7063 {
7064 0 switch ( *_acts++ )
7065 {
7066 0 case 0:
7067 0 ▶ { if (best > 'a') best = 'a', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 1, append = nullptr; } 0 0 0
7068 0 break;
7069 0 case 1:
7070 0 ▶ { if (best > 'b') best = 'b', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 2, append = nullptr; } 0 0 0
7071 0 break;
7072 0 case 2:
7073 0 ▶ { if (best > 'c') best = 'c', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 1, append = nullptr; } 0 0 0
7074 0 break;
7075 0 case 3:
7076 0 ▶ { if (best > 'd') best = 'd', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 2, append = nullptr; } 0 0 0
7077 0 break;
7078 0 case 4:
7079 0 ▶ { if (best > 'e') best = 'e', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 1, append = nullptr; } 0 0 0
7080 0 break;
7081 0 case 5:
7082 0 ▶ { if (best > 'f') best = 'f', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 2, append = nullptr; } 0 0 0
7083 0 break;
7084 0 case 7:
7085 0 ▶ { if (best > 'h') best = 'h', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'h') best = 'h', remove = 2, append = nullptr; } 0 0 0
7086 0 break;
7087 0 case 8:
7088 0 ▶ { if (best > 'i') best = 'i', remove = 3, append = "y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'i') best = 'i', remove = 3, append = "y"; } 0 0 0
7089 0 break;
7090 0 case 9:
7091 0 ▶ { if (best > 'j') best = 'j', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'j') best = 'j', remove = 1, append = nullptr; } 0 0 0
7092 0 break;
7093 0 case 10:
7094 0 ▶ { if (best > 'k') best = 'k', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'k') best = 'k', remove = 2, append = nullptr; } 0 0 0
7095 0 break;
7096 0 case 11:
7097 0 ▶ { if (best > 'l') best = 'l', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'l') best = 'l', remove = 1, append = nullptr; } 0 0 0
7098 0 break;
7099 0 case 12:
7100 0 ▶ { if (best > 'm') best = 'm', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'm') best = 'm', remove = 2, append = nullptr; } 0 0 0
7101 0 break;
7102 0 case 13:
7103 0 ▶ { if (best > 'n') best = 'n', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'n') best = 'n', remove = 1, append = nullptr; } 0 0 0
7104 0 break;
7105 0 case 14:
7106 0 ▶ { if (best > 'o') best = 'o', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'o') best = 'o', remove = 2, append = nullptr; } 0 0 0
7107 0 break;
7108 0 case 15:
7109 0 ▶ { if (best > 'p') best = 'p', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'p') best = 'p', remove = 1, append = nullptr; } 0 0 0
7110 0 break;
7111 0 case 16:
7112 0 ▶ { if (best > 'q') best = 'q', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'q') best = 'q', remove = 2, append = nullptr; } 0 0 0
7113 0 break;
7114 0 case 17:
7115 0 ▶ { if (best > 'r') best = 'r', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'r') best = 'r', remove = 1, append = nullptr; } 0 0 0
7116 0 break;
7117 }
7118 }
7119  
7120 0 _again:
7121 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7122 0 goto _out;
7123 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
7124 0 goto _resume;
7125 0 _test_eof: {}
7126 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
7127 {
7128 0 const char *__acts = _VBD_VBN_actions + _VBD_VBN_eof_actions[cs];
7129 0 unsigned int __nacts = (unsigned int) *__acts++;
7130 0 ▶ while ( __nacts-- > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
while ( __nacts-- > 0 ) { 0 0 0
7131 0 switch ( *__acts++ ) {
7132 0 case 3:
7133 0 ▶ { if (best > 'd') best = 'd', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 2, append = nullptr; } 0 0 0
7134 0 break;
7135 0 case 6:
7136 0 ▶ { if (best > 'g') best = 'g', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'g') best = 'g', remove = 1, append = nullptr; } 0 0 0
7137 0 break;
7138 0 case 9:
7139 0 ▶ { if (best > 'j') best = 'j', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'j') best = 'j', remove = 1, append = nullptr; } 0 0 0
7140 0 break;
7141 }
7142 }
7143 }
7144  
7145 0 _out: {}
7146 }
7147  
7148 0 ▶ add(VBD, VBN, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(VBD, VBN, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBD, VBN, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBD, VBN, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBD, VBN, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
7149 0 }
7150  
7151 static const char _VBZ_actions[] = {
7152 0, 1, 0, 1, 1, 1, 2, 1,
7153 3, 1, 4, 1, 5, 1, 6, 1,
7154 7, 1, 8
7155 };
7156  
7157 static const char _VBZ_key_offsets[] = {
7158 0, 0, 1, 2, 4, 14, 14, 25,
7159 26, 31, 31, 31, 31, 37, 45, 54
7160 };
7161  
7162 static const char _VBZ_trans_keys[] = {
7163 115, 101, 99, 115, 98, 100, 102, 104,
7164 106, 110, 112, 116, 118, 122, 122, 98,
7165 100, 102, 104, 106, 110, 112, 116, 118,
7166 120, 111, 97, 101, 105, 111, 117, 104,
7167 105, 111, 115, 120, 122, 97, 101, 105,
7168 110, 111, 114, 115, 117, 97, 101, 105,
7169 111, 117, 121, 122, 98, 120, 0
7170 };
7171  
7172 static const char _VBZ_single_lengths[] = {
7173 0, 1, 1, 2, 0, 0, 1, 1,
7174 5, 0, 0, 0, 6, 8, 7, 0
7175 };
7176  
7177 static const char _VBZ_range_lengths[] = {
7178 0, 0, 0, 0, 5, 0, 5, 0,
7179 0, 0, 0, 0, 0, 0, 1, 0
7180 };
7181  
7182 static const char _VBZ_index_offsets[] = {
7183 0, 0, 2, 4, 7, 13, 14, 21,
7184 23, 29, 30, 31, 32, 39, 48, 57
7185 };
7186  
7187 static const char _VBZ_indicies[] = {
7188 0, 1, 3, 2, 4, 4, 1, 5,
7189 5, 5, 5, 5, 1, 6, 7, 7,
7190 7, 7, 7, 7, 1, 8, 1, 9,
7191 9, 9, 9, 9, 1, 8, 10, 1,
7192 11, 12, 13, 14, 4, 15, 1, 16,
7193 16, 16, 17, 16, 18, 19, 16, 1,
7194 20, 20, 20, 20, 20, 20, 22, 21,
7195 1, 10, 0
7196 };
7197  
7198 static const char _VBZ_trans_targs[] = {
7199 2, 0, 11, 12, 11, 5, 11, 11,
7200 11, 9, 11, 3, 4, 6, 13, 14,
7201 11, 7, 8, 11, 11, 10, 15
7202 };
7203  
7204 static const char _VBZ_trans_actions[] = {
7205 0, 0, 17, 17, 11, 0, 13, 15,
7206 9, 0, 3, 0, 0, 0, 11, 11,
7207 1, 0, 0, 7, 5, 0, 7
7208 };
7209  
7210 static const int VBZ_start = 1;
7211  
7212 0 void english_morpho_guesser::add_VBZ(const string& form, vector<tagged_lemma>& lemmas) const {
7213 0 const char* p = form.c_str(); int cs;
7214 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
7215
7216 {
7217 0 cs = VBZ_start;
7218 }
7219  
7220 {
7221 int _klen;
7222 unsigned int _trans;
7223 const char *_acts;
7224 unsigned int _nacts;
7225 const char *_keys;
7226  
7227 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
7228 0 goto _test_eof;
7229 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7230 0 goto _out;
7231 0 _resume:
7232 0 _keys = _VBZ_trans_keys + _VBZ_key_offsets[cs];
7233 0 _trans = _VBZ_index_offsets[cs];
7234  
7235 0 _klen = _VBZ_single_lengths[cs];
7236 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7237 0 const char *_lower = _keys;
7238 const char *_mid;
7239 0 const char *_upper = _keys + _klen - 1;
7240 while (1) {
7241 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7242 0 break;
7243  
7244 0 _mid = _lower + ((_upper-_lower) >> 1);
7245 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < *_mid ) 0 0 0
7246 0 _upper = _mid - 1;
7247 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > *_mid ) 0 0 0
7248 0 _lower = _mid + 1;
7249 else {
7250 0 _trans += (unsigned int)(_mid - _keys);
7251 0 goto _match;
7252 }
7253 }
7254 0 _keys += _klen;
7255 0 _trans += _klen;
7256 }
7257  
7258 0 _klen = _VBZ_range_lengths[cs];
7259 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7260 0 const char *_lower = _keys;
7261 const char *_mid;
7262 0 const char *_upper = _keys + (_klen<<1) - 2;
7263 while (1) {
7264 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7265 0 break;
7266  
7267 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
7268 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str())]) < _mid[0] ) 0 0 0
7269 0 _upper = _mid - 2;
7270 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str())]) > _mid[1] ) 0 0 0
7271 0 _lower = _mid + 2;
7272 else {
7273 0 _trans += (unsigned int)((_mid - _keys)>>1);
7274 0 goto _match;
7275 }
7276 }
7277 0 _trans += _klen;
7278 }
7279  
7280 0 _match:
7281 0 _trans = _VBZ_indicies[_trans];
7282 0 cs = _VBZ_trans_targs[_trans];
7283  
7284 0 ▶ if ( _VBZ_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _VBZ_trans_actions[_trans] == 0 ) 0 0 0
7285 0 goto _again;
7286  
7287 0 _acts = _VBZ_actions + _VBZ_trans_actions[_trans];
7288 0 _nacts = (unsigned int) *_acts++;
7289 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
7290 {
7291 0 switch ( *_acts++ )
7292 {
7293 0 case 0:
7294 0 ▶ { if (best > 'a') best = 'a', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 1, append = nullptr; } 0 0 0
7295 0 break;
7296 0 case 1:
7297 0 ▶ { if (best > 'b') best = 'b', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 2, append = nullptr; } 0 0 0
7298 0 break;
7299 0 case 2:
7300 0 ▶ { if (best > 'c') best = 'c', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 1, append = nullptr; } 0 0 0
7301 0 break;
7302 0 case 3:
7303 0 ▶ { if (best > 'd') best = 'd', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 2, append = nullptr; } 0 0 0
7304 0 break;
7305 0 case 4:
7306 0 ▶ { if (best > 'e') best = 'e', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 1, append = nullptr; } 0 0 0
7307 0 break;
7308 0 case 5:
7309 0 ▶ { if (best > 'f') best = 'f', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 2, append = nullptr; } 0 0 0
7310 0 break;
7311 0 case 6:
7312 0 ▶ { if (best > 'g') best = 'g', remove = 3, append = "y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'g') best = 'g', remove = 3, append = "y"; } 0 0 0
7313 0 break;
7314 0 case 7:
7315 0 ▶ { if (best > 'h') best = 'h', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'h') best = 'h', remove = 2, append = nullptr; } 0 0 0
7316 0 break;
7317 0 case 8:
7318 0 ▶ { if (best > 'i') best = 'i', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'i') best = 'i', remove = 1, append = nullptr; } 0 0 0
7319 0 break;
7320 }
7321 }
7322  
7323 0 _again:
7324 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7325 0 goto _out;
7326 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
7327 0 goto _resume;
7328 0 _test_eof: {}
7329 0 _out: {}
7330 }
7331  
7332 0 ▶ add(VBZ, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(VBZ, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBZ, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBZ, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
add(VBZ, form.substr(0, form.size() - remove).append(append ? append : ""), lemmas); 0 0 0
7333 0 }
7334  
7335 static const char _JJR_RBR_actions[] = {
7336 0, 1, 0, 1, 1, 1, 3, 1,
7337 4, 1, 5, 2, 1, 4, 2, 2,
7338 5, 2, 4, 5
7339 };
7340  
7341 static const unsigned char _JJR_RBR_key_offsets[] = {
7342 0, 0, 1, 2, 26, 26, 32, 37,
7343 50, 56, 62, 73, 79, 85, 91, 102,
7344 103, 109, 115, 117, 123, 129, 135, 146,
7345 152, 163, 169, 175, 181
7346 };
7347  
7348 static const char _JJR_RBR_trans_keys[] = {
7349 114, 101, 98, 99, 100, 101, 102, 103,
7350 104, 105, 106, 107, 108, 109, 110, 112,
7351 113, 114, 115, 116, 117, 118, 119, 120,
7352 121, 122, 97, 98, 101, 105, 111, 117,
7353 97, 101, 105, 111, 117, 98, 99, 100,
7354 105, 111, 117, 122, 97, 101, 102, 109,
7355 112, 120, 97, 100, 101, 105, 111, 117,
7356 97, 101, 102, 105, 111, 117, 97, 101,
7357 103, 105, 111, 117, 122, 98, 109, 112,
7358 120, 97, 101, 104, 105, 111, 117, 97,
7359 101, 105, 106, 111, 117, 97, 101, 105,
7360 107, 111, 117, 97, 101, 105, 108, 111,
7361 117, 122, 98, 109, 112, 120, 101, 97,
7362 101, 105, 109, 111, 117, 97, 101, 105,
7363 110, 111, 117, 97, 122, 97, 101, 105,
7364 111, 112, 117, 97, 101, 105, 111, 113,
7365 117, 97, 101, 105, 111, 114, 117, 97,
7366 101, 105, 111, 115, 117, 122, 98, 109,
7367 112, 120, 97, 101, 105, 111, 116, 117,
7368 97, 101, 105, 111, 117, 118, 122, 98,
7369 109, 112, 120, 97, 101, 105, 111, 117,
7370 119, 97, 101, 105, 111, 117, 120, 97,
7371 101, 105, 111, 117, 121, 97, 101, 105,
7372 111, 117, 122, 0
7373 };
7374  
7375 static const char _JJR_RBR_single_lengths[] = {
7376 0, 1, 1, 24, 0, 6, 5, 7,
7377 6, 6, 7, 6, 6, 6, 7, 1,
7378 6, 6, 0, 6, 6, 6, 7, 6,
7379 7, 6, 6, 6, 6
7380 };
7381  
7382 static const char _JJR_RBR_range_lengths[] = {
7383 0, 0, 0, 0, 0, 0, 0, 3,
7384 0, 0, 2, 0, 0, 0, 2, 0,
7385 0, 0, 1, 0, 0, 0, 2, 0,
7386 2, 0, 0, 0, 0
7387 };
7388  
7389 static const unsigned char _JJR_RBR_index_offsets[] = {
7390 0, 0, 2, 4, 29, 30, 37, 43,
7391 54, 61, 68, 78, 85, 92, 99, 109,
7392 111, 118, 125, 127, 134, 141, 148, 158,
7393 165, 175, 182, 189, 196
7394 };
7395  
7396 static const char _JJR_RBR_indicies[] = {
7397 0, 1, 2, 1, 4, 5, 6, 7,
7398 8, 9, 10, 11, 12, 13, 14, 15,
7399 16, 17, 18, 19, 20, 21, 7, 22,
7400 23, 24, 25, 26, 3, 1, 27, 28,
7401 27, 27, 27, 27, 1, 29, 29, 29,
7402 29, 29, 1, 30, 31, 30, 27, 27,
7403 27, 30, 27, 30, 30, 1, 27, 28,
7404 27, 27, 27, 27, 1, 27, 27, 28,
7405 27, 27, 27, 1, 27, 27, 31, 27,
7406 27, 27, 30, 30, 30, 1, 27, 27,
7407 28, 27, 27, 27, 1, 27, 27, 27,
7408 28, 27, 27, 1, 27, 27, 27, 28,
7409 27, 27, 1, 27, 27, 27, 32, 27,
7410 27, 30, 30, 30, 1, 1, 33, 27,
7411 27, 27, 28, 27, 27, 1, 34, 34,
7412 34, 28, 34, 34, 1, 29, 1, 34,
7413 34, 34, 34, 28, 34, 1, 27, 27,
7414 27, 27, 28, 27, 1, 27, 27, 27,
7415 27, 28, 27, 1, 27, 27, 27, 27,
7416 31, 27, 30, 30, 30, 1, 27, 27,
7417 27, 27, 28, 27, 1, 27, 27, 27,
7418 27, 27, 31, 30, 30, 30, 1, 34,
7419 34, 34, 34, 34, 28, 1, 34, 34,
7420 34, 34, 34, 28, 1, 27, 27, 27,
7421 27, 27, 28, 1, 27, 27, 27, 27,
7422 27, 28, 1, 0
7423 };
7424  
7425 static const char _JJR_RBR_trans_targs[] = {
7426 2, 0, 3, 4, 5, 7, 8, 4,
7427 9, 10, 11, 4, 12, 13, 14, 16,
7428 17, 19, 20, 21, 22, 23, 24, 25,
7429 26, 27, 28, 6, 4, 4, 4, 4,
7430 15, 4, 18
7431 };
7432  
7433 static const char _JJR_RBR_trans_actions[] = {
7434 0, 0, 0, 9, 9, 9, 9, 17,
7435 9, 9, 9, 14, 9, 9, 9, 9,
7436 9, 9, 9, 9, 9, 9, 9, 9,
7437 9, 9, 9, 7, 3, 5, 7, 11,
7438 11, 1, 7
7439 };
7440  
7441 static const int JJR_RBR_start = 1;
7442  
7443 0 void english_morpho_guesser::add_JJR_RBR(const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const {
7444 0 const char* p = form.c_str() + negation_len; int cs;
7445 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
7446
7447 {
7448 0 cs = JJR_RBR_start;
7449 }
7450  
7451 {
7452 int _klen;
7453 unsigned int _trans;
7454 const char *_acts;
7455 unsigned int _nacts;
7456 const char *_keys;
7457  
7458 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
7459 0 goto _test_eof;
7460 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7461 0 goto _out;
7462 0 _resume:
7463 0 _keys = _JJR_RBR_trans_keys + _JJR_RBR_key_offsets[cs];
7464 0 _trans = _JJR_RBR_index_offsets[cs];
7465  
7466 0 _klen = _JJR_RBR_single_lengths[cs];
7467 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7468 0 const char *_lower = _keys;
7469 const char *_mid;
7470 0 const char *_upper = _keys + _klen - 1;
7471 while (1) {
7472 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7473 0 break;
7474  
7475 0 _mid = _lower + ((_upper-_lower) >> 1);
7476 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < *_mid ) 0 0 0
7477 0 _upper = _mid - 1;
7478 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > *_mid ) 0 0 0
7479 0 _lower = _mid + 1;
7480 else {
7481 0 _trans += (unsigned int)(_mid - _keys);
7482 0 goto _match;
7483 }
7484 }
7485 0 _keys += _klen;
7486 0 _trans += _klen;
7487 }
7488  
7489 0 _klen = _JJR_RBR_range_lengths[cs];
7490 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7491 0 const char *_lower = _keys;
7492 const char *_mid;
7493 0 const char *_upper = _keys + (_klen<<1) - 2;
7494 while (1) {
7495 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7496 0 break;
7497  
7498 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
7499 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < _mid[0] ) 0 0 0
7500 0 _upper = _mid - 2;
7501 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > _mid[1] ) 0 0 0
7502 0 _lower = _mid + 2;
7503 else {
7504 0 _trans += (unsigned int)((_mid - _keys)>>1);
7505 0 goto _match;
7506 }
7507 }
7508 0 _trans += _klen;
7509 }
7510  
7511 0 _match:
7512 0 _trans = _JJR_RBR_indicies[_trans];
7513 0 cs = _JJR_RBR_trans_targs[_trans];
7514  
7515 0 ▶ if ( _JJR_RBR_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _JJR_RBR_trans_actions[_trans] == 0 ) 0 0 0
7516 0 goto _again;
7517  
7518 0 _acts = _JJR_RBR_actions + _JJR_RBR_trans_actions[_trans];
7519 0 _nacts = (unsigned int) *_acts++;
7520 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
7521 {
7522 0 switch ( *_acts++ )
7523 {
7524 0 case 0:
7525 0 ▶ { if (best > 'a') best = 'a', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 2, append = nullptr; } 0 0 0
7526 0 break;
7527 0 case 1:
7528 0 ▶ { if (best > 'b') best = 'b', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 3, append = nullptr; } 0 0 0
7529 0 break;
7530 0 case 2:
7531 0 ▶ { if (best > 'c') best = 'c', remove = 3, append = "y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 3, append = "y"; } 0 0 0
7532 0 break;
7533 0 case 3:
7534 0 ▶ { if (best > 'd') best = 'd', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 2, append = nullptr; } 0 0 0
7535 0 break;
7536 0 case 4:
7537 0 ▶ { if (best > 'e') best = 'e', remove = 1, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 1, append = nullptr; } 0 0 0
7538 0 break;
7539 0 case 5:
7540 0 ▶ { if (best > 'f') best = 'f', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 2, append = nullptr; } 0 0 0
7541 0 break;
7542 }
7543 }
7544  
7545 0 _again:
7546 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7547 0 goto _out;
7548 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
7549 0 goto _resume;
7550 0 _test_eof: {}
7551 0 _out: {}
7552 }
7553  
7554 0 ▶ add(JJR, RBR, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(JJR, RBR, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(JJR, RBR, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(JJR, RBR, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(JJR, RBR, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
7555 0 }
7556  
7557 static const char _JJS_RBS_actions[] = {
7558 0, 1, 1, 1, 2, 1, 4, 1,
7559 5, 2, 0, 5, 2, 1, 4, 2,
7560 3, 5
7561 };
7562  
7563 static const unsigned char _JJS_RBS_key_offsets[] = {
7564 0, 0, 1, 2, 3, 25, 25, 25,
7565 31, 44, 50, 56, 67, 73, 79, 85,
7566 96, 102, 108, 114, 120, 126, 137, 143,
7567 154, 160, 166, 172, 178, 178, 183, 183,
7568 183, 184
7569 };
7570  
7571 static const char _JJS_RBS_trans_keys[] = {
7572 116, 115, 101, 98, 99, 100, 102, 103,
7573 104, 105, 106, 107, 108, 109, 110, 112,
7574 113, 114, 115, 116, 118, 119, 120, 121,
7575 122, 97, 98, 101, 105, 111, 117, 98,
7576 99, 100, 105, 111, 117, 122, 97, 101,
7577 102, 109, 112, 120, 97, 100, 101, 105,
7578 111, 117, 97, 101, 102, 105, 111, 117,
7579 97, 101, 103, 105, 111, 117, 122, 98,
7580 109, 112, 120, 97, 101, 104, 105, 111,
7581 117, 97, 101, 105, 106, 111, 117, 97,
7582 101, 105, 107, 111, 117, 97, 101, 105,
7583 108, 111, 117, 122, 98, 109, 112, 120,
7584 97, 101, 105, 109, 111, 117, 97, 101,
7585 105, 110, 111, 117, 97, 101, 105, 111,
7586 112, 117, 97, 101, 105, 111, 113, 117,
7587 97, 101, 105, 111, 114, 117, 97, 101,
7588 105, 111, 115, 117, 122, 98, 109, 112,
7589 120, 97, 101, 105, 111, 116, 117, 97,
7590 101, 105, 111, 117, 118, 122, 98, 109,
7591 112, 120, 97, 101, 105, 111, 117, 119,
7592 97, 101, 105, 111, 117, 120, 97, 101,
7593 105, 111, 117, 121, 97, 101, 105, 111,
7594 117, 122, 97, 101, 105, 111, 117, 101,
7595 97, 122, 0
7596 };
7597  
7598 static const char _JJS_RBS_single_lengths[] = {
7599 0, 1, 1, 1, 22, 0, 0, 6,
7600 7, 6, 6, 7, 6, 6, 6, 7,
7601 6, 6, 6, 6, 6, 7, 6, 7,
7602 6, 6, 6, 6, 0, 5, 0, 0,
7603 1, 0
7604 };
7605  
7606 static const char _JJS_RBS_range_lengths[] = {
7607 0, 0, 0, 0, 0, 0, 0, 0,
7608 3, 0, 0, 2, 0, 0, 0, 2,
7609 0, 0, 0, 0, 0, 2, 0, 2,
7610 0, 0, 0, 0, 0, 0, 0, 0,
7611 0, 1
7612 };
7613  
7614 static const unsigned char _JJS_RBS_index_offsets[] = {
7615 0, 0, 2, 4, 6, 29, 30, 31,
7616 38, 49, 56, 63, 73, 80, 87, 94,
7617 104, 111, 118, 125, 132, 139, 149, 156,
7618 166, 173, 180, 187, 194, 195, 201, 202,
7619 203, 205
7620 };
7621  
7622 static const char _JJS_RBS_indicies[] = {
7623 0, 1, 2, 1, 3, 1, 5, 6,
7624 7, 8, 9, 10, 11, 12, 13, 14,
7625 15, 16, 17, 18, 19, 20, 21, 22,
7626 23, 24, 25, 26, 4, 27, 28, 29,
7627 30, 29, 29, 29, 29, 27, 31, 32,
7628 31, 29, 29, 29, 31, 29, 31, 31,
7629 27, 29, 30, 29, 29, 29, 29, 27,
7630 29, 29, 30, 29, 29, 29, 27, 29,
7631 29, 32, 29, 29, 29, 31, 31, 31,
7632 27, 29, 29, 30, 29, 29, 29, 27,
7633 29, 29, 29, 30, 29, 29, 27, 29,
7634 29, 29, 30, 29, 29, 27, 29, 29,
7635 29, 33, 29, 29, 31, 31, 31, 27,
7636 29, 29, 29, 30, 29, 29, 27, 34,
7637 34, 34, 30, 34, 34, 27, 34, 34,
7638 34, 34, 30, 34, 27, 29, 29, 29,
7639 29, 30, 29, 27, 29, 29, 29, 29,
7640 30, 29, 27, 29, 29, 29, 29, 32,
7641 29, 31, 31, 31, 27, 29, 29, 29,
7642 29, 30, 29, 27, 29, 29, 29, 29,
7643 29, 32, 31, 31, 31, 27, 34, 34,
7644 34, 34, 34, 30, 27, 34, 34, 34,
7645 34, 34, 30, 27, 29, 29, 29, 29,
7646 29, 30, 27, 29, 29, 29, 29, 29,
7647 30, 27, 1, 35, 35, 35, 35, 35,
7648 28, 28, 27, 28, 36, 35, 28, 0
7649 };
7650  
7651 static const char _JJS_RBS_trans_targs[] = {
7652 2, 0, 3, 4, 5, 7, 8, 9,
7653 10, 11, 12, 31, 13, 14, 15, 16,
7654 17, 18, 19, 20, 21, 22, 23, 24,
7655 25, 26, 27, 6, 28, 29, 30, 30,
7656 30, 32, 33, 28, 28
7657 };
7658  
7659 static const char _JJS_RBS_trans_actions[] = {
7660 0, 0, 0, 0, 0, 0, 0, 0,
7661 0, 0, 0, 3, 0, 0, 0, 0,
7662 0, 0, 0, 0, 0, 0, 0, 0,
7663 0, 0, 0, 0, 7, 5, 1, 5,
7664 12, 12, 5, 15, 9
7665 };
7666  
7667 static const int JJS_RBS_start = 1;
7668  
7669 0 void english_morpho_guesser::add_JJS_RBS(const string& form, unsigned negation_len, vector<tagged_lemma>& lemmas) const {
7670 0 const char* p = form.c_str() + negation_len; int cs;
7671 0 char best = 'z'; unsigned remove = 0; const char* append = nullptr;
7672
7673 {
7674 0 cs = JJS_RBS_start;
7675 }
7676  
7677 {
7678 int _klen;
7679 unsigned int _trans;
7680 const char *_acts;
7681 unsigned int _nacts;
7682 const char *_keys;
7683  
7684 0 ▶ if ( p == ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (form.c_str() + form.size())) ) 0 0 0
7685 0 goto _test_eof;
7686 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7687 0 goto _out;
7688 0 _resume:
7689 0 _keys = _JJS_RBS_trans_keys + _JJS_RBS_key_offsets[cs];
7690 0 _trans = _JJS_RBS_index_offsets[cs];
7691  
7692 0 _klen = _JJS_RBS_single_lengths[cs];
7693 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7694 0 const char *_lower = _keys;
7695 const char *_mid;
7696 0 const char *_upper = _keys + _klen - 1;
7697 while (1) {
7698 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7699 0 break;
7700  
7701 0 _mid = _lower + ((_upper-_lower) >> 1);
7702 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < *_mid ) 0 0 0
7703 0 _upper = _mid - 1;
7704 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > *_mid ) 0 0 0
7705 0 _lower = _mid + 1;
7706 else {
7707 0 _trans += (unsigned int)(_mid - _keys);
7708 0 goto _match;
7709 }
7710 }
7711 0 _keys += _klen;
7712 0 _trans += _klen;
7713 }
7714  
7715 0 _klen = _JJS_RBS_range_lengths[cs];
7716 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
7717 0 const char *_lower = _keys;
7718 const char *_mid;
7719 0 const char *_upper = _keys + (_klen<<1) - 2;
7720 while (1) {
7721 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
7722 0 break;
7723  
7724 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
7725 0 ▶ if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) < _mid[0] ) 0 0 0
7726 0 _upper = _mid - 2;
7727 0 ▶ else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( form[form.size() - 1 - (p - form.c_str() - negation_len)]) > _mid[1] ) 0 0 0
7728 0 _lower = _mid + 2;
7729 else {
7730 0 _trans += (unsigned int)((_mid - _keys)>>1);
7731 0 goto _match;
7732 }
7733 }
7734 0 _trans += _klen;
7735 }
7736  
7737 0 _match:
7738 0 _trans = _JJS_RBS_indicies[_trans];
7739 0 cs = _JJS_RBS_trans_targs[_trans];
7740  
7741 0 ▶ if ( _JJS_RBS_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _JJS_RBS_trans_actions[_trans] == 0 ) 0 0 0
7742 0 goto _again;
7743  
7744 0 _acts = _JJS_RBS_actions + _JJS_RBS_trans_actions[_trans];
7745 0 _nacts = (unsigned int) *_acts++;
7746 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
7747 {
7748 0 switch ( *_acts++ )
7749 {
7750 0 case 0:
7751 0 ▶ { if (best > 'a') best = 'a', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'a') best = 'a', remove = 3, append = nullptr; } 0 0 0
7752 0 break;
7753 0 case 1:
7754 0 ▶ { if (best > 'b') best = 'b', remove = 4, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'b') best = 'b', remove = 4, append = nullptr; } 0 0 0
7755 0 break;
7756 0 case 2:
7757 0 ▶ { if (best > 'c') best = 'c', remove = 4, append = "y"; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'c') best = 'c', remove = 4, append = "y"; } 0 0 0
7758 0 break;
7759 0 case 3:
7760 0 ▶ { if (best > 'd') best = 'd', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'd') best = 'd', remove = 3, append = nullptr; } 0 0 0
7761 0 break;
7762 0 case 4:
7763 0 ▶ { if (best > 'e') best = 'e', remove = 2, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'e') best = 'e', remove = 2, append = nullptr; } 0 0 0
7764 0 break;
7765 0 case 5:
7766 0 ▶ { if (best > 'f') best = 'f', remove = 3, append = nullptr; }
Branch: 1 branch
BranchTrueFalseTotal
{ if (best > 'f') best = 'f', remove = 3, append = nullptr; } 0 0 0
7767 0 break;
7768 }
7769 }
7770  
7771 0 _again:
7772 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
7773 0 goto _out;
7774 0 ▶ if ( ++p != ( (form.c_str() + form.size())) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (form.c_str() + form.size())) ) 0 0 0
7775 0 goto _resume;
7776 0 _test_eof: {}
7777 0 _out: {}
7778 }
7779  
7780 0 ▶ add(JJS, RBS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas);
Branch: 4 branches
BranchTrueFalseTotal
add(JJS, RBS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(JJS, RBS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(JJS, RBS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
add(JJS, RBS, form.substr(0, form.size() - remove).append(append ? append : ""), negation_len, lemmas); 0 0 0
7781 0 }
7782  
7783 } // namespace morphodita
7784  
7785 /////////
7786 // File: morphodita/morpho/external_morpho.h
7787 /////////
7788  
7789 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
7790 //
7791 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
7792 // Mathematics and Physics, Charles University in Prague, Czech Republic.
7793 //
7794 // This Source Code Form is subject to the terms of the Mozilla Public
7795 // License, v. 2.0. If a copy of the MPL was not distributed with this
7796 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7797  
7798 namespace morphodita {
7799  
7800 class external_morpho : public morpho {
7801 public:
7802 0 external_morpho(unsigned version) : version(version) {}
7803  
7804 virtual int analyze(string_piece form, morpho::guesser_mode guesser, vector<tagged_lemma>& lemmas) const override;
7805 virtual int generate(string_piece lemma, const char* tag_wildcard, guesser_mode guesser, vector<tagged_lemma_forms>& forms) const override;
7806 virtual int raw_lemma_len(string_piece lemma) const override;
7807 virtual int lemma_id_len(string_piece lemma) const override;
7808 virtual int raw_form_len(string_piece form) const override;
7809 virtual tokenizer* new_tokenizer() const override;
7810  
7811 bool load(istream& is);
7812  
7813 private:
7814 unsigned version;
7815  
7816 string unknown_tag;
7817 };
7818  
7819 } // namespace morphodita
7820  
7821 /////////
7822 // File: morphodita/tokenizer/generic_tokenizer.h
7823 /////////
7824  
7825 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
7826 //
7827 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
7828 // Mathematics and Physics, Charles University in Prague, Czech Republic.
7829 //
7830 // This Source Code Form is subject to the terms of the Mozilla Public
7831 // License, v. 2.0. If a copy of the MPL was not distributed with this
7832 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7833  
7834 namespace morphodita {
7835  
7836 class generic_tokenizer : public ragel_tokenizer {
7837 public:
7838 enum { LATEST = 2 };
7839 generic_tokenizer(unsigned version);
7840  
7841 virtual bool next_sentence(vector<token_range>& tokens) override;
7842 };
7843  
7844 } // namespace morphodita
7845  
7846 /////////
7847 // File: morphodita/morpho/external_morpho.cpp
7848 /////////
7849  
7850 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
7851 //
7852 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
7853 // Mathematics and Physics, Charles University in Prague, Czech Republic.
7854 //
7855 // This Source Code Form is subject to the terms of the Mozilla Public
7856 // License, v. 2.0. If a copy of the MPL was not distributed with this
7857 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7858  
7859 namespace morphodita {
7860  
7861 0 bool external_morpho::load(istream& is) {
7862 0 binary_decoder data;
7863 0 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 0 0 0
7864  
7865 try {
7866 // Load unknown_tag
7867 0 ▶ unsigned length = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned length = data.next_1B(); 0 0 0
7868 0 ▶ unknown_tag.assign(data.next<char>(length), length);
Branch: 3 branches
BranchTrueFalseTotal
unknown_tag.assign(data.next<char>(length), length); 0 0 0
unknown_tag.assign(data.next<char>(length), length); 0 0 0
unknown_tag.assign(data.next<char>(length), length); 0 0 0
7869 } catch (binary_decoder_error&) {
7870 return false;
7871 }
7872  
7873 0 return data.is_end();
7874 0 }
7875  
7876 0 int external_morpho::analyze(string_piece form, guesser_mode /*guesser*/, vector<tagged_lemma>& lemmas) const {
7877 0 lemmas.clear();
7878  
7879 0 ▶ if (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (form.len) { 0 0 0
7880 // Start by skipping the first form
7881 0 string_piece lemmatags = form;
7882 0 ▶ while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++;
Branch: 2 branches
BranchTrueFalseTotal
while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++; 0 0 0
while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++; 0 0 0
7883 0 ▶ if (lemmatags.len) lemmatags.len--, lemmatags.str++;
Branch: 1 branch
BranchTrueFalseTotal
if (lemmatags.len) lemmatags.len--, lemmatags.str++; 0 0 0
7884  
7885 // Split lemmatags using ' ' into lemma-tag pairs.
7886 0 ▶ while (lemmatags.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (lemmatags.len) { 0 0 0
7887 0 auto lemma_start = lemmatags.str;
7888 0 ▶ while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++;
Branch: 2 branches
BranchTrueFalseTotal
while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++; 0 0 0
while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++; 0 0 0
7889 0 ▶ if (!lemmatags.len) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmatags.len) break; 0 0 0
7890 0 auto lemma_len = lemmatags.str - lemma_start;
7891 0 lemmatags.len--, lemmatags.str++;
7892  
7893 0 auto tag_start = lemmatags.str;
7894 0 ▶ while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++;
Branch: 2 branches
BranchTrueFalseTotal
while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++; 0 0 0
while (lemmatags.len && *lemmatags.str != ' ') lemmatags.len--, lemmatags.str++; 0 0 0
7895 0 auto tag_len = lemmatags.str - tag_start;
7896 0 ▶ if (lemmatags.len) lemmatags.len--, lemmatags.str++;
Branch: 1 branch
BranchTrueFalseTotal
if (lemmatags.len) lemmatags.len--, lemmatags.str++; 0 0 0
7897  
7898 0 ▶ lemmas.emplace_back(string(lemma_start, lemma_len), string(tag_start, tag_len));
Branch: 3 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(lemma_start, lemma_len), string(tag_start, tag_len)); 0 0 0
lemmas.emplace_back(string(lemma_start, lemma_len), string(tag_start, tag_len)); 0 0 0
lemmas.emplace_back(string(lemma_start, lemma_len), string(tag_start, tag_len)); 0 0 0
7899 }
7900  
7901 0 ▶ if (!lemmas.empty()) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return NO_GUESSER; 0 0 0
7902 }
7903  
7904 0 ▶ lemmas.emplace_back(string(form.str, form.len), unknown_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
7905 0 return -1;
7906 }
7907  
7908 0 int external_morpho::generate(string_piece lemma, const char* tag_wildcard, morpho::guesser_mode /*guesser*/, vector<tagged_lemma_forms>& forms) const {
7909 0 forms.clear();
7910  
7911 0 ▶ tag_filter filter(tag_wildcard);
Branch: 1 branch
BranchTrueFalseTotal
tag_filter filter(tag_wildcard); 0 0 0
7912  
7913 0 ▶ if (lemma.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma.len) { 0 0 0
7914 // Start by locating the lemma
7915 0 string_piece formtags = lemma;
7916 0 ▶ while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++;
Branch: 2 branches
BranchTrueFalseTotal
while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++; 0 0 0
while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++; 0 0 0
7917 0 string_piece real_lemma(lemma.str, lemma.len - formtags.len);
7918 0 ▶ if (formtags.len) formtags.len--, formtags.str++;
Branch: 1 branch
BranchTrueFalseTotal
if (formtags.len) formtags.len--, formtags.str++; 0 0 0
7919  
7920 // Split formtags using ' ' into form-tag pairs.
7921 0 bool any_result = false;
7922 0 ▶ while (formtags.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (formtags.len) { 0 0 0
7923 0 auto form_start = formtags.str;
7924 0 ▶ while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++;
Branch: 2 branches
BranchTrueFalseTotal
while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++; 0 0 0
while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++; 0 0 0
7925 0 ▶ if (!formtags.len) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!formtags.len) break; 0 0 0
7926 0 auto form_len = formtags.str - form_start;
7927 0 formtags.len--, formtags.str++;
7928  
7929 0 auto tag_start = formtags.str;
7930 0 ▶ while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++;
Branch: 2 branches
BranchTrueFalseTotal
while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++; 0 0 0
while (formtags.len && *formtags.str != ' ') formtags.len--, formtags.str++; 0 0 0
7931 0 auto tag_len = formtags.str - tag_start;
7932 0 ▶ if (formtags.len) formtags.len--, formtags.str++;
Branch: 1 branch
BranchTrueFalseTotal
if (formtags.len) formtags.len--, formtags.str++; 0 0 0
7933  
7934 0 any_result = true;
7935 0 ▶ string tag(tag_start, tag_len);
Branch: 1 branch
BranchTrueFalseTotal
string tag(tag_start, tag_len); 0 0 0
7936 0 ▶ if (filter.matches(tag.c_str())) {
Branch: 1 branch
BranchTrueFalseTotal
if (filter.matches(tag.c_str())) { 0 0 0
7937 0 ▶ if (forms.empty()) forms.emplace_back(string(real_lemma.str, real_lemma.len));
Branch: 3 branches
BranchTrueFalseTotal
if (forms.empty()) forms.emplace_back(string(real_lemma.str, real_lemma.len)); 0 0 0
if (forms.empty()) forms.emplace_back(string(real_lemma.str, real_lemma.len)); 0 0 0
if (forms.empty()) forms.emplace_back(string(real_lemma.str, real_lemma.len)); 0 0 0
7938 0 ▶ forms.back().forms.emplace_back(string(form_start, form_len), tag);
Branch: 2 branches
BranchTrueFalseTotal
forms.back().forms.emplace_back(string(form_start, form_len), tag); 0 0 0
forms.back().forms.emplace_back(string(form_start, form_len), tag); 0 0 0
7939 }
7940 0 }
7941  
7942 0 ▶ if (any_result) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (any_result) return NO_GUESSER; 0 0 0
7943 }
7944  
7945 0 return -1;
7946 0 }
7947  
7948 0 int external_morpho::raw_lemma_len(string_piece lemma) const {
7949 0 unsigned lemma_len = 0;
7950 0 ▶ while (lemma_len < lemma.len && lemma.str[lemma_len] != ' ') lemma_len++;
Branch: 2 branches
BranchTrueFalseTotal
while (lemma_len < lemma.len && lemma.str[lemma_len] != ' ') lemma_len++; 0 0 0
while (lemma_len < lemma.len && lemma.str[lemma_len] != ' ') lemma_len++; 0 0 0
7951 0 return lemma_len;
7952 }
7953  
7954 0 int external_morpho::lemma_id_len(string_piece lemma) const {
7955 0 unsigned lemma_len = 0;
7956 0 ▶ while (lemma_len < lemma.len && lemma.str[lemma_len] != ' ') lemma_len++;
Branch: 2 branches
BranchTrueFalseTotal
while (lemma_len < lemma.len && lemma.str[lemma_len] != ' ') lemma_len++; 0 0 0
while (lemma_len < lemma.len && lemma.str[lemma_len] != ' ') lemma_len++; 0 0 0
7957 0 return lemma_len;
7958 }
7959  
7960 0 int external_morpho::raw_form_len(string_piece form) const {
7961 0 unsigned form_len = 0;
7962 0 ▶ while (form_len < form.len && form.str[form_len] != ' ') form_len++;
Branch: 2 branches
BranchTrueFalseTotal
while (form_len < form.len && form.str[form_len] != ' ') form_len++; 0 0 0
while (form_len < form.len && form.str[form_len] != ' ') form_len++; 0 0 0
7963 0 return form_len;
7964 }
7965  
7966 0 tokenizer* external_morpho::new_tokenizer() const {
7967 0 ▶ return new generic_tokenizer(version);
Branch: 2 branches
BranchTrueFalseTotal
return new generic_tokenizer(version); 0 0 0
return new generic_tokenizer(version); 0 0 0
7968 }
7969  
7970 } // namespace morphodita
7971  
7972 /////////
7973 // File: morphodita/morpho/generic_lemma_addinfo.h
7974 /////////
7975  
7976 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
7977 //
7978 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
7979 // Mathematics and Physics, Charles University in Prague, Czech Republic.
7980 //
7981 // This Source Code Form is subject to the terms of the Mozilla Public
7982 // License, v. 2.0. If a copy of the MPL was not distributed with this
7983 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7984  
7985 namespace morphodita {
7986  
7987 // Declarations
7988 struct generic_lemma_addinfo {
7989 inline static int raw_lemma_len(string_piece lemma);
7990 inline static int lemma_id_len(string_piece lemma);
7991 inline static string format(const unsigned char* addinfo, int addinfo_len);
7992 inline static bool generatable(const unsigned char* addinfo, int addinfo_len);
7993  
7994 inline int parse(string_piece lemma, bool die_on_failure = false);
7995 inline bool match_lemma_id(const unsigned char* other_addinfo, int other_addinfo_len);
7996  
7997 vector<unsigned char> data;
7998 };
7999  
8000 // Definitions
8001 18 int generic_lemma_addinfo::raw_lemma_len(string_piece lemma) {
8002 18 return lemma.len;
8003 }
8004  
8005 7 int generic_lemma_addinfo::lemma_id_len(string_piece lemma) {
8006 7 return lemma.len;
8007 }
8008  
8009 0 string generic_lemma_addinfo::format(const unsigned char* /*addinfo*/, int /*addinfo_len*/) {
8010 0 return string();
8011 }
8012  
8013 0 bool generic_lemma_addinfo::generatable(const unsigned char* /*addinfo*/, int /*addinfo_len*/) {
8014 0 return true;
8015 }
8016  
8017 0 int generic_lemma_addinfo::parse(string_piece lemma, bool /*die_on_failure*/) {
8018 0 return lemma.len;
8019 }
8020  
8021 0 bool generic_lemma_addinfo::match_lemma_id(const unsigned char* /*other_addinfo*/, int /*other_addinfo_len*/) {
8022 0 return true;
8023 }
8024  
8025 } // namespace morphodita
8026  
8027 /////////
8028 // File: morphodita/morpho/generic_morpho.h
8029 /////////
8030  
8031 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8032 //
8033 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8034 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8035 //
8036 // This Source Code Form is subject to the terms of the Mozilla Public
8037 // License, v. 2.0. If a copy of the MPL was not distributed with this
8038 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8039  
8040 namespace morphodita {
8041  
8042 class generic_morpho : public morpho {
8043 public:
8044 1 generic_morpho(unsigned version) : version(version) {}
8045  
8046 virtual int analyze(string_piece form, morpho::guesser_mode guesser, vector<tagged_lemma>& lemmas) const override;
8047 virtual int generate(string_piece lemma, const char* tag_wildcard, guesser_mode guesser, vector<tagged_lemma_forms>& forms) const override;
8048 virtual int raw_lemma_len(string_piece lemma) const override;
8049 virtual int lemma_id_len(string_piece lemma) const override;
8050 virtual int raw_form_len(string_piece form) const override;
8051 virtual tokenizer* new_tokenizer() const override;
8052  
8053 bool load(istream& is);
8054 private:
8055 inline void analyze_special(string_piece form, vector<tagged_lemma>& lemmas) const;
8056  
8057 unsigned version;
8058 morpho_dictionary<generic_lemma_addinfo> dictionary;
8059 unique_ptr<morpho_statistical_guesser> statistical_guesser;
8060  
8061 string unknown_tag, number_tag, punctuation_tag, symbol_tag;
8062 };
8063  
8064 } // namespace morphodita
8065  
8066 /////////
8067 // File: morphodita/morpho/generic_morpho.cpp
8068 /////////
8069  
8070 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8071 //
8072 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8073 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8074 //
8075 // This Source Code Form is subject to the terms of the Mozilla Public
8076 // License, v. 2.0. If a copy of the MPL was not distributed with this
8077 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8078  
8079 namespace morphodita {
8080  
8081 1 bool generic_morpho::load(istream& is) {
8082 1 binary_decoder data;
8083 1 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 1 0 1
if (!compressor::load(is, data)) return false; 0 1 1
8084  
8085 try {
8086 // Load tags
8087 1 ▶ unsigned length = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
unsigned length = data.next_1B(); 1 0 1
8088 1 ▶ unknown_tag.assign(data.next<char>(length), length);
Branch: 2 branches
BranchTrueFalseTotal
unknown_tag.assign(data.next<char>(length), length); 1 0 1
unknown_tag.assign(data.next<char>(length), length); 1 0 1
8089 1 ▶ length = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
length = data.next_1B(); 1 0 1
8090 1 ▶ number_tag.assign(data.next<char>(length), length);
Branch: 2 branches
BranchTrueFalseTotal
number_tag.assign(data.next<char>(length), length); 1 0 1
number_tag.assign(data.next<char>(length), length); 1 0 1
8091 1 ▶ length = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
length = data.next_1B(); 1 0 1
8092 1 ▶ punctuation_tag.assign(data.next<char>(length), length);
Branch: 2 branches
BranchTrueFalseTotal
punctuation_tag.assign(data.next<char>(length), length); 1 0 1
punctuation_tag.assign(data.next<char>(length), length); 1 0 1
8093 1 ▶ length = data.next_1B();
Branch: 1 branch
BranchTrueFalseTotal
length = data.next_1B(); 1 0 1
8094 1 ▶ symbol_tag.assign(data.next<char>(length), length);
Branch: 2 branches
BranchTrueFalseTotal
symbol_tag.assign(data.next<char>(length), length); 1 0 1
symbol_tag.assign(data.next<char>(length), length); 1 0 1
8095  
8096 // Load dictionary
8097 1 ▶ dictionary.load(data);
Branch: 1 branch
BranchTrueFalseTotal
dictionary.load(data); 1 0 1
8098  
8099 // Optionally statistical guesser if present
8100 1 statistical_guesser.reset();
8101 1 ▶ if (data.next_1B()) {
Branch: 2 branches
BranchTrueFalseTotal
if (data.next_1B()) { 1 0 1
if (data.next_1B()) { 0 1 1
8102 0 ▶ statistical_guesser.reset(new morpho_statistical_guesser());
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser.reset(new morpho_statistical_guesser()); 0 0 0
8103 0 ▶ statistical_guesser->load(data);
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser->load(data); 0 0 0
8104 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
8105 } catch (binary_decoder_error&) {
8106 return false;
8107 }
8108  
8109 1 return data.is_end();
8110 1 }
8111  
8112 14 int generic_morpho::analyze(string_piece form, guesser_mode guesser, vector<tagged_lemma>& lemmas) const {
8113 14 lemmas.clear();
8114  
8115 14 ▶ if (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (form.len) { 14 0 14
8116 // Generate all casing variants if needed (they are different than given form).
8117 14 string form_uclc; // first uppercase, rest lowercase
8118 14 string form_lc; // all lowercase
8119 14 ▶ generate_casing_variants(form, form_uclc, form_lc);
Branch: 1 branch
BranchTrueFalseTotal
generate_casing_variants(form, form_uclc, form_lc); 14 0 14
8120  
8121 // Start by analysing using the dictionary and all casing variants.
8122 14 ▶ dictionary.analyze(form, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
dictionary.analyze(form, lemmas); 14 0 14
8123 14 ▶ if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas); 0 14 14
if (!form_uclc.empty()) dictionary.analyze(form_uclc, lemmas); 0 0 0
8124 14 ▶ if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas); 4 10 14
if (!form_lc.empty()) dictionary.analyze(form_lc, lemmas); 4 0 4
8125 14 ▶ if (!lemmas.empty()) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return NO_GUESSER; 10 4 14
8126  
8127 // Then call analyze_special to handle numbers, punctuation and symbols.
8128 4 ▶ analyze_special(form, lemmas);
Branch: 1 branch
BranchTrueFalseTotal
analyze_special(form, lemmas); 4 0 4
8129 4 ▶ if (!lemmas.empty()) return NO_GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return NO_GUESSER; 4 0 4
8130  
8131 // For the statistical guesser, use all casing variants.
8132 0 ▶ if (guesser == GUESSER && statistical_guesser) {
Branch: 3 branches
BranchTrueFalseTotal
if (guesser == GUESSER && statistical_guesser) { 0 0 0
if (guesser == GUESSER && statistical_guesser) { 0 0 0
if (guesser == GUESSER && statistical_guesser) { 0 0 0
8133 0 ▶ if (form_uclc.empty() && form_lc.empty())
Branch: 3 branches
BranchTrueFalseTotal
if (form_uclc.empty() && form_lc.empty()) 0 0 0
if (form_uclc.empty() && form_lc.empty()) 0 0 0
if (form_uclc.empty() && form_lc.empty()) 0 0 0
8134 0 ▶ statistical_guesser->analyze(form, lemmas, nullptr);
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser->analyze(form, lemmas, nullptr); 0 0 0
8135 else {
8136 0 ▶ morpho_statistical_guesser::used_rules used_rules; used_rules.reserve(3);
Branch: 1 branch
BranchTrueFalseTotal
morpho_statistical_guesser::used_rules used_rules; used_rules.reserve(3); 0 0 0
8137 0 ▶ statistical_guesser->analyze(form, lemmas, &used_rules);
Branch: 1 branch
BranchTrueFalseTotal
statistical_guesser->analyze(form, lemmas, &used_rules); 0 0 0
8138 0 ▶ if (!form_uclc.empty()) statistical_guesser->analyze(form_uclc, lemmas, &used_rules);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_uclc.empty()) statistical_guesser->analyze(form_uclc, lemmas, &used_rules); 0 0 0
if (!form_uclc.empty()) statistical_guesser->analyze(form_uclc, lemmas, &used_rules); 0 0 0
8139 0 ▶ if (!form_lc.empty()) statistical_guesser->analyze(form_lc, lemmas, &used_rules);
Branch: 2 branches
BranchTrueFalseTotal
if (!form_lc.empty()) statistical_guesser->analyze(form_lc, lemmas, &used_rules); 0 0 0
if (!form_lc.empty()) statistical_guesser->analyze(form_lc, lemmas, &used_rules); 0 0 0
8140 0 }
8141 }
8142 0 ▶ if (!lemmas.empty()) return GUESSER;
Branch: 1 branch
BranchTrueFalseTotal
if (!lemmas.empty()) return GUESSER; 0 0 0
8143 28 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 14 14
} 0 14 14
8144  
8145 0 ▶ lemmas.emplace_back(string(form.str, form.len), unknown_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), unknown_tag); 0 0 0
8146 0 return -1;
8147 }
8148  
8149 0 int generic_morpho::generate(string_piece lemma, const char* tag_wildcard, morpho::guesser_mode /*guesser*/, vector<tagged_lemma_forms>& forms) const {
8150 0 forms.clear();
8151  
8152 0 ▶ tag_filter filter(tag_wildcard);
Branch: 1 branch
BranchTrueFalseTotal
tag_filter filter(tag_wildcard); 0 0 0
8153  
8154 0 ▶ if (lemma.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (lemma.len) { 0 0 0
8155 0 ▶ if (dictionary.generate(lemma, filter, forms))
Branch: 2 branches
BranchTrueFalseTotal
if (dictionary.generate(lemma, filter, forms)) 0 0 0
if (dictionary.generate(lemma, filter, forms)) 0 0 0
8156 0 return NO_GUESSER;
8157 }
8158  
8159 0 return -1;
8160 0 }
8161  
8162 18 int generic_morpho::raw_lemma_len(string_piece lemma) const {
8163 18 return generic_lemma_addinfo::raw_lemma_len(lemma);
8164 }
8165  
8166 7 int generic_morpho::lemma_id_len(string_piece lemma) const {
8167 7 return generic_lemma_addinfo::lemma_id_len(lemma);
8168 }
8169  
8170 14 int generic_morpho::raw_form_len(string_piece form) const {
8171 14 return form.len;
8172 }
8173  
8174 0 tokenizer* generic_morpho::new_tokenizer() const {
8175 0 ▶ return new generic_tokenizer(version);
Branch: 2 branches
BranchTrueFalseTotal
return new generic_tokenizer(version); 0 0 0
return new generic_tokenizer(version); 0 0 0
8176 }
8177  
8178 4 void generic_morpho::analyze_special(string_piece form, vector<tagged_lemma>& lemmas) const {
8179 using namespace unilib;
8180  
8181 // Analyzer for numbers, punctuation and symbols.
8182 // Number is anything matching [+-]? is_Pn* ([.,] is_Pn*)? ([Ee] [+-]? is_Pn+)? for at least one is_Pn* nonempty.
8183 // Punctuation is any form beginning with either unicode punctuation or punctuation_exceptions character.
8184 // Beware that numbers takes precedence, so - is punctuation, -3 is number, -. is punctuation, -.3 is number.
8185 4 ▶ if (!form.len) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!form.len) return; 0 4 4
8186  
8187 4 string_piece number = form;
8188 4 char32_t first = utf8::decode(number.str, number.len);
8189  
8190 // Try matching a number.
8191 4 char32_t codepoint = first;
8192 4 bool any_digit = false;
8193 4 ▶ if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len);
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 4 0 4
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 4 4
8194 4 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len); 0 4 4
8195 4 ▶ if ((codepoint == '.' && number.len) || codepoint == ',') codepoint = utf8::decode(number.str, number.len);
Branch: 3 branches
BranchTrueFalseTotal
if ((codepoint == '.' && number.len) || codepoint == ',') codepoint = utf8::decode(number.str, number.len); 4 0 4
if ((codepoint == '.' && number.len) || codepoint == ',') codepoint = utf8::decode(number.str, number.len); 4 0 4
if ((codepoint == '.' && number.len) || codepoint == ',') codepoint = utf8::decode(number.str, number.len); 0 4 4
8196 4 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len); 0 4 4
8197 4 ▶ if (any_digit && (codepoint == 'e' || codepoint == 'E')) {
Branch: 3 branches
BranchTrueFalseTotal
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 4 4
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
if (any_digit && (codepoint == 'e' || codepoint == 'E')) { 0 0 0
8198 0 codepoint = utf8::decode(number.str, number.len);
8199 0 ▶ if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len);
Branch: 2 branches
BranchTrueFalseTotal
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 0 0
if (codepoint == '+' || codepoint == '-') codepoint = utf8::decode(number.str, number.len); 0 0 0
8200 0 any_digit = false;
8201 0 ▶ while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len);
Branch: 1 branch
BranchTrueFalseTotal
while (unicode::category(codepoint) & unicode::N) any_digit = true, codepoint = utf8::decode(number.str, number.len); 0 0 0
8202 }
8203  
8204 4 ▶ if (any_digit && !number.len && (!codepoint || codepoint == '.')) {
Branch: 4 branches
BranchTrueFalseTotal
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 4 4
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
if (any_digit && !number.len && (!codepoint || codepoint == '.')) { 0 0 0
8205 0 ▶ lemmas.emplace_back(string(form.str, form.len), number_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), number_tag); 0 0 0
lemmas.emplace_back(string(form.str, form.len), number_tag); 0 0 0
8206 0 return;
8207 }
8208  
8209 // Try matching punctuation or symbol.
8210 4 bool punctuation = true, symbol = true;
8211 4 string_piece form_ori = form;
8212 8 ▶ while (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (form.len) { 4 4 8
8213 4 codepoint = utf8::decode(form.str, form.len);
8214 4 ▶ punctuation = punctuation && unicode::category(codepoint) & unicode::P;
Branch: 2 branches
BranchTrueFalseTotal
punctuation = punctuation && unicode::category(codepoint) & unicode::P; 4 0 4
punctuation = punctuation && unicode::category(codepoint) & unicode::P; 4 0 4
8215 4 ▶ symbol = symbol && unicode::category(codepoint) & unicode::S;
Branch: 2 branches
BranchTrueFalseTotal
symbol = symbol && unicode::category(codepoint) & unicode::S; 4 0 4
symbol = symbol && unicode::category(codepoint) & unicode::S; 0 4 4
8216 }
8217 4 ▶ if (punctuation)
Branch: 1 branch
BranchTrueFalseTotal
if (punctuation) 4 0 4
8218 12 ▶ lemmas.emplace_back(string(form_ori.str, form_ori.len), punctuation_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form_ori.str, form_ori.len), punctuation_tag); 4 0 4
lemmas.emplace_back(string(form_ori.str, form_ori.len), punctuation_tag); 4 0 4
8219 0 ▶ else if (symbol)
Branch: 1 branch
BranchTrueFalseTotal
else if (symbol) 0 0 0
8220 0 ▶ lemmas.emplace_back(string(form_ori.str, form_ori.len), symbol_tag);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form_ori.str, form_ori.len), symbol_tag); 0 0 0
lemmas.emplace_back(string(form_ori.str, form_ori.len), symbol_tag); 0 0 0
8221 }
8222  
8223 } // namespace morphodita
8224  
8225 /////////
8226 // File: morphodita/morpho/morpho_ids.h
8227 /////////
8228  
8229 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8230 //
8231 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8232 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8233 //
8234 // This Source Code Form is subject to the terms of the Mozilla Public
8235 // License, v. 2.0. If a copy of the MPL was not distributed with this
8236 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8237  
8238 namespace morphodita {
8239  
8240 class morpho_ids {
8241 public:
8242 enum morpho_id {
8243 CZECH = 0,
8244 ENGLISH_V1 = 1,
8245 GENERIC = 2,
8246 EXTERNAL = 3,
8247 ENGLISH_V2 = 4,
8248 ENGLISH_V3 = 5, ENGLISH = ENGLISH_V3,
8249 SLOVAK_PDT = 6,
8250 DERIVATOR_DICTIONARY = 7,
8251 };
8252  
8253 static bool parse(const string& str, morpho_id& id) {
8254 if (str == "czech") return id = CZECH, true;
8255 if (str == "english") return id = ENGLISH, true;
8256 if (str == "external") return id = EXTERNAL, true;
8257 if (str == "generic") return id = GENERIC, true;
8258 if (str == "slovak_pdt") return id = SLOVAK_PDT, true;
8259 return false;
8260 }
8261 };
8262  
8263 typedef morpho_ids::morpho_id morpho_id;
8264  
8265 } // namespace morphodita
8266  
8267 /////////
8268 // File: utils/new_unique_ptr.h
8269 /////////
8270  
8271 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
8272 //
8273 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8274 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8275 //
8276 // This Source Code Form is subject to the terms of the Mozilla Public
8277 // License, v. 2.0. If a copy of the MPL was not distributed with this
8278 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8279  
8280 namespace utils {
8281  
8282 template<typename T, typename... Args>
8283 0 unique_ptr<T> new_unique_ptr(Args&&... args) {
8284 0 ▶ return unique_ptr<T>(new T(std::forward<Args>(args)...));
Branch: 10 branches
BranchTrueFalseTotal
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 1 0 1
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
return unique_ptr<T>(new T(std::forward<Args>(args)...)); 0 0 0
8285 }
8286  
8287 } // namespace utils
8288  
8289 /////////
8290 // File: morphodita/morpho/morpho.cpp
8291 /////////
8292  
8293 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8294 //
8295 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8296 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8297 //
8298 // This Source Code Form is subject to the terms of the Mozilla Public
8299 // License, v. 2.0. If a copy of the MPL was not distributed with this
8300 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8301  
8302 namespace morphodita {
8303  
8304 1 morpho* morpho::load(istream& is) {
8305 1 morpho_id id = morpho_id(is.get());
8306 1 switch (id) {
8307 0 case morpho_ids::CZECH:
8308 {
8309 0 ▶ auto res = new_unique_ptr<czech_morpho>(czech_morpho::morpho_language::CZECH, 1);
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<czech_morpho>(czech_morpho::morpho_language::CZECH, 1); 0 0 0
8310 0 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 0 0 0
if (res->load(is)) return res.release(); 0 0 0
8311 0 break;
8312 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
8313 0 case morpho_ids::ENGLISH_V1:
8314 case morpho_ids::ENGLISH_V2:
8315 case morpho_ids::ENGLISH_V3:
8316 {
8317 0 ▶ auto res = new_unique_ptr<english_morpho>(id == morpho_ids::ENGLISH_V1 ? 1 :
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<english_morpho>(id == morpho_ids::ENGLISH_V1 ? 1 : 0 0 0
8318 0 ▶ id == morpho_ids::ENGLISH_V2 ? 2 :
Branch: 1 branch
BranchTrueFalseTotal
id == morpho_ids::ENGLISH_V2 ? 2 : 0 0 0
8319 0 ▶ 3);
Branch: 1 branch
BranchTrueFalseTotal
3); 0 0 0
8320 0 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 0 0 0
if (res->load(is)) return res.release(); 0 0 0
8321 0 break;
8322 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
8323 0 case morpho_ids::EXTERNAL:
8324 {
8325 0 ▶ auto res = new_unique_ptr<external_morpho>(1);
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<external_morpho>(1); 0 0 0
8326 0 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 0 0 0
if (res->load(is)) return res.release(); 0 0 0
8327 0 break;
8328 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
8329 1 case morpho_ids::GENERIC:
8330 {
8331 1 ▶ auto res = new_unique_ptr<generic_morpho>(1);
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<generic_morpho>(1); 1 0 1
8332 1 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 1 0 1
if (res->load(is)) return res.release(); 1 0 1
8333 0 break;
8334 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 0 1
8335 0 case morpho_ids::SLOVAK_PDT:
8336 {
8337 0 ▶ auto res = new_unique_ptr<czech_morpho>(czech_morpho::morpho_language::SLOVAK, 3);
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<czech_morpho>(czech_morpho::morpho_language::SLOVAK, 3); 0 0 0
8338 0 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 0 0 0
if (res->load(is)) return res.release(); 0 0 0
8339 0 break;
8340 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
8341 0 case morpho_ids::DERIVATOR_DICTIONARY:
8342 {
8343 0 ▶ auto derinet = new_unique_ptr<derivator_dictionary>();
Branch: 1 branch
BranchTrueFalseTotal
auto derinet = new_unique_ptr<derivator_dictionary>(); 0 0 0
8344 0 ▶ if (!derinet->load(is)) return nullptr;
Branch: 2 branches
BranchTrueFalseTotal
if (!derinet->load(is)) return nullptr; 0 0 0
if (!derinet->load(is)) return nullptr; 0 0 0
8345  
8346 0 ▶ unique_ptr<morpho> dictionary(load(is));
Branch: 1 branch
BranchTrueFalseTotal
unique_ptr<morpho> dictionary(load(is)); 0 0 0
8347 0 ▶ if (!dictionary) return nullptr;
Branch: 1 branch
BranchTrueFalseTotal
if (!dictionary) return nullptr; 0 0 0
8348 0 derinet->dictionary = dictionary.get();
8349 0 dictionary->derinet.reset(derinet.release());
8350 0 return dictionary.release();
8351 0 }
8352 }
8353  
8354 0 return nullptr;
8355 }
8356  
8357 0 morpho* morpho::load(const char* fname) {
8358 0 ▶ ifstream f(path_from_utf8(fname).c_str(), ifstream::binary);
Branch: 2 branches
BranchTrueFalseTotal
ifstream f(path_from_utf8(fname).c_str(), ifstream::binary); 0 0 0
ifstream f(path_from_utf8(fname).c_str(), ifstream::binary); 0 0 0
8359 0 ▶ if (!f) return nullptr;
Branch: 2 branches
BranchTrueFalseTotal
if (!f) return nullptr; 0 0 0
if (!f) return nullptr; 0 0 0
8360  
8361 0 ▶ return load(f);
Branch: 1 branch
BranchTrueFalseTotal
return load(f); 0 0 0
8362 0 }
8363  
8364 0 const derivator* morpho::get_derivator() const {
8365 0 return derinet.get();
8366 }
8367  
8368 } // namespace morphodita
8369  
8370 /////////
8371 // File: morphodita/morpho/morpho_statistical_guesser.cpp
8372 /////////
8373  
8374 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8375 //
8376 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8377 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8378 //
8379 // This Source Code Form is subject to the terms of the Mozilla Public
8380 // License, v. 2.0. If a copy of the MPL was not distributed with this
8381 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8382  
8383 namespace morphodita {
8384  
8385 0 void morpho_statistical_guesser::load(binary_decoder& data) {
8386 // Load tags and default tag
8387 0 tags.resize(data.next_2B());
8388 0 ▶ for (auto&& tag : tags) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tag : tags) { 0 0 0
8389 0 ▶ tag.resize(data.next_1B());
Branch: 2 branches
BranchTrueFalseTotal
tag.resize(data.next_1B()); 0 0 0
tag.resize(data.next_1B()); 0 0 0
8390 0 ▶ for (unsigned i = 0; i < tag.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < tag.size(); i++) 0 0 0
8391 0 ▶ tag[i] = data.next_1B();
Branch: 2 branches
BranchTrueFalseTotal
tag[i] = data.next_1B(); 0 0 0
tag[i] = data.next_1B(); 0 0 0
8392 }
8393 0 default_tag = data.next_2B();
8394  
8395 // Load rules
8396 0 rules.load(data);
8397 0 }
8398  
8399 // Helper method for analyze.
8400 0 static bool contains(morpho_statistical_guesser::used_rules* used, const string& rule) {
8401 0 ▶ if (!used) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (!used) return false; 0 0 0
8402  
8403 0 ▶ for (auto&& used_rule : *used)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& used_rule : *used) 0 0 0
8404 0 ▶ if (used_rule == rule)
Branch: 1 branch
BranchTrueFalseTotal
if (used_rule == rule) 0 0 0
8405 0 return true;
8406  
8407 0 return false;
8408 }
8409  
8410 // Produces unique lemma-tag pairs.
8411 0 void morpho_statistical_guesser::analyze(string_piece form, vector<tagged_lemma>& lemmas, morpho_statistical_guesser::used_rules* used) {
8412 0 unsigned lemmas_initial_size = lemmas.size();
8413  
8414 // We have rules in format "suffix prefix" in rules.
8415 // Find the matching rule with longest suffix and of those with longest prefix.
8416 0 ▶ string rule_label; rule_label.reserve(12);
Branch: 1 branch
BranchTrueFalseTotal
string rule_label; rule_label.reserve(12); 0 0 0
8417 0 unsigned suffix_len = 0;
8418 0 ▶ for (; suffix_len < form.len; suffix_len++) {
Branch: 1 branch
BranchTrueFalseTotal
for (; suffix_len < form.len; suffix_len++) { 0 0 0
8419 0 ▶ rule_label.push_back(form.str[form.len - (suffix_len + 1)]);
Branch: 1 branch
BranchTrueFalseTotal
rule_label.push_back(form.str[form.len - (suffix_len + 1)]); 0 0 0
8420 0 ▶ if (!rules.at(rule_label.c_str(), rule_label.size(), [](pointer_decoder& data){ data.next<char>(data.next_2B()); }))
Branch: 2 branches
BranchTrueFalseTotal
if (!rules.at(rule_label.c_str(), rule_label.size(), [](pointer_decoder& data){ data.next<char>(data.next_2B()); })) 0 0 0
if (!rules.at(rule_label.c_str(), rule_label.size(), [](pointer_decoder& data){ data.next<char>(data.next_2B()); })) 0 0 0
8421 0 break;
8422 }
8423  
8424 0 ▶ for (suffix_len++; suffix_len--; ) {
Branch: 1 branch
BranchTrueFalseTotal
for (suffix_len++; suffix_len--; ) { 0 0 0
8425 0 ▶ rule_label.resize(suffix_len);
Branch: 1 branch
BranchTrueFalseTotal
rule_label.resize(suffix_len); 0 0 0
8426 0 ▶ rule_label.push_back(' ');
Branch: 1 branch
BranchTrueFalseTotal
rule_label.push_back(' '); 0 0 0
8427  
8428 0 const unsigned char* rule = nullptr;
8429 0 unsigned rule_prefix_len = 0;
8430 0 ▶ for (unsigned prefix_len = 0; prefix_len + suffix_len <= form.len; prefix_len++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned prefix_len = 0; prefix_len + suffix_len <= form.len; prefix_len++) { 0 0 0
8431 0 ▶ if (prefix_len) rule_label.push_back(form.str[prefix_len - 1]);
Branch: 2 branches
BranchTrueFalseTotal
if (prefix_len) rule_label.push_back(form.str[prefix_len - 1]); 0 0 0
if (prefix_len) rule_label.push_back(form.str[prefix_len - 1]); 0 0 0
8432 0 ▶ const unsigned char* found = rules.at(rule_label.c_str(), rule_label.size(), [](pointer_decoder& data){ data.next<char>(data.next_2B()); });
Branch: 1 branch
BranchTrueFalseTotal
const unsigned char* found = rules.at(rule_label.c_str(), rule_label.size(), [](pointer_decoder& data){ data.next<char>(data.next_2B()); }); 0 0 0
8433 0 ▶ if (!found) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!found) break; 0 0 0
8434 0 ▶ if (*(found += sizeof(uint16_t))) {
Branch: 1 branch
BranchTrueFalseTotal
if (*(found += sizeof(uint16_t))) { 0 0 0
8435 0 rule = found;
8436 0 rule_prefix_len = prefix_len;
8437 }
8438 }
8439  
8440 0 ▶ if (rule) {
Branch: 1 branch
BranchTrueFalseTotal
if (rule) { 0 0 0
8441 0 ▶ rule_label.resize(suffix_len + 1 + rule_prefix_len);
Branch: 1 branch
BranchTrueFalseTotal
rule_label.resize(suffix_len + 1 + rule_prefix_len); 0 0 0
8442 0 ▶ if (rule_label.size() > 1 && !contains(used, rule_label)) { // ignore rule ' '
Branch: 3 branches
BranchTrueFalseTotal
if (rule_label.size() > 1 && !contains(used, rule_label)) { // ignore rule ' ' 0 0 0
if (rule_label.size() > 1 && !contains(used, rule_label)) { // ignore rule ' ' 0 0 0
if (rule_label.size() > 1 && !contains(used, rule_label)) { // ignore rule ' ' 0 0 0
8443 0 ▶ if (used) used->push_back(rule_label);
Branch: 2 branches
BranchTrueFalseTotal
if (used) used->push_back(rule_label); 0 0 0
if (used) used->push_back(rule_label); 0 0 0
8444 0 ▶ for (int rules_len = *rule++; rules_len; rules_len--) {
Branch: 1 branch
BranchTrueFalseTotal
for (int rules_len = *rule++; rules_len; rules_len--) { 0 0 0
8445 0 unsigned pref_del_len = *rule++; const char* pref_del = (const char*)rule; rule += pref_del_len;
8446 0 unsigned pref_add_len = *rule++; const char* pref_add = (const char*)rule; rule += pref_add_len;
8447 0 unsigned suff_del_len = *rule++; const char* suff_del = (const char*)rule; rule += suff_del_len;
8448 0 unsigned suff_add_len = *rule++; const char* suff_add = (const char*)rule; rule += suff_add_len;
8449 0 unsigned tags_len = *rule++; const uint16_t* tags = (const uint16_t*)rule; rule += tags_len * sizeof(uint16_t);
8450  
8451 0 ▶ if (pref_del_len + suff_del_len > form.len ||
Branch: 1 branch
BranchTrueFalseTotal
if (pref_del_len + suff_del_len > form.len || 0 0 0
8452 0 ▶ (pref_del_len && !small_memeq(pref_del, form.str, pref_del_len)) ||
Branch: 2 branches
BranchTrueFalseTotal
(pref_del_len && !small_memeq(pref_del, form.str, pref_del_len)) || 0 0 0
(pref_del_len && !small_memeq(pref_del, form.str, pref_del_len)) || 0 0 0
8453 0 ▶ (suff_del_len && !small_memeq(suff_del, form.str + form.len - suff_del_len, suff_del_len)) ||
Branch: 3 branches
BranchTrueFalseTotal
(suff_del_len && !small_memeq(suff_del, form.str + form.len - suff_del_len, suff_del_len)) || 0 0 0
(suff_del_len && !small_memeq(suff_del, form.str + form.len - suff_del_len, suff_del_len)) || 0 0 0
(suff_del_len && !small_memeq(suff_del, form.str + form.len - suff_del_len, suff_del_len)) || 0 0 0
8454 0 ▶ (form.len + pref_add_len - pref_del_len + suff_add_len - suff_del_len == 0))
Branch: 1 branch
BranchTrueFalseTotal
(form.len + pref_add_len - pref_del_len + suff_add_len - suff_del_len == 0)) 0 0 0
8455 0 continue;
8456  
8457 0 string lemma;
8458 0 ▶ lemma.reserve(form.len + pref_add_len - pref_del_len + suff_add_len - suff_del_len);
Branch: 1 branch
BranchTrueFalseTotal
lemma.reserve(form.len + pref_add_len - pref_del_len + suff_add_len - suff_del_len); 0 0 0
8459 0 ▶ if (pref_add_len) lemma.append(pref_add, pref_add_len);
Branch: 2 branches
BranchTrueFalseTotal
if (pref_add_len) lemma.append(pref_add, pref_add_len); 0 0 0
if (pref_add_len) lemma.append(pref_add, pref_add_len); 0 0 0
8460 0 ▶ if (pref_del_len + suff_del_len < form.len) lemma.append(form.str + pref_del_len, form.len - pref_del_len - suff_del_len);
Branch: 2 branches
BranchTrueFalseTotal
if (pref_del_len + suff_del_len < form.len) lemma.append(form.str + pref_del_len, form.len - pref_del_len - suff_del_len); 0 0 0
if (pref_del_len + suff_del_len < form.len) lemma.append(form.str + pref_del_len, form.len - pref_del_len - suff_del_len); 0 0 0
8461 0 ▶ if (suff_add_len) lemma.append(suff_add, suff_add_len);
Branch: 2 branches
BranchTrueFalseTotal
if (suff_add_len) lemma.append(suff_add, suff_add_len); 0 0 0
if (suff_add_len) lemma.append(suff_add, suff_add_len); 0 0 0
8462 0 ▶ while (tags_len--)
Branch: 1 branch
BranchTrueFalseTotal
while (tags_len--) 0 0 0
8463 0 ▶ lemmas.emplace_back(lemma, this->tags[unaligned_load_inc<uint16_t>(tags)]);
Branch: 1 branch
BranchTrueFalseTotal
lemmas.emplace_back(lemma, this->tags[unaligned_load_inc<uint16_t>(tags)]); 0 0 0
8464 0 }
8465 }
8466 0 break;
8467 }
8468 }
8469  
8470 // If nothing was found, use default tag.
8471 0 ▶ if (lemmas.size() == lemmas_initial_size)
Branch: 1 branch
BranchTrueFalseTotal
if (lemmas.size() == lemmas_initial_size) 0 0 0
8472 0 ▶ if (!contains(used, string())) {
Branch: 1 branch
BranchTrueFalseTotal
if (!contains(used, string())) { 0 0 0
8473 0 ▶ if (used) used->push_back(string());
Branch: 2 branches
BranchTrueFalseTotal
if (used) used->push_back(string()); 0 0 0
if (used) used->push_back(string()); 0 0 0
8474 0 ▶ lemmas.emplace_back(string(form.str, form.len), tags[default_tag]);
Branch: 2 branches
BranchTrueFalseTotal
lemmas.emplace_back(string(form.str, form.len), tags[default_tag]); 0 0 0
lemmas.emplace_back(string(form.str, form.len), tags[default_tag]); 0 0 0
8475 }
8476 0 }
8477  
8478 } // namespace morphodita
8479  
8480 /////////
8481 // File: morphodita/morpho/tag_filter.cpp
8482 /////////
8483  
8484 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8485 //
8486 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8487 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8488 //
8489 // This Source Code Form is subject to the terms of the Mozilla Public
8490 // License, v. 2.0. If a copy of the MPL was not distributed with this
8491 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8492  
8493 namespace morphodita {
8494  
8495 0 tag_filter::tag_filter(const char* filter) {
8496 0 ▶ if (!filter) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!filter) return; 0 0 0
8497  
8498 0 ▶ wildcard.assign(filter);
Branch: 1 branch
BranchTrueFalseTotal
wildcard.assign(filter); 0 0 0
8499 0 filter = wildcard.c_str();
8500  
8501 0 ▶ for (int tag_pos = 0, filter_pos = 0; filter[filter_pos]; tag_pos++, filter_pos++) {
Branch: 1 branch
BranchTrueFalseTotal
for (int tag_pos = 0, filter_pos = 0; filter[filter_pos]; tag_pos++, filter_pos++) { 0 0 0
8502 0 ▶ if (filter[filter_pos] == '?') continue;
Branch: 1 branch
BranchTrueFalseTotal
if (filter[filter_pos] == '?') continue; 0 0 0
8503 0 ▶ if (filter[filter_pos] == '[') {
Branch: 1 branch
BranchTrueFalseTotal
if (filter[filter_pos] == '[') { 0 0 0
8504 0 filter_pos++;
8505  
8506 0 bool negate = false;
8507 0 ▶ if (filter[filter_pos] == '^') negate = true, filter_pos++;
Branch: 1 branch
BranchTrueFalseTotal
if (filter[filter_pos] == '^') negate = true, filter_pos++; 0 0 0
8508  
8509 0 int chars_start = filter_pos;
8510 0 ▶ for (bool first = true; filter[filter_pos] && (first || filter[filter_pos] != ']'); first = false)
Branch: 3 branches
BranchTrueFalseTotal
for (bool first = true; filter[filter_pos] && (first || filter[filter_pos] != ']'); first = false) 0 0 0
for (bool first = true; filter[filter_pos] && (first || filter[filter_pos] != ']'); first = false) 0 0 0
for (bool first = true; filter[filter_pos] && (first || filter[filter_pos] != ']'); first = false) 0 0 0
8511 0 filter_pos++;
8512  
8513 0 ▶ filters.emplace_back(tag_pos, negate, chars_start, filter_pos - chars_start);
Branch: 1 branch
BranchTrueFalseTotal
filters.emplace_back(tag_pos, negate, chars_start, filter_pos - chars_start); 0 0 0
8514 0 ▶ if (!filter[filter_pos]) break;
Branch: 1 branch
BranchTrueFalseTotal
if (!filter[filter_pos]) break; 0 0 0
8515 } else {
8516 0 ▶ filters.emplace_back(tag_pos, false, filter_pos, 1);
Branch: 1 branch
BranchTrueFalseTotal
filters.emplace_back(tag_pos, false, filter_pos, 1); 0 0 0
8517 }
8518 }
8519 }
8520  
8521 } // namespace morphodita
8522  
8523 /////////
8524 // File: morphodita/tagger/tagger.h
8525 /////////
8526  
8527 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8528 //
8529 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8530 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8531 //
8532 // This Source Code Form is subject to the terms of the Mozilla Public
8533 // License, v. 2.0. If a copy of the MPL was not distributed with this
8534 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8535  
8536 namespace morphodita {
8537  
8538 class tagger {
8539 public:
8540 0 virtual ~tagger() {}
8541  
8542 static tagger* load(const char* fname);
8543 static tagger* load(istream& is);
8544  
8545 // Return morpho associated with the tagger. Do not delete the pointer, it is
8546 // owned by the tagger instance and deleted in the tagger destructor.
8547 virtual const morpho* get_morpho() const = 0;
8548  
8549 // Perform morphologic analysis and subsequent disambiguation.
8550 virtual void tag(const vector<string_piece>& forms, vector<tagged_lemma>& tags, morpho::guesser_mode guesser = morpho::GUESSER_UNSPECIFIED) const = 0;
8551  
8552 // Perform disambiguation only on given analyses.
8553 virtual void tag_analyzed(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<int>& tags) const = 0;
8554  
8555 // Construct a new tokenizer instance appropriate for this tagger.
8556 // Can return NULL if no such tokenizer exists.
8557 // Is equal to get_morpho()->new_tokenizer.
8558 tokenizer* new_tokenizer() const;
8559 };
8560  
8561 } // namespace morphodita
8562  
8563 /////////
8564 // File: morphodita/tagger/elementary_features.h
8565 /////////
8566  
8567 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8568 //
8569 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8570 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8571 //
8572 // This Source Code Form is subject to the terms of the Mozilla Public
8573 // License, v. 2.0. If a copy of the MPL was not distributed with this
8574 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8575  
8576 namespace morphodita {
8577  
8578 // Declarations
8579 enum elementary_feature_type { PER_FORM, PER_TAG, DYNAMIC };
8580 enum elementary_feature_range { ONLY_CURRENT, ANY_OFFSET };
8581  
8582 typedef uint32_t elementary_feature_value;
8583 enum :elementary_feature_value { elementary_feature_unknown = 0, elementary_feature_empty = 1 };
8584  
8585 struct elementary_feature_description {
8586 string name;
8587 elementary_feature_type type;
8588 elementary_feature_range range;
8589 int index;
8590 int map_index;
8591 };
8592  
8593 template<class Map>
8594 class elementary_features {
8595 public:
8596 bool load(istream& is);
8597 bool save(ostream& out);
8598  
8599 vector<Map> maps;
8600 };
8601  
8602 class persistent_elementary_feature_map : public persistent_unordered_map {
8603 public:
8604 26 persistent_elementary_feature_map() : persistent_unordered_map() {}
8605 persistent_elementary_feature_map(const persistent_unordered_map&& map) : persistent_unordered_map(map) {}
8606  
8607 96 elementary_feature_value value(const char* feature, int len) const {
8608 96 auto* it = at_typed<elementary_feature_value>(feature, len);
8609 96 ▶ return it ? unaligned_load<elementary_feature_value>(it) : elementary_feature_unknown;
Branch: 1 branch
BranchTrueFalseTotal
return it ? unaligned_load<elementary_feature_value>(it) : elementary_feature_unknown; 37 59 96
8610 }
8611 };
8612  
8613 // Definitions
8614 template <class Map>
8615 1 inline bool elementary_features<Map>::load(istream& is) {
8616 1 binary_decoder data;
8617 1 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 1 0 1
if (!compressor::load(is, data)) return false; 0 1 1
8618  
8619 try {
8620 1 ▶ maps.resize(data.next_1B());
Branch: 2 branches
BranchTrueFalseTotal
maps.resize(data.next_1B()); 1 0 1
maps.resize(data.next_1B()); 1 0 1
8621 27 ▶ for (auto&& map : maps)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& map : maps) 26 1 27
8622 26 ▶ map.load(data);
Branch: 2 branches
BranchTrueFalseTotal
map.load(data); 26 0 26
map.load(data); 0 0 0
8623 } catch (binary_decoder_error&) {
8624 return false;
8625 }
8626  
8627 1 return data.is_end();
8628 1 }
8629  
8630 } // namespace morphodita
8631  
8632 /////////
8633 // File: morphodita/tagger/vli.h
8634 /////////
8635  
8636 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8637 //
8638 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8639 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8640 //
8641 // This Source Code Form is subject to the terms of the Mozilla Public
8642 // License, v. 2.0. If a copy of the MPL was not distributed with this
8643 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8644  
8645 namespace morphodita {
8646  
8647 // Declarations
8648 template <class T>
8649 class vli {
8650 public:
8651 static int max_length();
8652 static void encode(T value, char*& where);
8653 static T decode(const char*& from);
8654 };
8655  
8656 // Definitions
8657 template <>
8658 22 inline int vli<uint32_t>::max_length() {
8659 22 return 5;
8660 }
8661  
8662 template <>
8663 267 inline void vli<uint32_t>::encode(uint32_t value, char*& where) {
8664 267 ▶ if (value < 0x80) *where++ = value;
Branch: 1 branch
BranchTrueFalseTotal
if (value < 0x80) *where++ = value; 267 0 267
8665 0 ▶ else if (value < 0x4000) *where++ = (value >> 7) | 0x80u, *where++ = value & 0x7Fu;
Branch: 1 branch
BranchTrueFalseTotal
else if (value < 0x4000) *where++ = (value >> 7) | 0x80u, *where++ = value & 0x7Fu; 0 0 0
8666 0 ▶ else if (value < 0x200000) *where++ = (value >> 14) | 0x80u, *where++ = ((value >> 7) & 0x7Fu) | 0x80u, *where++ = value & 0x7Fu;
Branch: 1 branch
BranchTrueFalseTotal
else if (value < 0x200000) *where++ = (value >> 14) | 0x80u, *where++ = ((value >> 7) & 0x7Fu) | 0x80u, *where++ = value & 0x7Fu; 0 0 0
8667 0 ▶ else if (value < 0x10000000) *where++ = (value >> 21) | 0x80u, *where++ = ((value >> 14) & 0x7Fu) | 0x80u, *where++ = ((value >> 7) & 0x7Fu) | 0x80u, *where++ = value & 0x7Fu;
Branch: 1 branch
BranchTrueFalseTotal
else if (value < 0x10000000) *where++ = (value >> 21) | 0x80u, *where++ = ((value >> 14) & 0x7Fu) | 0x80u, *where++ = ((value >> 7) & 0x7Fu) | 0x80u, *where++ = value & 0x7Fu; 0 0 0
8668 0 else *where++ = (value >> 28) | 0x80u, *where++ = ((value >> 21) & 0x7Fu) | 0x80u, *where++ = ((value >> 14) & 0x7Fu) | 0x80u, *where++ = ((value >> 7) & 0x7Fu) | 0x80u, *where++ = value & 0x7Fu;
8669 267 }
8670  
8671 template <>
8672 inline uint32_t vli<uint32_t>::decode(const char*& from) {
8673 uint32_t value = 0;
8674 while (((unsigned char)(*from)) & 0x80u) value = (value << 7) | (((unsigned char)(*from++)) ^ 0x80u);
8675 value = (value << 7) | ((unsigned char)(*from++));
8676 return value;
8677 }
8678  
8679 } // namespace morphodita
8680  
8681 /////////
8682 // File: morphodita/tagger/feature_sequences.h
8683 /////////
8684  
8685 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8686 //
8687 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8688 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8689 //
8690 // This Source Code Form is subject to the terms of the Mozilla Public
8691 // License, v. 2.0. If a copy of the MPL was not distributed with this
8692 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8693  
8694 namespace morphodita {
8695  
8696 // Declarations
8697 typedef int32_t feature_sequence_score;
8698 typedef int64_t feature_sequences_score;
8699  
8700 struct feature_sequence_element {
8701 elementary_feature_type type;
8702 int elementary_index;
8703 int sequence_index;
8704  
8705 45 feature_sequence_element() {}
8706 feature_sequence_element(elementary_feature_type type, int elementary_index, int sequence_index) : type(type), elementary_index(elementary_index), sequence_index(sequence_index) {}
8707 };
8708  
8709 struct feature_sequence {
8710 vector<feature_sequence_element> elements;
8711 int dependant_range = 1;
8712 };
8713  
8714 template <class ElementaryFeatures, class Map>
8715 class feature_sequences {
8716 public:
8717 typedef typename ElementaryFeatures::per_form_features per_form_features;
8718 typedef typename ElementaryFeatures::per_tag_features per_tag_features;
8719 typedef typename ElementaryFeatures::dynamic_features dynamic_features;
8720  
8721 void parse(int window_size, istream& is);
8722 bool load(istream& is);
8723 bool save(ostream& os);
8724  
8725 struct cache;
8726  
8727 inline void initialize_sentence(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, cache& c) const;
8728 inline void compute_dynamic_features(int form_index, int tag_index, const dynamic_features* prev_dynamic, dynamic_features& dynamic, cache& c) const;
8729 inline feature_sequences_score score(int form_index, int tags_window[], int tags_unchanged, dynamic_features& dynamic, cache& c) const;
8730 void feature_keys(int form_index, int tags_window[], int tags_unchanged, dynamic_features& dynamic, vector<string>& keys, cache& c) const;
8731  
8732 ElementaryFeatures elementary;
8733 vector<Map> scores;
8734 vector<feature_sequence> sequences;
8735 };
8736  
8737 class persistent_feature_sequence_map : public persistent_unordered_map {
8738 public:
8739 21 persistent_feature_sequence_map() : persistent_unordered_map() {}
8740 persistent_feature_sequence_map(const persistent_unordered_map&& map) : persistent_unordered_map(map) {}
8741  
8742 108 feature_sequence_score score(const char* feature, int len) const {
8743 108 auto* it = at_typed<feature_sequence_score>(feature, len);
8744 108 ▶ return it ? unaligned_load<feature_sequence_score>(it) : 0;
Branch: 1 branch
BranchTrueFalseTotal
return it ? unaligned_load<feature_sequence_score>(it) : 0; 55 53 108
8745 }
8746 };
8747  
8748 template <class ElementaryFeatures> using persistent_feature_sequences = feature_sequences<ElementaryFeatures, persistent_feature_sequence_map>;
8749  
8750 // Definitions
8751 template <class ElementaryFeatures, class Map>
8752 0 inline bool feature_sequences<ElementaryFeatures, Map>::load(istream& is) {
8753 0 ▶ if (!elementary.load(is)) return false;
Branch: 6 branches
BranchTrueFalseTotal
if (!elementary.load(is)) return false; 0 0 0
if (!elementary.load(is)) return false; 0 0 0
if (!elementary.load(is)) return false; 1 0 1
if (!elementary.load(is)) return false; 0 1 1
if (!elementary.load(is)) return false; 0 0 0
if (!elementary.load(is)) return false; 0 0 0
8754  
8755 0 binary_decoder data;
8756 0 ▶ if (!compressor::load(is, data)) return false;
Branch: 6 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 1 0 1
if (!compressor::load(is, data)) return false; 0 1 1
if (!compressor::load(is, data)) return false; 0 0 0
if (!compressor::load(is, data)) return false; 0 0 0
8757  
8758 try {
8759 0 ▶ sequences.resize(data.next_1B());
Branch: 6 branches
BranchTrueFalseTotal
sequences.resize(data.next_1B()); 0 0 0
sequences.resize(data.next_1B()); 0 0 0
sequences.resize(data.next_1B()); 1 0 1
sequences.resize(data.next_1B()); 1 0 1
sequences.resize(data.next_1B()); 0 0 0
sequences.resize(data.next_1B()); 0 0 0
8760 0 ▶ for (auto&& sequence : sequences) {
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& sequence : sequences) { 0 0 0
for (auto&& sequence : sequences) { 21 1 22
for (auto&& sequence : sequences) { 0 0 0
8761 0 ▶ sequence.dependant_range = data.next_4B();
Branch: 3 branches
BranchTrueFalseTotal
sequence.dependant_range = data.next_4B(); 0 0 0
sequence.dependant_range = data.next_4B(); 21 0 21
sequence.dependant_range = data.next_4B(); 0 0 0
8762 0 ▶ sequence.elements.resize(data.next_1B());
Branch: 6 branches
BranchTrueFalseTotal
sequence.elements.resize(data.next_1B()); 0 0 0
sequence.elements.resize(data.next_1B()); 0 0 0
sequence.elements.resize(data.next_1B()); 21 0 21
sequence.elements.resize(data.next_1B()); 21 0 21
sequence.elements.resize(data.next_1B()); 0 0 0
sequence.elements.resize(data.next_1B()); 0 0 0
8763 0 ▶ for (auto&& element : sequence.elements) {
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& element : sequence.elements) { 0 0 0
for (auto&& element : sequence.elements) { 45 21 66
for (auto&& element : sequence.elements) { 0 0 0
8764 0 ▶ element.type = elementary_feature_type(data.next_4B());
Branch: 3 branches
BranchTrueFalseTotal
element.type = elementary_feature_type(data.next_4B()); 0 0 0
element.type = elementary_feature_type(data.next_4B()); 45 0 45
element.type = elementary_feature_type(data.next_4B()); 0 0 0
8765 0 ▶ element.elementary_index = data.next_4B();
Branch: 3 branches
BranchTrueFalseTotal
element.elementary_index = data.next_4B(); 0 0 0
element.elementary_index = data.next_4B(); 45 0 45
element.elementary_index = data.next_4B(); 0 0 0
8766 0 ▶ element.sequence_index = data.next_4B();
Branch: 3 branches
BranchTrueFalseTotal
element.sequence_index = data.next_4B(); 0 0 0
element.sequence_index = data.next_4B(); 45 0 45
element.sequence_index = data.next_4B(); 0 0 0
8767 }
8768 }
8769  
8770 0 ▶ scores.resize(data.next_1B());
Branch: 6 branches
BranchTrueFalseTotal
scores.resize(data.next_1B()); 0 0 0
scores.resize(data.next_1B()); 0 0 0
scores.resize(data.next_1B()); 1 0 1
scores.resize(data.next_1B()); 1 0 1
scores.resize(data.next_1B()); 0 0 0
scores.resize(data.next_1B()); 0 0 0
8771 0 ▶ for (auto&& score : scores)
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& score : scores) 0 0 0
for (auto&& score : scores) 21 1 22
for (auto&& score : scores) 0 0 0
8772 0 ▶ score.load(data);
Branch: 6 branches
BranchTrueFalseTotal
score.load(data); 0 0 0
score.load(data); 0 0 0
score.load(data); 21 0 21
score.load(data); 0 0 0
score.load(data); 0 0 0
score.load(data); 0 0 0
8773 } catch (binary_decoder_error&) {
8774 return false;
8775 }
8776  
8777 0 return data.is_end();
8778 0 }
8779  
8780 template <class ElementaryFeatures, class Map>
8781 struct feature_sequences<ElementaryFeatures, Map>::cache {
8782 const vector<string_piece>* forms;
8783 const vector<vector<tagged_lemma>>* analyses;
8784 vector<per_form_features> elementary_per_form;
8785 vector<vector<per_tag_features>> elementary_per_tag;
8786  
8787 struct cache_element {
8788 vector<char> key;
8789 int key_size;
8790 feature_sequence_score score;
8791  
8792 0 ▶ cache_element(int elements) : key(vli<elementary_feature_value>::max_length() * elements), key_size(0), score(0) {}
Branch: 3 branches
BranchTrueFalseTotal
cache_element(int elements) : key(vli<elementary_feature_value>::max_length() * elements), key_size(0), score(0) {} 0 0 0
cache_element(int elements) : key(vli<elementary_feature_value>::max_length() * elements), key_size(0), score(0) {} 21 0 21
cache_element(int elements) : key(vli<elementary_feature_value>::max_length() * elements), key_size(0), score(0) {} 0 0 0
8793 };
8794 vector<cache_element> caches;
8795 vector<const per_tag_features*> window;
8796 vector<char> key;
8797 feature_sequences_score score;
8798  
8799 0 cache(const feature_sequences<ElementaryFeatures, Map>& self) : score(0) {
8800 0 ▶ caches.reserve(self.sequences.size());
Branch: 3 branches
BranchTrueFalseTotal
caches.reserve(self.sequences.size()); 0 0 0
caches.reserve(self.sequences.size()); 1 0 1
caches.reserve(self.sequences.size()); 0 0 0
8801 0 int max_sequence_elements = 0, max_window_size = 1;
8802 0 ▶ for (auto&& sequence : self.sequences) {
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& sequence : self.sequences) { 0 0 0
for (auto&& sequence : self.sequences) { 21 1 22
for (auto&& sequence : self.sequences) { 0 0 0
8803 0 ▶ caches.emplace_back(int(sequence.elements.size()));
Branch: 3 branches
BranchTrueFalseTotal
caches.emplace_back(int(sequence.elements.size())); 0 0 0
caches.emplace_back(int(sequence.elements.size())); 21 0 21
caches.emplace_back(int(sequence.elements.size())); 0 0 0
8804 0 ▶ if (int(sequence.elements.size()) > max_sequence_elements) max_sequence_elements = sequence.elements.size();
Branch: 3 branches
BranchTrueFalseTotal
if (int(sequence.elements.size()) > max_sequence_elements) max_sequence_elements = sequence.elements.size(); 0 0 0
if (int(sequence.elements.size()) > max_sequence_elements) max_sequence_elements = sequence.elements.size(); 1 20 21
if (int(sequence.elements.size()) > max_sequence_elements) max_sequence_elements = sequence.elements.size(); 0 0 0
8805 0 ▶ for (auto&& element : sequence.elements)
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& element : sequence.elements) 0 0 0
for (auto&& element : sequence.elements) 45 21 66
for (auto&& element : sequence.elements) 0 0 0
8806 0 ▶ if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size)
Branch: 6 branches
BranchTrueFalseTotal
if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size) 0 0 0
if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size) 0 0 0
if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size) 26 19 45
if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size) 2 24 26
if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size) 0 0 0
if (element.type == PER_TAG && 1 - element.sequence_index > max_window_size) 0 0 0
8807 0 max_window_size = 1 - element.sequence_index;
8808 }
8809 0 ▶ key.resize(max_sequence_elements * vli<elementary_feature_value>::max_length());
Branch: 3 branches
BranchTrueFalseTotal
key.resize(max_sequence_elements * vli<elementary_feature_value>::max_length()); 0 0 0
key.resize(max_sequence_elements * vli<elementary_feature_value>::max_length()); 1 0 1
key.resize(max_sequence_elements * vli<elementary_feature_value>::max_length()); 0 0 0
8810 0 ▶ window.resize(max_window_size);
Branch: 3 branches
BranchTrueFalseTotal
window.resize(max_window_size); 0 0 0
window.resize(max_window_size); 1 0 1
window.resize(max_window_size); 0 0 0
8811 0 }
8812 };
8813  
8814 template <class ElementaryFeatures, class Map>
8815 0 void feature_sequences<ElementaryFeatures, Map>::initialize_sentence(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, cache& c) const {
8816 // Store forms and forms_size
8817 0 c.forms = &forms;
8818 0 c.analyses = &analyses;
8819  
8820 // Enlarge elementary features vectors if needed
8821 0 ▶ if (forms.size() > c.elementary_per_form.size()) c.elementary_per_form.resize(forms.size() * 2);
Branch: 3 branches
BranchTrueFalseTotal
if (forms.size() > c.elementary_per_form.size()) c.elementary_per_form.resize(forms.size() * 2); 0 0 0
if (forms.size() > c.elementary_per_form.size()) c.elementary_per_form.resize(forms.size() * 2); 1 1 2
if (forms.size() > c.elementary_per_form.size()) c.elementary_per_form.resize(forms.size() * 2); 0 0 0
8822 0 ▶ if (forms.size() > c.elementary_per_tag.size()) c.elementary_per_tag.resize(forms.size() * 2);
Branch: 3 branches
BranchTrueFalseTotal
if (forms.size() > c.elementary_per_tag.size()) c.elementary_per_tag.resize(forms.size() * 2); 0 0 0
if (forms.size() > c.elementary_per_tag.size()) c.elementary_per_tag.resize(forms.size() * 2); 1 1 2
if (forms.size() > c.elementary_per_tag.size()) c.elementary_per_tag.resize(forms.size() * 2); 0 0 0
8823 0 ▶ for (unsigned i = 0; i < forms.size(); i++)
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) 0 0 0
for (unsigned i = 0; i < forms.size(); i++) 7 2 9
for (unsigned i = 0; i < forms.size(); i++) 0 0 0
8824 0 ▶ if (analyses[i].size() > c.elementary_per_tag[i].size())
Branch: 3 branches
BranchTrueFalseTotal
if (analyses[i].size() > c.elementary_per_tag[i].size()) 0 0 0
if (analyses[i].size() > c.elementary_per_tag[i].size()) 5 2 7
if (analyses[i].size() > c.elementary_per_tag[i].size()) 0 0 0
8825 0 c.elementary_per_tag[i].resize(analyses[i].size() * 2);
8826  
8827 // Compute elementary features
8828 0 elementary.compute_features(forms, analyses, c.elementary_per_form, c.elementary_per_tag);
8829  
8830 // Clear score cache, because scores may have been modified
8831 0 c.score = 0;
8832 0 ▶ for (auto&& cache : c.caches)
Branch: 3 branches
BranchTrueFalseTotal
for (auto&& cache : c.caches) 0 0 0
for (auto&& cache : c.caches) 42 2 44
for (auto&& cache : c.caches) 0 0 0
8833 0 cache.key_size = cache.score = 0;
8834 0 }
8835  
8836 template <class ElementaryFeatures, class Map>
8837 0 void feature_sequences<ElementaryFeatures, Map>::compute_dynamic_features(int form_index, int tag_index, const dynamic_features* prev_dynamic, dynamic_features& dynamic, cache& c) const {
8838 0 ▶ elementary.compute_dynamic_features((*c.analyses)[form_index][tag_index], c.elementary_per_form[form_index], c.elementary_per_tag[form_index][tag_index], form_index > 0 ? prev_dynamic : nullptr, dynamic);
Branch: 3 branches
BranchTrueFalseTotal
elementary.compute_dynamic_features((*c.analyses)[form_index][tag_index], c.elementary_per_form[form_index], c.elementary_per_tag[form_index][tag_index], form_index > 0 ? prev_dynamic : nullptr, dynamic); 0 0 0
elementary.compute_dynamic_features((*c.analyses)[form_index][tag_index], c.elementary_per_form[form_index], c.elementary_per_tag[form_index][tag_index], form_index > 0 ? prev_dynamic : nullptr, dynamic); 20 2 22
elementary.compute_dynamic_features((*c.analyses)[form_index][tag_index], c.elementary_per_form[form_index], c.elementary_per_tag[form_index][tag_index], form_index > 0 ? prev_dynamic : nullptr, dynamic); 0 0 0
8839 0 }
8840  
8841 template <class ElementaryFeatures, class Map>
8842 0 feature_sequences_score feature_sequences<ElementaryFeatures, Map>::score(int form_index, int tags_window[], int tags_unchanged, dynamic_features& dynamic, cache& c) const {
8843 // Start by creating a window of per_tag_features*
8844 0 ▶ for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++)
Branch: 9 branches
BranchTrueFalseTotal
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 0 0 0
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 0 0 0
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 0 0 0
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 54 16 70
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 52 2 54
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 52 18 70
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 0 0 0
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 0 0 0
for (int i = 0; i < int(c.window.size()) && form_index - i >= 0; i++) 0 0 0
8845 0 c.window[i] = &c.elementary_per_tag[form_index - i][tags_window[i]];
8846  
8847 // Compute the score
8848 0 feature_sequences_score result = c.score;
8849 0 ▶ for (unsigned i = 0; i < sequences.size(); i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < sequences.size(); i++) { 0 0 0
for (unsigned i = 0; i < sequences.size(); i++) { 190 7 197
for (unsigned i = 0; i < sequences.size(); i++) { 0 0 0
8850 0 ▶ if (tags_unchanged >= sequences[i].dependant_range)
Branch: 3 branches
BranchTrueFalseTotal
if (tags_unchanged >= sequences[i].dependant_range) 0 0 0
if (tags_unchanged >= sequences[i].dependant_range) 11 179 190
if (tags_unchanged >= sequences[i].dependant_range) 0 0 0
8851 0 break;
8852  
8853 0 char* key = c.key.data();
8854 0 ▶ for (unsigned j = 0; j < sequences[i].elements.size(); j++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned j = 0; j < sequences[i].elements.size(); j++) { 0 0 0
for (unsigned j = 0; j < sequences[i].elements.size(); j++) { 332 114 446
for (unsigned j = 0; j < sequences[i].elements.size(); j++) { 0 0 0
8855 0 auto& element = sequences[i].elements[j];
8856 elementary_feature_value value;
8857  
8858 0 switch (element.type) {
8859 0 case PER_FORM:
8860 0 ▶ value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index];
Branch: 6 branches
BranchTrueFalseTotal
value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index]; 0 0 0
value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index]; 0 0 0
value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index]; 91 4 95
value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index]; 86 5 91
value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index]; 0 0 0
value = form_index + element.sequence_index < 0 || unsigned(form_index + element.sequence_index) >= c.forms->size() ? elementary_feature_empty : c.elementary_per_form[form_index + element.sequence_index].values[element.elementary_index]; 0 0 0
8861 0 break;
8862 0 case PER_TAG:
8863 0 ▶ value = form_index + element.sequence_index < 0 ? elementary_feature_empty : c.window[-element.sequence_index]->values[element.elementary_index];
Branch: 3 branches
BranchTrueFalseTotal
value = form_index + element.sequence_index < 0 ? elementary_feature_empty : c.window[-element.sequence_index]->values[element.elementary_index]; 0 0 0
value = form_index + element.sequence_index < 0 ? elementary_feature_empty : c.window[-element.sequence_index]->values[element.elementary_index]; 235 2 237
value = form_index + element.sequence_index < 0 ? elementary_feature_empty : c.window[-element.sequence_index]->values[element.elementary_index]; 0 0 0
8864 0 break;
8865 0 case DYNAMIC:
8866 default:
8867 0 value = dynamic.values[element.elementary_index];
8868 }
8869  
8870 0 ▶ if (value == elementary_feature_unknown) {
Branch: 3 branches
BranchTrueFalseTotal
if (value == elementary_feature_unknown) { 0 0 0
if (value == elementary_feature_unknown) { 65 267 332
if (value == elementary_feature_unknown) { 0 0 0
8871 0 key = c.key.data();
8872 0 break;
8873 }
8874 0 vli<elementary_feature_value>::encode(value, key);
8875 }
8876  
8877 0 result -= c.caches[i].score;
8878 0 int key_size = key - c.key.data();
8879 0 ▶ if (!key_size) {
Branch: 3 branches
BranchTrueFalseTotal
if (!key_size) { 0 0 0
if (!key_size) { 65 114 179
if (!key_size) { 0 0 0
8880 0 c.caches[i].score = 0;
8881 0 c.caches[i].key_size = 0;
8882 0 ▶ } else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) {
Branch: 9 branches
BranchTrueFalseTotal
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 0 0 0
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 0 0 0
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 0 0 0
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 84 30 114
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 78 6 84
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 108 6 114
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 0 0 0
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 0 0 0
} else if (key_size != c.caches[i].key_size || !small_memeq(c.key.data(), c.caches[i].key.data(), key_size)) { 0 0 0
8883 0 ▶ c.caches[i].score = scores[i].score(c.key.data(), key_size);
Branch: 3 branches
BranchTrueFalseTotal
c.caches[i].score = scores[i].score(c.key.data(), key_size); 0 0 0
c.caches[i].score = scores[i].score(c.key.data(), key_size); 108 0 108
c.caches[i].score = scores[i].score(c.key.data(), key_size); 0 0 0
8884 0 c.caches[i].key_size = key_size;
8885 0 small_memcpy(c.caches[i].key.data(), c.key.data(), key_size);
8886 }
8887 0 result += c.caches[i].score;
8888 }
8889  
8890 0 c.score = result;
8891 0 return result;
8892 }
8893  
8894 template <class ElementaryFeatures, class Map>
8895 void feature_sequences<ElementaryFeatures, Map>::feature_keys(int form_index, int tags_window[], int tags_unchanged, dynamic_features& dynamic, vector<string>& keys, cache& c) const {
8896 score(form_index, tags_window, tags_unchanged, dynamic, c);
8897  
8898 keys.resize(c.caches.size());
8899 for (unsigned i = 0; i < c.caches.size(); i++)
8900 keys[i].assign(c.caches[i].key.data(), c.caches[i].key_size);
8901 }
8902  
8903 } // namespace morphodita
8904  
8905 /////////
8906 // File: morphodita/tagger/viterbi.h
8907 /////////
8908  
8909 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
8910 //
8911 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
8912 // Mathematics and Physics, Charles University in Prague, Czech Republic.
8913 //
8914 // This Source Code Form is subject to the terms of the Mozilla Public
8915 // License, v. 2.0. If a copy of the MPL was not distributed with this
8916 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8917  
8918 namespace morphodita {
8919  
8920 // Declarations
8921 template <class FeatureSequences>
8922 class viterbi {
8923 public:
8924 0 viterbi(const FeatureSequences& features, int decoding_order, int window_size)
8925 0 : features(features), decoding_order(decoding_order), window_size(window_size) {}
8926  
8927 struct cache;
8928 void tag(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, cache& c, vector<int>& tags) const;
8929  
8930 private:
8931 struct node;
8932  
8933 const FeatureSequences& features;
8934 int decoding_order, window_size;
8935 };
8936  
8937 // Definitions
8938 template <class FeatureSequences>
8939 struct viterbi<FeatureSequences>::cache {
8940 vector<node> nodes;
8941 typename FeatureSequences::cache features_cache;
8942  
8943 0 ▶ cache(const viterbi<FeatureSequences>& self) : features_cache(self.features) {}
Branch: 3 branches
BranchTrueFalseTotal
cache(const viterbi<FeatureSequences>& self) : features_cache(self.features) {} 0 0 0
cache(const viterbi<FeatureSequences>& self) : features_cache(self.features) {} 1 0 1
cache(const viterbi<FeatureSequences>& self) : features_cache(self.features) {} 0 0 0
8944 };
8945  
8946 template <class FeatureSequences>
8947 struct viterbi<FeatureSequences>::node {
8948 int tag;
8949 int prev;
8950 feature_sequences_score score;
8951 typename FeatureSequences::dynamic_features dynamic;
8952 };
8953  
8954 template <class FeatureSequences>
8955 0 void viterbi<FeatureSequences>::tag(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, cache& c, vector<int>& tags) const {
8956 0 ▶ if (!forms.size()) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!forms.size()) return; 0 0 0
if (!forms.size()) return; 0 2 2
if (!forms.size()) return; 0 0 0
8957  
8958 // Count number of nodes and allocate
8959 0 unsigned nodes = 0;
8960 0 ▶ for (unsigned i = 0, states = 1; i < forms.size(); i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0, states = 1; i < forms.size(); i++) { 0 0 0
for (unsigned i = 0, states = 1; i < forms.size(); i++) { 7 2 9
for (unsigned i = 0, states = 1; i < forms.size(); i++) { 0 0 0
8961 0 ▶ if (analyses[i].empty()) return;
Branch: 3 branches
BranchTrueFalseTotal
if (analyses[i].empty()) return; 0 0 0
if (analyses[i].empty()) return; 0 7 7
if (analyses[i].empty()) return; 0 0 0
8962 0 ▶ states = (i+1 >= unsigned(decoding_order) ? states / analyses[i-decoding_order+1].size() : states) * analyses[i].size();
Branch: 3 branches
BranchTrueFalseTotal
states = (i+1 >= unsigned(decoding_order) ? states / analyses[i-decoding_order+1].size() : states) * analyses[i].size(); 0 0 0
states = (i+1 >= unsigned(decoding_order) ? states / analyses[i-decoding_order+1].size() : states) * analyses[i].size(); 3 4 7
states = (i+1 >= unsigned(decoding_order) ? states / analyses[i-decoding_order+1].size() : states) * analyses[i].size(); 0 0 0
8963 0 nodes += states;
8964 }
8965 0 ▶ if (nodes > c.nodes.size()) c.nodes.resize(nodes);
Branch: 6 branches
BranchTrueFalseTotal
if (nodes > c.nodes.size()) c.nodes.resize(nodes); 0 0 0
if (nodes > c.nodes.size()) c.nodes.resize(nodes); 0 0 0
if (nodes > c.nodes.size()) c.nodes.resize(nodes); 2 0 2
if (nodes > c.nodes.size()) c.nodes.resize(nodes); 2 0 2
if (nodes > c.nodes.size()) c.nodes.resize(nodes); 0 0 0
if (nodes > c.nodes.size()) c.nodes.resize(nodes); 0 0 0
8966  
8967 // Init feature sequences
8968 0 ▶ features.initialize_sentence(forms, analyses, c.features_cache);
Branch: 3 branches
BranchTrueFalseTotal
features.initialize_sentence(forms, analyses, c.features_cache); 0 0 0
features.initialize_sentence(forms, analyses, c.features_cache); 2 0 2
features.initialize_sentence(forms, analyses, c.features_cache); 0 0 0
8969  
8970 0 int window_stack[16]; vector<int> window_heap;
8971 0 ▶ int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data());
Branch: 6 branches
BranchTrueFalseTotal
int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data()); 0 0 0
int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data()); 0 0 0
int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data()); 2 0 2
int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data()); 0 0 0
int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data()); 0 0 0
int* window = window_size <= 16 ? window_stack : (window_heap.resize(window_size), window_heap.data()); 0 0 0
8972 typename FeatureSequences::dynamic_features dynamic;
8973 feature_sequences_score score;
8974  
8975 // Compute all nodes score
8976 0 int nodes_prev = -1, nodes_now = 0;
8977 0 ▶ for (unsigned i = 0; i < forms.size(); i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
for (unsigned i = 0; i < forms.size(); i++) { 7 2 9
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
8978 0 int nodes_next = nodes_now;
8979  
8980 0 ▶ for (int j = 0; j < window_size; j++) window[j] = -1;
Branch: 3 branches
BranchTrueFalseTotal
for (int j = 0; j < window_size; j++) window[j] = -1; 0 0 0
for (int j = 0; j < window_size; j++) window[j] = -1; 21 7 28
for (int j = 0; j < window_size; j++) window[j] = -1; 0 0 0
8981 0 ▶ for (int tag = 0; tag < int(analyses[i].size()); tag++)
Branch: 3 branches
BranchTrueFalseTotal
for (int tag = 0; tag < int(analyses[i].size()); tag++) 0 0 0
for (int tag = 0; tag < int(analyses[i].size()); tag++) 11 7 18
for (int tag = 0; tag < int(analyses[i].size()); tag++) 0 0 0
8982 0 ▶ for (int prev = nodes_prev; prev < nodes_now; prev++) {
Branch: 3 branches
BranchTrueFalseTotal
for (int prev = nodes_prev; prev < nodes_now; prev++) { 0 0 0
for (int prev = nodes_prev; prev < nodes_now; prev++) { 22 11 33
for (int prev = nodes_prev; prev < nodes_now; prev++) { 0 0 0
8983 // Compute predecessors and number of unchanges
8984 0 int same_tags = window[0] == tag;
8985 0 window[0] = tag;
8986 0 ▶ for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) {
Branch: 6 branches
BranchTrueFalseTotal
for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) { 0 0 0
for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) { 0 0 0
for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) { 45 14 59
for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) { 37 8 45
for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) { 0 0 0
for (int p = prev, n = 1; p >= 0 && n < window_size; p = c.nodes[p].prev, n++) { 0 0 0
8987 0 ▶ same_tags += same_tags == n && window[n] == c.nodes[p].tag;
Branch: 6 branches
BranchTrueFalseTotal
same_tags += same_tags == n && window[n] == c.nodes[p].tag; 0 0 0
same_tags += same_tags == n && window[n] == c.nodes[p].tag; 0 0 0
same_tags += same_tags == n && window[n] == c.nodes[p].tag; 15 22 37
same_tags += same_tags == n && window[n] == c.nodes[p].tag; 4 11 15
same_tags += same_tags == n && window[n] == c.nodes[p].tag; 0 0 0
same_tags += same_tags == n && window[n] == c.nodes[p].tag; 0 0 0
8988 0 window[n] = c.nodes[p].tag;
8989 }
8990  
8991 // Compute dynamic elementary features and score
8992 0 ▶ features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache);
Branch: 6 branches
BranchTrueFalseTotal
features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache); 0 0 0
features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache); 0 0 0
features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache); 20 2 22
features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache); 22 0 22
features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache); 0 0 0
features.compute_dynamic_features(i, tag, prev >= 0 ? &c.nodes[prev].dynamic : nullptr, dynamic, c.features_cache); 0 0 0
8993 0 ▶ score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) +
Branch: 9 branches
BranchTrueFalseTotal
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 0 0 0
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 0 0 0
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 0 0 0
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 6 16 22
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 2 4 6
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 18 0 18
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 0 0 0
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 0 0 0
score = (nodes_prev + 1 == nodes_now && analyses[i].size() == 1 ? 0 : features.score(i, window, same_tags, dynamic, c.features_cache)) + 0 0 0
8994 0 ▶ (prev >= 0 ? c.nodes[prev].score : 0);
Branch: 3 branches
BranchTrueFalseTotal
(prev >= 0 ? c.nodes[prev].score : 0); 0 0 0
(prev >= 0 ? c.nodes[prev].score : 0); 20 2 22
(prev >= 0 ? c.nodes[prev].score : 0); 0 0 0
8995  
8996 // Update existing node or create a new one
8997 0 ▶ if (same_tags >= decoding_order-1) {
Branch: 3 branches
BranchTrueFalseTotal
if (same_tags >= decoding_order-1) { 0 0 0
if (same_tags >= decoding_order-1) { 4 18 22
if (same_tags >= decoding_order-1) { 0 0 0
8998 0 ▶ if (score <= c.nodes[nodes_next-1].score) continue;
Branch: 3 branches
BranchTrueFalseTotal
if (score <= c.nodes[nodes_next-1].score) continue; 0 0 0
if (score <= c.nodes[nodes_next-1].score) continue; 0 4 4
if (score <= c.nodes[nodes_next-1].score) continue; 0 0 0
8999 0 nodes_next--;
9000 }
9001 0 c.nodes[nodes_next].tag = tag;
9002 0 c.nodes[nodes_next].prev = prev;
9003 0 c.nodes[nodes_next].score = score;
9004 0 c.nodes[nodes_next++].dynamic = dynamic;
9005 }
9006  
9007 0 nodes_prev = nodes_now;
9008 0 nodes_now = nodes_next;
9009 }
9010  
9011 // Choose the best ending node
9012 0 int best = nodes_prev;
9013 0 ▶ for (int node = nodes_prev + 1; node < nodes_now; node++)
Branch: 3 branches
BranchTrueFalseTotal
for (int node = nodes_prev + 1; node < nodes_now; node++) 0 0 0
for (int node = nodes_prev + 1; node < nodes_now; node++) 3 2 5
for (int node = nodes_prev + 1; node < nodes_now; node++) 0 0 0
9014 0 ▶ if (c.nodes[node].score > c.nodes[best].score)
Branch: 3 branches
BranchTrueFalseTotal
if (c.nodes[node].score > c.nodes[best].score) 0 0 0
if (c.nodes[node].score > c.nodes[best].score) 1 2 3
if (c.nodes[node].score > c.nodes[best].score) 0 0 0
9015 0 best = node;
9016  
9017 0 ▶ for (int i = forms.size() - 1; i >= 0; i--, best = c.nodes[best].prev)
Branch: 3 branches
BranchTrueFalseTotal
for (int i = forms.size() - 1; i >= 0; i--, best = c.nodes[best].prev) 0 0 0
for (int i = forms.size() - 1; i >= 0; i--, best = c.nodes[best].prev) 7 2 9
for (int i = forms.size() - 1; i >= 0; i--, best = c.nodes[best].prev) 0 0 0
9018 0 tags[i] = c.nodes[best].tag;
9019 0 }
9020  
9021 } // namespace morphodita
9022  
9023 /////////
9024 // File: morphodita/tagger/conllu_elementary_features.h
9025 /////////
9026  
9027 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9028 //
9029 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9030 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9031 //
9032 // This Source Code Form is subject to the terms of the Mozilla Public
9033 // License, v. 2.0. If a copy of the MPL was not distributed with this
9034 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9035  
9036 namespace morphodita {
9037  
9038 // Declarations
9039 template <class Map>
9040 class conllu_elementary_features : public elementary_features<Map> {
9041 public:
9042 conllu_elementary_features();
9043  
9044 enum features_per_form { FORM, FOLLOWING_VERB_TAG, FOLLOWING_VERB_FORM, NUM, CAP, DASH, PREFIX1, PREFIX2, PREFIX3, PREFIX4, PREFIX5, PREFIX6, PREFIX7, PREFIX8, PREFIX9, SUFFIX1, SUFFIX2, SUFFIX3, SUFFIX4, SUFFIX5, SUFFIX6, SUFFIX7, SUFFIX8, SUFFIX9, PER_FORM_TOTAL };
9045 enum features_per_tag { TAG, TAG_UPOS, TAG_CASE, TAG_GENDER, TAG_NUMBER, TAG_NEGATIVE, TAG_PERSON, LEMMA, PER_TAG_TOTAL };
9046 enum features_dynamic { PREVIOUS_VERB_TAG, PREVIOUS_VERB_FORM, PREVIOUS_OR_CURRENT_VERB_TAG, PREVIOUS_OR_CURRENT_VERB_FORM, DYNAMIC_TOTAL };
9047 enum features_map { MAP_NONE = -1, MAP_FORM, MAP_PREFIX1, MAP_PREFIX2, MAP_PREFIX3, MAP_PREFIX4, MAP_PREFIX5, MAP_PREFIX6, MAP_PREFIX7, MAP_PREFIX8, MAP_PREFIX9, MAP_SUFFIX1, MAP_SUFFIX2, MAP_SUFFIX3, MAP_SUFFIX4, MAP_SUFFIX5, MAP_SUFFIX6, MAP_SUFFIX7, MAP_SUFFIX8, MAP_SUFFIX9, MAP_TAG, MAP_TAG_UPOS, MAP_TAG_CASE, MAP_TAG_GENDER, MAP_TAG_NUMBER, MAP_TAG_NEGATIVE, MAP_TAG_PERSON, MAP_LEMMA, MAP_TOTAL } ;
9048  
9049 struct per_form_features { elementary_feature_value values[PER_FORM_TOTAL]; };
9050 struct per_tag_features { elementary_feature_value values[PER_TAG_TOTAL]; };
9051 struct dynamic_features { elementary_feature_value values[DYNAMIC_TOTAL]; };
9052  
9053 static vector<elementary_feature_description> descriptions;
9054  
9055 void compute_features(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<per_form_features>& per_form, vector<vector<per_tag_features>>& per_tag) const;
9056 inline void compute_dynamic_features(const tagged_lemma& tag, const per_form_features& per_form, const per_tag_features& per_tag, const dynamic_features* prev_dynamic, dynamic_features& dynamic) const;
9057  
9058 using elementary_features<Map>::maps;
9059 };
9060  
9061 typedef conllu_elementary_features<persistent_elementary_feature_map> persistent_conllu_elementary_features;
9062  
9063 // Definitions
9064 template <class Map>
9065 0 conllu_elementary_features<Map>::conllu_elementary_features() {
9066 0 ▶ maps.resize(MAP_TOTAL);
Branch: 1 branch
BranchTrueFalseTotal
maps.resize(MAP_TOTAL); 0 0 0
9067 0 }
9068  
9069 template <class Map>
9070 vector<elementary_feature_description> conllu_elementary_features<Map>::descriptions = {
9071 {"Form", PER_FORM, ANY_OFFSET, FORM, MAP_FORM},
9072 {"FollowingVerbTag", PER_FORM, ANY_OFFSET, FOLLOWING_VERB_TAG, MAP_TAG},
9073 {"FollowingVerbForm", PER_FORM, ANY_OFFSET, FOLLOWING_VERB_FORM, MAP_FORM},
9074 {"Num", PER_FORM, ONLY_CURRENT, NUM, MAP_NONE},
9075 {"Cap", PER_FORM, ONLY_CURRENT, CAP, MAP_NONE},
9076 {"Dash", PER_FORM, ONLY_CURRENT, DASH, MAP_NONE},
9077 {"Prefix1", PER_FORM, ONLY_CURRENT, PREFIX1, MAP_PREFIX1},
9078 {"Prefix2", PER_FORM, ONLY_CURRENT, PREFIX2, MAP_PREFIX2},
9079 {"Prefix3", PER_FORM, ONLY_CURRENT, PREFIX3, MAP_PREFIX3},
9080 {"Prefix4", PER_FORM, ONLY_CURRENT, PREFIX4, MAP_PREFIX4},
9081 {"Prefix5", PER_FORM, ONLY_CURRENT, PREFIX5, MAP_PREFIX5},
9082 {"Prefix6", PER_FORM, ONLY_CURRENT, PREFIX6, MAP_PREFIX6},
9083 {"Prefix7", PER_FORM, ONLY_CURRENT, PREFIX7, MAP_PREFIX7},
9084 {"Prefix8", PER_FORM, ONLY_CURRENT, PREFIX8, MAP_PREFIX8},
9085 {"Prefix9", PER_FORM, ONLY_CURRENT, PREFIX9, MAP_PREFIX9},
9086 {"Suffix1", PER_FORM, ONLY_CURRENT, SUFFIX1, MAP_SUFFIX1},
9087 {"Suffix2", PER_FORM, ONLY_CURRENT, SUFFIX2, MAP_SUFFIX2},
9088 {"Suffix3", PER_FORM, ONLY_CURRENT, SUFFIX3, MAP_SUFFIX3},
9089 {"Suffix4", PER_FORM, ONLY_CURRENT, SUFFIX4, MAP_SUFFIX4},
9090 {"Suffix5", PER_FORM, ONLY_CURRENT, SUFFIX5, MAP_SUFFIX5},
9091 {"Suffix6", PER_FORM, ONLY_CURRENT, SUFFIX6, MAP_SUFFIX6},
9092 {"Suffix7", PER_FORM, ONLY_CURRENT, SUFFIX7, MAP_SUFFIX7},
9093 {"Suffix8", PER_FORM, ONLY_CURRENT, SUFFIX8, MAP_SUFFIX8},
9094 {"Suffix9", PER_FORM, ONLY_CURRENT, SUFFIX9, MAP_SUFFIX9},
9095  
9096 {"Tag", PER_TAG, ANY_OFFSET, TAG, MAP_TAG},
9097 {"TagUPos", PER_TAG, ANY_OFFSET, TAG_UPOS, MAP_TAG_UPOS},
9098 {"TagCase", PER_TAG, ANY_OFFSET, TAG_CASE, MAP_TAG_CASE},
9099 {"TagGender", PER_TAG, ANY_OFFSET, TAG_GENDER, MAP_TAG_GENDER},
9100 {"TagNumber", PER_TAG, ANY_OFFSET, TAG_NUMBER, MAP_TAG_NUMBER},
9101 {"TagNegative", PER_TAG, ANY_OFFSET, TAG_NEGATIVE, MAP_TAG_NEGATIVE},
9102 {"TagPerson", PER_TAG, ANY_OFFSET, TAG_PERSON, MAP_TAG_PERSON},
9103 {"Lemma", PER_TAG, ANY_OFFSET, LEMMA, MAP_LEMMA},
9104  
9105 {"PreviousVerbTag", DYNAMIC, ANY_OFFSET, PREVIOUS_VERB_TAG, MAP_TAG},
9106 {"PreviousVerbForm", DYNAMIC, ANY_OFFSET, PREVIOUS_VERB_FORM, MAP_FORM},
9107 };
9108  
9109 template <class Map>
9110 0 void conllu_elementary_features<Map>::compute_features(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<per_form_features>& per_form, vector<vector<per_tag_features>>& per_tag) const {
9111 using namespace unilib;
9112  
9113 // We process the sentence in reverse order, so that we can compute FollowingVerbTag and FollowingVerbLemma directly.
9114 0 elementary_feature_value following_verb_tag = elementary_feature_empty, following_verb_form = elementary_feature_empty;
9115 0 ▶ for (unsigned i = forms.size(); i--;) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = forms.size(); i--;) { 0 0 0
9116 0 int verb_candidate = -1;
9117  
9118 // Per_tag features and verb_candidate
9119 0 ▶ for (unsigned j = 0; j < analyses[i].size(); j++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned j = 0; j < analyses[i].size(); j++) { 0 0 0
9120 0 const string& tag = analyses[i][j].tag;
9121 0 const string& lemma = analyses[i][j].lemma;
9122  
9123 // Tag consists of three parts separated by tag[0] character
9124 // - first is TAG_UPOS,
9125 // - second is TAG_LPOS,
9126 // - then there is any number of | separated named fields in format Name=Value
9127 0 per_tag[i][j].values[TAG] = maps[MAP_TAG].value(tag.c_str(), tag.size());
9128 0 per_tag[i][j].values[TAG_UPOS] = per_tag[i][j].values[TAG_CASE] = per_tag[i][j].values[TAG_GENDER] = elementary_feature_empty;
9129 0 per_tag[i][j].values[TAG_NUMBER] = per_tag[i][j].values[TAG_NEGATIVE] = per_tag[i][j].values[TAG_PERSON] = elementary_feature_empty;
9130 0 ▶ per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == lemma ? per_tag[i][j-1].values[LEMMA] :
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == lemma ? per_tag[i][j-1].values[LEMMA] : 0 0 0
per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == lemma ? per_tag[i][j-1].values[LEMMA] : 0 0 0
9131 0 maps[MAP_LEMMA].value(lemma.c_str(), lemma.size());
9132  
9133 0 char separator = tag[0];
9134 0 size_t index = tag.find(separator, 1);
9135 0 ▶ if (index == string::npos) index = tag.size();
Branch: 1 branch
BranchTrueFalseTotal
if (index == string::npos) index = tag.size(); 0 0 0
9136 0 ▶ per_tag[i][j].values[TAG_UPOS] = maps[MAP_TAG_UPOS].value(tag.c_str() + (index ? 1 : 0), index - (index ? 1 : 0));
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[TAG_UPOS] = maps[MAP_TAG_UPOS].value(tag.c_str() + (index ? 1 : 0), index - (index ? 1 : 0)); 0 0 0
per_tag[i][j].values[TAG_UPOS] = maps[MAP_TAG_UPOS].value(tag.c_str() + (index ? 1 : 0), index - (index ? 1 : 0)); 0 0 0
9137  
9138 0 ▶ if (index < tag.size()) index++;
Branch: 1 branch
BranchTrueFalseTotal
if (index < tag.size()) index++; 0 0 0
9139 0 ▶ if (index < tag.size()) index = tag.find(separator, index);
Branch: 1 branch
BranchTrueFalseTotal
if (index < tag.size()) index = tag.find(separator, index); 0 0 0
9140 0 ▶ if (index < tag.size()) index++;
Branch: 1 branch
BranchTrueFalseTotal
if (index < tag.size()) index++; 0 0 0
9141 0 ▶ for (size_t length; index < tag.size(); index += length + 1) {
Branch: 1 branch
BranchTrueFalseTotal
for (size_t length; index < tag.size(); index += length + 1) { 0 0 0
9142 0 length = tag.find('|', index);
9143 0 ▶ length = (length == string::npos ? tag.size() : length) - index;
Branch: 1 branch
BranchTrueFalseTotal
length = (length == string::npos ? tag.size() : length) - index; 0 0 0
9144  
9145 0 ▶ for (size_t equal_sign = 0; equal_sign + 1 < length; equal_sign++)
Branch: 1 branch
BranchTrueFalseTotal
for (size_t equal_sign = 0; equal_sign + 1 < length; equal_sign++) 0 0 0
9146 0 ▶ if (tag[index + equal_sign] == '=') {
Branch: 1 branch
BranchTrueFalseTotal
if (tag[index + equal_sign] == '=') { 0 0 0
9147 0 int value = -1, map;
9148 0 switch (equal_sign) {
9149 0 case 4:
9150 0 ▶ if (tag.compare(index, equal_sign, "Case") == 0) value = TAG_CASE, map = MAP_TAG_CASE;
Branch: 1 branch
BranchTrueFalseTotal
if (tag.compare(index, equal_sign, "Case") == 0) value = TAG_CASE, map = MAP_TAG_CASE; 0 0 0
9151 0 break;
9152 0 case 6:
9153 0 ▶ if (tag.compare(index, equal_sign, "Gender") == 0) value = TAG_GENDER, map = MAP_TAG_GENDER;
Branch: 1 branch
BranchTrueFalseTotal
if (tag.compare(index, equal_sign, "Gender") == 0) value = TAG_GENDER, map = MAP_TAG_GENDER; 0 0 0
9154 0 ▶ if (tag.compare(index, equal_sign, "Number") == 0) value = TAG_NUMBER, map = MAP_TAG_NUMBER;
Branch: 1 branch
BranchTrueFalseTotal
if (tag.compare(index, equal_sign, "Number") == 0) value = TAG_NUMBER, map = MAP_TAG_NUMBER; 0 0 0
9155 0 ▶ if (tag.compare(index, equal_sign, "Person") == 0) value = TAG_PERSON, map = MAP_TAG_PERSON;
Branch: 1 branch
BranchTrueFalseTotal
if (tag.compare(index, equal_sign, "Person") == 0) value = TAG_PERSON, map = MAP_TAG_PERSON; 0 0 0
9156 0 break;
9157 0 case 8:
9158 0 ▶ if (tag.compare(index, equal_sign, "Negative") == 0) value = TAG_NEGATIVE, map = MAP_TAG_NEGATIVE;
Branch: 1 branch
BranchTrueFalseTotal
if (tag.compare(index, equal_sign, "Negative") == 0) value = TAG_NEGATIVE, map = MAP_TAG_NEGATIVE; 0 0 0
9159 0 break;
9160 }
9161  
9162 0 ▶ if (value >= 0)
Branch: 1 branch
BranchTrueFalseTotal
if (value >= 0) 0 0 0
9163 0 per_tag[i][j].values[value] = maps[map].value(tag.c_str() + index + equal_sign + 1, length - equal_sign - 1);
9164 0 break;
9165 }
9166 }
9167  
9168 0 ▶ if (tag.size() >= 2 && tag[1] == 'V') {
Branch: 3 branches
BranchTrueFalseTotal
if (tag.size() >= 2 && tag[1] == 'V') { 0 0 0
if (tag.size() >= 2 && tag[1] == 'V') { 0 0 0
if (tag.size() >= 2 && tag[1] == 'V') { 0 0 0
9169 int tag_compare;
9170 0 ▶ verb_candidate = verb_candidate < 0 || (tag_compare = tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate;
Branch: 4 branches
BranchTrueFalseTotal
verb_candidate = verb_candidate < 0 || (tag_compare = tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
9171 }
9172 }
9173  
9174 // Per_form features
9175 0 per_form[i].values[FORM] = maps[MAP_FORM].value(forms[i].str, forms[i].len);
9176 0 per_form[i].values[FOLLOWING_VERB_TAG] = following_verb_tag;
9177 0 per_form[i].values[FOLLOWING_VERB_FORM] = following_verb_form;
9178  
9179 // Update following_verb_{tag,lemma} _after_ filling FOLLOWING_VERB_{TAG,LEMMA}.
9180 0 ▶ if (verb_candidate >= 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (verb_candidate >= 0) { 0 0 0
9181 0 following_verb_tag = per_tag[i][verb_candidate].values[TAG];
9182 0 following_verb_form = per_form[i].values[FORM];
9183 }
9184  
9185 // Ortographic per_form features if needed
9186 0 ▶ if (analyses[i].size() == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (analyses[i].size() == 1) { 0 0 0
9187 0 per_form[i].values[NUM] = per_form[i].values[CAP] = per_form[i].values[DASH] = elementary_feature_unknown;
9188 0 per_form[i].values[PREFIX1] = per_form[i].values[PREFIX2] = per_form[i].values[PREFIX3] = elementary_feature_unknown;
9189 0 per_form[i].values[PREFIX4] = per_form[i].values[PREFIX5] = per_form[i].values[PREFIX6] = elementary_feature_unknown;
9190 0 per_form[i].values[PREFIX7] = per_form[i].values[PREFIX8] = per_form[i].values[PREFIX9] = elementary_feature_unknown;
9191 0 per_form[i].values[SUFFIX1] = per_form[i].values[SUFFIX2] = per_form[i].values[SUFFIX3] = elementary_feature_unknown;
9192 0 per_form[i].values[SUFFIX4] = per_form[i].values[SUFFIX5] = per_form[i].values[SUFFIX6] = elementary_feature_unknown;
9193 0 per_form[i].values[SUFFIX7] = per_form[i].values[SUFFIX8] = per_form[i].values[SUFFIX9] = elementary_feature_unknown;
9194 0 ▶ } else if (forms[i].len <= 0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (forms[i].len <= 0) { 0 0 0
9195 0 per_form[i].values[NUM] = per_form[i].values[CAP] = per_form[i].values[DASH] = elementary_feature_empty + 1;
9196 0 per_form[i].values[PREFIX1] = per_form[i].values[PREFIX2] = per_form[i].values[PREFIX3] = elementary_feature_empty;
9197 0 per_form[i].values[PREFIX4] = per_form[i].values[PREFIX5] = per_form[i].values[PREFIX6] = elementary_feature_empty;
9198 0 per_form[i].values[PREFIX7] = per_form[i].values[PREFIX8] = per_form[i].values[PREFIX9] = elementary_feature_empty;
9199 0 per_form[i].values[SUFFIX1] = per_form[i].values[SUFFIX2] = per_form[i].values[SUFFIX3] = elementary_feature_empty;
9200 0 per_form[i].values[SUFFIX4] = per_form[i].values[SUFFIX5] = per_form[i].values[SUFFIX6] = elementary_feature_empty;
9201 0 per_form[i].values[SUFFIX7] = per_form[i].values[SUFFIX8] = per_form[i].values[SUFFIX9] = elementary_feature_empty;
9202 } else {
9203 0 string_piece form = forms[i];
9204 0 const char* form_start = form.str;
9205  
9206 0 bool num = false, cap = false, dash = false;
9207 0 size_t indices[18] = {0, form.len, form.len, form.len, form.len, form.len, form.len, form.len, form.len, form.len, 0, 0, 0, 0, 0, 0, 0, 0}; // careful here regarding forms shorter than 9 characters
9208 0 int index = 0;
9209 0 ▶ while (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (form.len) { 0 0 0
9210 0 indices[(index++) % 18] = form.str - form_start;
9211  
9212 0 unicode::category_t cat = unicode::category(utf8::decode(form.str, form.len));
9213 0 ▶ num = num || cat & unicode::N;
Branch: 2 branches
BranchTrueFalseTotal
num = num || cat & unicode::N; 0 0 0
num = num || cat & unicode::N; 0 0 0
9214 0 ▶ cap = cap || cat & unicode::Lut;
Branch: 2 branches
BranchTrueFalseTotal
cap = cap || cat & unicode::Lut; 0 0 0
cap = cap || cat & unicode::Lut; 0 0 0
9215 0 ▶ dash = dash || cat & unicode::Pd;
Branch: 2 branches
BranchTrueFalseTotal
dash = dash || cat & unicode::Pd; 0 0 0
dash = dash || cat & unicode::Pd; 0 0 0
9216  
9217 0 ▶ if (index == 10 || (!form.len && index < 10)) {
Branch: 3 branches
BranchTrueFalseTotal
if (index == 10 || (!form.len && index < 10)) { 0 0 0
if (index == 10 || (!form.len && index < 10)) { 0 0 0
if (index == 10 || (!form.len && index < 10)) { 0 0 0
9218 0 ▶ per_form[i].values[PREFIX1] = maps[MAP_PREFIX1].value(form_start, indices[1]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX1] = maps[MAP_PREFIX1].value(form_start, indices[1]); 0 0 0
9219 0 ▶ per_form[i].values[PREFIX2] = maps[MAP_PREFIX2].value(form_start, indices[2]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX2] = maps[MAP_PREFIX2].value(form_start, indices[2]); 0 0 0
9220 0 ▶ per_form[i].values[PREFIX3] = maps[MAP_PREFIX3].value(form_start, indices[3]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX3] = maps[MAP_PREFIX3].value(form_start, indices[3]); 0 0 0
9221 0 ▶ per_form[i].values[PREFIX4] = maps[MAP_PREFIX4].value(form_start, indices[4]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX4] = maps[MAP_PREFIX4].value(form_start, indices[4]); 0 0 0
9222 0 ▶ per_form[i].values[PREFIX5] = maps[MAP_PREFIX5].value(form_start, indices[5]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX5] = maps[MAP_PREFIX5].value(form_start, indices[5]); 0 0 0
9223 0 ▶ per_form[i].values[PREFIX6] = maps[MAP_PREFIX6].value(form_start, indices[6]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX6] = maps[MAP_PREFIX6].value(form_start, indices[6]); 0 0 0
9224 0 ▶ per_form[i].values[PREFIX7] = maps[MAP_PREFIX7].value(form_start, indices[7]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX7] = maps[MAP_PREFIX7].value(form_start, indices[7]); 0 0 0
9225 0 ▶ per_form[i].values[PREFIX8] = maps[MAP_PREFIX8].value(form_start, indices[8]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX8] = maps[MAP_PREFIX8].value(form_start, indices[8]); 0 0 0
9226 0 ▶ per_form[i].values[PREFIX9] = maps[MAP_PREFIX9].value(form_start, indices[9]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX9] = maps[MAP_PREFIX9].value(form_start, indices[9]); 0 0 0
9227 }
9228 }
9229 0 ▶ per_form[i].values[SUFFIX1] = maps[MAP_SUFFIX1].value(form_start + indices[(index+18-1) % 18], form.str - form_start - indices[(index+18-1) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX1] = maps[MAP_SUFFIX1].value(form_start + indices[(index+18-1) % 18], form.str - form_start - indices[(index+18-1) % 18]); 0 0 0
9230 0 ▶ per_form[i].values[SUFFIX2] = maps[MAP_SUFFIX2].value(form_start + indices[(index+18-2) % 18], form.str - form_start - indices[(index+18-2) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX2] = maps[MAP_SUFFIX2].value(form_start + indices[(index+18-2) % 18], form.str - form_start - indices[(index+18-2) % 18]); 0 0 0
9231 0 ▶ per_form[i].values[SUFFIX3] = maps[MAP_SUFFIX3].value(form_start + indices[(index+18-3) % 18], form.str - form_start - indices[(index+18-3) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX3] = maps[MAP_SUFFIX3].value(form_start + indices[(index+18-3) % 18], form.str - form_start - indices[(index+18-3) % 18]); 0 0 0
9232 0 ▶ per_form[i].values[SUFFIX4] = maps[MAP_SUFFIX4].value(form_start + indices[(index+18-4) % 18], form.str - form_start - indices[(index+18-4) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX4] = maps[MAP_SUFFIX4].value(form_start + indices[(index+18-4) % 18], form.str - form_start - indices[(index+18-4) % 18]); 0 0 0
9233 0 ▶ per_form[i].values[SUFFIX5] = maps[MAP_SUFFIX5].value(form_start + indices[(index+18-5) % 18], form.str - form_start - indices[(index+18-5) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX5] = maps[MAP_SUFFIX5].value(form_start + indices[(index+18-5) % 18], form.str - form_start - indices[(index+18-5) % 18]); 0 0 0
9234 0 ▶ per_form[i].values[SUFFIX6] = maps[MAP_SUFFIX6].value(form_start + indices[(index+18-6) % 18], form.str - form_start - indices[(index+18-6) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX6] = maps[MAP_SUFFIX6].value(form_start + indices[(index+18-6) % 18], form.str - form_start - indices[(index+18-6) % 18]); 0 0 0
9235 0 ▶ per_form[i].values[SUFFIX7] = maps[MAP_SUFFIX7].value(form_start + indices[(index+18-7) % 18], form.str - form_start - indices[(index+18-7) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX7] = maps[MAP_SUFFIX7].value(form_start + indices[(index+18-7) % 18], form.str - form_start - indices[(index+18-7) % 18]); 0 0 0
9236 0 ▶ per_form[i].values[SUFFIX8] = maps[MAP_SUFFIX8].value(form_start + indices[(index+18-8) % 18], form.str - form_start - indices[(index+18-8) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX8] = maps[MAP_SUFFIX8].value(form_start + indices[(index+18-8) % 18], form.str - form_start - indices[(index+18-8) % 18]); 0 0 0
9237 0 ▶ per_form[i].values[SUFFIX9] = maps[MAP_SUFFIX9].value(form_start + indices[(index+18-9) % 18], form.str - form_start - indices[(index+18-9) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX9] = maps[MAP_SUFFIX9].value(form_start + indices[(index+18-9) % 18], form.str - form_start - indices[(index+18-9) % 18]); 0 0 0
9238 0 per_form[i].values[NUM] = elementary_feature_empty + 1 + num;
9239 0 per_form[i].values[CAP] = elementary_feature_empty + 1 + cap;
9240 0 per_form[i].values[DASH] = elementary_feature_empty + 1 + dash;
9241 }
9242 }
9243 0 }
9244  
9245 template <class Map>
9246 0 void conllu_elementary_features<Map>::compute_dynamic_features(const tagged_lemma& tag, const per_form_features& per_form, const per_tag_features& per_tag, const dynamic_features* prev_dynamic, dynamic_features& dynamic) const {
9247 0 ▶ if (prev_dynamic) {
Branch: 1 branch
BranchTrueFalseTotal
if (prev_dynamic) { 0 0 0
9248 0 dynamic.values[PREVIOUS_VERB_TAG] = prev_dynamic->values[PREVIOUS_OR_CURRENT_VERB_TAG];
9249 0 dynamic.values[PREVIOUS_VERB_FORM] = prev_dynamic->values[PREVIOUS_OR_CURRENT_VERB_FORM];
9250 } else {
9251 0 dynamic.values[PREVIOUS_VERB_TAG] = elementary_feature_empty;
9252 0 dynamic.values[PREVIOUS_VERB_FORM] = elementary_feature_empty;
9253 }
9254  
9255 0 ▶ if (tag.tag.size() >= 2 && tag.tag[1] == 'V') {
Branch: 3 branches
BranchTrueFalseTotal
if (tag.tag.size() >= 2 && tag.tag[1] == 'V') { 0 0 0
if (tag.tag.size() >= 2 && tag.tag[1] == 'V') { 0 0 0
if (tag.tag.size() >= 2 && tag.tag[1] == 'V') { 0 0 0
9256 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_TAG] = per_tag.values[TAG];
9257 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_FORM] = per_form.values[FORM];
9258 } else {
9259 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_TAG] = dynamic.values[PREVIOUS_VERB_TAG];
9260 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_FORM] = dynamic.values[PREVIOUS_VERB_FORM];
9261 }
9262 0 }
9263  
9264 } // namespace morphodita
9265  
9266 /////////
9267 // File: morphodita/tagger/czech_elementary_features.h
9268 /////////
9269  
9270 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9271 //
9272 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9273 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9274 //
9275 // This Source Code Form is subject to the terms of the Mozilla Public
9276 // License, v. 2.0. If a copy of the MPL was not distributed with this
9277 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9278  
9279 namespace morphodita {
9280  
9281 // Declarations
9282 template <class Map>
9283 class czech_elementary_features : public elementary_features<Map> {
9284 public:
9285 czech_elementary_features();
9286  
9287 enum features_per_form { FORM, FOLLOWING_VERB_TAG, FOLLOWING_VERB_LEMMA, NUM, CAP, DASH, PREFIX1, PREFIX2, PREFIX3, PREFIX4, SUFFIX1, SUFFIX2, SUFFIX3, SUFFIX4, PER_FORM_TOTAL };
9288 enum features_per_tag { TAG, TAG3, TAG5, TAG25, LEMMA, PER_TAG_TOTAL };
9289 enum features_dynamic { PREVIOUS_VERB_TAG, PREVIOUS_VERB_LEMMA, PREVIOUS_OR_CURRENT_VERB_TAG, PREVIOUS_OR_CURRENT_VERB_LEMMA, DYNAMIC_TOTAL };
9290 enum features_map { MAP_NONE = -1, MAP_FORM, MAP_LEMMA, MAP_PREFIX1, MAP_PREFIX2, MAP_PREFIX3, MAP_PREFIX4, MAP_SUFFIX1, MAP_SUFFIX2, MAP_SUFFIX3, MAP_SUFFIX4, MAP_TAG, MAP_TAG3, MAP_TAG5, MAP_TAG25, MAP_TOTAL } ;
9291  
9292 struct per_form_features { elementary_feature_value values[PER_FORM_TOTAL]; };
9293 struct per_tag_features { elementary_feature_value values[PER_TAG_TOTAL]; };
9294 struct dynamic_features { elementary_feature_value values[DYNAMIC_TOTAL]; };
9295  
9296 static vector<elementary_feature_description> descriptions;
9297  
9298 void compute_features(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<per_form_features>& per_form, vector<vector<per_tag_features>>& per_tag) const;
9299 inline void compute_dynamic_features(const tagged_lemma& tag, const per_form_features& per_form, const per_tag_features& per_tag, const dynamic_features* prev_dynamic, dynamic_features& dynamic) const;
9300  
9301 using elementary_features<Map>::maps;
9302 };
9303  
9304 typedef czech_elementary_features<persistent_elementary_feature_map> persistent_czech_elementary_features;
9305  
9306 // Definitions
9307 template <class Map>
9308 0 czech_elementary_features<Map>::czech_elementary_features() {
9309 0 ▶ maps.resize(MAP_TOTAL);
Branch: 1 branch
BranchTrueFalseTotal
maps.resize(MAP_TOTAL); 0 0 0
9310 0 }
9311  
9312 template <class Map>
9313 vector<elementary_feature_description> czech_elementary_features<Map>::descriptions = {
9314 {"Form", PER_FORM, ANY_OFFSET, FORM, MAP_FORM},
9315 {"FollowingVerbTag", PER_FORM, ANY_OFFSET, FOLLOWING_VERB_TAG, MAP_TAG},
9316 {"FollowingVerbLemma", PER_FORM, ANY_OFFSET, FOLLOWING_VERB_LEMMA, MAP_LEMMA },
9317 {"Num", PER_FORM, ONLY_CURRENT, NUM, MAP_NONE},
9318 {"Cap", PER_FORM, ONLY_CURRENT, CAP, MAP_NONE},
9319 {"Dash", PER_FORM, ONLY_CURRENT, DASH, MAP_NONE},
9320 {"Prefix1", PER_FORM, ONLY_CURRENT, PREFIX1, MAP_PREFIX1},
9321 {"Prefix2", PER_FORM, ONLY_CURRENT, PREFIX2, MAP_PREFIX2},
9322 {"Prefix3", PER_FORM, ONLY_CURRENT, PREFIX3, MAP_PREFIX3},
9323 {"Prefix4", PER_FORM, ONLY_CURRENT, PREFIX4, MAP_PREFIX4},
9324 {"Suffix1", PER_FORM, ONLY_CURRENT, SUFFIX1, MAP_SUFFIX1},
9325 {"Suffix2", PER_FORM, ONLY_CURRENT, SUFFIX2, MAP_SUFFIX2},
9326 {"Suffix3", PER_FORM, ONLY_CURRENT, SUFFIX3, MAP_SUFFIX3},
9327 {"Suffix4", PER_FORM, ONLY_CURRENT, SUFFIX4, MAP_SUFFIX4},
9328  
9329 {"Tag", PER_TAG, ANY_OFFSET, TAG, MAP_TAG},
9330 {"Tag3", PER_TAG, ANY_OFFSET, TAG3, MAP_TAG3},
9331 {"Tag5", PER_TAG, ANY_OFFSET, TAG5, MAP_TAG5},
9332 {"Tag25", PER_TAG, ANY_OFFSET, TAG25, MAP_TAG25},
9333 {"Lemma", PER_TAG, ANY_OFFSET, LEMMA, MAP_LEMMA},
9334  
9335 {"PreviousVerbTag", DYNAMIC, ANY_OFFSET, PREVIOUS_VERB_TAG, MAP_TAG},
9336 {"PreviousVerbLemma", DYNAMIC, ANY_OFFSET, PREVIOUS_VERB_LEMMA, MAP_LEMMA}
9337 };
9338  
9339 template <class Map>
9340 0 void czech_elementary_features<Map>::compute_features(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<per_form_features>& per_form, vector<vector<per_tag_features>>& per_tag) const {
9341 using namespace unilib;
9342  
9343 // We process the sentence in reverse order, so that we can compute FollowingVerbTag and FollowingVerbLemma directly.
9344 0 elementary_feature_value following_verb_tag = elementary_feature_empty, following_verb_lemma = elementary_feature_empty;
9345 0 ▶ for (unsigned i = forms.size(); i--;) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = forms.size(); i--;) { 0 0 0
9346 0 int verb_candidate = -1;
9347  
9348 // Per_tag features and verb_candidate
9349 0 ▶ for (unsigned j = 0; j < analyses[i].size(); j++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned j = 0; j < analyses[i].size(); j++) { 0 0 0
9350 char tag25[2];
9351 0 ▶ per_tag[i][j].values[TAG] = maps[MAP_TAG].value(analyses[i][j].tag.c_str(), analyses[i][j].tag.size());
Branch: 1 branch
BranchTrueFalseTotal
per_tag[i][j].values[TAG] = maps[MAP_TAG].value(analyses[i][j].tag.c_str(), analyses[i][j].tag.size()); 0 0 0
9352 0 ▶ per_tag[i][j].values[TAG3] = analyses[i][j].tag.size() >= 3 ? maps[MAP_TAG3].value(analyses[i][j].tag.c_str() + 2, 1) : elementary_feature_empty;
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[TAG3] = analyses[i][j].tag.size() >= 3 ? maps[MAP_TAG3].value(analyses[i][j].tag.c_str() + 2, 1) : elementary_feature_empty; 0 0 0
per_tag[i][j].values[TAG3] = analyses[i][j].tag.size() >= 3 ? maps[MAP_TAG3].value(analyses[i][j].tag.c_str() + 2, 1) : elementary_feature_empty; 0 0 0
9353 0 ▶ per_tag[i][j].values[TAG5] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG5].value(analyses[i][j].tag.c_str() + 4, 1) : elementary_feature_empty;
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[TAG5] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG5].value(analyses[i][j].tag.c_str() + 4, 1) : elementary_feature_empty; 0 0 0
per_tag[i][j].values[TAG5] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG5].value(analyses[i][j].tag.c_str() + 4, 1) : elementary_feature_empty; 0 0 0
9354 0 ▶ per_tag[i][j].values[TAG25] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG25].value((tag25[0] = analyses[i][j].tag[1], tag25[1] = analyses[i][j].tag[4], tag25), 2) : elementary_feature_empty;
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[TAG25] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG25].value((tag25[0] = analyses[i][j].tag[1], tag25[1] = analyses[i][j].tag[4], tag25), 2) : elementary_feature_empty; 0 0 0
per_tag[i][j].values[TAG25] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG25].value((tag25[0] = analyses[i][j].tag[1], tag25[1] = analyses[i][j].tag[4], tag25), 2) : elementary_feature_empty; 0 0 0
9355 0 ▶ per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == analyses[i][j].lemma ? per_tag[i][j-1].values[LEMMA] :
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == analyses[i][j].lemma ? per_tag[i][j-1].values[LEMMA] : 0 0 0
per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == analyses[i][j].lemma ? per_tag[i][j-1].values[LEMMA] : 0 0 0
9356 0 ▶ maps[MAP_LEMMA].value(analyses[i][j].lemma.c_str(), analyses[i][j].lemma.size());
Branch: 1 branch
BranchTrueFalseTotal
maps[MAP_LEMMA].value(analyses[i][j].lemma.c_str(), analyses[i][j].lemma.size()); 0 0 0
9357  
9358 0 ▶ if (analyses[i][j].tag[0] == 'V') {
Branch: 1 branch
BranchTrueFalseTotal
if (analyses[i][j].tag[0] == 'V') { 0 0 0
9359 int tag_compare;
9360 0 ▶ verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate;
Branch: 5 branches
BranchTrueFalseTotal
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
9361 }
9362 }
9363  
9364 // Per_form features
9365 0 per_form[i].values[FORM] = maps[MAP_FORM].value(forms[i].str, forms[i].len);
9366 0 per_form[i].values[FOLLOWING_VERB_TAG] = following_verb_tag;
9367 0 per_form[i].values[FOLLOWING_VERB_LEMMA] = following_verb_lemma;
9368  
9369 // Update following_verb_{tag,lemma} _after_ filling FOLLOWING_VERB_{TAG,LEMMA}.
9370 0 ▶ if (verb_candidate >= 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (verb_candidate >= 0) { 0 0 0
9371 0 following_verb_tag = per_tag[i][verb_candidate].values[TAG];
9372 0 following_verb_lemma = per_tag[i][verb_candidate].values[LEMMA];
9373 }
9374  
9375 // Ortographic per_form features if needed
9376 0 ▶ if (analyses[i].size() == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (analyses[i].size() == 1) { 0 0 0
9377 0 per_form[i].values[NUM] = per_form[i].values[CAP] = per_form[i].values[DASH] = elementary_feature_unknown;
9378 0 per_form[i].values[PREFIX1] = per_form[i].values[PREFIX2] = per_form[i].values[PREFIX3] = per_form[i].values[PREFIX4] = elementary_feature_unknown;
9379 0 per_form[i].values[SUFFIX1] = per_form[i].values[SUFFIX2] = per_form[i].values[SUFFIX3] = per_form[i].values[SUFFIX4] = elementary_feature_unknown;
9380 0 ▶ } else if (forms[i].len <= 0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (forms[i].len <= 0) { 0 0 0
9381 0 per_form[i].values[NUM] = per_form[i].values[CAP] = per_form[i].values[DASH] = elementary_feature_empty + 1;
9382 0 per_form[i].values[PREFIX1] = per_form[i].values[PREFIX2] = per_form[i].values[PREFIX3] = per_form[i].values[PREFIX4] = elementary_feature_empty;
9383 0 per_form[i].values[SUFFIX1] = per_form[i].values[SUFFIX2] = per_form[i].values[SUFFIX3] = per_form[i].values[SUFFIX4] = elementary_feature_empty;
9384 } else {
9385 0 string_piece form = forms[i];
9386 0 const char* form_start = form.str;
9387  
9388 0 bool num = false, cap = false, dash = false;
9389 0 size_t indices[8] = {0, form.len, form.len, form.len, form.len, 0, 0, 0}; // careful here regarding forms shorter than 4 characters
9390 0 int index = 0;
9391 0 ▶ while (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (form.len) { 0 0 0
9392 0 indices[(index++)&7] = form.str - form_start;
9393  
9394 0 unicode::category_t cat = unicode::category(utf8::decode(form.str, form.len));
9395 0 ▶ num = num || cat & unicode::N;
Branch: 2 branches
BranchTrueFalseTotal
num = num || cat & unicode::N; 0 0 0
num = num || cat & unicode::N; 0 0 0
9396 0 ▶ cap = cap || cat & unicode::Lut;
Branch: 2 branches
BranchTrueFalseTotal
cap = cap || cat & unicode::Lut; 0 0 0
cap = cap || cat & unicode::Lut; 0 0 0
9397 0 ▶ dash = dash || cat & unicode::Pd;
Branch: 2 branches
BranchTrueFalseTotal
dash = dash || cat & unicode::Pd; 0 0 0
dash = dash || cat & unicode::Pd; 0 0 0
9398  
9399 0 ▶ if (index == 5 || (!form.len && index < 5)) {
Branch: 3 branches
BranchTrueFalseTotal
if (index == 5 || (!form.len && index < 5)) { 0 0 0
if (index == 5 || (!form.len && index < 5)) { 0 0 0
if (index == 5 || (!form.len && index < 5)) { 0 0 0
9400 0 ▶ per_form[i].values[PREFIX1] = maps[MAP_PREFIX1].value(form_start, indices[1]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX1] = maps[MAP_PREFIX1].value(form_start, indices[1]); 0 0 0
9401 0 ▶ per_form[i].values[PREFIX2] = maps[MAP_PREFIX2].value(form_start, indices[2]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX2] = maps[MAP_PREFIX2].value(form_start, indices[2]); 0 0 0
9402 0 ▶ per_form[i].values[PREFIX3] = maps[MAP_PREFIX3].value(form_start, indices[3]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX3] = maps[MAP_PREFIX3].value(form_start, indices[3]); 0 0 0
9403 0 ▶ per_form[i].values[PREFIX4] = maps[MAP_PREFIX4].value(form_start, indices[4]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX4] = maps[MAP_PREFIX4].value(form_start, indices[4]); 0 0 0
9404 }
9405 }
9406 0 ▶ per_form[i].values[SUFFIX1] = maps[MAP_SUFFIX1].value(form_start + indices[(index-1)&7], form.str - form_start - indices[(index-1)&7]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX1] = maps[MAP_SUFFIX1].value(form_start + indices[(index-1)&7], form.str - form_start - indices[(index-1)&7]); 0 0 0
9407 0 ▶ per_form[i].values[SUFFIX2] = maps[MAP_SUFFIX2].value(form_start + indices[(index-2)&7], form.str - form_start - indices[(index-2)&7]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX2] = maps[MAP_SUFFIX2].value(form_start + indices[(index-2)&7], form.str - form_start - indices[(index-2)&7]); 0 0 0
9408 0 ▶ per_form[i].values[SUFFIX3] = maps[MAP_SUFFIX3].value(form_start + indices[(index-3)&7], form.str - form_start - indices[(index-3)&7]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX3] = maps[MAP_SUFFIX3].value(form_start + indices[(index-3)&7], form.str - form_start - indices[(index-3)&7]); 0 0 0
9409 0 ▶ per_form[i].values[SUFFIX4] = maps[MAP_SUFFIX4].value(form_start + indices[(index-4)&7], form.str - form_start - indices[(index-4)&7]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX4] = maps[MAP_SUFFIX4].value(form_start + indices[(index-4)&7], form.str - form_start - indices[(index-4)&7]); 0 0 0
9410 0 per_form[i].values[NUM] = elementary_feature_empty + 1 + num;
9411 0 per_form[i].values[CAP] = elementary_feature_empty + 1 + cap;
9412 0 per_form[i].values[DASH] = elementary_feature_empty + 1 + dash;
9413 }
9414 }
9415 0 }
9416  
9417 template <class Map>
9418 0 void czech_elementary_features<Map>::compute_dynamic_features(const tagged_lemma& tag, const per_form_features& /*per_form*/, const per_tag_features& per_tag, const dynamic_features* prev_dynamic, dynamic_features& dynamic) const {
9419 0 ▶ if (prev_dynamic) {
Branch: 1 branch
BranchTrueFalseTotal
if (prev_dynamic) { 0 0 0
9420 0 dynamic.values[PREVIOUS_VERB_TAG] = prev_dynamic->values[PREVIOUS_OR_CURRENT_VERB_TAG];
9421 0 dynamic.values[PREVIOUS_VERB_LEMMA] = prev_dynamic->values[PREVIOUS_OR_CURRENT_VERB_LEMMA];
9422 } else {
9423 0 dynamic.values[PREVIOUS_VERB_TAG] = elementary_feature_empty;
9424 0 dynamic.values[PREVIOUS_VERB_LEMMA] = elementary_feature_empty;
9425 }
9426  
9427 0 ▶ if (tag.tag[0] == 'V') {
Branch: 1 branch
BranchTrueFalseTotal
if (tag.tag[0] == 'V') { 0 0 0
9428 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_TAG] = per_tag.values[TAG];
9429 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_LEMMA] = per_tag.values[LEMMA];
9430 } else {
9431 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_TAG] = dynamic.values[PREVIOUS_VERB_TAG];
9432 0 dynamic.values[PREVIOUS_OR_CURRENT_VERB_LEMMA] = dynamic.values[PREVIOUS_VERB_LEMMA];
9433 }
9434 0 }
9435  
9436 } // namespace morphodita
9437  
9438 /////////
9439 // File: morphodita/tagger/generic_elementary_features.h
9440 /////////
9441  
9442 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9443 //
9444 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9445 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9446 //
9447 // This Source Code Form is subject to the terms of the Mozilla Public
9448 // License, v. 2.0. If a copy of the MPL was not distributed with this
9449 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9450  
9451 namespace morphodita {
9452  
9453 // Declarations
9454 template <class Map>
9455 class generic_elementary_features : public elementary_features<Map> {
9456 public:
9457 generic_elementary_features();
9458  
9459 enum features_per_form { FORM, FOLLOWING_VERB_TAG, FOLLOWING_VERB_LEMMA, NUM, CAP, DASH, PREFIX1, PREFIX2, PREFIX3, PREFIX4, PREFIX5, PREFIX6, PREFIX7, PREFIX8, PREFIX9, SUFFIX1, SUFFIX2, SUFFIX3, SUFFIX4, SUFFIX5, SUFFIX6, SUFFIX7, SUFFIX8, SUFFIX9, PER_FORM_TOTAL };
9460 enum features_per_tag { TAG, TAG1, TAG2, TAG3, TAG4, TAG5, LEMMA, PER_TAG_TOTAL };
9461 enum features_dynamic { PREVIOUS_VERB_TAG, PREVIOUS_VERB_LEMMA, PREVIOUS_OR_CURRENT_VERB_TAG, PREVIOUS_OR_CURRENT_VERB_LEMMA, DYNAMIC_TOTAL };
9462 enum features_map { MAP_NONE = -1, MAP_FORM, MAP_PREFIX1, MAP_PREFIX2, MAP_PREFIX3, MAP_PREFIX4, MAP_PREFIX5, MAP_PREFIX6, MAP_PREFIX7, MAP_PREFIX8, MAP_PREFIX9, MAP_SUFFIX1, MAP_SUFFIX2, MAP_SUFFIX3, MAP_SUFFIX4, MAP_SUFFIX5, MAP_SUFFIX6, MAP_SUFFIX7, MAP_SUFFIX8, MAP_SUFFIX9, MAP_TAG, MAP_TAG1, MAP_TAG2, MAP_TAG3, MAP_TAG4, MAP_TAG5, MAP_LEMMA, MAP_TOTAL } ;
9463  
9464 struct per_form_features { elementary_feature_value values[PER_FORM_TOTAL]; };
9465 struct per_tag_features { elementary_feature_value values[PER_TAG_TOTAL]; };
9466 struct dynamic_features { elementary_feature_value values[DYNAMIC_TOTAL]; };
9467  
9468 static vector<elementary_feature_description> descriptions;
9469  
9470 void compute_features(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<per_form_features>& per_form, vector<vector<per_tag_features>>& per_tag) const;
9471 inline void compute_dynamic_features(const tagged_lemma& tag, const per_form_features& per_form, const per_tag_features& per_tag, const dynamic_features* prev_dynamic, dynamic_features& dynamic) const;
9472  
9473 using elementary_features<Map>::maps;
9474 };
9475  
9476 typedef generic_elementary_features<persistent_elementary_feature_map> persistent_generic_elementary_features;
9477  
9478 // Definitions
9479 template <class Map>
9480 1 generic_elementary_features<Map>::generic_elementary_features() {
9481 1 ▶ maps.resize(MAP_TOTAL);
Branch: 1 branch
BranchTrueFalseTotal
maps.resize(MAP_TOTAL); 1 0 1
9482 1 }
9483  
9484 template <class Map>
9485 vector<elementary_feature_description> generic_elementary_features<Map>::descriptions = {
9486 {"Form", PER_FORM, ANY_OFFSET, FORM, MAP_FORM},
9487 {"FollowingVerbTag", PER_FORM, ANY_OFFSET, FOLLOWING_VERB_TAG, MAP_TAG},
9488 {"FollowingVerbLemma", PER_FORM, ANY_OFFSET, FOLLOWING_VERB_LEMMA, MAP_LEMMA },
9489 {"Num", PER_FORM, ONLY_CURRENT, NUM, MAP_NONE},
9490 {"Cap", PER_FORM, ONLY_CURRENT, CAP, MAP_NONE},
9491 {"Dash", PER_FORM, ONLY_CURRENT, DASH, MAP_NONE},
9492 {"Prefix1", PER_FORM, ONLY_CURRENT, PREFIX1, MAP_PREFIX1},
9493 {"Prefix2", PER_FORM, ONLY_CURRENT, PREFIX2, MAP_PREFIX2},
9494 {"Prefix3", PER_FORM, ONLY_CURRENT, PREFIX3, MAP_PREFIX3},
9495 {"Prefix4", PER_FORM, ONLY_CURRENT, PREFIX4, MAP_PREFIX4},
9496 {"Prefix5", PER_FORM, ONLY_CURRENT, PREFIX5, MAP_PREFIX5},
9497 {"Prefix6", PER_FORM, ONLY_CURRENT, PREFIX6, MAP_PREFIX6},
9498 {"Prefix7", PER_FORM, ONLY_CURRENT, PREFIX7, MAP_PREFIX7},
9499 {"Prefix8", PER_FORM, ONLY_CURRENT, PREFIX8, MAP_PREFIX8},
9500 {"Prefix9", PER_FORM, ONLY_CURRENT, PREFIX9, MAP_PREFIX9},
9501 {"Suffix1", PER_FORM, ONLY_CURRENT, SUFFIX1, MAP_SUFFIX1},
9502 {"Suffix2", PER_FORM, ONLY_CURRENT, SUFFIX2, MAP_SUFFIX2},
9503 {"Suffix3", PER_FORM, ONLY_CURRENT, SUFFIX3, MAP_SUFFIX3},
9504 {"Suffix4", PER_FORM, ONLY_CURRENT, SUFFIX4, MAP_SUFFIX4},
9505 {"Suffix5", PER_FORM, ONLY_CURRENT, SUFFIX5, MAP_SUFFIX5},
9506 {"Suffix6", PER_FORM, ONLY_CURRENT, SUFFIX6, MAP_SUFFIX6},
9507 {"Suffix7", PER_FORM, ONLY_CURRENT, SUFFIX7, MAP_SUFFIX7},
9508 {"Suffix8", PER_FORM, ONLY_CURRENT, SUFFIX8, MAP_SUFFIX8},
9509 {"Suffix9", PER_FORM, ONLY_CURRENT, SUFFIX9, MAP_SUFFIX9},
9510  
9511 {"Tag", PER_TAG, ANY_OFFSET, TAG, MAP_TAG},
9512 {"Tag1", PER_TAG, ANY_OFFSET, TAG1, MAP_TAG1},
9513 {"Tag2", PER_TAG, ANY_OFFSET, TAG2, MAP_TAG2},
9514 {"Tag3", PER_TAG, ANY_OFFSET, TAG3, MAP_TAG3},
9515 {"Tag4", PER_TAG, ANY_OFFSET, TAG4, MAP_TAG4},
9516 {"Tag5", PER_TAG, ANY_OFFSET, TAG5, MAP_TAG5},
9517 {"Lemma", PER_TAG, ANY_OFFSET, LEMMA, MAP_LEMMA},
9518  
9519 {"PreviousVerbTag", DYNAMIC, ANY_OFFSET, PREVIOUS_VERB_TAG, MAP_TAG},
9520 {"PreviousVerbLemma", DYNAMIC, ANY_OFFSET, PREVIOUS_VERB_LEMMA, MAP_LEMMA}
9521 };
9522  
9523 template <class Map>
9524 2 void generic_elementary_features<Map>::compute_features(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<per_form_features>& per_form, vector<vector<per_tag_features>>& per_tag) const {
9525 using namespace unilib;
9526  
9527 // We process the sentence in reverse order, so that we can compute FollowingVerbTag and FollowingVerbLemma directly.
9528 2 elementary_feature_value following_verb_tag = elementary_feature_empty, following_verb_lemma = elementary_feature_empty;
9529 9 ▶ for (unsigned i = forms.size(); i--;) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = forms.size(); i--;) { 7 2 9
9530 7 int verb_candidate = -1;
9531  
9532 // Per_tag features and verb_candidate
9533 18 ▶ for (unsigned j = 0; j < analyses[i].size(); j++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned j = 0; j < analyses[i].size(); j++) { 11 7 18
9534 11 per_tag[i][j].values[TAG] = maps[MAP_TAG].value(analyses[i][j].tag.c_str(), analyses[i][j].tag.size());
9535 11 ▶ per_tag[i][j].values[TAG1] = analyses[i][j].tag.size() >= 1 ? maps[MAP_TAG1].value(analyses[i][j].tag.c_str() + 0, 1) : elementary_feature_empty;
Branch: 1 branch
BranchTrueFalseTotal
per_tag[i][j].values[TAG1] = analyses[i][j].tag.size() >= 1 ? maps[MAP_TAG1].value(analyses[i][j].tag.c_str() + 0, 1) : elementary_feature_empty; 11 0 11
9536 11 ▶ per_tag[i][j].values[TAG2] = analyses[i][j].tag.size() >= 2 ? maps[MAP_TAG2].value(analyses[i][j].tag.c_str() + 1, 1) : elementary_feature_empty;
Branch: 1 branch
BranchTrueFalseTotal
per_tag[i][j].values[TAG2] = analyses[i][j].tag.size() >= 2 ? maps[MAP_TAG2].value(analyses[i][j].tag.c_str() + 1, 1) : elementary_feature_empty; 11 0 11
9537 11 ▶ per_tag[i][j].values[TAG3] = analyses[i][j].tag.size() >= 3 ? maps[MAP_TAG3].value(analyses[i][j].tag.c_str() + 2, 1) : elementary_feature_empty;
Branch: 1 branch
BranchTrueFalseTotal
per_tag[i][j].values[TAG3] = analyses[i][j].tag.size() >= 3 ? maps[MAP_TAG3].value(analyses[i][j].tag.c_str() + 2, 1) : elementary_feature_empty; 11 0 11
9538 11 ▶ per_tag[i][j].values[TAG4] = analyses[i][j].tag.size() >= 4 ? maps[MAP_TAG4].value(analyses[i][j].tag.c_str() + 3, 1) : elementary_feature_empty;
Branch: 1 branch
BranchTrueFalseTotal
per_tag[i][j].values[TAG4] = analyses[i][j].tag.size() >= 4 ? maps[MAP_TAG4].value(analyses[i][j].tag.c_str() + 3, 1) : elementary_feature_empty; 2 9 11
9539 11 ▶ per_tag[i][j].values[TAG5] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG5].value(analyses[i][j].tag.c_str() + 4, 1) : elementary_feature_empty;
Branch: 1 branch
BranchTrueFalseTotal
per_tag[i][j].values[TAG5] = analyses[i][j].tag.size() >= 5 ? maps[MAP_TAG5].value(analyses[i][j].tag.c_str() + 4, 1) : elementary_feature_empty; 0 11 11
9540 18 ▶ per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == analyses[i][j].lemma ? per_tag[i][j-1].values[LEMMA] :
Branch: 2 branches
BranchTrueFalseTotal
per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == analyses[i][j].lemma ? per_tag[i][j-1].values[LEMMA] : 4 7 11
per_tag[i][j].values[LEMMA] = j && analyses[i][j-1].lemma == analyses[i][j].lemma ? per_tag[i][j-1].values[LEMMA] : 4 0 4
9541 7 maps[MAP_LEMMA].value(analyses[i][j].lemma.c_str(), analyses[i][j].lemma.size());
9542  
9543 11 ▶ if (analyses[i][j].tag[0] == 'V') {
Branch: 1 branch
BranchTrueFalseTotal
if (analyses[i][j].tag[0] == 'V') { 3 8 11
9544 int tag_compare;
9545 3 ▶ verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate;
Branch: 4 branches
BranchTrueFalseTotal
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 1 2 3
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 1 0 1
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 1 1
verb_candidate = verb_candidate < 0 || (tag_compare = analyses[i][j].tag.compare(analyses[i][verb_candidate].tag), tag_compare < 0) || (tag_compare == 0 && analyses[i][j].lemma < analyses[i][verb_candidate].lemma) ? j : verb_candidate; 0 0 0
9546 }
9547 }
9548  
9549 // Per_form features
9550 7 per_form[i].values[FORM] = maps[MAP_FORM].value(forms[i].str, forms[i].len);
9551 7 per_form[i].values[FOLLOWING_VERB_TAG] = following_verb_tag;
9552 7 per_form[i].values[FOLLOWING_VERB_LEMMA] = following_verb_lemma;
9553  
9554 // Update following_verb_{tag,lemma} _after_ filling FOLLOWING_VERB_{TAG,LEMMA}.
9555 7 ▶ if (verb_candidate >= 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (verb_candidate >= 0) { 2 5 7
9556 2 following_verb_tag = per_tag[i][verb_candidate].values[TAG];
9557 2 following_verb_lemma = per_tag[i][verb_candidate].values[LEMMA];
9558 }
9559  
9560 // Ortographic per_form features if needed
9561 7 ▶ if (analyses[i].size() == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (analyses[i].size() == 1) { 5 2 7
9562 5 per_form[i].values[NUM] = per_form[i].values[CAP] = per_form[i].values[DASH] = elementary_feature_unknown;
9563 5 per_form[i].values[PREFIX1] = per_form[i].values[PREFIX2] = per_form[i].values[PREFIX3] = elementary_feature_unknown;
9564 5 per_form[i].values[PREFIX4] = per_form[i].values[PREFIX5] = per_form[i].values[PREFIX6] = elementary_feature_unknown;
9565 5 per_form[i].values[PREFIX7] = per_form[i].values[PREFIX8] = per_form[i].values[PREFIX9] = elementary_feature_unknown;
9566 5 per_form[i].values[SUFFIX1] = per_form[i].values[SUFFIX2] = per_form[i].values[SUFFIX3] = elementary_feature_unknown;
9567 5 per_form[i].values[SUFFIX4] = per_form[i].values[SUFFIX5] = per_form[i].values[SUFFIX6] = elementary_feature_unknown;
9568 5 per_form[i].values[SUFFIX7] = per_form[i].values[SUFFIX8] = per_form[i].values[SUFFIX9] = elementary_feature_unknown;
9569 2 ▶ } else if (forms[i].len <= 0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (forms[i].len <= 0) { 0 2 2
9570 0 per_form[i].values[NUM] = per_form[i].values[CAP] = per_form[i].values[DASH] = elementary_feature_empty + 1;
9571 0 per_form[i].values[PREFIX1] = per_form[i].values[PREFIX2] = per_form[i].values[PREFIX3] = elementary_feature_empty;
9572 0 per_form[i].values[PREFIX4] = per_form[i].values[PREFIX5] = per_form[i].values[PREFIX6] = elementary_feature_empty;
9573 0 per_form[i].values[PREFIX7] = per_form[i].values[PREFIX8] = per_form[i].values[PREFIX9] = elementary_feature_empty;
9574 0 per_form[i].values[SUFFIX1] = per_form[i].values[SUFFIX2] = per_form[i].values[SUFFIX3] = elementary_feature_empty;
9575 0 per_form[i].values[SUFFIX4] = per_form[i].values[SUFFIX5] = per_form[i].values[SUFFIX6] = elementary_feature_empty;
9576 0 per_form[i].values[SUFFIX7] = per_form[i].values[SUFFIX8] = per_form[i].values[SUFFIX9] = elementary_feature_empty;
9577 } else {
9578 2 string_piece form = forms[i];
9579 2 const char* form_start = form.str;
9580  
9581 2 bool num = false, cap = false, dash = false;
9582 2 size_t indices[18] = {0, form.len, form.len, form.len, form.len, form.len, form.len, form.len, form.len, form.len, 0, 0, 0, 0, 0, 0, 0, 0}; // careful here regarding forms shorter than 9 characters
9583 2 int index = 0;
9584 11 ▶ while (form.len) {
Branch: 1 branch
BranchTrueFalseTotal
while (form.len) { 9 2 11
9585 9 indices[(index++) % 18] = form.str - form_start;
9586  
9587 9 unicode::category_t cat = unicode::category(utf8::decode(form.str, form.len));
9588 9 ▶ num = num || cat & unicode::N;
Branch: 2 branches
BranchTrueFalseTotal
num = num || cat & unicode::N; 9 0 9
num = num || cat & unicode::N; 0 9 9
9589 9 ▶ cap = cap || cat & unicode::Lut;
Branch: 2 branches
BranchTrueFalseTotal
cap = cap || cat & unicode::Lut; 9 0 9
cap = cap || cat & unicode::Lut; 0 9 9
9590 9 ▶ dash = dash || cat & unicode::Pd;
Branch: 2 branches
BranchTrueFalseTotal
dash = dash || cat & unicode::Pd; 9 0 9
dash = dash || cat & unicode::Pd; 0 9 9
9591  
9592 9 ▶ if (index == 10 || (!form.len && index < 10)) {
Branch: 3 branches
BranchTrueFalseTotal
if (index == 10 || (!form.len && index < 10)) { 9 0 9
if (index == 10 || (!form.len && index < 10)) { 2 7 9
if (index == 10 || (!form.len && index < 10)) { 2 0 2
9593 2 ▶ per_form[i].values[PREFIX1] = maps[MAP_PREFIX1].value(form_start, indices[1]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX1] = maps[MAP_PREFIX1].value(form_start, indices[1]); 2 0 2
9594 2 ▶ per_form[i].values[PREFIX2] = maps[MAP_PREFIX2].value(form_start, indices[2]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX2] = maps[MAP_PREFIX2].value(form_start, indices[2]); 2 0 2
9595 2 ▶ per_form[i].values[PREFIX3] = maps[MAP_PREFIX3].value(form_start, indices[3]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX3] = maps[MAP_PREFIX3].value(form_start, indices[3]); 2 0 2
9596 2 ▶ per_form[i].values[PREFIX4] = maps[MAP_PREFIX4].value(form_start, indices[4]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX4] = maps[MAP_PREFIX4].value(form_start, indices[4]); 2 0 2
9597 2 ▶ per_form[i].values[PREFIX5] = maps[MAP_PREFIX5].value(form_start, indices[5]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX5] = maps[MAP_PREFIX5].value(form_start, indices[5]); 2 0 2
9598 2 ▶ per_form[i].values[PREFIX6] = maps[MAP_PREFIX6].value(form_start, indices[6]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX6] = maps[MAP_PREFIX6].value(form_start, indices[6]); 2 0 2
9599 2 ▶ per_form[i].values[PREFIX7] = maps[MAP_PREFIX7].value(form_start, indices[7]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX7] = maps[MAP_PREFIX7].value(form_start, indices[7]); 2 0 2
9600 2 ▶ per_form[i].values[PREFIX8] = maps[MAP_PREFIX8].value(form_start, indices[8]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX8] = maps[MAP_PREFIX8].value(form_start, indices[8]); 2 0 2
9601 2 ▶ per_form[i].values[PREFIX9] = maps[MAP_PREFIX9].value(form_start, indices[9]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[PREFIX9] = maps[MAP_PREFIX9].value(form_start, indices[9]); 2 0 2
9602 }
9603 }
9604 2 ▶ per_form[i].values[SUFFIX1] = maps[MAP_SUFFIX1].value(form_start + indices[(index+18-1) % 18], form.str - form_start - indices[(index+18-1) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX1] = maps[MAP_SUFFIX1].value(form_start + indices[(index+18-1) % 18], form.str - form_start - indices[(index+18-1) % 18]); 2 0 2
9605 2 ▶ per_form[i].values[SUFFIX2] = maps[MAP_SUFFIX2].value(form_start + indices[(index+18-2) % 18], form.str - form_start - indices[(index+18-2) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX2] = maps[MAP_SUFFIX2].value(form_start + indices[(index+18-2) % 18], form.str - form_start - indices[(index+18-2) % 18]); 2 0 2
9606 2 ▶ per_form[i].values[SUFFIX3] = maps[MAP_SUFFIX3].value(form_start + indices[(index+18-3) % 18], form.str - form_start - indices[(index+18-3) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX3] = maps[MAP_SUFFIX3].value(form_start + indices[(index+18-3) % 18], form.str - form_start - indices[(index+18-3) % 18]); 2 0 2
9607 2 ▶ per_form[i].values[SUFFIX4] = maps[MAP_SUFFIX4].value(form_start + indices[(index+18-4) % 18], form.str - form_start - indices[(index+18-4) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX4] = maps[MAP_SUFFIX4].value(form_start + indices[(index+18-4) % 18], form.str - form_start - indices[(index+18-4) % 18]); 2 0 2
9608 2 ▶ per_form[i].values[SUFFIX5] = maps[MAP_SUFFIX5].value(form_start + indices[(index+18-5) % 18], form.str - form_start - indices[(index+18-5) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX5] = maps[MAP_SUFFIX5].value(form_start + indices[(index+18-5) % 18], form.str - form_start - indices[(index+18-5) % 18]); 2 0 2
9609 2 ▶ per_form[i].values[SUFFIX6] = maps[MAP_SUFFIX6].value(form_start + indices[(index+18-6) % 18], form.str - form_start - indices[(index+18-6) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX6] = maps[MAP_SUFFIX6].value(form_start + indices[(index+18-6) % 18], form.str - form_start - indices[(index+18-6) % 18]); 2 0 2
9610 2 ▶ per_form[i].values[SUFFIX7] = maps[MAP_SUFFIX7].value(form_start + indices[(index+18-7) % 18], form.str - form_start - indices[(index+18-7) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX7] = maps[MAP_SUFFIX7].value(form_start + indices[(index+18-7) % 18], form.str - form_start - indices[(index+18-7) % 18]); 2 0 2
9611 2 ▶ per_form[i].values[SUFFIX8] = maps[MAP_SUFFIX8].value(form_start + indices[(index+18-8) % 18], form.str - form_start - indices[(index+18-8) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX8] = maps[MAP_SUFFIX8].value(form_start + indices[(index+18-8) % 18], form.str - form_start - indices[(index+18-8) % 18]); 2 0 2
9612 2 ▶ per_form[i].values[SUFFIX9] = maps[MAP_SUFFIX9].value(form_start + indices[(index+18-9) % 18], form.str - form_start - indices[(index+18-9) % 18]);
Branch: 1 branch
BranchTrueFalseTotal
per_form[i].values[SUFFIX9] = maps[MAP_SUFFIX9].value(form_start + indices[(index+18-9) % 18], form.str - form_start - indices[(index+18-9) % 18]); 2 0 2
9613 2 per_form[i].values[NUM] = elementary_feature_empty + 1 + num;
9614 2 per_form[i].values[CAP] = elementary_feature_empty + 1 + cap;
9615 2 per_form[i].values[DASH] = elementary_feature_empty + 1 + dash;
9616 }
9617 }
9618 2 }
9619  
9620 template <class Map>
9621 22 void generic_elementary_features<Map>::compute_dynamic_features(const tagged_lemma& tag, const per_form_features& /*per_form*/, const per_tag_features& per_tag, const dynamic_features* prev_dynamic, dynamic_features& dynamic) const {
9622 22 ▶ if (prev_dynamic) {
Branch: 1 branch
BranchTrueFalseTotal
if (prev_dynamic) { 20 2 22
9623 20 dynamic.values[PREVIOUS_VERB_TAG] = prev_dynamic->values[PREVIOUS_OR_CURRENT_VERB_TAG];
9624 20 dynamic.values[PREVIOUS_VERB_LEMMA] = prev_dynamic->values[PREVIOUS_OR_CURRENT_VERB_LEMMA];
9625 } else {
9626 2 dynamic.values[PREVIOUS_VERB_TAG] = elementary_feature_empty;
9627 2 dynamic.values[PREVIOUS_VERB_LEMMA] = elementary_feature_empty;
9628 }
9629  
9630 22 ▶ if (tag.tag[0] == 'V') {
Branch: 1 branch
BranchTrueFalseTotal
if (tag.tag[0] == 'V') { 3 19 22
9631 3 dynamic.values[PREVIOUS_OR_CURRENT_VERB_TAG] = per_tag.values[TAG];
9632 3 dynamic.values[PREVIOUS_OR_CURRENT_VERB_LEMMA] = per_tag.values[LEMMA];
9633 } else {
9634 19 dynamic.values[PREVIOUS_OR_CURRENT_VERB_TAG] = dynamic.values[PREVIOUS_VERB_TAG];
9635 19 dynamic.values[PREVIOUS_OR_CURRENT_VERB_LEMMA] = dynamic.values[PREVIOUS_VERB_LEMMA];
9636 }
9637 22 }
9638  
9639 } // namespace morphodita
9640  
9641 /////////
9642 // File: utils/threadsafe_stack.h
9643 /////////
9644  
9645 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
9646 //
9647 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9648 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9649 //
9650 // This Source Code Form is subject to the terms of the Mozilla Public
9651 // License, v. 2.0. If a copy of the MPL was not distributed with this
9652 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9653  
9654 namespace utils {
9655  
9656 //
9657 // Declarations
9658 //
9659  
9660 template <class T>
9661 class threadsafe_stack {
9662 public:
9663 inline void push(T* t);
9664 inline T* pop();
9665  
9666 private:
9667 vector<unique_ptr<T>> stack;
9668 atomic_flag lock = ATOMIC_FLAG_INIT;
9669 };
9670  
9671 //
9672 // Definitions
9673 //
9674  
9675 template <class T>
9676 0 void threadsafe_stack<T>::push(T* t) {
9677 0 ▶ while (lock.test_and_set(memory_order_acquire)) {}
Branch: 5 branches
BranchTrueFalseTotal
while (lock.test_and_set(memory_order_acquire)) {} 0 0 0
while (lock.test_and_set(memory_order_acquire)) {} 0 2 2
while (lock.test_and_set(memory_order_acquire)) {} 0 0 0
while (lock.test_and_set(memory_order_acquire)) {} 0 2 2
while (lock.test_and_set(memory_order_acquire)) {} 0 2 2
9678 0 stack.emplace_back(t);
9679 0 lock.clear(memory_order_release);
9680 0 }
9681  
9682 template <class T>
9683 0 T* threadsafe_stack<T>::pop() {
9684 0 T* res = nullptr;
9685  
9686 0 ▶ while (lock.test_and_set(memory_order_acquire)) {}
Branch: 5 branches
BranchTrueFalseTotal
while (lock.test_and_set(memory_order_acquire)) {} 0 0 0
while (lock.test_and_set(memory_order_acquire)) {} 0 2 2
while (lock.test_and_set(memory_order_acquire)) {} 0 0 0
while (lock.test_and_set(memory_order_acquire)) {} 0 2 2
while (lock.test_and_set(memory_order_acquire)) {} 0 2 2
9687 0 ▶ if (!stack.empty()) {
Branch: 5 branches
BranchTrueFalseTotal
if (!stack.empty()) { 0 0 0
if (!stack.empty()) { 1 1 2
if (!stack.empty()) { 0 0 0
if (!stack.empty()) { 1 1 2
if (!stack.empty()) { 1 1 2
9688 0 res = stack.back().release();
9689 0 stack.pop_back();
9690 }
9691 0 lock.clear(memory_order_release);
9692  
9693 0 return res;
9694 }
9695  
9696 } // namespace utils
9697  
9698 /////////
9699 // File: morphodita/tagger/perceptron_tagger.h
9700 /////////
9701  
9702 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9703 //
9704 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9705 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9706 //
9707 // This Source Code Form is subject to the terms of the Mozilla Public
9708 // License, v. 2.0. If a copy of the MPL was not distributed with this
9709 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9710  
9711 namespace morphodita {
9712  
9713 // Declarations
9714 template<class FeatureSequences>
9715 class perceptron_tagger : public tagger {
9716 public:
9717 perceptron_tagger(int decoding_order, int window_size);
9718  
9719 bool load(istream& is);
9720 virtual const morpho* get_morpho() const override;
9721 virtual void tag(const vector<string_piece>& forms, vector<tagged_lemma>& tags, morpho::guesser_mode guesser = morpho::guesser_mode(-1)) const override;
9722 virtual void tag_analyzed(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<int>& tags) const override;
9723  
9724 private:
9725 int decoding_order, window_size;
9726  
9727 unique_ptr<morpho> dict;
9728 bool use_guesser;
9729 FeatureSequences features;
9730 typedef viterbi<FeatureSequences> viterbi_decoder;
9731 viterbi_decoder decoder;
9732 struct cache {
9733 vector<string_piece> forms;
9734 vector<vector<tagged_lemma>> analyses;
9735 vector<int> tags;
9736 typename viterbi_decoder::cache decoder_cache;
9737  
9738 0 ▶ cache(const perceptron_tagger<FeatureSequences>& self) : decoder_cache(self.decoder) {}
Branch: 3 branches
BranchTrueFalseTotal
cache(const perceptron_tagger<FeatureSequences>& self) : decoder_cache(self.decoder) {} 0 0 0
cache(const perceptron_tagger<FeatureSequences>& self) : decoder_cache(self.decoder) {} 1 0 1
cache(const perceptron_tagger<FeatureSequences>& self) : decoder_cache(self.decoder) {} 0 0 0
9739 };
9740  
9741 mutable threadsafe_stack<cache> caches;
9742 };
9743  
9744 // Definitions
9745  
9746 template<class FeatureSequences>
9747 0 perceptron_tagger<FeatureSequences>::perceptron_tagger(int decoding_order, int window_size)
9748 0 ▶ : decoding_order(decoding_order), window_size(window_size), decoder(features, decoding_order, window_size) {}
Branch: 3 branches
BranchTrueFalseTotal
: decoding_order(decoding_order), window_size(window_size), decoder(features, decoding_order, window_size) {} 0 0 0
: decoding_order(decoding_order), window_size(window_size), decoder(features, decoding_order, window_size) {} 1 0 1
: decoding_order(decoding_order), window_size(window_size), decoder(features, decoding_order, window_size) {} 0 0 0
9749  
9750 template<class FeatureSequences>
9751 0 bool perceptron_tagger<FeatureSequences>::load(istream& is) {
9752 0 ▶ if (dict.reset(morpho::load(is)), !dict) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (dict.reset(morpho::load(is)), !dict) return false; 0 0 0
if (dict.reset(morpho::load(is)), !dict) return false; 0 1 1
if (dict.reset(morpho::load(is)), !dict) return false; 0 0 0
9753 0 use_guesser = is.get();
9754 0 ▶ if (!features.load(is)) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (!features.load(is)) return false; 0 0 0
if (!features.load(is)) return false; 0 1 1
if (!features.load(is)) return false; 0 0 0
9755 0 return true;
9756 }
9757  
9758 template<class FeatureSequences>
9759 0 const morpho* perceptron_tagger<FeatureSequences>::get_morpho() const {
9760 0 return dict.get();
9761 }
9762  
9763 template<class FeatureSequences>
9764 0 void perceptron_tagger<FeatureSequences>::tag(const vector<string_piece>& forms, vector<tagged_lemma>& tags, morpho::guesser_mode guesser) const {
9765 0 tags.clear();
9766 0 ▶ if (!dict) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!dict) return; 0 0 0
if (!dict) return; 0 2 2
if (!dict) return; 0 0 0
9767  
9768 0 cache* c = caches.pop();
9769 0 ▶ if (!c) c = new cache(*this);
Branch: 9 branches
BranchTrueFalseTotal
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 1 1 2
if (!c) c = new cache(*this); 1 0 1
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
9770  
9771 0 c->forms.resize(forms.size());
9772 0 ▶ if (c->analyses.size() < forms.size()) c->analyses.resize(forms.size());
Branch: 3 branches
BranchTrueFalseTotal
if (c->analyses.size() < forms.size()) c->analyses.resize(forms.size()); 0 0 0
if (c->analyses.size() < forms.size()) c->analyses.resize(forms.size()); 2 0 2
if (c->analyses.size() < forms.size()) c->analyses.resize(forms.size()); 0 0 0
9773 0 ▶ for (unsigned i = 0; i < forms.size(); i++) {
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
for (unsigned i = 0; i < forms.size(); i++) { 7 2 9
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
9774 0 c->forms[i] = forms[i];
9775 0 c->forms[i].len = dict->raw_form_len(forms[i]);
9776 0 ▶ dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]);
Branch: 6 branches
BranchTrueFalseTotal
dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]); 0 0 0
dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]); 0 0 0
dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]); 7 0 7
dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]); 0 7 7
dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]); 0 0 0
dict->analyze(forms[i], guesser >= 0 ? guesser : use_guesser ? morpho::GUESSER : morpho::NO_GUESSER, c->analyses[i]); 0 0 0
9777 }
9778  
9779 0 ▶ if (c->tags.size() < forms.size()) c->tags.resize(forms.size() * 2);
Branch: 3 branches
BranchTrueFalseTotal
if (c->tags.size() < forms.size()) c->tags.resize(forms.size() * 2); 0 0 0
if (c->tags.size() < forms.size()) c->tags.resize(forms.size() * 2); 1 1 2
if (c->tags.size() < forms.size()) c->tags.resize(forms.size() * 2); 0 0 0
9780 0 decoder.tag(c->forms, c->analyses, c->decoder_cache, c->tags);
9781  
9782 0 ▶ for (unsigned i = 0; i < forms.size(); i++)
Branch: 3 branches
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) 0 0 0
for (unsigned i = 0; i < forms.size(); i++) 7 2 9
for (unsigned i = 0; i < forms.size(); i++) 0 0 0
9783 0 tags.emplace_back(c->analyses[i][c->tags[i]]);
9784  
9785 0 caches.push(c);
9786 }
9787  
9788 template<class FeatureSequences>
9789 0 void perceptron_tagger<FeatureSequences>::tag_analyzed(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<int>& tags) const {
9790 0 tags.clear();
9791  
9792 0 cache* c = caches.pop();
9793 0 ▶ if (!c) c = new cache(*this);
Branch: 9 branches
BranchTrueFalseTotal
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
if (!c) c = new cache(*this); 0 0 0
9794  
9795 0 tags.resize(forms.size());
9796 0 decoder.tag(forms, analyses, c->decoder_cache, tags);
9797  
9798 0 caches.push(c);
9799 0 }
9800  
9801 } // namespace morphodita
9802  
9803 /////////
9804 // File: morphodita/tagger/tagger_ids.h
9805 /////////
9806  
9807 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9808 //
9809 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9810 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9811 //
9812 // This Source Code Form is subject to the terms of the Mozilla Public
9813 // License, v. 2.0. If a copy of the MPL was not distributed with this
9814 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9815  
9816 namespace morphodita {
9817  
9818 class tagger_ids {
9819 public:
9820 enum tagger_id {
9821 CZECH2 = 0, CZECH3 = 1, CZECH2_3 = 6,
9822 /* 2 was used internally for ENGLISH3, but never released publicly */
9823 GENERIC2 = 3, GENERIC3 = 4, GENERIC4 = 5, GENERIC2_3 = 7,
9824 CONLLU2 = 8, CONLLU2_3 = 9, CONLLU3 = 10,
9825 };
9826  
9827 static bool parse(const string& str, tagger_id& id) {
9828 if (str == "czech2") return id = CZECH2, true;
9829 if (str == "czech2_3") return id = CZECH2_3, true;
9830 if (str == "czech3") return id = CZECH3, true;
9831 if (str == "generic2") return id = GENERIC2, true;
9832 if (str == "generic2_3") return id = GENERIC2_3, true;
9833 if (str == "generic3") return id = GENERIC3, true;
9834 if (str == "generic4") return id = GENERIC4, true;
9835 if (str == "conllu2") return id = CONLLU2, true;
9836 if (str == "conllu2_3") return id = CONLLU2_3, true;
9837 if (str == "conllu3") return id = CONLLU3, true;
9838 return false;
9839 }
9840  
9841 2 static int decoding_order(tagger_id id) {
9842 2 switch (id) {
9843 0 case CZECH2: return 2;
9844 0 case CZECH2_3: return 2;
9845 0 case CZECH3: return 3;
9846 0 case GENERIC2: return 2;
9847 0 case GENERIC2_3: return 2;
9848 2 case GENERIC3: return 3;
9849 0 case GENERIC4: return 4;
9850 0 case CONLLU2: return 2;
9851 0 case CONLLU2_3: return 2;
9852 0 case CONLLU3: return 3;
9853 }
9854 0 return 0;
9855 }
9856  
9857 1 static int window_size(tagger_id id) {
9858 1 switch (id) {
9859 0 case CZECH2_3: return 3;
9860 0 case GENERIC2_3: return 3;
9861 0 case CONLLU2_3: return 3;
9862 1 default: break;
9863 }
9864 1 return decoding_order(id);
9865 }
9866 };
9867  
9868 typedef tagger_ids::tagger_id tagger_id;
9869  
9870 } // namespace morphodita
9871  
9872 /////////
9873 // File: morphodita/tagger/tagger.cpp
9874 /////////
9875  
9876 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9877 //
9878 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9879 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9880 //
9881 // This Source Code Form is subject to the terms of the Mozilla Public
9882 // License, v. 2.0. If a copy of the MPL was not distributed with this
9883 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9884  
9885 namespace morphodita {
9886  
9887 1 tagger* tagger::load(istream& is) {
9888 1 tagger_id id = tagger_id(is.get());
9889 1 switch (id) {
9890 0 case tagger_ids::CZECH2:
9891 case tagger_ids::CZECH2_3:
9892 case tagger_ids::CZECH3:
9893 {
9894 0 ▶ auto res = new_unique_ptr<perceptron_tagger<persistent_feature_sequences<persistent_czech_elementary_features>>>(tagger_ids::decoding_order(id), tagger_ids::window_size(id));
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<perceptron_tagger<persistent_feature_sequences<persistent_czech_elementary_features>>>(tagger_ids::decoding_order(id), tagger_ids::window_size(id)); 0 0 0
9895 0 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 0 0 0
if (res->load(is)) return res.release(); 0 0 0
9896 0 break;
9897 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
9898 1 case tagger_ids::GENERIC2:
9899 case tagger_ids::GENERIC2_3:
9900 case tagger_ids::GENERIC3:
9901 case tagger_ids::GENERIC4:
9902 {
9903 1 ▶ auto res = new_unique_ptr<perceptron_tagger<persistent_feature_sequences<persistent_generic_elementary_features>>>(tagger_ids::decoding_order(id), tagger_ids::window_size(id));
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<perceptron_tagger<persistent_feature_sequences<persistent_generic_elementary_features>>>(tagger_ids::decoding_order(id), tagger_ids::window_size(id)); 1 0 1
9904 1 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 1 0 1
if (res->load(is)) return res.release(); 1 0 1
9905 0 break;
9906 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 0 1
9907 0 case tagger_ids::CONLLU2:
9908 case tagger_ids::CONLLU2_3:
9909 case tagger_ids::CONLLU3:
9910 {
9911 0 ▶ auto res = new_unique_ptr<perceptron_tagger<persistent_feature_sequences<persistent_conllu_elementary_features>>>(tagger_ids::decoding_order(id), tagger_ids::window_size(id));
Branch: 1 branch
BranchTrueFalseTotal
auto res = new_unique_ptr<perceptron_tagger<persistent_feature_sequences<persistent_conllu_elementary_features>>>(tagger_ids::decoding_order(id), tagger_ids::window_size(id)); 0 0 0
9912 0 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 0 0 0
if (res->load(is)) return res.release(); 0 0 0
9913 0 break;
9914 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
9915 }
9916  
9917 0 return nullptr;
9918 }
9919  
9920 0 tagger* tagger::load(const char* fname) {
9921 0 ▶ ifstream f(path_from_utf8(fname).c_str(), ifstream::binary);
Branch: 2 branches
BranchTrueFalseTotal
ifstream f(path_from_utf8(fname).c_str(), ifstream::binary); 0 0 0
ifstream f(path_from_utf8(fname).c_str(), ifstream::binary); 0 0 0
9922 0 ▶ if (!f) return nullptr;
Branch: 2 branches
BranchTrueFalseTotal
if (!f) return nullptr; 0 0 0
if (!f) return nullptr; 0 0 0
9923  
9924 0 ▶ return load(f);
Branch: 1 branch
BranchTrueFalseTotal
return load(f); 0 0 0
9925 0 }
9926  
9927 0 tokenizer* tagger::new_tokenizer() const {
9928 0 auto morpho = get_morpho();
9929 0 ▶ return morpho ? morpho->new_tokenizer() : nullptr;
Branch: 1 branch
BranchTrueFalseTotal
return morpho ? morpho->new_tokenizer() : nullptr; 0 0 0
9930 }
9931  
9932 } // namespace morphodita
9933  
9934 /////////
9935 // File: morphodita/tagset_converter/identity_tagset_converter.h
9936 /////////
9937  
9938 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9939 //
9940 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9941 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9942 //
9943 // This Source Code Form is subject to the terms of the Mozilla Public
9944 // License, v. 2.0. If a copy of the MPL was not distributed with this
9945 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9946  
9947 namespace morphodita {
9948  
9949 class identity_tagset_converter : public tagset_converter {
9950 public:
9951 virtual void convert(tagged_lemma& tagged_lemma) const override;
9952 virtual void convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const override;
9953 virtual void convert_generated(vector<tagged_lemma_forms>& forms) const override;
9954 };
9955  
9956 } // namespace morphodita
9957  
9958 /////////
9959 // File: morphodita/tagset_converter/identity_tagset_converter.cpp
9960 /////////
9961  
9962 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9963 //
9964 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9965 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9966 //
9967 // This Source Code Form is subject to the terms of the Mozilla Public
9968 // License, v. 2.0. If a copy of the MPL was not distributed with this
9969 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9970  
9971 namespace morphodita {
9972  
9973 0 void identity_tagset_converter::convert(tagged_lemma& /*tagged_lemma*/) const {}
9974  
9975 0 void identity_tagset_converter::convert_analyzed(vector<tagged_lemma>& /*tagged_lemmas*/) const {}
9976  
9977 0 void identity_tagset_converter::convert_generated(vector<tagged_lemma_forms>& /*forms*/) const {}
9978  
9979 } // namespace morphodita
9980  
9981 /////////
9982 // File: morphodita/tagset_converter/pdt_to_conll2009_tagset_converter.h
9983 /////////
9984  
9985 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
9986 //
9987 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
9988 // Mathematics and Physics, Charles University in Prague, Czech Republic.
9989 //
9990 // This Source Code Form is subject to the terms of the Mozilla Public
9991 // License, v. 2.0. If a copy of the MPL was not distributed with this
9992 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
9993  
9994 namespace morphodita {
9995  
9996 class pdt_to_conll2009_tagset_converter : public tagset_converter {
9997 public:
9998 virtual void convert(tagged_lemma& tagged_lemma) const override;
9999 virtual void convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const override;
10000 virtual void convert_generated(vector<tagged_lemma_forms>& forms) const override;
10001  
10002 private:
10003 inline void convert_tag(const string& lemma, string& tag) const;
10004 inline bool convert_lemma(string& lemma) const;
10005 };
10006  
10007 } // namespace morphodita
10008  
10009 /////////
10010 // File: morphodita/tagset_converter/pdt_to_conll2009_tagset_converter.cpp
10011 /////////
10012  
10013 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10014 //
10015 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10016 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10017 //
10018 // This Source Code Form is subject to the terms of the Mozilla Public
10019 // License, v. 2.0. If a copy of the MPL was not distributed with this
10020 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10021  
10022 namespace morphodita {
10023  
10024 static const char* names[15] = {"POS", "SubPOS", "Gen", "Num", "Cas", "PGe", "PNu", "Per", "Ten", "Gra", "Neg", "Voi", "", "", "Var"};
10025  
10026 0 inline void pdt_to_conll2009_tagset_converter::convert_tag(const string& lemma, string& tag) const {
10027 char pdt_tag[16];
10028 0 strncpy(pdt_tag, tag.c_str(), 15);
10029  
10030 // Clear the tag
10031 0 tag.clear();
10032  
10033 // Fill FEAT of filled tag characters
10034 0 ▶ for (int i = 0; i < 15 && pdt_tag[i]; i++)
Branch: 2 branches
BranchTrueFalseTotal
for (int i = 0; i < 15 && pdt_tag[i]; i++) 0 0 0
for (int i = 0; i < 15 && pdt_tag[i]; i++) 0 0 0
10035 0 ▶ if (pdt_tag[i] != '-') {
Branch: 1 branch
BranchTrueFalseTotal
if (pdt_tag[i] != '-') { 0 0 0
10036 0 ▶ if (!tag.empty()) tag.push_back('|');
Branch: 2 branches
BranchTrueFalseTotal
if (!tag.empty()) tag.push_back('|'); 0 0 0
if (!tag.empty()) tag.push_back('|'); 0 0 0
10037 0 ▶ tag.append(names[i]);
Branch: 1 branch
BranchTrueFalseTotal
tag.append(names[i]); 0 0 0
10038 0 ▶ tag.push_back('=');
Branch: 1 branch
BranchTrueFalseTotal
tag.push_back('='); 0 0 0
10039 0 ▶ tag.push_back(pdt_tag[i]);
Branch: 1 branch
BranchTrueFalseTotal
tag.push_back(pdt_tag[i]); 0 0 0
10040 }
10041  
10042 // Try adding Sem FEAT
10043 0 ▶ for (unsigned i = 0; i + 2 < lemma.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i + 2 < lemma.size(); i++) 0 0 0
10044 0 ▶ if (lemma[i] == '_' && lemma[i + 1] == ';') {
Branch: 3 branches
BranchTrueFalseTotal
if (lemma[i] == '_' && lemma[i + 1] == ';') { 0 0 0
if (lemma[i] == '_' && lemma[i + 1] == ';') { 0 0 0
if (lemma[i] == '_' && lemma[i + 1] == ';') { 0 0 0
10045 0 ▶ if (!tag.empty()) tag.push_back('|');
Branch: 2 branches
BranchTrueFalseTotal
if (!tag.empty()) tag.push_back('|'); 0 0 0
if (!tag.empty()) tag.push_back('|'); 0 0 0
10046 0 ▶ tag.append("Sem=");
Branch: 1 branch
BranchTrueFalseTotal
tag.append("Sem="); 0 0 0
10047 0 ▶ tag.push_back(lemma[i + 2]);
Branch: 1 branch
BranchTrueFalseTotal
tag.push_back(lemma[i + 2]); 0 0 0
10048 0 break;
10049 }
10050 0 }
10051  
10052 0 inline bool pdt_to_conll2009_tagset_converter::convert_lemma(string& lemma) const {
10053 0 unsigned raw_lemma = czech_lemma_addinfo::raw_lemma_len(lemma);
10054 0 ▶ return raw_lemma < lemma.size() ? (lemma.resize(raw_lemma), true) : false;
Branch: 1 branch
BranchTrueFalseTotal
return raw_lemma < lemma.size() ? (lemma.resize(raw_lemma), true) : false; 0 0 0
10055 }
10056  
10057 0 void pdt_to_conll2009_tagset_converter::convert(tagged_lemma& tagged_lemma) const {
10058 0 convert_tag(tagged_lemma.lemma, tagged_lemma.tag);
10059 0 convert_lemma(tagged_lemma.lemma);
10060 0 }
10061  
10062 0 void pdt_to_conll2009_tagset_converter::convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const {
10063 0 bool lemma_changed = false;
10064  
10065 0 ▶ for (auto&& tagged_lemma : tagged_lemmas) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_lemma : tagged_lemmas) { 0 0 0
10066 0 ▶ convert_tag(tagged_lemma.lemma, tagged_lemma.tag);
Branch: 1 branch
BranchTrueFalseTotal
convert_tag(tagged_lemma.lemma, tagged_lemma.tag); 0 0 0
10067 0 ▶ lemma_changed |= convert_lemma(tagged_lemma.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma_changed |= convert_lemma(tagged_lemma.lemma); 0 0 0
10068 }
10069  
10070 // If no lemma was changed or there is 1 analysis, no duplicates could be created.
10071 0 ▶ if (!lemma_changed || tagged_lemmas.size() < 2) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
10072  
10073 0 tagset_converter_unique_analyzed(tagged_lemmas);
10074 }
10075  
10076 0 void pdt_to_conll2009_tagset_converter::convert_generated(vector<tagged_lemma_forms>& forms) const {
10077 0 bool lemma_changed = false;
10078  
10079 0 ▶ for (auto&& tagged_lemma_forms : forms) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_lemma_forms : forms) { 0 0 0
10080 0 ▶ for (auto&& tagged_form : tagged_lemma_forms.forms)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_form : tagged_lemma_forms.forms) 0 0 0
10081 0 ▶ convert_tag(tagged_lemma_forms.lemma, tagged_form.tag);
Branch: 1 branch
BranchTrueFalseTotal
convert_tag(tagged_lemma_forms.lemma, tagged_form.tag); 0 0 0
10082 0 ▶ lemma_changed |= convert_lemma(tagged_lemma_forms.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma_changed |= convert_lemma(tagged_lemma_forms.lemma); 0 0 0
10083 }
10084  
10085 // If no lemma was changed or there is 1 analysis, no duplicates could be created.
10086 0 ▶ if (!lemma_changed || forms.size() < 2) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!lemma_changed || forms.size() < 2) return; 0 0 0
if (!lemma_changed || forms.size() < 2) return; 0 0 0
if (!lemma_changed || forms.size() < 2) return; 0 0 0
10087  
10088 0 tagset_converter_unique_generated(forms);
10089 }
10090  
10091 } // namespace morphodita
10092  
10093 /////////
10094 // File: morphodita/tagset_converter/strip_lemma_comment_tagset_converter.h
10095 /////////
10096  
10097 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10098 //
10099 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10100 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10101 //
10102 // This Source Code Form is subject to the terms of the Mozilla Public
10103 // License, v. 2.0. If a copy of the MPL was not distributed with this
10104 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10105  
10106 namespace morphodita {
10107  
10108 class strip_lemma_comment_tagset_converter : public tagset_converter {
10109 public:
10110 0 strip_lemma_comment_tagset_converter(const morpho& dictionary) : dictionary(dictionary) {}
10111  
10112 virtual void convert(tagged_lemma& tagged_lemma) const override;
10113 virtual void convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const override;
10114 virtual void convert_generated(vector<tagged_lemma_forms>& forms) const override;
10115  
10116 private:
10117 inline bool convert_lemma(string& lemma) const;
10118 const morpho& dictionary;
10119 };
10120  
10121 } // namespace morphodita
10122  
10123 /////////
10124 // File: morphodita/tagset_converter/strip_lemma_comment_tagset_converter.cpp
10125 /////////
10126  
10127 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10128 //
10129 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10130 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10131 //
10132 // This Source Code Form is subject to the terms of the Mozilla Public
10133 // License, v. 2.0. If a copy of the MPL was not distributed with this
10134 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10135  
10136 namespace morphodita {
10137  
10138 0 inline bool strip_lemma_comment_tagset_converter::convert_lemma(string& lemma) const {
10139 0 ▶ unsigned lemma_id_len = dictionary.lemma_id_len(lemma);
Branch: 1 branch
BranchTrueFalseTotal
unsigned lemma_id_len = dictionary.lemma_id_len(lemma); 0 0 0
10140 0 ▶ return lemma_id_len < lemma.size() ? (lemma.resize(lemma_id_len), true) : false;
Branch: 1 branch
BranchTrueFalseTotal
return lemma_id_len < lemma.size() ? (lemma.resize(lemma_id_len), true) : false; 0 0 0
10141 }
10142  
10143 0 void strip_lemma_comment_tagset_converter::convert(tagged_lemma& tagged_lemma) const {
10144 0 convert_lemma(tagged_lemma.lemma);
10145 0 }
10146  
10147 0 void strip_lemma_comment_tagset_converter::convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const {
10148 0 bool lemma_changed = false;
10149  
10150 0 ▶ for (auto&& tagged_lemma : tagged_lemmas)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_lemma : tagged_lemmas) 0 0 0
10151 0 ▶ lemma_changed |= convert_lemma(tagged_lemma.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma_changed |= convert_lemma(tagged_lemma.lemma); 0 0 0
10152  
10153 // If no lemma was changed or there is 1 analysis, no duplicates could be created.
10154 0 ▶ if (!lemma_changed || tagged_lemmas.size() < 2) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
10155  
10156 0 tagset_converter_unique_analyzed(tagged_lemmas);
10157 }
10158  
10159 0 void strip_lemma_comment_tagset_converter::convert_generated(vector<tagged_lemma_forms>& forms) const {
10160 0 bool lemma_changed = false;
10161  
10162 0 ▶ for (auto&& tagged_lemma_forms : forms)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_lemma_forms : forms) 0 0 0
10163 0 ▶ lemma_changed |= convert_lemma(tagged_lemma_forms.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma_changed |= convert_lemma(tagged_lemma_forms.lemma); 0 0 0
10164  
10165 // If no lemma was changed or there is 1 analysis, no duplicates could be created.
10166 0 ▶ if (!lemma_changed || forms.size() < 2) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!lemma_changed || forms.size() < 2) return; 0 0 0
if (!lemma_changed || forms.size() < 2) return; 0 0 0
if (!lemma_changed || forms.size() < 2) return; 0 0 0
10167  
10168 0 tagset_converter_unique_generated(forms);
10169 }
10170  
10171 } // namespace morphodita
10172  
10173 /////////
10174 // File: morphodita/tagset_converter/strip_lemma_id_tagset_converter.h
10175 /////////
10176  
10177 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10178 //
10179 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10180 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10181 //
10182 // This Source Code Form is subject to the terms of the Mozilla Public
10183 // License, v. 2.0. If a copy of the MPL was not distributed with this
10184 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10185  
10186 namespace morphodita {
10187  
10188 class strip_lemma_id_tagset_converter : public tagset_converter {
10189 public:
10190 0 strip_lemma_id_tagset_converter(const morpho& dictionary) : dictionary(dictionary) {}
10191  
10192 virtual void convert(tagged_lemma& tagged_lemma) const override;
10193 virtual void convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const override;
10194 virtual void convert_generated(vector<tagged_lemma_forms>& forms) const override;
10195  
10196 private:
10197 inline bool convert_lemma(string& lemma) const;
10198 const morpho& dictionary;
10199 };
10200  
10201 } // namespace morphodita
10202  
10203 /////////
10204 // File: morphodita/tagset_converter/strip_lemma_id_tagset_converter.cpp
10205 /////////
10206  
10207 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10208 //
10209 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10210 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10211 //
10212 // This Source Code Form is subject to the terms of the Mozilla Public
10213 // License, v. 2.0. If a copy of the MPL was not distributed with this
10214 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10215  
10216 namespace morphodita {
10217  
10218 0 inline bool strip_lemma_id_tagset_converter::convert_lemma(string& lemma) const {
10219 0 ▶ unsigned raw_lemma_len = dictionary.raw_lemma_len(lemma);
Branch: 1 branch
BranchTrueFalseTotal
unsigned raw_lemma_len = dictionary.raw_lemma_len(lemma); 0 0 0
10220 0 ▶ return raw_lemma_len < lemma.size() ? (lemma.resize(raw_lemma_len), true) : false;
Branch: 1 branch
BranchTrueFalseTotal
return raw_lemma_len < lemma.size() ? (lemma.resize(raw_lemma_len), true) : false; 0 0 0
10221 }
10222  
10223 0 void strip_lemma_id_tagset_converter::convert(tagged_lemma& tagged_lemma) const {
10224 0 convert_lemma(tagged_lemma.lemma);
10225 0 }
10226  
10227 0 void strip_lemma_id_tagset_converter::convert_analyzed(vector<tagged_lemma>& tagged_lemmas) const {
10228 0 bool lemma_changed = false;
10229  
10230 0 ▶ for (auto&& tagged_lemma : tagged_lemmas)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_lemma : tagged_lemmas) 0 0 0
10231 0 ▶ lemma_changed |= convert_lemma(tagged_lemma.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma_changed |= convert_lemma(tagged_lemma.lemma); 0 0 0
10232  
10233 // If no lemma was changed or there is 1 analysis, no duplicates could be created.
10234 0 ▶ if (!lemma_changed || tagged_lemmas.size() < 2) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
if (!lemma_changed || tagged_lemmas.size() < 2) return; 0 0 0
10235  
10236 0 tagset_converter_unique_analyzed(tagged_lemmas);
10237 }
10238  
10239 0 void strip_lemma_id_tagset_converter::convert_generated(vector<tagged_lemma_forms>& forms) const {
10240 0 bool lemma_changed = false;
10241  
10242 0 ▶ for (auto&& tagged_lemma_forms : forms)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_lemma_forms : forms) 0 0 0
10243 0 ▶ lemma_changed |= convert_lemma(tagged_lemma_forms.lemma);
Branch: 1 branch
BranchTrueFalseTotal
lemma_changed |= convert_lemma(tagged_lemma_forms.lemma); 0 0 0
10244  
10245 // If no lemma was changed or there is 1 analysis, no duplicates could be created.
10246 0 ▶ if (!lemma_changed || forms.size() < 2) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!lemma_changed || forms.size() < 2) return; 0 0 0
if (!lemma_changed || forms.size() < 2) return; 0 0 0
if (!lemma_changed || forms.size() < 2) return; 0 0 0
10247  
10248 0 tagset_converter_unique_generated(forms);
10249 }
10250  
10251 } // namespace morphodita
10252  
10253 /////////
10254 // File: morphodita/tagset_converter/tagset_converter.cpp
10255 /////////
10256  
10257 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10258 //
10259 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10260 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10261 //
10262 // This Source Code Form is subject to the terms of the Mozilla Public
10263 // License, v. 2.0. If a copy of the MPL was not distributed with this
10264 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10265  
10266 namespace morphodita {
10267  
10268 0 tagset_converter* tagset_converter::new_identity_converter() {
10269 0 return new identity_tagset_converter();
10270 }
10271  
10272 0 tagset_converter* tagset_converter::new_pdt_to_conll2009_converter() {
10273 0 return new pdt_to_conll2009_tagset_converter();
10274 }
10275  
10276 0 tagset_converter* tagset_converter::new_strip_lemma_comment_converter(const morpho& dictionary) {
10277 0 return new strip_lemma_comment_tagset_converter(dictionary);
10278 }
10279  
10280 0 tagset_converter* tagset_converter::new_strip_lemma_id_converter(const morpho& dictionary) {
10281 0 return new strip_lemma_id_tagset_converter(dictionary);
10282 }
10283  
10284 0 tagset_converter* new_tagset_converter(const string& name, const morpho& dictionary) {
10285 0 ▶ if (name == "pdt_to_conll2009") return tagset_converter::new_pdt_to_conll2009_converter();
Branch: 1 branch
BranchTrueFalseTotal
if (name == "pdt_to_conll2009") return tagset_converter::new_pdt_to_conll2009_converter(); 0 0 0
10286 0 ▶ if (name == "strip_lemma_comment") return tagset_converter::new_strip_lemma_comment_converter(dictionary);
Branch: 1 branch
BranchTrueFalseTotal
if (name == "strip_lemma_comment") return tagset_converter::new_strip_lemma_comment_converter(dictionary); 0 0 0
10287 0 ▶ if (name == "strip_lemma_id") return tagset_converter::new_strip_lemma_id_converter(dictionary);
Branch: 1 branch
BranchTrueFalseTotal
if (name == "strip_lemma_id") return tagset_converter::new_strip_lemma_id_converter(dictionary); 0 0 0
10288 0 return nullptr;
10289 }
10290  
10291 0 void tagset_converter_unique_analyzed(vector<tagged_lemma>& tagged_lemmas) {
10292 // Remove possible lemma-tag pair duplicates
10293 struct tagged_lemma_comparator {
10294 0 ▶ inline static bool eq(const tagged_lemma& a, const tagged_lemma& b) { return a.lemma == b.lemma && a.tag == b.tag; }
Branch: 2 branches
BranchTrueFalseTotal
inline static bool eq(const tagged_lemma& a, const tagged_lemma& b) { return a.lemma == b.lemma && a.tag == b.tag; } 0 0 0
inline static bool eq(const tagged_lemma& a, const tagged_lemma& b) { return a.lemma == b.lemma && a.tag == b.tag; } 0 0 0
10295 0 ▶ inline static bool lt(const tagged_lemma& a, const tagged_lemma& b) { int lemma_compare = a.lemma.compare(b.lemma); return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); }
Branch: 3 branches
BranchTrueFalseTotal
inline static bool lt(const tagged_lemma& a, const tagged_lemma& b) { int lemma_compare = a.lemma.compare(b.lemma); return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); } 0 0 0
inline static bool lt(const tagged_lemma& a, const tagged_lemma& b) { int lemma_compare = a.lemma.compare(b.lemma); return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); } 0 0 0
inline static bool lt(const tagged_lemma& a, const tagged_lemma& b) { int lemma_compare = a.lemma.compare(b.lemma); return lemma_compare < 0 || (lemma_compare == 0 && a.tag < b.tag); } 0 0 0
10296 };
10297  
10298 0 sort(tagged_lemmas.begin(), tagged_lemmas.end(), tagged_lemma_comparator::lt);
10299 0 ▶ tagged_lemmas.resize(unique(tagged_lemmas.begin(), tagged_lemmas.end(), tagged_lemma_comparator::eq) - tagged_lemmas.begin());
Branch: 2 branches
BranchTrueFalseTotal
tagged_lemmas.resize(unique(tagged_lemmas.begin(), tagged_lemmas.end(), tagged_lemma_comparator::eq) - tagged_lemmas.begin()); 0 0 0
tagged_lemmas.resize(unique(tagged_lemmas.begin(), tagged_lemmas.end(), tagged_lemma_comparator::eq) - tagged_lemmas.begin()); 0 0 0
10300 0 }
10301  
10302 0 void tagset_converter_unique_generated(vector<tagged_lemma_forms>& forms) {
10303 // Regroup and if needed remove duplicate form-tag pairs for each lemma
10304 0 ▶ for (unsigned i = 0; i < forms.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
10305 0 bool any_merged = false;
10306 0 ▶ for (unsigned j = forms.size() - 1; j > i; j--)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned j = forms.size() - 1; j > i; j--) 0 0 0
10307 0 ▶ if (forms[j].lemma == forms[i].lemma) {
Branch: 1 branch
BranchTrueFalseTotal
if (forms[j].lemma == forms[i].lemma) { 0 0 0
10308 // Same lemma was found. Merge form-tag pairs
10309 0 ▶ for (auto&& tagged_form : forms[j].forms)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& tagged_form : forms[j].forms) 0 0 0
10310 0 ▶ forms[i].forms.emplace_back(std::move(tagged_form));
Branch: 1 branch
BranchTrueFalseTotal
forms[i].forms.emplace_back(std::move(tagged_form)); 0 0 0
10311  
10312 // Remove lemma j by moving it to end and deleting
10313 0 ▶ if (j < forms.size() - 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (j < forms.size() - 1) { 0 0 0
10314 0 forms[j].lemma.swap(forms[forms.size() - 1].lemma);
10315 0 forms[j].forms.swap(forms[forms.size() - 1].forms);
10316 }
10317 0 forms.pop_back();
10318 0 any_merged = true;
10319 }
10320  
10321 0 ▶ if (any_merged && forms[i].forms.size() > 1) {
Branch: 3 branches
BranchTrueFalseTotal
if (any_merged && forms[i].forms.size() > 1) { 0 0 0
if (any_merged && forms[i].forms.size() > 1) { 0 0 0
if (any_merged && forms[i].forms.size() > 1) { 0 0 0
10322 // Remove duplicate form-tag pairs
10323 struct tagged_form_comparator {
10324 0 ▶ inline static bool eq(const tagged_form& a, const tagged_form& b) { return a.tag == b.tag && a.form == b.form; }
Branch: 2 branches
BranchTrueFalseTotal
inline static bool eq(const tagged_form& a, const tagged_form& b) { return a.tag == b.tag && a.form == b.form; } 0 0 0
inline static bool eq(const tagged_form& a, const tagged_form& b) { return a.tag == b.tag && a.form == b.form; } 0 0 0
10325 0 ▶ inline static bool lt(const tagged_form& a, const tagged_form& b) { int tag_compare = a.tag.compare(b.tag); return tag_compare < 0 || (tag_compare == 0 && a.form < b.form); }
Branch: 3 branches
BranchTrueFalseTotal
inline static bool lt(const tagged_form& a, const tagged_form& b) { int tag_compare = a.tag.compare(b.tag); return tag_compare < 0 || (tag_compare == 0 && a.form < b.form); } 0 0 0
inline static bool lt(const tagged_form& a, const tagged_form& b) { int tag_compare = a.tag.compare(b.tag); return tag_compare < 0 || (tag_compare == 0 && a.form < b.form); } 0 0 0
inline static bool lt(const tagged_form& a, const tagged_form& b) { int tag_compare = a.tag.compare(b.tag); return tag_compare < 0 || (tag_compare == 0 && a.form < b.form); } 0 0 0
10326 };
10327  
10328 0 sort(forms[i].forms.begin(), forms[i].forms.end(), tagged_form_comparator::lt);
10329 0 ▶ forms[i].forms.resize(unique(forms[i].forms.begin(), forms[i].forms.end(), tagged_form_comparator::eq) - forms[i].forms.begin());
Branch: 2 branches
BranchTrueFalseTotal
forms[i].forms.resize(unique(forms[i].forms.begin(), forms[i].forms.end(), tagged_form_comparator::eq) - forms[i].forms.begin()); 0 0 0
forms[i].forms.resize(unique(forms[i].forms.begin(), forms[i].forms.end(), tagged_form_comparator::eq) - forms[i].forms.begin()); 0 0 0
10330 }
10331 }
10332 0 }
10333  
10334 } // namespace morphodita
10335  
10336 /////////
10337 // File: morphodita/tokenizer/czech_tokenizer.cpp
10338 /////////
10339  
10340 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10341 //
10342 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10343 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10344 //
10345 // This Source Code Form is subject to the terms of the Mozilla Public
10346 // License, v. 2.0. If a copy of the MPL was not distributed with this
10347 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10348  
10349 namespace morphodita {
10350  
10351 static const char _czech_tokenizer_cond_offsets[] = {
10352 0, 0, 0, 0, 0, 0, 0, 0,
10353 2, 2, 2, 2, 2, 2, 2, 2,
10354 2, 2, 2, 2
10355 };
10356  
10357 static const char _czech_tokenizer_cond_lengths[] = {
10358 0, 0, 0, 0, 0, 0, 0, 2,
10359 0, 0, 0, 0, 0, 0, 0, 0,
10360 0, 0, 0, 0
10361 };
10362  
10363 static const short _czech_tokenizer_cond_keys[] = {
10364 43u, 43u, 45u, 45u, 0
10365 };
10366  
10367 static const char _czech_tokenizer_cond_spaces[] = {
10368 1, 0, 0
10369 };
10370  
10371 static const unsigned char _czech_tokenizer_key_offsets[] = {
10372 0, 0, 17, 29, 43, 46, 51, 54,
10373 89, 94, 99, 100, 105, 106, 111, 125,
10374 132, 137, 140, 152
10375 };
10376  
10377 static const short _czech_tokenizer_trans_keys[] = {
10378 13u, 32u, 34u, 40u, 91u, 96u, 123u, 129u,
10379 133u, 135u, 147u, 150u, 162u, 9u, 10u, 65u,
10380 90u, 34u, 40u, 91u, 96u, 123u, 129u, 133u,
10381 135u, 150u, 162u, 65u, 90u, 13u, 32u, 34u,
10382 39u, 41u, 59u, 93u, 125u, 139u, 141u, 147u,
10383 161u, 9u, 10u, 159u, 48u, 57u, 43u, 45u,
10384 159u, 48u, 57u, 159u, 48u, 57u, 9u, 10u,
10385 13u, 32u, 33u, 44u, 46u, 47u, 63u, 129u,
10386 131u, 135u, 142u, 147u, 157u, 159u, 160u, 301u,
10387 557u, 811u, 1067u, 0u, 42u, 48u, 57u, 58u,
10388 64u, 65u, 90u, 91u, 96u, 97u, 122u, 123u,
10389 255u, 9u, 10u, 13u, 32u, 147u, 9u, 10u,
10390 13u, 32u, 147u, 13u, 9u, 10u, 13u, 32u,
10391 147u, 10u, 9u, 10u, 13u, 32u, 147u, 13u,
10392 32u, 34u, 39u, 41u, 59u, 93u, 125u, 139u,
10393 141u, 147u, 161u, 9u, 10u, 44u, 46u, 69u,
10394 101u, 159u, 48u, 57u, 69u, 101u, 159u, 48u,
10395 57u, 159u, 48u, 57u, 129u, 131u, 135u, 151u,
10396 155u, 157u, 65u, 90u, 97u, 122u, 142u, 143u,
10397 159u, 48u, 57u, 0
10398 };
10399  
10400 static const char _czech_tokenizer_single_lengths[] = {
10401 0, 13, 10, 12, 1, 3, 1, 21,
10402 5, 5, 1, 5, 1, 5, 12, 5,
10403 3, 1, 6, 1
10404 };
10405  
10406 static const char _czech_tokenizer_range_lengths[] = {
10407 0, 2, 1, 1, 1, 1, 1, 7,
10408 0, 0, 0, 0, 0, 0, 1, 1,
10409 1, 1, 3, 1
10410 };
10411  
10412 static const unsigned char _czech_tokenizer_index_offsets[] = {
10413 0, 0, 16, 28, 42, 45, 50, 53,
10414 82, 88, 94, 96, 102, 104, 110, 124,
10415 131, 136, 139, 149
10416 };
10417  
10418 static const char _czech_tokenizer_indicies[] = {
10419 1, 1, 2, 2, 2, 2, 2, 3,
10420 2, 3, 1, 2, 2, 1, 3, 0,
10421 2, 2, 2, 2, 2, 3, 2, 3,
10422 2, 2, 3, 0, 4, 4, 5, 5,
10423 5, 5, 5, 5, 5, 5, 4, 5,
10424 4, 0, 6, 6, 0, 7, 7, 8,
10425 8, 0, 8, 8, 0, 10, 11, 12,
10426 10, 13, 9, 13, 9, 13, 16, 16,
10427 16, 16, 10, 16, 15, 13, 9, 17,
10428 9, 17, 9, 15, 9, 16, 9, 16,
10429 9, 14, 10, 11, 12, 10, 10, 18,
10430 10, 19, 20, 10, 10, 18, 22, 21,
10431 10, 19, 23, 10, 10, 18, 22, 21,
10432 10, 20, 23, 10, 10, 18, 4, 4,
10433 5, 5, 5, 5, 5, 5, 5, 5,
10434 4, 5, 4, 24, 25, 25, 26, 26,
10435 15, 15, 24, 26, 26, 6, 6, 24,
10436 8, 8, 24, 16, 16, 16, 16, 16,
10437 16, 16, 16, 16, 24, 15, 15, 24,
10438 0
10439 };
10440  
10441 static const char _czech_tokenizer_trans_targs[] = {
10442 7, 1, 2, 7, 1, 3, 16, 6,
10443 17, 7, 8, 9, 13, 14, 0, 15,
10444 18, 19, 7, 10, 11, 7, 7, 12,
10445 7, 4, 5
10446 };
10447  
10448 static const char _czech_tokenizer_trans_actions[] = {
10449 1, 0, 0, 2, 3, 0, 4, 0,
10450 0, 7, 0, 0, 0, 4, 0, 4,
10451 0, 0, 8, 0, 0, 9, 10, 0,
10452 11, 0, 0
10453 };
10454  
10455 static const char _czech_tokenizer_to_state_actions[] = {
10456 0, 0, 0, 0, 0, 0, 0, 5,
10457 0, 0, 0, 0, 0, 0, 0, 0,
10458 0, 0, 0, 0
10459 };
10460  
10461 static const char _czech_tokenizer_from_state_actions[] = {
10462 0, 0, 0, 0, 0, 0, 0, 6,
10463 0, 0, 0, 0, 0, 0, 0, 0,
10464 0, 0, 0, 0
10465 };
10466  
10467 static const unsigned char _czech_tokenizer_eof_trans[] = {
10468 0, 1, 1, 1, 1, 1, 1, 0,
10469 19, 19, 22, 19, 22, 19, 25, 25,
10470 25, 25, 25, 25
10471 };
10472  
10473 static const int czech_tokenizer_start = 7;
10474  
10475 // The list of lower cased words that when preceding eos do not end sentence.
10476 // Note: because of VS, we cannot list the abbreviations directly in UTF-8,
10477 // because the compilation of utf-8 encoded sources fail on some locales
10478 // (e.g., Japanese).
10479 // perl -CS -ple 'use Encode;s/([^[:ascii:]])/join("", map {sprintf "\\%o", ord($_)} split(m@@, encode("utf-8", $1)))/ge'
10480 // perl -CS -ple 'use Encode;s/\\([0-7]{3})\\([0-7]{3})/decode("utf-8", chr(oct($1)).chr(oct($2)))/ge'
10481 const unordered_set<string> czech_tokenizer::abbreviations_czech = {
10482 // Titles
10483 "prof", "csc", "drsc", "doc", "phd", "ph", "d",
10484 "judr", "mddr", "mudr", "mvdr", "paeddr", "paedr", "phdr", "rndr", "rsdr", "dr",
10485 "ing", "arch", "mgr", "bc", "mag", "mba", "bca", "mga",
10486 "gen", "plk", "pplk", "npor", "por", "ppor", "kpt", "mjr", "sgt", "pls", "p", "s",
10487 "p", "p\303\255", "fa", "fy", "mr", "mrs", "ms", "miss", "tr", "sv",
10488 // Geographic names
10489 "angl", "fr", "\304\215es", "ces", "\304\215s", "cs", "slov", "n\304\233m", "nem", "it", "pol", "ma\304\217", "mad", "rus",
10490 "sev", "v\303\275ch", "vych", "ji\305\276", "jiz", "z\303\241p", "zap",
10491 // Common abbrevs
10492 "adr", "\304\215", "c", "eg", "ev", "g", "hod", "j", "kr", "m", "max", "min", "mj", "nap\305\231", "napr",
10493 "okr", "pop\305\231", "popr", "pozn", "r", "\305\231", "red", "rep", "resp", "srov", "st", "st\305\231", "str",
10494 "sv", "tel", "tj", "tzv", "\303\272", "u", "uh", "ul", "um", "zl", "zn",
10495 };
10496  
10497 const unordered_set<string> czech_tokenizer::abbreviations_slovak = {
10498 // Titles
10499 "prof", "csc", "drsc", "doc", "phd", "ph", "d",
10500 "judr", "mddr", "mudr", "mvdr", "paeddr", "paedr", "phdr", "rndr", "rsdr", "dr",
10501 "ing", "arch", "mgr", "bc", "mag", "mba", "bca", "mga",
10502 "gen", "plk", "pplk", "npor", "por", "ppor", "kpt", "mjr", "sgt", "pls", "p", "s",
10503 "p", "p\303\255", "fa", "fy", "mr", "mrs", "ms", "miss", "tr", "sv",
10504 // Geographic names
10505 "angl", "fr", "\304\215es", "ces", "\304\215s", "cs", "slov", "nem", "it", "po\304\276", "pol", "ma\304\217", "mad",
10506 "rus", "sev", "v\303\275ch", "vych", "ju\305\276", "juz", "z\303\241p", "zap",
10507 // Common abbrevs
10508 "adr", "\304\215", "c", "eg", "ev", "g", "hod", "j", "kr", "m", "max", "min", "mj", "napr",
10509 "okr", "popr", "pozn", "r", "red", "rep", "resp", "srov", "st", "str",
10510 "sv", "tel", "tj", "tzv", "\303\272", "u", "uh", "ul", "um", "zl", "zn",
10511 };
10512  
10513 0 czech_tokenizer::czech_tokenizer(tokenizer_language language, unsigned version, const morpho* m)
10514 0 ▶ : ragel_tokenizer(version <= 1 ? 1 : 2), m(m) {
Branch: 1 branch
BranchTrueFalseTotal
: ragel_tokenizer(version <= 1 ? 1 : 2), m(m) { 0 0 0
10515 0 switch (language) {
10516 0 case CZECH:
10517 0 abbreviations = &abbreviations_czech;
10518 0 break;
10519 0 case SLOVAK:
10520 0 abbreviations = &abbreviations_slovak;
10521 0 break;
10522 }
10523 0 }
10524  
10525 0 void czech_tokenizer::merge_hyphenated(vector<token_range>& tokens) {
10526 using namespace unilib;
10527  
10528 0 ▶ if (!m) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!m) return; 0 0 0
10529 0 ▶ if (tokens.empty() || chars[tokens.back().start].cat & ~unicode::L) return;
Branch: 3 branches
BranchTrueFalseTotal
if (tokens.empty() || chars[tokens.back().start].cat & ~unicode::L) return; 0 0 0
if (tokens.empty() || chars[tokens.back().start].cat & ~unicode::L) return; 0 0 0
if (tokens.empty() || chars[tokens.back().start].cat & ~unicode::L) return; 0 0 0
10530  
10531 0 unsigned matched_hyphens = 0;
10532 0 ▶ for (unsigned hyphens = 1; hyphens <= 2; hyphens++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned hyphens = 1; hyphens <= 2; hyphens++) { 0 0 0
10533 // Are the tokens a sequence of 'hyphens' hyphenated tokens?
10534 0 ▶ if (tokens.size() < 2*hyphens + 1) break;
Branch: 1 branch
BranchTrueFalseTotal
if (tokens.size() < 2*hyphens + 1) break; 0 0 0
10535 0 unsigned first_hyphen = tokens.size() - 2*hyphens;
10536 0 ▶ if (tokens[first_hyphen].length != 1 || chars[tokens[first_hyphen].start].cat & ~unicode::P ||
Branch: 1 branch
BranchTrueFalseTotal
if (tokens[first_hyphen].length != 1 || chars[tokens[first_hyphen].start].cat & ~unicode::P || 0 0 0
10537 0 ▶ tokens[first_hyphen].start + tokens[first_hyphen].length != tokens[first_hyphen + 1].start ||
Branch: 1 branch
BranchTrueFalseTotal
tokens[first_hyphen].start + tokens[first_hyphen].length != tokens[first_hyphen + 1].start || 0 0 0
10538 0 ▶ tokens[first_hyphen-1].start + tokens[first_hyphen-1].length != tokens[first_hyphen].start ||
Branch: 3 branches
BranchTrueFalseTotal
tokens[first_hyphen-1].start + tokens[first_hyphen-1].length != tokens[first_hyphen].start || 0 0 0
tokens[first_hyphen-1].start + tokens[first_hyphen-1].length != tokens[first_hyphen].start || 0 0 0
tokens[first_hyphen-1].start + tokens[first_hyphen-1].length != tokens[first_hyphen].start || 0 0 0
10539 0 ▶ chars[tokens[first_hyphen-1].start].cat & ~unicode::L)
Branch: 1 branch
BranchTrueFalseTotal
chars[tokens[first_hyphen-1].start].cat & ~unicode::L) 0 0 0
10540 0 break;
10541  
10542 0 ▶ if (m->analyze(string_piece(chars[tokens[first_hyphen-1].start].str, chars[tokens.back().start + tokens.back().length].str - chars[tokens[first_hyphen-1].start].str), morpho::NO_GUESSER, lemmas) >= 0)
Branch: 2 branches
BranchTrueFalseTotal
if (m->analyze(string_piece(chars[tokens[first_hyphen-1].start].str, chars[tokens.back().start + tokens.back().length].str - chars[tokens[first_hyphen-1].start].str), morpho::NO_GUESSER, lemmas) >= 0) 0 0 0
if (m->analyze(string_piece(chars[tokens[first_hyphen-1].start].str, chars[tokens.back().start + tokens.back().length].str - chars[tokens[first_hyphen-1].start].str), morpho::NO_GUESSER, lemmas) >= 0) 0 0 0
10543 0 matched_hyphens = hyphens;
10544 }
10545  
10546 0 ▶ if (matched_hyphens) {
Branch: 1 branch
BranchTrueFalseTotal
if (matched_hyphens) { 0 0 0
10547 0 unsigned first = tokens.size() - 2*matched_hyphens - 1;
10548 0 tokens[first].length = tokens.back().start + tokens.back().length - tokens[first].start;
10549 0 tokens.resize(first + 1);
10550 }
10551 }
10552  
10553 0 bool czech_tokenizer::next_sentence(vector<token_range>& tokens) {
10554 using namespace unilib;
10555  
10556 int cs, act;
10557 size_t ts, te;
10558 0 size_t whitespace = 0; // Suppress "may be uninitialized" warning
10559  
10560 0 ▶ while (tokenize_url_email(tokens))
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)) 0 0 0
while (tokenize_url_email(tokens)) 0 0 0
10561 0 ▶ if (emergency_sentence_split(tokens))
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) 0 0 0
10562 0 return true;
10563
10564 {
10565 0 cs = czech_tokenizer_start;
10566 0 ts = 0;
10567 0 te = 0;
10568 0 act = 0;
10569 }
10570  
10571 {
10572 int _klen;
10573 const short *_keys;
10574 int _trans;
10575 short _widec;
10576  
10577 0 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 0 0 0
10578 0 goto _test_eof;
10579 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
10580 0 goto _out;
10581 0 _resume:
10582 0 ▶ switch ( _czech_tokenizer_from_state_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _czech_tokenizer_from_state_actions[cs] ) { 0 0 0
10583 0 case 6:
10584 0 {ts = ( current);}
10585 0 break;
10586 }
10587  
10588 0 _widec = ( ragel_char(chars[current]));
10589 0 _klen = _czech_tokenizer_cond_lengths[cs];
10590 0 _keys = _czech_tokenizer_cond_keys + (_czech_tokenizer_cond_offsets[cs]*2);
10591 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
10592 0 const short *_lower = _keys;
10593 const short *_mid;
10594 0 const short *_upper = _keys + (_klen<<1) - 2;
10595 while (1) {
10596 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
10597 0 break;
10598  
10599 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
10600 0 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 0 0 0
10601 0 _upper = _mid - 2;
10602 0 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 0 0 0
10603 0 _lower = _mid + 2;
10604 else {
10605 0 switch ( _czech_tokenizer_cond_spaces[_czech_tokenizer_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
10606 0 case 0: {
10607 0 _widec = (short)(256u + (( ragel_char(chars[current])) - 0u));
10608 0 if (
10609 0 ▶ !current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256;
Branch: 3 branches
BranchTrueFalseTotal
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
10610 0 break;
10611 }
10612 0 case 1: {
10613 0 _widec = (short)(768u + (( ragel_char(chars[current])) - 0u));
10614 0 if (
10615 0 ▶ !current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256;
Branch: 4 branches
BranchTrueFalseTotal
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
10616 0 break;
10617 }
10618 }
10619 0 break;
10620 }
10621 }
10622 }
10623  
10624 0 _keys = _czech_tokenizer_trans_keys + _czech_tokenizer_key_offsets[cs];
10625 0 _trans = _czech_tokenizer_index_offsets[cs];
10626  
10627 0 _klen = _czech_tokenizer_single_lengths[cs];
10628 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
10629 0 const short *_lower = _keys;
10630 const short *_mid;
10631 0 const short *_upper = _keys + _klen - 1;
10632 while (1) {
10633 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
10634 0 break;
10635  
10636 0 _mid = _lower + ((_upper-_lower) >> 1);
10637 0 ▶ if ( _widec < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < *_mid ) 0 0 0
10638 0 _upper = _mid - 1;
10639 0 ▶ else if ( _widec > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > *_mid ) 0 0 0
10640 0 _lower = _mid + 1;
10641 else {
10642 0 _trans += (unsigned int)(_mid - _keys);
10643 0 goto _match;
10644 }
10645 }
10646 0 _keys += _klen;
10647 0 _trans += _klen;
10648 }
10649  
10650 0 _klen = _czech_tokenizer_range_lengths[cs];
10651 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
10652 0 const short *_lower = _keys;
10653 const short *_mid;
10654 0 const short *_upper = _keys + (_klen<<1) - 2;
10655 while (1) {
10656 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
10657 0 break;
10658  
10659 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
10660 0 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 0 0 0
10661 0 _upper = _mid - 2;
10662 0 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 0 0 0
10663 0 _lower = _mid + 2;
10664 else {
10665 0 _trans += (unsigned int)((_mid - _keys)>>1);
10666 0 goto _match;
10667 }
10668 }
10669 0 _trans += _klen;
10670 }
10671  
10672 0 _match:
10673 0 _trans = _czech_tokenizer_indicies[_trans];
10674 0 _eof_trans:
10675 0 cs = _czech_tokenizer_trans_targs[_trans];
10676  
10677 0 ▶ if ( _czech_tokenizer_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _czech_tokenizer_trans_actions[_trans] == 0 ) 0 0 0
10678 0 goto _again;
10679  
10680 0 switch ( _czech_tokenizer_trans_actions[_trans] ) {
10681 0 case 3:
10682 0 { whitespace = current; }
10683 0 break;
10684 0 case 4:
10685 0 {te = ( current)+1;}
10686 0 break;
10687 0 case 7:
10688 0 ▶ {te = ( current)+1;{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{te = ( current)+1;{ tokens.emplace_back(ts, te - ts); 0 0 0
10689 0 ▶ merge_hyphenated(tokens);
Branch: 1 branch
BranchTrueFalseTotal
merge_hyphenated(tokens); 0 0 0
10690 0 current = te;
10691 do
10692 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
10693 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
10694 0 ( current)--;
10695 }}
10696 0 break;
10697 0 case 2:
10698 0 {te = ( current)+1;{
10699 0 ▶ bool eos = is_eos(tokens, chars[ts].chr, abbreviations);
Branch: 1 branch
BranchTrueFalseTotal
bool eos = is_eos(tokens, chars[ts].chr, abbreviations); 0 0 0
10700 0 ▶ for (current = ts; current < whitespace; current++)
Branch: 1 branch
BranchTrueFalseTotal
for (current = ts; current < whitespace; current++) 0 0 0
10701 0 ▶ tokens.emplace_back(current, 1);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(current, 1); 0 0 0
10702 0 {( current) = (( whitespace))-1;}
10703 0 ▶ if (eos) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (eos) {( current)++; goto _out; } 0 0 0
10704 }}
10705 0 break;
10706 0 case 10:
10707 0 {te = ( current)+1;{
10708 0 ▶ if (!tokens.empty()) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (!tokens.empty()) {( current)++; goto _out; } 0 0 0
10709 0 current = te;
10710 do
10711 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
10712 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
10713 0 ( current)--;
10714 }}
10715 0 break;
10716 0 case 11:
10717 0 ▶ {te = ( current);( current)--;{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{te = ( current);( current)--;{ tokens.emplace_back(ts, te - ts); 0 0 0
10718 0 ▶ merge_hyphenated(tokens);
Branch: 1 branch
BranchTrueFalseTotal
merge_hyphenated(tokens); 0 0 0
10719 0 current = te;
10720 do
10721 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
10722 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
10723 0 ( current)--;
10724 }}
10725 0 break;
10726 0 case 8:
10727 0 {te = ( current);( current)--;{
10728 0 current = te;
10729 do
10730 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
10731 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
10732 0 ( current)--;
10733 }}
10734 0 break;
10735 0 case 9:
10736 0 {te = ( current);( current)--;{
10737 0 ▶ if (!tokens.empty()) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (!tokens.empty()) {( current)++; goto _out; } 0 0 0
10738 0 current = te;
10739 do
10740 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
10741 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
10742 0 ( current)--;
10743 }}
10744 0 break;
10745 0 case 1:
10746 0 ▶ {{( current) = ((te))-1;}{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{{( current) = ((te))-1;}{ tokens.emplace_back(ts, te - ts); 0 0 0
10747 0 ▶ merge_hyphenated(tokens);
Branch: 1 branch
BranchTrueFalseTotal
merge_hyphenated(tokens); 0 0 0
10748 0 current = te;
10749 do
10750 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
10751 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
10752 0 ( current)--;
10753 }}
10754 0 break;
10755 }
10756  
10757 0 _again:
10758 0 ▶ switch ( _czech_tokenizer_to_state_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _czech_tokenizer_to_state_actions[cs] ) { 0 0 0
10759 0 case 5:
10760 0 {ts = 0;}
10761 0 break;
10762 }
10763  
10764 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
10765 0 goto _out;
10766 0 ▶ if ( ++( current) != ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++( current) != ( (chars.size() - 1)) ) 0 0 0
10767 0 goto _resume;
10768 0 _test_eof: {}
10769 0 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 0 0 0
10770 {
10771 0 ▶ if ( _czech_tokenizer_eof_trans[cs] > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _czech_tokenizer_eof_trans[cs] > 0 ) { 0 0 0
10772 0 _trans = _czech_tokenizer_eof_trans[cs] - 1;
10773 0 goto _eof_trans;
10774 }
10775 }
10776  
10777 0 _out: {}
10778 }
10779  
10780 (void)act; // Suppress unused variable warning
10781  
10782 0 return !tokens.empty();
10783 }
10784  
10785 } // namespace morphodita
10786  
10787 /////////
10788 // File: morphodita/tokenizer/english_tokenizer.cpp
10789 /////////
10790  
10791 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
10792 //
10793 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
10794 // Mathematics and Physics, Charles University in Prague, Czech Republic.
10795 //
10796 // This Source Code Form is subject to the terms of the Mozilla Public
10797 // License, v. 2.0. If a copy of the MPL was not distributed with this
10798 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10799  
10800 namespace morphodita {
10801  
10802 // The list of lowercased words that when preceding eos do not end sentence.
10803 const unordered_set<string> english_tokenizer::abbreviations = {
10804 // Titles
10805 "adj", "adm", "adv", "assoc", "asst", "bart", "bldg", "brig", "bros", "capt",
10806 "cmdr", "col", "comdr", "con", "corp", "cpl", "d", "dr", "dr", "drs", "ens",
10807 "gen", "gov", "hon", "hosp", "hr", "insp", "lt", "mm", "mr", "mrs", "ms",
10808 "maj", "messrs", "mlle", "mme", "mr", "mrs", "ms", "msgr", "op", "ord",
10809 "pfc", "ph", "phd", "prof", "pvt", "rep", "reps", "res", "rev", "rt", "sen",
10810 "sens", "sfc", "sgt", "sr", "st", "supt", "surg", "univ",
10811 // Common abbrevs
10812 "addr", "approx", "apr", "aug", "calif", "co", "corp", "dec", "def", "e",
10813 "e.g", "eg", "feb", "fla", "ft", "gen", "gov", "hrs", "i.", "i.e", "ie",
10814 "inc", "jan", "jr", "ltd", "mar", "max", "min", "mph", "mt", "n", "nov",
10815 "oct", "ont", "pa", "pres", "rep", "rev", "s", "sec", "sen", "sep", "sept",
10816 "sgt", "sr", "tel", "un", "univ", "v", "va", "vs", "w", "yrs",
10817 };
10818  
10819 static const char _english_tokenizer_split_token_key_offsets[] = {
10820 0, 0, 16, 20, 22, 26, 28, 30,
10821 32, 34, 36, 44, 46, 50, 52, 54,
10822 56, 58, 60, 62, 64, 66, 68, 72,
10823 74, 76, 78, 80, 82, 82
10824 };
10825  
10826 static const unsigned char _english_tokenizer_split_token_trans_keys[] = {
10827 65u, 68u, 69u, 76u, 77u, 78u, 83u, 84u,
10828 97u, 100u, 101u, 108u, 109u, 110u, 115u, 116u,
10829 78u, 84u, 110u, 116u, 78u, 110u, 65u, 79u,
10830 97u, 111u, 87u, 119u, 71u, 103u, 84u, 116u,
10831 79u, 111u, 39u, 161u, 77u, 82u, 86u, 89u,
10832 109u, 114u, 118u, 121u, 77u, 109u, 69u, 73u,
10833 101u, 105u, 76u, 108u, 39u, 161u, 68u, 100u,
10834 76u, 108u, 39u, 161u, 69u, 101u, 82u, 114u,
10835 79u, 111u, 77u, 109u, 39u, 79u, 111u, 161u,
10836 78u, 110u, 78u, 110u, 78u, 110u, 65u, 97u,
10837 67u, 99u, 0
10838 };
10839  
10840 static const char _english_tokenizer_split_token_single_lengths[] = {
10841 0, 16, 4, 2, 4, 2, 2, 2,
10842 2, 2, 8, 2, 4, 2, 2, 2,
10843 2, 2, 2, 2, 2, 2, 4, 2,
10844 2, 2, 2, 2, 0, 0
10845 };
10846  
10847 static const char _english_tokenizer_split_token_range_lengths[] = {
10848 0, 0, 0, 0, 0, 0, 0, 0,
10849 0, 0, 0, 0, 0, 0, 0, 0,
10850 0, 0, 0, 0, 0, 0, 0, 0,
10851 0, 0, 0, 0, 0, 0
10852 };
10853  
10854 static const unsigned char _english_tokenizer_split_token_index_offsets[] = {
10855 0, 0, 17, 22, 25, 30, 33, 36,
10856 39, 42, 45, 54, 57, 62, 65, 68,
10857 71, 74, 77, 80, 83, 86, 89, 94,
10858 97, 100, 103, 106, 109, 110
10859 };
10860  
10861 static const char _english_tokenizer_split_token_indicies[] = {
10862 0, 2, 3, 4, 2, 5, 2, 6,
10863 0, 2, 3, 4, 2, 5, 2, 6,
10864 1, 7, 8, 7, 8, 1, 9, 9,
10865 1, 10, 11, 10, 11, 1, 12, 12,
10866 1, 12, 12, 1, 13, 13, 1, 11,
10867 11, 1, 14, 14, 1, 15, 2, 2,
10868 16, 15, 2, 2, 16, 1, 17, 17,
10869 1, 18, 11, 18, 11, 1, 12, 12,
10870 1, 19, 19, 1, 12, 12, 1, 2,
10871 2, 1, 20, 20, 1, 21, 21, 1,
10872 22, 22, 1, 23, 23, 1, 12, 12,
10873 1, 24, 25, 25, 24, 1, 14, 14,
10874 1, 26, 26, 1, 27, 27, 1, 28,
10875 28, 1, 12, 12, 1, 1, 1, 0
10876 };
10877  
10878 static const char _english_tokenizer_split_token_trans_targs[] = {
10879 2, 0, 9, 10, 16, 17, 22, 3,
10880 7, 4, 5, 6, 28, 8, 29, 11,
10881 14, 12, 13, 15, 18, 19, 20, 21,
10882 23, 24, 25, 26, 27
10883 };
10884  
10885 static const char _english_tokenizer_split_token_trans_actions[] = {
10886 0, 0, 0, 0, 0, 0, 0, 1,
10887 1, 0, 0, 0, 0, 0, 2, 1,
10888 1, 0, 0, 0, 1, 0, 0, 0,
10889 0, 0, 1, 0, 0
10890 };
10891  
10892 static const char _english_tokenizer_split_token_eof_actions[] = {
10893 0, 0, 0, 0, 0, 0, 0, 0,
10894 0, 0, 0, 0, 0, 0, 0, 0,
10895 0, 0, 0, 0, 0, 0, 0, 0,
10896 0, 0, 0, 0, 3, 0
10897 };
10898  
10899 static const int english_tokenizer_split_token_start = 1;
10900  
10901 0 void english_tokenizer::split_token(vector<token_range>& tokens) {
10902 0 ▶ if (tokens.empty() || chars[tokens.back().start].cat & ~unilib::unicode::L) return;
Branch: 3 branches
BranchTrueFalseTotal
if (tokens.empty() || chars[tokens.back().start].cat & ~unilib::unicode::L) return; 0 0 0
if (tokens.empty() || chars[tokens.back().start].cat & ~unilib::unicode::L) return; 0 0 0
if (tokens.empty() || chars[tokens.back().start].cat & ~unilib::unicode::L) return; 0 0 0
10903  
10904 0 size_t index = tokens.back().start, end = index + tokens.back().length;
10905 int cs;
10906 0 size_t split_mark = 0, split_len = 0;
10907
10908 {
10909 0 cs = english_tokenizer_split_token_start;
10910 }
10911  
10912 {
10913 int _klen;
10914 const unsigned char *_keys;
10915 int _trans;
10916  
10917 0 ▶ if ( ( index) == ( end) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( index) == ( end) ) 0 0 0
10918 0 goto _test_eof;
10919 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
10920 0 goto _out;
10921 0 _resume:
10922 0 _keys = _english_tokenizer_split_token_trans_keys + _english_tokenizer_split_token_key_offsets[cs];
10923 0 _trans = _english_tokenizer_split_token_index_offsets[cs];
10924  
10925 0 _klen = _english_tokenizer_split_token_single_lengths[cs];
10926 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
10927 0 const unsigned char *_lower = _keys;
10928 const unsigned char *_mid;
10929 0 const unsigned char *_upper = _keys + _klen - 1;
10930 while (1) {
10931 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
10932 0 break;
10933  
10934 0 _mid = _lower + ((_upper-_lower) >> 1);
10935 0 ▶ if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) < *_mid ) 0 0 0
10936 0 _upper = _mid - 1;
10937 0 ▶ else if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) > *_mid ) 0 0 0
10938 0 _lower = _mid + 1;
10939 else {
10940 0 _trans += (unsigned int)(_mid - _keys);
10941 0 goto _match;
10942 }
10943 }
10944 0 _keys += _klen;
10945 0 _trans += _klen;
10946 }
10947  
10948 0 _klen = _english_tokenizer_split_token_range_lengths[cs];
10949 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
10950 0 const unsigned char *_lower = _keys;
10951 const unsigned char *_mid;
10952 0 const unsigned char *_upper = _keys + (_klen<<1) - 2;
10953 while (1) {
10954 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
10955 0 break;
10956  
10957 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
10958 0 ▶ if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) < _mid[0] ) 0 0 0
10959 0 _upper = _mid - 2;
10960 0 ▶ else if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( ( ragel_char(chars[tokens.back().start + end - index - 1])) > _mid[1] ) 0 0 0
10961 0 _lower = _mid + 2;
10962 else {
10963 0 _trans += (unsigned int)((_mid - _keys)>>1);
10964 0 goto _match;
10965 }
10966 }
10967 0 _trans += _klen;
10968 }
10969  
10970 0 _match:
10971 0 _trans = _english_tokenizer_split_token_indicies[_trans];
10972 0 cs = _english_tokenizer_split_token_trans_targs[_trans];
10973  
10974 0 ▶ if ( _english_tokenizer_split_token_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _english_tokenizer_split_token_trans_actions[_trans] == 0 ) 0 0 0
10975 0 goto _again;
10976  
10977 0 switch ( _english_tokenizer_split_token_trans_actions[_trans] ) {
10978 0 case 1:
10979 0 { split_mark = index - tokens.back().start + 1; }
10980 0 break;
10981 0 case 2:
10982 0 { split_mark = index - tokens.back().start + 1; }
10983 0 { split_len = split_mark; {( index)++; goto _out; } }
10984 break;
10985 }
10986  
10987 0 _again:
10988 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
10989 0 goto _out;
10990 0 ▶ if ( ++( index) != ( end) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++( index) != ( end) ) 0 0 0
10991 0 goto _resume;
10992 0 _test_eof: {}
10993 0 ▶ if ( ( index) == ( end) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( index) == ( end) ) 0 0 0
10994 {
10995 0 ▶ switch ( _english_tokenizer_split_token_eof_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _english_tokenizer_split_token_eof_actions[cs] ) { 0 0 0
10996 0 case 3:
10997 0 { split_len = split_mark; {( index)++; goto _out; } }
10998 break;
10999 }
11000 }
11001  
11002 0 _out: {}
11003 }
11004  
11005 0 ▶ if (split_len && split_len < end) {
Branch: 2 branches
BranchTrueFalseTotal
if (split_len && split_len < end) { 0 0 0
if (split_len && split_len < end) { 0 0 0
11006 0 tokens.back().length -= split_len;
11007 0 ▶ tokens.emplace_back(end - split_len, split_len);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(end - split_len, split_len); 0 0 0
11008 }
11009 }
11010  
11011 static const char _english_tokenizer_cond_offsets[] = {
11012 0, 0, 0, 0, 0, 0, 0, 0,
11013 0, 0, 0, 2, 2, 2, 2, 2,
11014 2, 2, 2, 2, 2, 2, 2, 2,
11015 2, 2
11016 };
11017  
11018 static const char _english_tokenizer_cond_lengths[] = {
11019 0, 0, 0, 0, 0, 0, 0, 0,
11020 0, 0, 2, 0, 0, 0, 0, 0,
11021 0, 0, 0, 0, 0, 0, 0, 0,
11022 0, 0
11023 };
11024  
11025 static const short _english_tokenizer_cond_keys[] = {
11026 43u, 43u, 45u, 45u, 0
11027 };
11028  
11029 static const char _english_tokenizer_cond_spaces[] = {
11030 1, 0, 0
11031 };
11032  
11033 static const unsigned char _english_tokenizer_key_offsets[] = {
11034 0, 0, 17, 29, 43, 46, 49, 52,
11035 55, 60, 63, 98, 103, 108, 109, 114,
11036 115, 120, 134, 141, 145, 150, 153, 168,
11037 181, 195
11038 };
11039  
11040 static const short _english_tokenizer_trans_keys[] = {
11041 13u, 32u, 34u, 40u, 91u, 96u, 123u, 129u,
11042 133u, 135u, 147u, 150u, 162u, 9u, 10u, 65u,
11043 90u, 34u, 40u, 91u, 96u, 123u, 129u, 133u,
11044 135u, 150u, 162u, 65u, 90u, 13u, 32u, 34u,
11045 39u, 41u, 59u, 93u, 125u, 139u, 141u, 147u,
11046 161u, 9u, 10u, 159u, 48u, 57u, 159u, 48u,
11047 57u, 159u, 48u, 57u, 159u, 48u, 57u, 43u,
11048 45u, 159u, 48u, 57u, 159u, 48u, 57u, 9u,
11049 10u, 13u, 32u, 33u, 44u, 46u, 47u, 63u,
11050 129u, 131u, 135u, 142u, 147u, 157u, 159u, 160u,
11051 301u, 557u, 811u, 1067u, 0u, 42u, 48u, 57u,
11052 58u, 64u, 65u, 90u, 91u, 96u, 97u, 122u,
11053 123u, 255u, 9u, 10u, 13u, 32u, 147u, 9u,
11054 10u, 13u, 32u, 147u, 13u, 9u, 10u, 13u,
11055 32u, 147u, 10u, 9u, 10u, 13u, 32u, 147u,
11056 13u, 32u, 34u, 39u, 41u, 59u, 93u, 125u,
11057 139u, 141u, 147u, 161u, 9u, 10u, 44u, 46u,
11058 69u, 101u, 159u, 48u, 57u, 44u, 46u, 69u,
11059 101u, 69u, 101u, 159u, 48u, 57u, 159u, 48u,
11060 57u, 39u, 45u, 129u, 131u, 135u, 151u, 155u,
11061 157u, 161u, 65u, 90u, 97u, 122u, 142u, 143u,
11062 45u, 129u, 131u, 135u, 151u, 155u, 157u, 65u,
11063 90u, 97u, 122u, 142u, 143u, 39u, 129u, 131u,
11064 135u, 151u, 155u, 157u, 161u, 65u, 90u, 97u,
11065 122u, 142u, 143u, 159u, 48u, 57u, 0
11066 };
11067  
11068 static const char _english_tokenizer_single_lengths[] = {
11069 0, 13, 10, 12, 1, 1, 1, 1,
11070 3, 1, 21, 5, 5, 1, 5, 1,
11071 5, 12, 5, 4, 3, 1, 9, 7,
11072 8, 1
11073 };
11074  
11075 static const char _english_tokenizer_range_lengths[] = {
11076 0, 2, 1, 1, 1, 1, 1, 1,
11077 1, 1, 7, 0, 0, 0, 0, 0,
11078 0, 1, 1, 0, 1, 1, 3, 3,
11079 3, 1
11080 };
11081  
11082 static const unsigned char _english_tokenizer_index_offsets[] = {
11083 0, 0, 16, 28, 42, 45, 48, 51,
11084 54, 59, 62, 91, 97, 103, 105, 111,
11085 113, 119, 133, 140, 145, 150, 153, 166,
11086 177, 189
11087 };
11088  
11089 static const char _english_tokenizer_indicies[] = {
11090 1, 1, 2, 2, 2, 2, 2, 3,
11091 2, 3, 1, 2, 2, 1, 3, 0,
11092 2, 2, 2, 2, 2, 3, 2, 3,
11093 2, 2, 3, 0, 4, 4, 5, 5,
11094 5, 5, 5, 5, 5, 5, 4, 5,
11095 4, 0, 6, 6, 0, 7, 7, 0,
11096 8, 8, 0, 9, 9, 0, 10, 10,
11097 11, 11, 0, 11, 11, 0, 13, 14,
11098 15, 13, 16, 12, 16, 12, 16, 19,
11099 19, 19, 19, 13, 19, 18, 16, 12,
11100 20, 12, 20, 12, 18, 12, 19, 12,
11101 19, 12, 17, 13, 14, 15, 13, 13,
11102 21, 13, 22, 23, 13, 13, 21, 25,
11103 24, 13, 22, 26, 13, 13, 21, 25,
11104 24, 13, 23, 26, 13, 13, 21, 4,
11105 4, 5, 5, 5, 5, 5, 5, 5,
11106 5, 4, 5, 4, 27, 28, 29, 30,
11107 30, 18, 18, 27, 28, 29, 30, 30,
11108 27, 30, 30, 9, 9, 27, 11, 11,
11109 27, 31, 32, 19, 19, 19, 19, 19,
11110 19, 31, 19, 19, 19, 27, 32, 19,
11111 19, 19, 19, 19, 19, 19, 19, 19,
11112 27, 31, 19, 19, 19, 19, 19, 19,
11113 31, 19, 19, 19, 27, 18, 18, 27,
11114 0
11115 };
11116  
11117 static const char _english_tokenizer_trans_targs[] = {
11118 10, 1, 2, 10, 1, 3, 5, 6,
11119 19, 20, 9, 21, 10, 11, 12, 16,
11120 17, 0, 18, 22, 25, 10, 13, 14,
11121 10, 10, 15, 10, 4, 7, 8, 23,
11122 24
11123 };
11124  
11125 static const char _english_tokenizer_trans_actions[] = {
11126 1, 0, 0, 2, 3, 0, 0, 0,
11127 4, 4, 0, 0, 7, 0, 0, 0,
11128 4, 0, 4, 0, 0, 8, 0, 0,
11129 9, 10, 0, 11, 0, 0, 0, 0,
11130 0
11131 };
11132  
11133 static const char _english_tokenizer_to_state_actions[] = {
11134 0, 0, 0, 0, 0, 0, 0, 0,
11135 0, 0, 5, 0, 0, 0, 0, 0,
11136 0, 0, 0, 0, 0, 0, 0, 0,
11137 0, 0
11138 };
11139  
11140 static const char _english_tokenizer_from_state_actions[] = {
11141 0, 0, 0, 0, 0, 0, 0, 0,
11142 0, 0, 6, 0, 0, 0, 0, 0,
11143 0, 0, 0, 0, 0, 0, 0, 0,
11144 0, 0
11145 };
11146  
11147 static const unsigned char _english_tokenizer_eof_trans[] = {
11148 0, 1, 1, 1, 1, 1, 1, 1,
11149 1, 1, 0, 22, 22, 25, 22, 25,
11150 22, 28, 28, 28, 28, 28, 28, 28,
11151 28, 28
11152 };
11153  
11154 static const int english_tokenizer_start = 10;
11155  
11156 0 ▶english_tokenizer::english_tokenizer(unsigned version) : ragel_tokenizer(version <= 1 ? 1 : 2) {}
Branch: 1 branch
BranchTrueFalseTotal
english_tokenizer::english_tokenizer(unsigned version) : ragel_tokenizer(version <= 1 ? 1 : 2) {} 0 0 0
11157  
11158 0 bool english_tokenizer::next_sentence(vector<token_range>& tokens) {
11159 using namespace unilib;
11160  
11161 int cs, act;
11162 size_t ts, te;
11163 0 size_t whitespace = 0; // Suppress "may be uninitialized" warning
11164  
11165 0 ▶ while (tokenize_url_email(tokens))
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)) 0 0 0
while (tokenize_url_email(tokens)) 0 0 0
11166 0 ▶ if (emergency_sentence_split(tokens))
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) 0 0 0
11167 0 return true;
11168
11169 {
11170 0 cs = english_tokenizer_start;
11171 0 ts = 0;
11172 0 te = 0;
11173 0 act = 0;
11174 }
11175  
11176 {
11177 int _klen;
11178 const short *_keys;
11179 int _trans;
11180 short _widec;
11181  
11182 0 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 0 0 0
11183 0 goto _test_eof;
11184 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
11185 0 goto _out;
11186 0 _resume:
11187 0 ▶ switch ( _english_tokenizer_from_state_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _english_tokenizer_from_state_actions[cs] ) { 0 0 0
11188 0 case 6:
11189 0 {ts = ( current);}
11190 0 break;
11191 }
11192  
11193 0 _widec = ( ragel_char(chars[current]));
11194 0 _klen = _english_tokenizer_cond_lengths[cs];
11195 0 _keys = _english_tokenizer_cond_keys + (_english_tokenizer_cond_offsets[cs]*2);
11196 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
11197 0 const short *_lower = _keys;
11198 const short *_mid;
11199 0 const short *_upper = _keys + (_klen<<1) - 2;
11200 while (1) {
11201 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
11202 0 break;
11203  
11204 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
11205 0 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 0 0 0
11206 0 _upper = _mid - 2;
11207 0 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 0 0 0
11208 0 _lower = _mid + 2;
11209 else {
11210 0 switch ( _english_tokenizer_cond_spaces[_english_tokenizer_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
11211 0 case 0: {
11212 0 _widec = (short)(256u + (( ragel_char(chars[current])) - 0u));
11213 0 if (
11214 0 ▶ !current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256;
Branch: 3 branches
BranchTrueFalseTotal
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
11215 0 break;
11216 }
11217 0 case 1: {
11218 0 _widec = (short)(768u + (( ragel_char(chars[current])) - 0u));
11219 0 if (
11220 0 ▶ !current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256;
Branch: 4 branches
BranchTrueFalseTotal
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
11221 0 break;
11222 }
11223 }
11224 0 break;
11225 }
11226 }
11227 }
11228  
11229 0 _keys = _english_tokenizer_trans_keys + _english_tokenizer_key_offsets[cs];
11230 0 _trans = _english_tokenizer_index_offsets[cs];
11231  
11232 0 _klen = _english_tokenizer_single_lengths[cs];
11233 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
11234 0 const short *_lower = _keys;
11235 const short *_mid;
11236 0 const short *_upper = _keys + _klen - 1;
11237 while (1) {
11238 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
11239 0 break;
11240  
11241 0 _mid = _lower + ((_upper-_lower) >> 1);
11242 0 ▶ if ( _widec < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < *_mid ) 0 0 0
11243 0 _upper = _mid - 1;
11244 0 ▶ else if ( _widec > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > *_mid ) 0 0 0
11245 0 _lower = _mid + 1;
11246 else {
11247 0 _trans += (unsigned int)(_mid - _keys);
11248 0 goto _match;
11249 }
11250 }
11251 0 _keys += _klen;
11252 0 _trans += _klen;
11253 }
11254  
11255 0 _klen = _english_tokenizer_range_lengths[cs];
11256 0 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 0 0
11257 0 const short *_lower = _keys;
11258 const short *_mid;
11259 0 const short *_upper = _keys + (_klen<<1) - 2;
11260 while (1) {
11261 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
11262 0 break;
11263  
11264 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
11265 0 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 0 0 0
11266 0 _upper = _mid - 2;
11267 0 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 0 0 0
11268 0 _lower = _mid + 2;
11269 else {
11270 0 _trans += (unsigned int)((_mid - _keys)>>1);
11271 0 goto _match;
11272 }
11273 }
11274 0 _trans += _klen;
11275 }
11276  
11277 0 _match:
11278 0 _trans = _english_tokenizer_indicies[_trans];
11279 0 _eof_trans:
11280 0 cs = _english_tokenizer_trans_targs[_trans];
11281  
11282 0 ▶ if ( _english_tokenizer_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _english_tokenizer_trans_actions[_trans] == 0 ) 0 0 0
11283 0 goto _again;
11284  
11285 0 switch ( _english_tokenizer_trans_actions[_trans] ) {
11286 0 case 3:
11287 0 { whitespace = current; }
11288 0 break;
11289 0 case 4:
11290 0 {te = ( current)+1;}
11291 0 break;
11292 0 case 7:
11293 0 ▶ {te = ( current)+1;{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{te = ( current)+1;{ tokens.emplace_back(ts, te - ts); 0 0 0
11294 0 ▶ split_token(tokens);
Branch: 1 branch
BranchTrueFalseTotal
split_token(tokens); 0 0 0
11295 0 current = te;
11296 do
11297 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11298 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11299 0 ( current)--;
11300 }}
11301 0 break;
11302 0 case 2:
11303 0 {te = ( current)+1;{
11304 0 ▶ bool eos = is_eos(tokens, chars[ts].chr, &abbreviations);
Branch: 1 branch
BranchTrueFalseTotal
bool eos = is_eos(tokens, chars[ts].chr, &abbreviations); 0 0 0
11305 0 ▶ for (current = ts; current < whitespace; current++)
Branch: 1 branch
BranchTrueFalseTotal
for (current = ts; current < whitespace; current++) 0 0 0
11306 0 ▶ tokens.emplace_back(current, 1);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(current, 1); 0 0 0
11307 0 {( current) = (( whitespace))-1;}
11308 0 ▶ if (eos) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (eos) {( current)++; goto _out; } 0 0 0
11309 }}
11310 0 break;
11311 0 case 10:
11312 0 {te = ( current)+1;{
11313 0 ▶ if (!tokens.empty()) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (!tokens.empty()) {( current)++; goto _out; } 0 0 0
11314 0 current = te;
11315 do
11316 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11317 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11318 0 ( current)--;
11319 }}
11320 0 break;
11321 0 case 11:
11322 0 ▶ {te = ( current);( current)--;{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{te = ( current);( current)--;{ tokens.emplace_back(ts, te - ts); 0 0 0
11323 0 ▶ split_token(tokens);
Branch: 1 branch
BranchTrueFalseTotal
split_token(tokens); 0 0 0
11324 0 current = te;
11325 do
11326 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11327 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11328 0 ( current)--;
11329 }}
11330 0 break;
11331 0 case 8:
11332 0 {te = ( current);( current)--;{
11333 0 current = te;
11334 do
11335 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11336 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11337 0 ( current)--;
11338 }}
11339 0 break;
11340 0 case 9:
11341 0 {te = ( current);( current)--;{
11342 0 ▶ if (!tokens.empty()) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (!tokens.empty()) {( current)++; goto _out; } 0 0 0
11343 0 current = te;
11344 do
11345 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11346 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11347 0 ( current)--;
11348 }}
11349 0 break;
11350 0 case 1:
11351 0 ▶ {{( current) = ((te))-1;}{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{{( current) = ((te))-1;}{ tokens.emplace_back(ts, te - ts); 0 0 0
11352 0 ▶ split_token(tokens);
Branch: 1 branch
BranchTrueFalseTotal
split_token(tokens); 0 0 0
11353 0 current = te;
11354 do
11355 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11356 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11357 0 ( current)--;
11358 }}
11359 0 break;
11360 }
11361  
11362 0 _again:
11363 0 ▶ switch ( _english_tokenizer_to_state_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _english_tokenizer_to_state_actions[cs] ) { 0 0 0
11364 0 case 5:
11365 0 {ts = 0;}
11366 0 break;
11367 }
11368  
11369 0 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 0 0
11370 0 goto _out;
11371 0 ▶ if ( ++( current) != ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++( current) != ( (chars.size() - 1)) ) 0 0 0
11372 0 goto _resume;
11373 0 _test_eof: {}
11374 0 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 0 0 0
11375 {
11376 0 ▶ if ( _english_tokenizer_eof_trans[cs] > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _english_tokenizer_eof_trans[cs] > 0 ) { 0 0 0
11377 0 _trans = _english_tokenizer_eof_trans[cs] - 1;
11378 0 goto _eof_trans;
11379 }
11380 }
11381  
11382 0 _out: {}
11383 }
11384  
11385 (void)act; // Suppress unused variable warning
11386  
11387 0 return !tokens.empty();
11388 }
11389  
11390 } // namespace morphodita
11391  
11392 /////////
11393 // File: morphodita/tokenizer/generic_tokenizer.cpp
11394 /////////
11395  
11396 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
11397 //
11398 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
11399 // Mathematics and Physics, Charles University in Prague, Czech Republic.
11400 //
11401 // This Source Code Form is subject to the terms of the Mozilla Public
11402 // License, v. 2.0. If a copy of the MPL was not distributed with this
11403 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
11404  
11405 namespace morphodita {
11406  
11407 static const char _generic_tokenizer_cond_offsets[] = {
11408 0, 0, 0, 0, 0, 0, 0, 0,
11409 2, 2, 2, 2, 2, 2, 2, 2,
11410 2, 2, 2, 2
11411 };
11412  
11413 static const char _generic_tokenizer_cond_lengths[] = {
11414 0, 0, 0, 0, 0, 0, 0, 2,
11415 0, 0, 0, 0, 0, 0, 0, 0,
11416 0, 0, 0, 0
11417 };
11418  
11419 static const short _generic_tokenizer_cond_keys[] = {
11420 43u, 43u, 45u, 45u, 0
11421 };
11422  
11423 static const char _generic_tokenizer_cond_spaces[] = {
11424 1, 0, 0
11425 };
11426  
11427 static const unsigned char _generic_tokenizer_key_offsets[] = {
11428 0, 0, 17, 29, 43, 46, 51, 54,
11429 89, 94, 99, 100, 105, 106, 111, 125,
11430 131, 136, 139, 151
11431 };
11432  
11433 static const short _generic_tokenizer_trans_keys[] = {
11434 13u, 32u, 34u, 40u, 91u, 96u, 123u, 129u,
11435 133u, 135u, 147u, 150u, 162u, 9u, 10u, 65u,
11436 90u, 34u, 40u, 91u, 96u, 123u, 129u, 133u,
11437 135u, 150u, 162u, 65u, 90u, 13u, 32u, 34u,
11438 39u, 41u, 59u, 93u, 125u, 139u, 141u, 147u,
11439 161u, 9u, 10u, 159u, 48u, 57u, 43u, 45u,
11440 159u, 48u, 57u, 159u, 48u, 57u, 9u, 10u,
11441 13u, 32u, 33u, 44u, 46u, 47u, 63u, 129u,
11442 131u, 135u, 142u, 147u, 157u, 159u, 160u, 301u,
11443 557u, 811u, 1067u, 0u, 42u, 48u, 57u, 58u,
11444 64u, 65u, 90u, 91u, 96u, 97u, 122u, 123u,
11445 255u, 9u, 10u, 13u, 32u, 147u, 9u, 10u,
11446 13u, 32u, 147u, 13u, 9u, 10u, 13u, 32u,
11447 147u, 10u, 9u, 10u, 13u, 32u, 147u, 13u,
11448 32u, 34u, 39u, 41u, 59u, 93u, 125u, 139u,
11449 141u, 147u, 161u, 9u, 10u, 46u, 69u, 101u,
11450 159u, 48u, 57u, 69u, 101u, 159u, 48u, 57u,
11451 159u, 48u, 57u, 129u, 131u, 135u, 151u, 155u,
11452 157u, 65u, 90u, 97u, 122u, 142u, 143u, 159u,
11453 48u, 57u, 0
11454 };
11455  
11456 static const char _generic_tokenizer_single_lengths[] = {
11457 0, 13, 10, 12, 1, 3, 1, 21,
11458 5, 5, 1, 5, 1, 5, 12, 4,
11459 3, 1, 6, 1
11460 };
11461  
11462 static const char _generic_tokenizer_range_lengths[] = {
11463 0, 2, 1, 1, 1, 1, 1, 7,
11464 0, 0, 0, 0, 0, 0, 1, 1,
11465 1, 1, 3, 1
11466 };
11467  
11468 static const unsigned char _generic_tokenizer_index_offsets[] = {
11469 0, 0, 16, 28, 42, 45, 50, 53,
11470 82, 88, 94, 96, 102, 104, 110, 124,
11471 130, 135, 138, 148
11472 };
11473  
11474 static const char _generic_tokenizer_indicies[] = {
11475 1, 1, 2, 2, 2, 2, 2, 3,
11476 2, 3, 1, 2, 2, 1, 3, 0,
11477 2, 2, 2, 2, 2, 3, 2, 3,
11478 2, 2, 3, 0, 4, 4, 5, 5,
11479 5, 5, 5, 5, 5, 5, 4, 5,
11480 4, 0, 6, 6, 0, 7, 7, 8,
11481 8, 0, 8, 8, 0, 10, 11, 12,
11482 10, 13, 9, 13, 9, 13, 16, 16,
11483 16, 16, 10, 16, 15, 13, 9, 17,
11484 9, 17, 9, 15, 9, 16, 9, 16,
11485 9, 14, 10, 11, 12, 10, 10, 18,
11486 10, 19, 20, 10, 10, 18, 22, 21,
11487 10, 19, 23, 10, 10, 18, 22, 21,
11488 10, 20, 23, 10, 10, 18, 4, 4,
11489 5, 5, 5, 5, 5, 5, 5, 5,
11490 4, 5, 4, 24, 25, 26, 26, 15,
11491 15, 24, 26, 26, 6, 6, 24, 8,
11492 8, 24, 16, 16, 16, 16, 16, 16,
11493 16, 16, 16, 24, 15, 15, 24, 0
11494 };
11495  
11496 static const char _generic_tokenizer_trans_targs[] = {
11497 7, 1, 2, 7, 1, 3, 16, 6,
11498 17, 7, 8, 9, 13, 14, 0, 15,
11499 18, 19, 7, 10, 11, 7, 7, 12,
11500 7, 4, 5
11501 };
11502  
11503 static const char _generic_tokenizer_trans_actions[] = {
11504 1, 0, 0, 2, 3, 0, 4, 0,
11505 0, 7, 0, 0, 0, 4, 0, 4,
11506 0, 0, 8, 0, 0, 9, 10, 0,
11507 11, 0, 0
11508 };
11509  
11510 static const char _generic_tokenizer_to_state_actions[] = {
11511 0, 0, 0, 0, 0, 0, 0, 5,
11512 0, 0, 0, 0, 0, 0, 0, 0,
11513 0, 0, 0, 0
11514 };
11515  
11516 static const char _generic_tokenizer_from_state_actions[] = {
11517 0, 0, 0, 0, 0, 0, 0, 6,
11518 0, 0, 0, 0, 0, 0, 0, 0,
11519 0, 0, 0, 0
11520 };
11521  
11522 static const unsigned char _generic_tokenizer_eof_trans[] = {
11523 0, 1, 1, 1, 1, 1, 1, 0,
11524 19, 19, 22, 19, 22, 19, 25, 25,
11525 25, 25, 25, 25
11526 };
11527  
11528 static const int generic_tokenizer_start = 7;
11529  
11530 3 ▶generic_tokenizer::generic_tokenizer(unsigned version) : ragel_tokenizer(version <= 1 ? 1 : 2) {}
Branch: 1 branch
BranchTrueFalseTotal
generic_tokenizer::generic_tokenizer(unsigned version) : ragel_tokenizer(version <= 1 ? 1 : 2) {} 0 3 3
11531  
11532 2 bool generic_tokenizer::next_sentence(vector<token_range>& tokens) {
11533 using namespace unilib;
11534  
11535 int cs, act;
11536 size_t ts, te;
11537 2 size_t whitespace = 0; // Suppress "may be uninitialized" warning
11538  
11539 2 ▶ while (tokenize_url_email(tokens))
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)) 2 0 2
while (tokenize_url_email(tokens)) 0 2 2
11540 0 ▶ if (emergency_sentence_split(tokens))
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) 0 0 0
11541 0 return true;
11542
11543 {
11544 2 cs = generic_tokenizer_start;
11545 2 ts = 0;
11546 2 te = 0;
11547 2 act = 0;
11548 }
11549  
11550 {
11551 int _klen;
11552 const short *_keys;
11553 int _trans;
11554 short _widec;
11555  
11556 2 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 0 2 2
11557 0 goto _test_eof;
11558 2 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 2 2
11559 0 goto _out;
11560 2 _resume:
11561 37 ▶ switch ( _generic_tokenizer_from_state_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _generic_tokenizer_from_state_actions[cs] ) { 10 27 37
11562 10 case 6:
11563 10 {ts = ( current);}
11564 10 break;
11565 }
11566  
11567 37 _widec = ( ragel_char(chars[current]));
11568 37 _klen = _generic_tokenizer_cond_lengths[cs];
11569 37 _keys = _generic_tokenizer_cond_keys + (_generic_tokenizer_cond_offsets[cs]*2);
11570 37 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 10 27 37
11571 10 const short *_lower = _keys;
11572 const short *_mid;
11573 10 const short *_upper = _keys + (_klen<<1) - 2;
11574 while (1) {
11575 27 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 10 17 27
11576 10 break;
11577  
11578 17 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
11579 17 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 3 14 17
11580 3 _upper = _mid - 2;
11581 14 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 14 0 14
11582 14 _lower = _mid + 2;
11583 else {
11584 0 switch ( _generic_tokenizer_cond_spaces[_generic_tokenizer_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
11585 0 case 0: {
11586 0 _widec = (short)(256u + (( ragel_char(chars[current])) - 0u));
11587 0 if (
11588 0 ▶ !current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256;
Branch: 3 branches
BranchTrueFalseTotal
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
!current || (chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N | unicode::Pd)) ) _widec += 256; 0 0 0
11589 0 break;
11590 }
11591 0 case 1: {
11592 0 _widec = (short)(768u + (( ragel_char(chars[current])) - 0u));
11593 0 if (
11594 0 ▶ !current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256;
Branch: 4 branches
BranchTrueFalseTotal
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
!current || ((chars[current-1].cat & ~(unicode::L | unicode::M | unicode::N)) && chars[current-1].chr != '+') ) _widec += 256; 0 0 0
11595 0 break;
11596 }
11597 }
11598 0 break;
11599 }
11600 }
11601 }
11602  
11603 37 _keys = _generic_tokenizer_trans_keys + _generic_tokenizer_key_offsets[cs];
11604 37 _trans = _generic_tokenizer_index_offsets[cs];
11605  
11606 37 _klen = _generic_tokenizer_single_lengths[cs];
11607 37 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 37 0 37
11608 37 const short *_lower = _keys;
11609 const short *_mid;
11610 37 const short *_upper = _keys + _klen - 1;
11611 while (1) {
11612 139 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 27 112 139
11613 27 break;
11614  
11615 112 _mid = _lower + ((_upper-_lower) >> 1);
11616 112 ▶ if ( _widec < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < *_mid ) 66 46 112
11617 66 _upper = _mid - 1;
11618 46 ▶ else if ( _widec > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > *_mid ) 36 10 46
11619 36 _lower = _mid + 1;
11620 else {
11621 10 _trans += (unsigned int)(_mid - _keys);
11622 10 goto _match;
11623 }
11624 }
11625 27 _keys += _klen;
11626 27 _trans += _klen;
11627 }
11628  
11629 27 _klen = _generic_tokenizer_range_lengths[cs];
11630 27 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 3 24 27
11631 24 const short *_lower = _keys;
11632 const short *_mid;
11633 24 const short *_upper = _keys + (_klen<<1) - 2;
11634 while (1) {
11635 37 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 5 32 37
11636 5 break;
11637  
11638 32 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
11639 32 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 10 22 32
11640 10 _upper = _mid - 2;
11641 22 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 3 19 22
11642 3 _lower = _mid + 2;
11643 else {
11644 19 _trans += (unsigned int)((_mid - _keys)>>1);
11645 19 goto _match;
11646 }
11647 }
11648 5 _trans += _klen;
11649 }
11650  
11651 3 _match:
11652 37 _trans = _generic_tokenizer_indicies[_trans];
11653 39 _eof_trans:
11654 39 cs = _generic_tokenizer_trans_targs[_trans];
11655  
11656 39 ▶ if ( _generic_tokenizer_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _generic_tokenizer_trans_actions[_trans] == 0 ) 27 12 39
11657 27 goto _again;
11658  
11659 12 switch ( _generic_tokenizer_trans_actions[_trans] ) {
11660 0 case 3:
11661 0 { whitespace = current; }
11662 0 break;
11663 2 case 4:
11664 2 {te = ( current)+1;}
11665 2 break;
11666 0 case 7:
11667 0 ▶ {te = ( current)+1;{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{te = ( current)+1;{ tokens.emplace_back(ts, te - ts); 0 0 0
11668 0 current = te;
11669 do
11670 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11671 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11672 0 ( current)--;
11673 }}
11674 0 break;
11675 0 case 2:
11676 0 {te = ( current)+1;{
11677 0 ▶ bool eos = is_eos(tokens, chars[ts].chr, nullptr);
Branch: 1 branch
BranchTrueFalseTotal
bool eos = is_eos(tokens, chars[ts].chr, nullptr); 0 0 0
11678 0 ▶ for (current = ts; current < whitespace; current++)
Branch: 1 branch
BranchTrueFalseTotal
for (current = ts; current < whitespace; current++) 0 0 0
11679 0 ▶ tokens.emplace_back(current, 1);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(current, 1); 0 0 0
11680 0 {( current) = (( whitespace))-1;}
11681 0 ▶ if (eos) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (eos) {( current)++; goto _out; } 0 0 0
11682 }}
11683 0 break;
11684 0 case 10:
11685 0 {te = ( current)+1;{
11686 0 ▶ if (!tokens.empty()) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (!tokens.empty()) {( current)++; goto _out; } 0 0 0
11687 0 current = te;
11688 do
11689 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11690 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11691 0 ( current)--;
11692 }}
11693 0 break;
11694 7 case 11:
11695 7 ▶ {te = ( current);( current)--;{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{te = ( current);( current)--;{ tokens.emplace_back(ts, te - ts); 7 0 7
11696 7 current = te;
11697 do
11698 7 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 7 7
11699 7 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 7 0 7
while (tokenize_url_email(tokens)); 0 7 7
11700 7 ( current)--;
11701 }}
11702 7 break;
11703 3 case 8:
11704 3 {te = ( current);( current)--;{
11705 3 current = te;
11706 do
11707 3 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 3 3
11708 3 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 3 0 3
while (tokenize_url_email(tokens)); 0 3 3
11709 3 ( current)--;
11710 }}
11711 3 break;
11712 0 case 9:
11713 0 {te = ( current);( current)--;{
11714 0 ▶ if (!tokens.empty()) {( current)++; goto _out; }
Branch: 1 branch
BranchTrueFalseTotal
if (!tokens.empty()) {( current)++; goto _out; } 0 0 0
11715 0 current = te;
11716 do
11717 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11718 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11719 0 ( current)--;
11720 }}
11721 0 break;
11722 0 case 1:
11723 0 ▶ {{( current) = ((te))-1;}{ tokens.emplace_back(ts, te - ts);
Branch: 1 branch
BranchTrueFalseTotal
{{( current) = ((te))-1;}{ tokens.emplace_back(ts, te - ts); 0 0 0
11724 0 current = te;
11725 do
11726 0 ▶ if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } }
Branch: 1 branch
BranchTrueFalseTotal
if (emergency_sentence_split(tokens)) { ( current)--; {( current)++; goto _out; } } 0 0 0
11727 0 ▶ while (tokenize_url_email(tokens));
Branch: 2 branches
BranchTrueFalseTotal
while (tokenize_url_email(tokens)); 0 0 0
while (tokenize_url_email(tokens)); 0 0 0
11728 0 ( current)--;
11729 }}
11730 0 break;
11731 }
11732  
11733 39 _again:
11734 39 ▶ switch ( _generic_tokenizer_to_state_actions[cs] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _generic_tokenizer_to_state_actions[cs] ) { 10 29 39
11735 10 case 5:
11736 10 {ts = 0;}
11737 10 break;
11738 }
11739  
11740 39 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 0 39 39
11741 0 goto _out;
11742 39 ▶ if ( ++( current) != ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++( current) != ( (chars.size() - 1)) ) 35 4 39
11743 35 goto _resume;
11744 4 _test_eof: {}
11745 4 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 4 0 4
11746 {
11747 4 ▶ if ( _generic_tokenizer_eof_trans[cs] > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _generic_tokenizer_eof_trans[cs] > 0 ) { 2 2 4
11748 2 _trans = _generic_tokenizer_eof_trans[cs] - 1;
11749 2 goto _eof_trans;
11750 }
11751 }
11752  
11753 0 _out: {}
11754 }
11755  
11756 (void)act; // Suppress unused variable warning
11757  
11758 2 return !tokens.empty();
11759 }
11760  
11761 } // namespace morphodita
11762  
11763 /////////
11764 // File: morphodita/tokenizer/ragel_tokenizer.cpp
11765 /////////
11766  
11767 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
11768 //
11769 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
11770 // Mathematics and Physics, Charles University in Prague, Czech Republic.
11771 //
11772 // This Source Code Form is subject to the terms of the Mozilla Public
11773 // License, v. 2.0. If a copy of the MPL was not distributed with this
11774 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
11775  
11776 namespace morphodita {
11777  
11778 static const char _ragel_url_email_cond_offsets[] = {
11779 0, 0, 0, 0, 0, 0, 0, 0,
11780 0, 0, 0, 0, 0, 1, 1, 1,
11781 1, 1, 1, 1, 1, 1, 1, 1,
11782 1, 1, 1, 1, 1, 1, 1, 1,
11783 1, 1, 1, 1, 1, 1, 1, 1,
11784 1, 1, 1, 1, 1, 1, 1, 1,
11785 1, 1, 1, 1, 1, 1, 1, 1,
11786 1, 1, 1, 2, 3, 3, 4, 5,
11787 6, 7, 8, 9, 10, 11, 12, 13,
11788 14, 15, 16
11789 };
11790  
11791 static const char _ragel_url_email_cond_lengths[] = {
11792 0, 0, 0, 0, 0, 0, 0, 0,
11793 0, 0, 0, 0, 1, 0, 0, 0,
11794 0, 0, 0, 0, 0, 0, 0, 0,
11795 0, 0, 0, 0, 0, 0, 0, 0,
11796 0, 0, 0, 0, 0, 0, 0, 0,
11797 0, 0, 0, 0, 0, 0, 0, 0,
11798 0, 0, 0, 0, 0, 0, 0, 0,
11799 0, 0, 1, 1, 0, 1, 1, 1,
11800 1, 1, 1, 1, 1, 1, 1, 1,
11801 1, 1, 1
11802 };
11803  
11804 static const short _ragel_url_email_cond_keys[] = {
11805 41u, 41u, 47u, 47u, 47u, 47u, 41u, 41u,
11806 47u, 47u, 47u, 47u, 47u, 47u, 47u, 47u,
11807 47u, 47u, 47u, 47u, 47u, 47u, 47u, 47u,
11808 47u, 47u, 47u, 47u, 47u, 47u, 47u, 47u,
11809 47u, 47u, 0
11810 };
11811  
11812 static const char _ragel_url_email_cond_spaces[] = {
11813 1, 0, 0, 1, 0, 0, 0, 0,
11814 0, 0, 0, 0, 0, 0, 0, 0,
11815 0, 0
11816 };
11817  
11818 static const short _ragel_url_email_key_offsets[] = {
11819 0, 0, 15, 29, 41, 54, 63, 71,
11820 78, 86, 92, 100, 117, 145, 154, 162,
11821 171, 179, 188, 196, 204, 215, 225, 233,
11822 241, 252, 262, 270, 278, 289, 299, 315,
11823 330, 346, 360, 376, 393, 409, 426, 442,
11824 459, 475, 491, 510, 528, 544, 560, 579,
11825 597, 613, 629, 648, 666, 682, 698, 714,
11826 725, 726, 741, 752, 756, 773, 801, 812,
11827 823, 834, 848, 861, 879, 893, 908, 926,
11828 944, 962, 983
11829 };
11830  
11831 static const short _ragel_url_email_trans_keys[] = {
11832 33u, 48u, 49u, 50u, 95u, 36u, 37u, 39u,
11833 46u, 51u, 57u, 65u, 90u, 97u, 122u, 33u,
11834 58u, 64u, 95u, 36u, 37u, 39u, 46u, 48u,
11835 57u, 65u, 90u, 97u, 122u, 33u, 95u, 36u,
11836 37u, 39u, 46u, 48u, 57u, 65u, 90u, 97u,
11837 122u, 33u, 64u, 95u, 36u, 37u, 39u, 46u,
11838 48u, 57u, 65u, 90u, 97u, 122u, 48u, 49u,
11839 50u, 51u, 57u, 65u, 90u, 97u, 122u, 45u,
11840 46u, 48u, 57u, 65u, 90u, 97u, 122u, 45u,
11841 48u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
11842 48u, 57u, 65u, 90u, 97u, 122u, 48u, 57u,
11843 65u, 90u, 97u, 122u, 45u, 46u, 48u, 57u,
11844 65u, 90u, 97u, 122u, 33u, 39u, 41u, 61u,
11845 95u, 36u, 47u, 48u, 57u, 58u, 59u, 63u,
11846 64u, 65u, 90u, 97u, 122u, 33u, 39u, 40u,
11847 44u, 46u, 61u, 63u, 95u, 129u, 131u, 135u,
11848 151u, 809u, 1065u, 36u, 38u, 42u, 57u, 58u,
11849 59u, 64u, 90u, 97u, 122u, 142u, 143u, 155u,
11850 159u, 48u, 49u, 50u, 51u, 57u, 65u, 90u,
11851 97u, 122u, 45u, 46u, 48u, 57u, 65u, 90u,
11852 97u, 122u, 48u, 49u, 50u, 51u, 57u, 65u,
11853 90u, 97u, 122u, 45u, 46u, 48u, 57u, 65u,
11854 90u, 97u, 122u, 48u, 49u, 50u, 51u, 57u,
11855 65u, 90u, 97u, 122u, 45u, 46u, 48u, 57u,
11856 65u, 90u, 97u, 122u, 45u, 46u, 48u, 57u,
11857 65u, 90u, 97u, 122u, 45u, 46u, 53u, 48u,
11858 52u, 54u, 57u, 65u, 90u, 97u, 122u, 45u,
11859 46u, 48u, 53u, 54u, 57u, 65u, 90u, 97u,
11860 122u, 45u, 46u, 48u, 57u, 65u, 90u, 97u,
11861 122u, 45u, 46u, 48u, 57u, 65u, 90u, 97u,
11862 122u, 45u, 46u, 53u, 48u, 52u, 54u, 57u,
11863 65u, 90u, 97u, 122u, 45u, 46u, 48u, 53u,
11864 54u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
11865 48u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
11866 48u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
11867 53u, 48u, 52u, 54u, 57u, 65u, 90u, 97u,
11868 122u, 45u, 46u, 48u, 53u, 54u, 57u, 65u,
11869 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
11870 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
11871 90u, 97u, 122u, 33u, 45u, 58u, 64u, 95u,
11872 36u, 37u, 39u, 46u, 48u, 57u, 65u, 90u,
11873 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
11874 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
11875 97u, 122u, 33u, 58u, 64u, 95u, 36u, 37u,
11876 39u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
11877 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
11878 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
11879 33u, 48u, 49u, 50u, 58u, 64u, 95u, 36u,
11880 37u, 39u, 46u, 51u, 57u, 65u, 90u, 97u,
11881 122u, 33u, 45u, 46u, 58u, 64u, 95u, 36u,
11882 37u, 39u, 44u, 48u, 57u, 65u, 90u, 97u,
11883 122u, 33u, 48u, 49u, 50u, 58u, 64u, 95u,
11884 36u, 37u, 39u, 46u, 51u, 57u, 65u, 90u,
11885 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
11886 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
11887 97u, 122u, 33u, 48u, 49u, 50u, 58u, 64u,
11888 95u, 36u, 37u, 39u, 46u, 51u, 57u, 65u,
11889 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
11890 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
11891 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
11892 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
11893 90u, 97u, 122u, 33u, 45u, 46u, 53u, 58u,
11894 64u, 95u, 36u, 37u, 39u, 44u, 48u, 52u,
11895 54u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
11896 46u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
11897 48u, 53u, 54u, 57u, 65u, 90u, 97u, 122u,
11898 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
11899 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
11900 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
11901 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
11902 33u, 45u, 46u, 53u, 58u, 64u, 95u, 36u,
11903 37u, 39u, 44u, 48u, 52u, 54u, 57u, 65u,
11904 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
11905 95u, 36u, 37u, 39u, 44u, 48u, 53u, 54u,
11906 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
11907 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
11908 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
11909 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
11910 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
11911 53u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
11912 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
11913 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
11914 39u, 44u, 48u, 53u, 54u, 57u, 65u, 90u,
11915 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
11916 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
11917 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
11918 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
11919 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
11920 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
11921 97u, 122u, 33u, 47u, 95u, 36u, 37u, 39u,
11922 57u, 65u, 90u, 97u, 122u, 47u, 33u, 48u,
11923 49u, 50u, 95u, 36u, 37u, 39u, 46u, 51u,
11924 57u, 65u, 90u, 97u, 122u, 45u, 46u, 58u,
11925 303u, 559u, 48u, 57u, 65u, 90u, 97u, 122u,
11926 303u, 559u, 48u, 57u, 33u, 39u, 41u, 61u,
11927 95u, 36u, 47u, 48u, 57u, 58u, 59u, 63u,
11928 64u, 65u, 90u, 97u, 122u, 33u, 39u, 40u,
11929 44u, 46u, 61u, 63u, 95u, 129u, 131u, 135u,
11930 151u, 809u, 1065u, 36u, 38u, 42u, 57u, 58u,
11931 59u, 64u, 90u, 97u, 122u, 142u, 143u, 155u,
11932 159u, 45u, 46u, 58u, 303u, 559u, 48u, 57u,
11933 65u, 90u, 97u, 122u, 45u, 46u, 58u, 303u,
11934 559u, 48u, 57u, 65u, 90u, 97u, 122u, 45u,
11935 46u, 58u, 303u, 559u, 48u, 57u, 65u, 90u,
11936 97u, 122u, 45u, 46u, 53u, 58u, 303u, 559u,
11937 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
11938 45u, 46u, 58u, 303u, 559u, 48u, 53u, 54u,
11939 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
11940 58u, 64u, 95u, 303u, 559u, 36u, 37u, 39u,
11941 44u, 48u, 57u, 65u, 90u, 97u, 122u, 33u,
11942 95u, 303u, 559u, 36u, 37u, 39u, 46u, 48u,
11943 57u, 65u, 90u, 97u, 122u, 33u, 64u, 95u,
11944 303u, 559u, 36u, 37u, 39u, 46u, 48u, 57u,
11945 65u, 90u, 97u, 122u, 33u, 45u, 46u, 58u,
11946 64u, 95u, 303u, 559u, 36u, 37u, 39u, 44u,
11947 48u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
11948 46u, 58u, 64u, 95u, 303u, 559u, 36u, 37u,
11949 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
11950 33u, 45u, 46u, 58u, 64u, 95u, 303u, 559u,
11951 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
11952 97u, 122u, 33u, 45u, 46u, 53u, 58u, 64u,
11953 95u, 303u, 559u, 36u, 37u, 39u, 44u, 48u,
11954 52u, 54u, 57u, 65u, 90u, 97u, 122u, 33u,
11955 45u, 46u, 58u, 64u, 95u, 303u, 559u, 36u,
11956 37u, 39u, 44u, 48u, 53u, 54u, 57u, 65u,
11957 90u, 97u, 122u, 0
11958 };
11959  
11960 static const char _ragel_url_email_single_lengths[] = {
11961 0, 5, 4, 2, 3, 3, 2, 1,
11962 2, 0, 2, 5, 14, 3, 2, 3,
11963 2, 3, 2, 2, 3, 2, 2, 2,
11964 3, 2, 2, 2, 3, 2, 6, 5,
11965 6, 4, 6, 7, 6, 7, 6, 7,
11966 6, 6, 7, 6, 6, 6, 7, 6,
11967 6, 6, 7, 6, 6, 6, 6, 3,
11968 1, 5, 5, 2, 5, 14, 5, 5,
11969 5, 6, 5, 8, 4, 5, 8, 8,
11970 8, 9, 8
11971 };
11972  
11973 static const char _ragel_url_email_range_lengths[] = {
11974 0, 5, 5, 5, 5, 3, 3, 3,
11975 3, 3, 3, 6, 7, 3, 3, 3,
11976 3, 3, 3, 3, 4, 4, 3, 3,
11977 4, 4, 3, 3, 4, 4, 5, 5,
11978 5, 5, 5, 5, 5, 5, 5, 5,
11979 5, 5, 6, 6, 5, 5, 6, 6,
11980 5, 5, 6, 6, 5, 5, 5, 4,
11981 0, 5, 3, 1, 6, 7, 3, 3,
11982 3, 4, 4, 5, 5, 5, 5, 5,
11983 5, 6, 6
11984 };
11985  
11986 static const short _ragel_url_email_index_offsets[] = {
11987 0, 0, 11, 21, 29, 38, 45, 51,
11988 56, 62, 66, 72, 84, 106, 113, 119,
11989 126, 132, 139, 145, 151, 159, 166, 172,
11990 178, 186, 193, 199, 205, 213, 220, 232,
11991 243, 255, 265, 277, 290, 302, 315, 327,
11992 340, 352, 364, 378, 391, 403, 415, 429,
11993 442, 454, 466, 480, 493, 505, 517, 529,
11994 537, 539, 550, 559, 563, 575, 597, 606,
11995 615, 624, 635, 645, 659, 669, 680, 694,
11996 708, 722, 738
11997 };
11998  
11999 static const char _ragel_url_email_indicies[] = {
12000 0, 2, 3, 4, 0, 0, 0, 5,
12001 6, 6, 1, 0, 7, 8, 0, 0,
12002 0, 0, 0, 0, 1, 9, 9, 9,
12003 9, 9, 9, 9, 1, 9, 8, 9,
12004 9, 9, 9, 9, 9, 1, 10, 11,
12005 12, 13, 14, 14, 1, 15, 16, 14,
12006 14, 14, 1, 15, 14, 14, 14, 1,
12007 15, 17, 14, 14, 14, 1, 14, 18,
12008 18, 1, 15, 17, 14, 19, 19, 1,
12009 20, 21, 21, 20, 20, 20, 21, 20,
12010 20, 21, 21, 1, 22, 22, 24, 22,
12011 22, 23, 22, 23, 23, 23, 23, 23,
12012 25, 26, 23, 23, 22, 23, 23, 23,
12013 23, 1, 27, 28, 29, 30, 18, 18,
12014 1, 15, 31, 14, 14, 14, 1, 32,
12015 33, 34, 35, 18, 18, 1, 15, 36,
12016 14, 14, 14, 1, 37, 38, 39, 40,
12017 18, 18, 1, 15, 36, 35, 14, 14,
12018 1, 15, 36, 32, 14, 14, 1, 15,
12019 36, 41, 35, 32, 14, 14, 1, 15,
12020 36, 32, 14, 14, 14, 1, 15, 31,
12021 30, 14, 14, 1, 15, 31, 27, 14,
12022 14, 1, 15, 31, 42, 30, 27, 14,
12023 14, 1, 15, 31, 27, 14, 14, 14,
12024 1, 15, 16, 13, 14, 14, 1, 15,
12025 16, 10, 14, 14, 1, 15, 16, 43,
12026 13, 10, 14, 14, 1, 15, 16, 10,
12027 14, 14, 14, 1, 0, 44, 45, 7,
12028 8, 0, 0, 0, 46, 46, 46, 1,
12029 0, 44, 7, 8, 0, 0, 0, 46,
12030 46, 46, 1, 0, 44, 47, 7, 8,
12031 0, 0, 0, 46, 46, 46, 1, 0,
12032 7, 8, 0, 0, 0, 46, 48, 48,
12033 1, 0, 44, 47, 7, 8, 0, 0,
12034 0, 46, 49, 49, 1, 0, 50, 51,
12035 52, 7, 8, 0, 0, 0, 53, 48,
12036 48, 1, 0, 44, 54, 7, 8, 0,
12037 0, 0, 46, 46, 46, 1, 0, 55,
12038 56, 57, 7, 8, 0, 0, 0, 58,
12039 48, 48, 1, 0, 44, 59, 7, 8,
12040 0, 0, 0, 46, 46, 46, 1, 0,
12041 60, 61, 62, 7, 8, 0, 0, 0,
12042 63, 48, 48, 1, 0, 44, 59, 7,
12043 8, 0, 0, 0, 58, 46, 46, 1,
12044 0, 44, 59, 7, 8, 0, 0, 0,
12045 55, 46, 46, 1, 0, 44, 59, 64,
12046 7, 8, 0, 0, 0, 58, 55, 46,
12047 46, 1, 0, 44, 59, 7, 8, 0,
12048 0, 0, 55, 46, 46, 46, 1, 0,
12049 44, 54, 7, 8, 0, 0, 0, 53,
12050 46, 46, 1, 0, 44, 54, 7, 8,
12051 0, 0, 0, 50, 46, 46, 1, 0,
12052 44, 54, 65, 7, 8, 0, 0, 0,
12053 53, 50, 46, 46, 1, 0, 44, 54,
12054 7, 8, 0, 0, 0, 50, 46, 46,
12055 46, 1, 0, 44, 45, 7, 8, 0,
12056 0, 0, 5, 46, 46, 1, 0, 44,
12057 45, 7, 8, 0, 0, 0, 2, 46,
12058 46, 1, 0, 44, 45, 66, 7, 8,
12059 0, 0, 0, 5, 2, 46, 46, 1,
12060 0, 44, 45, 7, 8, 0, 0, 0,
12061 2, 46, 46, 46, 1, 0, 44, 47,
12062 7, 8, 0, 0, 0, 46, 67, 67,
12063 1, 0, 44, 47, 7, 8, 0, 0,
12064 0, 46, 68, 68, 1, 0, 44, 47,
12065 69, 8, 0, 0, 0, 46, 68, 68,
12066 1, 9, 70, 9, 9, 9, 9, 9,
12067 1, 71, 1, 0, 2, 3, 4, 0,
12068 0, 0, 5, 46, 46, 1, 15, 17,
12069 72, 21, 23, 14, 19, 19, 1, 21,
12070 23, 72, 1, 20, 21, 21, 20, 20,
12071 20, 21, 20, 20, 21, 21, 1, 22,
12072 22, 24, 22, 22, 23, 22, 23, 23,
12073 23, 23, 23, 25, 26, 23, 23, 22,
12074 23, 23, 23, 23, 1, 15, 17, 72,
12075 21, 23, 14, 14, 14, 1, 15, 17,
12076 72, 21, 23, 40, 14, 14, 1, 15,
12077 17, 72, 21, 23, 37, 14, 14, 1,
12078 15, 17, 73, 72, 21, 23, 40, 37,
12079 14, 14, 1, 15, 17, 72, 21, 23,
12080 37, 14, 14, 14, 1, 0, 44, 47,
12081 74, 8, 0, 21, 23, 0, 0, 46,
12082 49, 49, 1, 9, 9, 21, 23, 9,
12083 9, 75, 9, 9, 1, 9, 8, 9,
12084 21, 23, 9, 9, 75, 9, 9, 1,
12085 0, 44, 47, 74, 8, 0, 21, 23,
12086 0, 0, 46, 46, 46, 1, 0, 44,
12087 47, 74, 8, 0, 21, 23, 0, 0,
12088 63, 46, 46, 1, 0, 44, 47, 74,
12089 8, 0, 21, 23, 0, 0, 60, 46,
12090 46, 1, 0, 44, 47, 76, 74, 8,
12091 0, 21, 23, 0, 0, 63, 60, 46,
12092 46, 1, 0, 44, 47, 74, 8, 0,
12093 21, 23, 0, 0, 60, 46, 46, 46,
12094 1, 0
12095 };
12096  
12097 static const char _ragel_url_email_trans_targs[] = {
12098 2, 0, 30, 48, 50, 49, 52, 3,
12099 5, 4, 6, 26, 28, 27, 8, 7,
12100 13, 9, 10, 58, 11, 60, 12, 61,
12101 61, 12, 61, 14, 22, 24, 23, 15,
12102 16, 18, 20, 19, 17, 62, 63, 65,
12103 64, 21, 25, 29, 31, 35, 32, 33,
12104 34, 67, 36, 44, 46, 45, 37, 38,
12105 40, 42, 41, 39, 70, 71, 73, 72,
12106 43, 47, 51, 53, 54, 55, 56, 57,
12107 59, 66, 68, 69, 74
12108 };
12109  
12110 static const char _ragel_url_email_trans_actions[] = {
12111 0, 0, 0, 0, 0, 0, 0, 0,
12112 0, 0, 0, 0, 0, 0, 0, 0,
12113 0, 0, 0, 1, 0, 1, 0, 1,
12114 2, 3, 4, 0, 0, 0, 0, 0,
12115 0, 0, 0, 0, 0, 1, 1, 1,
12116 1, 0, 0, 0, 0, 0, 0, 0,
12117 0, 1, 0, 0, 0, 0, 0, 0,
12118 0, 0, 0, 0, 1, 1, 1, 1,
12119 0, 0, 0, 0, 0, 0, 0, 0,
12120 1, 1, 1, 1, 1
12121 };
12122  
12123 static const int ragel_url_email_start = 1;
12124  
12125 vector<uint8_t> ragel_tokenizer::ragel_map;
12126 atomic_flag ragel_tokenizer::ragel_map_flag = ATOMIC_FLAG_INIT;
12127  
12128 3 ragel_tokenizer::ragel_tokenizer(unsigned url_email_tokenizer) : unicode_tokenizer(url_email_tokenizer) {
12129 3 ▶ initialize_ragel_map();
Branch: 1 branch
BranchTrueFalseTotal
initialize_ragel_map(); 3 0 3
12130 3 }
12131  
12132 7 void ragel_tokenizer::initialize_ragel_map() {
12133 14 ▶ while (ragel_map_flag.test_and_set()) {}
Branch: 1 branch
BranchTrueFalseTotal
while (ragel_map_flag.test_and_set()) {} 0 7 7
12134 7 ▶ if (ragel_map.empty()) {
Branch: 1 branch
BranchTrueFalseTotal
if (ragel_map.empty()) { 2 5 7
12135 258 ▶ for (uint8_t ascii = 0; ascii < 128; ascii++)
Branch: 1 branch
BranchTrueFalseTotal
for (uint8_t ascii = 0; ascii < 128; ascii++) 256 2 258
12136 256 ▶ ragel_map.push_back(ascii);
Branch: 1 branch
BranchTrueFalseTotal
ragel_map.push_back(ascii); 256 0 256
12137  
12138 2 ragel_map_add(U'\u2026', 160); // horizontal ellipsis (TRIPLE DOT)
12139 2 ragel_map_add(U'\u2019', 161); // right single quotation mark
12140 2 ragel_map_add(U'\u2018', 162); // left single quotation mark
12141 2 ragel_map_add(U'\u2010', 163); // hyphen
12142 }
12143 ragel_map_flag.clear();
12144 7 }
12145  
12146 8 void ragel_tokenizer::ragel_map_add(char32_t chr, uint8_t mapping) {
12147 8 ▶ if (chr >= ragel_map.size())
Branch: 1 branch
BranchTrueFalseTotal
if (chr >= ragel_map.size()) 2 6 8
12148 2 ▶ ragel_map.resize(chr + 1, 128);
Branch: 1 branch
BranchTrueFalseTotal
ragel_map.resize(chr + 1, 128); 2 0 2
12149 8 ragel_map[chr] = mapping;
12150 8 }
12151  
12152 10 bool ragel_tokenizer::ragel_url_email(unsigned version, const vector<char_info>& chars, size_t& current, vector<token_range>& tokens) {
12153 int cs;
12154  
12155 10 size_t start = current, end = current, parens = 0;
12156
12157 {
12158 10 cs = ragel_url_email_start;
12159 }
12160  
12161 {
12162 int _klen;
12163 const short *_keys;
12164 int _trans;
12165 short _widec;
12166  
12167 10 ▶ if ( ( current) == ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ( current) == ( (chars.size() - 1)) ) 0 10 10
12168 0 goto _test_eof;
12169 10 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 10 0 10
12170 0 goto _out;
12171 10 _resume:
12172 22 _widec = ( ragel_char(chars[current]));
12173 22 _klen = _ragel_url_email_cond_lengths[cs];
12174 22 _keys = _ragel_url_email_cond_keys + (_ragel_url_email_cond_offsets[cs]*2);
12175 22 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 22 22
12176 0 const short *_lower = _keys;
12177 const short *_mid;
12178 0 const short *_upper = _keys + (_klen<<1) - 2;
12179 while (1) {
12180 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
12181 0 break;
12182  
12183 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
12184 0 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 0 0 0
12185 0 _upper = _mid - 2;
12186 0 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 0 0 0
12187 0 _lower = _mid + 2;
12188 else {
12189 0 switch ( _ragel_url_email_cond_spaces[_ragel_url_email_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
12190 0 case 0: {
12191 0 _widec = (short)(256u + (( ragel_char(chars[current])) - 0u));
12192 0 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ( 0 0 0
12193 0 version >= 2 ) _widec += 256;
12194 0 break;
12195 }
12196 0 case 1: {
12197 0 _widec = (short)(768u + (( ragel_char(chars[current])) - 0u));
12198 0 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ( 0 0 0
12199 0 parens ) _widec += 256;
12200 0 break;
12201 }
12202 }
12203 0 break;
12204 }
12205 }
12206 }
12207  
12208 22 _keys = _ragel_url_email_trans_keys + _ragel_url_email_key_offsets[cs];
12209 22 _trans = _ragel_url_email_index_offsets[cs];
12210  
12211 22 _klen = _ragel_url_email_single_lengths[cs];
12212 22 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 22 0 22
12213 22 const short *_lower = _keys;
12214 const short *_mid;
12215 22 const short *_upper = _keys + _klen - 1;
12216 while (1) {
12217 85 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 22 63 85
12218 22 break;
12219  
12220 63 _mid = _lower + ((_upper-_lower) >> 1);
12221 63 ▶ if ( _widec < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < *_mid ) 12 51 63
12222 12 _upper = _mid - 1;
12223 51 ▶ else if ( _widec > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > *_mid ) 51 0 51
12224 51 _lower = _mid + 1;
12225 else {
12226 0 _trans += (unsigned int)(_mid - _keys);
12227 0 goto _match;
12228 }
12229 }
12230 22 _keys += _klen;
12231 22 _trans += _klen;
12232 }
12233  
12234 22 _klen = _ragel_url_email_range_lengths[cs];
12235 22 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 22 22
12236 22 const short *_lower = _keys;
12237 const short *_mid;
12238 22 const short *_upper = _keys + (_klen<<1) - 2;
12239 while (1) {
12240 69 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 8 61 69
12241 8 break;
12242  
12243 61 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
12244 61 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 8 53 61
12245 8 _upper = _mid - 2;
12246 53 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 39 14 53
12247 39 _lower = _mid + 2;
12248 else {
12249 14 _trans += (unsigned int)((_mid - _keys)>>1);
12250 14 goto _match;
12251 }
12252 }
12253 8 _trans += _klen;
12254 }
12255  
12256 0 _match:
12257 22 _trans = _ragel_url_email_indicies[_trans];
12258 22 cs = _ragel_url_email_trans_targs[_trans];
12259  
12260 22 ▶ if ( _ragel_url_email_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _ragel_url_email_trans_actions[_trans] == 0 ) 22 0 22
12261 22 goto _again;
12262  
12263 0 switch ( _ragel_url_email_trans_actions[_trans] ) {
12264 0 case 3:
12265 0 {parens-=!!parens;}
12266 0 break;
12267 0 case 1:
12268 0 { end = current + 1; }
12269 0 break;
12270 0 case 2:
12271 0 {parens++;}
12272 0 { end = current + 1; }
12273 0 break;
12274 0 case 4:
12275 0 {parens-=!!parens;}
12276 0 { end = current + 1; }
12277 0 break;
12278 }
12279  
12280 22 _again:
12281 22 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 8 14 22
12282 8 goto _out;
12283 14 ▶ if ( ++( current) != ( (chars.size() - 1)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++( current) != ( (chars.size() - 1)) ) 12 2 14
12284 12 goto _resume;
12285 2 _test_eof: {}
12286 10 _out: {}
12287 }
12288  
12289 10 ▶ if (end > start) {
Branch: 1 branch
BranchTrueFalseTotal
if (end > start) { 0 10 10
12290 0 ▶ tokens.emplace_back(start, end - start);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(start, end - start); 0 0 0
12291 0 current = end;
12292 0 return true;
12293 } else {
12294 10 current = start;
12295 10 return false;
12296 }
12297 }
12298  
12299 } // namespace morphodita
12300  
12301 /////////
12302 // File: morphodita/tokenizer/vertical_tokenizer.h
12303 /////////
12304  
12305 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
12306 //
12307 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
12308 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12309 //
12310 // This Source Code Form is subject to the terms of the Mozilla Public
12311 // License, v. 2.0. If a copy of the MPL was not distributed with this
12312 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12313  
12314 namespace morphodita {
12315  
12316 class vertical_tokenizer : public unicode_tokenizer {
12317 public:
12318 1 vertical_tokenizer() : unicode_tokenizer(0) {}
12319  
12320 virtual bool next_sentence(vector<token_range>& tokens) override;
12321 };
12322  
12323 } // namespace morphodita
12324  
12325 /////////
12326 // File: morphodita/tokenizer/tokenizer.cpp
12327 /////////
12328  
12329 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
12330 //
12331 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
12332 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12333 //
12334 // This Source Code Form is subject to the terms of the Mozilla Public
12335 // License, v. 2.0. If a copy of the MPL was not distributed with this
12336 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12337  
12338 namespace morphodita {
12339  
12340 1 tokenizer* tokenizer::new_vertical_tokenizer() {
12341 1 ▶ return new vertical_tokenizer();
Branch: 2 branches
BranchTrueFalseTotal
return new vertical_tokenizer(); 1 0 1
return new vertical_tokenizer(); 0 0 0
12342 }
12343  
12344 0 tokenizer* tokenizer::new_czech_tokenizer() {
12345 0 ▶ return new czech_tokenizer(czech_tokenizer::CZECH, czech_tokenizer::LATEST);
Branch: 2 branches
BranchTrueFalseTotal
return new czech_tokenizer(czech_tokenizer::CZECH, czech_tokenizer::LATEST); 0 0 0
return new czech_tokenizer(czech_tokenizer::CZECH, czech_tokenizer::LATEST); 0 0 0
12346 }
12347  
12348 0 tokenizer* tokenizer::new_english_tokenizer() {
12349 0 ▶ return new english_tokenizer(english_tokenizer::LATEST);
Branch: 2 branches
BranchTrueFalseTotal
return new english_tokenizer(english_tokenizer::LATEST); 0 0 0
return new english_tokenizer(english_tokenizer::LATEST); 0 0 0
12350 }
12351  
12352 3 tokenizer* tokenizer::new_generic_tokenizer() {
12353 3 ▶ return new generic_tokenizer(generic_tokenizer::LATEST);
Branch: 2 branches
BranchTrueFalseTotal
return new generic_tokenizer(generic_tokenizer::LATEST); 3 0 3
return new generic_tokenizer(generic_tokenizer::LATEST); 0 0 0
12354 }
12355  
12356 } // namespace morphodita
12357  
12358 /////////
12359 // File: morphodita/tokenizer/unicode_tokenizer.cpp
12360 /////////
12361  
12362 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
12363 //
12364 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
12365 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12366 //
12367 // This Source Code Form is subject to the terms of the Mozilla Public
12368 // License, v. 2.0. If a copy of the MPL was not distributed with this
12369 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12370  
12371 namespace morphodita {
12372  
12373 4 unicode_tokenizer::unicode_tokenizer(unsigned url_email_tokenizer) : url_email_tokenizer(url_email_tokenizer) {
12374 4 ▶ ragel_tokenizer::initialize_ragel_map();
Branch: 1 branch
BranchTrueFalseTotal
ragel_tokenizer::initialize_ragel_map(); 4 0 4
12375  
12376 4 ▶ set_text(string_piece(nullptr, 0));
Branch: 1 branch
BranchTrueFalseTotal
set_text(string_piece(nullptr, 0)); 4 0 4
12377 4 }
12378  
12379 7 void unicode_tokenizer::set_text(string_piece text, bool make_copy /*= false*/) {
12380 using namespace unilib;
12381  
12382 7 ▶ if (make_copy && text.str) {
Branch: 2 branches
BranchTrueFalseTotal
if (make_copy && text.str) { 3 4 7
if (make_copy && text.str) { 3 0 3
12383 3 text_buffer.assign(text.str, text.len);
12384 3 text.str = text_buffer.c_str();
12385 }
12386 7 current = 0;
12387  
12388 7 chars.clear();
12389 152 ▶ for (const char* curr_str = text.str; text.len; curr_str = text.str)
Branch: 1 branch
BranchTrueFalseTotal
for (const char* curr_str = text.str; text.len; curr_str = text.str) 145 7 152
12390 145 ▶ chars.emplace_back(utf8::decode(text.str, text.len), curr_str);
Branch: 1 branch
BranchTrueFalseTotal
chars.emplace_back(utf8::decode(text.str, text.len), curr_str); 145 0 145
12391 7 ▶ chars.emplace_back(0, text.str);
Branch: 1 branch
BranchTrueFalseTotal
chars.emplace_back(0, text.str); 7 0 7
12392 7 }
12393  
12394 7 bool unicode_tokenizer::next_sentence(vector<string_piece>* forms, vector<token_range>* tokens_ptr) {
12395 7 ▶ vector<token_range>& tokens = tokens_ptr ? *tokens_ptr : tokens_buffer;
Branch: 1 branch
BranchTrueFalseTotal
vector<token_range>& tokens = tokens_ptr ? *tokens_ptr : tokens_buffer; 7 0 7
12396 7 tokens.clear();
12397 7 ▶ if (forms) forms->clear();
Branch: 1 branch
BranchTrueFalseTotal
if (forms) forms->clear(); 7 0 7
12398 7 ▶ if (current >= chars.size() - 1) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (current >= chars.size() - 1) return false; 3 4 7
12399  
12400 4 bool result = next_sentence(tokens);
12401 4 ▶ if (forms)
Branch: 1 branch
BranchTrueFalseTotal
if (forms) 4 0 4
12402 37 ▶ for (auto&& token : tokens)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& token : tokens) 33 4 37
12403 33 ▶ forms->emplace_back(chars[token.start].str, chars[token.start + token.length].str - chars[token.start].str);
Branch: 1 branch
BranchTrueFalseTotal
forms->emplace_back(chars[token.start].str, chars[token.start + token.length].str - chars[token.start].str); 33 0 33
12404  
12405 4 return result;
12406 }
12407  
12408 12 bool unicode_tokenizer::tokenize_url_email(vector<token_range>& tokens) {
12409 12 ▶ if (current >= chars.size() - 1) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (current >= chars.size() - 1) return false; 2 10 12
12410  
12411 10 ▶ return url_email_tokenizer ? ragel_tokenizer::ragel_url_email(url_email_tokenizer, chars, current, tokens) : false;
Branch: 2 branches
BranchTrueFalseTotal
return url_email_tokenizer ? ragel_tokenizer::ragel_url_email(url_email_tokenizer, chars, current, tokens) : false; 10 0 10
return url_email_tokenizer ? ragel_tokenizer::ragel_url_email(url_email_tokenizer, chars, current, tokens) : false; 0 10 10
12412 }
12413  
12414 10 bool unicode_tokenizer::emergency_sentence_split(const vector<token_range>& tokens) {
12415 using namespace unilib;
12416  
12417 // Implement emergency splitting for large sentences
12418 20 ▶ return tokens.size() >= 500 ||
Branch: 1 branch
BranchTrueFalseTotal
return tokens.size() >= 500 || 0 10 10
12419 20 ▶ (tokens.size() >= 450 && chars[tokens.back().start].cat & unicode::P) ||
Branch: 1 branch
BranchTrueFalseTotal
(tokens.size() >= 450 && chars[tokens.back().start].cat & unicode::P) || 10 0 10
12420 20 ▶ (tokens.size() >= 400 && chars[tokens.back().start].cat & unicode::Po);
Branch: 1 branch
BranchTrueFalseTotal
(tokens.size() >= 400 && chars[tokens.back().start].cat & unicode::Po); 0 0 0
12421 }
12422  
12423 0 bool unicode_tokenizer::is_eos(const vector<token_range>& tokens, char32_t eos_chr, const unordered_set<string>* abbreviations) {
12424 using namespace unilib;
12425  
12426 0 ▶ if (eos_chr == '.' && !tokens.empty()) {
Branch: 3 branches
BranchTrueFalseTotal
if (eos_chr == '.' && !tokens.empty()) { 0 0 0
if (eos_chr == '.' && !tokens.empty()) { 0 0 0
if (eos_chr == '.' && !tokens.empty()) { 0 0 0
12427 // Ignore one-letter capitals before dot
12428 0 ▶ if (tokens.back().length == 1 && chars[tokens.back().start].cat & unicode::Lut)
Branch: 3 branches
BranchTrueFalseTotal
if (tokens.back().length == 1 && chars[tokens.back().start].cat & unicode::Lut) 0 0 0
if (tokens.back().length == 1 && chars[tokens.back().start].cat & unicode::Lut) 0 0 0
if (tokens.back().length == 1 && chars[tokens.back().start].cat & unicode::Lut) 0 0 0
12429 0 return false;
12430  
12431 // Ignore specified abbreviations
12432 0 ▶ if (abbreviations) {
Branch: 1 branch
BranchTrueFalseTotal
if (abbreviations) { 0 0 0
12433 0 eos_buffer.clear();
12434 0 ▶ for (size_t i = 0; i < tokens.back().length; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (size_t i = 0; i < tokens.back().length; i++) 0 0 0
12435 0 utf8::append(eos_buffer, unicode::lowercase(chars[tokens.back().start + i].chr));
12436 0 ▶ if (abbreviations->count(eos_buffer))
Branch: 1 branch
BranchTrueFalseTotal
if (abbreviations->count(eos_buffer)) 0 0 0
12437 0 return false;
12438 }
12439 }
12440 0 return true;
12441 }
12442  
12443 } // namespace morphodita
12444  
12445 /////////
12446 // File: morphodita/tokenizer/vertical_tokenizer.cpp
12447 /////////
12448  
12449 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
12450 //
12451 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
12452 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12453 //
12454 // This Source Code Form is subject to the terms of the Mozilla Public
12455 // License, v. 2.0. If a copy of the MPL was not distributed with this
12456 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12457  
12458 namespace morphodita {
12459  
12460 2 bool vertical_tokenizer::next_sentence(vector<token_range>& tokens) {
12461 2 ▶ if (current >= chars.size() - 1) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (current >= chars.size() - 1) return false; 2 0 2
12462  
12463 while (true) {
12464 28 size_t line_start = current;
12465 118 ▶ while (current < chars.size() - 1 && chars[current].chr != '\r' && chars[current].chr != '\n') current++;
Branch: 4 branches
BranchTrueFalseTotal
while (current < chars.size() - 1 && chars[current].chr != '\r' && chars[current].chr != '\n') current++; 116 2 118
while (current < chars.size() - 1 && chars[current].chr != '\r' && chars[current].chr != '\n') current++; 116 0 116
while (current < chars.size() - 1 && chars[current].chr != '\r' && chars[current].chr != '\n') current++; 90 26 116
while (current < chars.size() - 1 && chars[current].chr != '\r' && chars[current].chr != '\n') current++; 90 28 118
12466  
12467 28 size_t line_end = current;
12468 28 ▶ if (current < chars.size() - 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (current < chars.size() - 1) { 26 2 28
12469 26 current++;
12470 52 ▶ if (current < chars.size() - 1 &&
Branch: 2 branches
BranchTrueFalseTotal
if (current < chars.size() - 1 && 26 0 26
if (current < chars.size() - 1 && 0 26 26
12471 26 ▶ ((chars[current-1].chr == '\r' && chars[current].chr == '\n') ||
Branch: 2 branches
BranchTrueFalseTotal
((chars[current-1].chr == '\r' && chars[current].chr == '\n') || 0 26 26
((chars[current-1].chr == '\r' && chars[current].chr == '\n') || 0 0 0
12472 26 ▶ (chars[current-1].chr == '\n' && chars[current].chr == '\r')))
Branch: 2 branches
BranchTrueFalseTotal
(chars[current-1].chr == '\n' && chars[current].chr == '\r'))) 26 0 26
(chars[current-1].chr == '\n' && chars[current].chr == '\r'))) 0 26 26
12473 0 current++;
12474 }
12475  
12476 28 ▶ if (line_start < line_end)
Branch: 1 branch
BranchTrueFalseTotal
if (line_start < line_end) 26 2 28
12477 26 ▶ tokens.emplace_back(line_start, line_end - line_start);
Branch: 1 branch
BranchTrueFalseTotal
tokens.emplace_back(line_start, line_end - line_start); 26 0 26
12478 else
12479 2 break;
12480 26 }
12481  
12482 2 return true;
12483 }
12484  
12485 } // namespace morphodita
12486  
12487 /////////
12488 // File: unilib/version.h
12489 /////////
12490  
12491 // This file is part of UniLib <http://github.com/ufal/unilib/>.
12492 //
12493 // Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
12494 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12495 //
12496 // This Source Code Form is subject to the terms of the Mozilla Public
12497 // License, v. 2.0. If a copy of the MPL was not distributed with this
12498 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12499 //
12500 // UniLib version: 3.3.1
12501 // Unicode version: 15.0.0
12502  
12503 namespace unilib {
12504  
12505 struct version {
12506 unsigned major;
12507 unsigned minor;
12508 unsigned patch;
12509 std::string prerelease;
12510  
12511 // Returns current version.
12512 static version current();
12513 };
12514  
12515 } // namespace unilib
12516  
12517 /////////
12518 // File: morphodita/version/version.h
12519 /////////
12520  
12521 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
12522 //
12523 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
12524 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12525 //
12526 // This Source Code Form is subject to the terms of the Mozilla Public
12527 // License, v. 2.0. If a copy of the MPL was not distributed with this
12528 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12529  
12530 namespace morphodita {
12531  
12532 class version {
12533 public:
12534 unsigned major;
12535 unsigned minor;
12536 unsigned patch;
12537 string prerelease;
12538  
12539 // Returns current MorphoDiTa version.
12540 static version current();
12541  
12542 // Returns multi-line formated version and copyright string.
12543 static string version_and_copyright(const string& other_libraries = string());
12544 };
12545  
12546 } // namespace morphodita
12547  
12548 /////////
12549 // File: morphodita/version/version.cpp
12550 /////////
12551  
12552 // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
12553 //
12554 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
12555 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12556 //
12557 // This Source Code Form is subject to the terms of the Mozilla Public
12558 // License, v. 2.0. If a copy of the MPL was not distributed with this
12559 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12560  
12561 namespace morphodita {
12562  
12563 0 version version::current() {
12564 0 return {1, 11, 2, ""};
12565 0 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
12566  
12567 // Returns multi-line formated version and copyright string.
12568 0 string version::version_and_copyright(const string& other_libraries) {
12569 0 ▶ ostringstream info;
Branch: 1 branch
BranchTrueFalseTotal
ostringstream info; 0 0 0
12570  
12571 0 ▶ auto morphodita = version::current();
Branch: 1 branch
BranchTrueFalseTotal
auto morphodita = version::current(); 0 0 0
12572 0 ▶ auto unilib = unilib::version::current();
Branch: 1 branch
BranchTrueFalseTotal
auto unilib = unilib::version::current(); 0 0 0
12573  
12574 0 ▶ info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch
Branch: 6 branches
BranchTrueFalseTotal
info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch 0 0 0
info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch 0 0 0
info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch 0 0 0
info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch 0 0 0
info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch 0 0 0
info << "MorphoDiTa version " << morphodita.major << '.' << morphodita.minor << '.' << morphodita.patch 0 0 0
12575 0 << (morphodita.prerelease.empty() ? "" : "-") << morphodita.prerelease
12576 0 ▶ << " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch
Branch: 9 branches
BranchTrueFalseTotal
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
12577 0 << (other_libraries.empty() ? "" : " and ") << other_libraries << ")\n"
12578 "Copyright 2015 by Institute of Formal and Applied Linguistics, Faculty of\n"
12579 0 ▶ "Mathematics and Physics, Charles University in Prague, Czech Republic.";
Branch: 4 branches
BranchTrueFalseTotal
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
12580  
12581 0 ▶ return info.str();
Branch: 1 branch
BranchTrueFalseTotal
return info.str(); 0 0 0
12582 0 }
12583  
12584 } // namespace morphodita
12585  
12586 /////////
12587 // File: bilou/bilou_entity.h
12588 /////////
12589  
12590 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12591 //
12592 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12593 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12594 //
12595 // This Source Code Form is subject to the terms of the Mozilla Public
12596 // License, v. 2.0. If a copy of the MPL was not distributed with this
12597 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12598  
12599 class bilou_entity {
12600 public:
12601 typedef entity_type value;
12602  
12603 enum :value { I, L, O, B_first, U_first, unknown = ~0U };
12604 static constexpr inline value B(entity_type entity) { return entity == entity_type_unknown ? unknown : B_first + 2 * entity; }
12605 static constexpr inline value U(entity_type entity) { return entity == entity_type_unknown ? unknown : U_first + 2 * entity; }
12606 static constexpr inline value total(entity_type entities) { return B_first + 2 * entities; }
12607  
12608 126 static inline bilou_type get_bilou(value bilou_entity) {
12609 126 switch (bilou_entity) {
12610 14 case I: return bilou_type_I;
12611 14 case L: return bilou_type_L;
12612 14 case O: return bilou_type_O;
12613 84 default: return (bilou_entity - B_first) & 1 ? bilou_type_U : bilou_type_B;
12614 }
12615 }
12616 70 static inline entity_type get_entity(value bilou_entity) {
12617 70 ▶ switch (bilou_entity) {
Branch: 1 branch
BranchTrueFalseTotal
switch (bilou_entity) { 42 28 70
12618 42 case I:
12619 case L:
12620 42 case O: return entity_type_unknown;
12621 28 default: return (bilou_entity - B_first) >> 1;
12622 }
12623 }
12624 static inline value from_bilou_entity(bilou_type bilou, entity_type entity) {
12625 switch (bilou) {
12626 case bilou_type_I: return I;
12627 case bilou_type_L: return L;
12628 case bilou_type_O: return O;
12629 case bilou_type_B: return B(entity);
12630 default: return U(entity);
12631 }
12632 }
12633 };
12634  
12635 /////////
12636 // File: ner/ner_ids.h
12637 /////////
12638  
12639 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12640 //
12641 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12642 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12643 //
12644 // This Source Code Form is subject to the terms of the Mozilla Public
12645 // License, v. 2.0. If a copy of the MPL was not distributed with this
12646 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12647  
12648 class ner_ids {
12649 public:
12650 enum ner_id { CZECH_NER = 0, ENGLISH_NER = 1, GENERIC_NER = 2 };
12651  
12652 static bool parse(const string& str, ner_id& id) {
12653 if (str == "czech") return id = CZECH_NER, true;
12654 if (str == "english") return id = ENGLISH_NER, true;
12655 if (str == "generic") return id = GENERIC_NER, true;
12656 return false;
12657 }
12658 };
12659  
12660 typedef ner_ids::ner_id ner_id;
12661  
12662 /////////
12663 // File: ner/bilou_ner.h
12664 /////////
12665  
12666 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12667 //
12668 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12669 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12670 //
12671 // This Source Code Form is subject to the terms of the Mozilla Public
12672 // License, v. 2.0. If a copy of the MPL was not distributed with this
12673 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12674  
12675 class bilou_ner : public ner {
12676 public:
12677 bilou_ner(ner_id id);
12678  
12679 bool load(istream& is);
12680  
12681 virtual void recognize(const vector<string_piece>& forms, vector<named_entity>& entities) const override;
12682 virtual tokenizer* new_tokenizer() const override;
12683  
12684 virtual void entity_types(vector<string>& types) const override;
12685  
12686 virtual void gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const override;
12687 private:
12688 friend class bilou_ner_trainer;
12689  
12690 // Methods used by bylou_ner_trainer
12691 static void fill_bilou_probabilities(const vector<double>& outcomes, bilou_probabilities& prob);
12692 static tokenizer* new_tokenizer(ner_id id);
12693  
12694 // Internal members of bilou_ner
12695 ner_id id;
12696 unique_ptr<ufal::nametag::tagger> tagger;
12697 entity_map named_entities;
12698 feature_templates templates;
12699 vector<network_classifier> networks;
12700  
12701 struct cache {
12702 ner_sentence sentence;
12703 vector<double> outcomes, network_buffer;
12704 string string_buffer;
12705 vector<named_entity> entities_buffer;
12706 };
12707 mutable threadsafe_stack<cache> caches;
12708 };
12709  
12710 /////////
12711 // File: tokenizer/morphodita_tokenizer_wrapper.h
12712 /////////
12713  
12714 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12715 //
12716 // Copyright 2017 Institute of Formal and Applied Linguistics, Faculty of
12717 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12718 //
12719 // This Source Code Form is subject to the terms of the Mozilla Public
12720 // License, v. 2.0. If a copy of the MPL was not distributed with this
12721 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12722  
12723 class morphodita_tokenizer_wrapper : public tokenizer {
12724 public:
12725 4 morphodita_tokenizer_wrapper(morphodita::tokenizer* morphodita_tokenizer)
12726 4 : morphodita_tokenizer(morphodita_tokenizer) {}
12727 8 virtual ~morphodita_tokenizer_wrapper() override {}
12728  
12729 virtual void set_text(string_piece text, bool make_copy = false) override;
12730 virtual bool next_sentence(vector<string_piece>* forms, vector<token_range>* tokens) override;
12731  
12732 private:
12733 unique_ptr<morphodita::tokenizer> morphodita_tokenizer;
12734 };
12735  
12736 /////////
12737 // File: ner/bilou_ner.cpp
12738 /////////
12739  
12740 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12741 //
12742 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12743 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12744 //
12745 // This Source Code Form is subject to the terms of the Mozilla Public
12746 // License, v. 2.0. If a copy of the MPL was not distributed with this
12747 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12748  
12749 1 bilou_ner::bilou_ner(ner_id id) : id(id) {}
12750  
12751 1 bool bilou_ner::load(istream& is) {
12752 1 ▶ if (tagger.reset(tagger::load_instance(is)), !tagger) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (tagger.reset(tagger::load_instance(is)), !tagger) return false; 1 0 1
if (tagger.reset(tagger::load_instance(is)), !tagger) return false; 0 1 1
12753 1 ▶ if (!named_entities.load(is)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!named_entities.load(is)) return false; 1 0 1
if (!named_entities.load(is)) return false; 0 1 1
12754  
12755 1 ▶ unique_ptr<tokenizer> tokenizer(new_tokenizer());
Branch: 1 branch
BranchTrueFalseTotal
unique_ptr<tokenizer> tokenizer(new_tokenizer()); 1 0 1
12756 1 ▶ if (!templates.load(is, nlp_pipeline(tokenizer.get(), tagger.get()))) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!templates.load(is, nlp_pipeline(tokenizer.get(), tagger.get()))) return false; 1 0 1
if (!templates.load(is, nlp_pipeline(tokenizer.get(), tagger.get()))) return false; 0 1 1
12757  
12758 1 ▶ int stages = is.get();
Branch: 1 branch
BranchTrueFalseTotal
int stages = is.get(); 1 0 1
12759 1 ▶ if (stages == EOF) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (stages == EOF) return false; 0 1 1
12760 1 ▶ networks.resize(stages);
Branch: 1 branch
BranchTrueFalseTotal
networks.resize(stages); 1 0 1
12761 3 ▶ for (auto&& network : networks)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& network : networks) 2 1 3
12762 2 ▶ if (!network.load(is)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!network.load(is)) return false; 2 0 2
if (!network.load(is)) return false; 0 2 2
12763  
12764 1 return true;
12765 1 }
12766  
12767 2 void bilou_ner::recognize(const vector<string_piece>& forms, vector<named_entity>& entities) const {
12768 2 entities.clear();
12769 2 ▶ if (forms.empty() || !tagger || !named_entities.size() || !networks.size()) return;
Branch: 5 branches
BranchTrueFalseTotal
if (forms.empty() || !tagger || !named_entities.size() || !networks.size()) return; 2 0 2
if (forms.empty() || !tagger || !named_entities.size() || !networks.size()) return; 2 0 2
if (forms.empty() || !tagger || !named_entities.size() || !networks.size()) return; 2 0 2
if (forms.empty() || !tagger || !named_entities.size() || !networks.size()) return; 0 2 2
if (forms.empty() || !tagger || !named_entities.size() || !networks.size()) return; 0 2 2
12770  
12771 // Acquire cache
12772 2 cache* c = caches.pop();
12773 2 ▶ if (!c) c = new cache();
Branch: 1 branch
BranchTrueFalseTotal
if (!c) c = new cache(); 1 1 2
12774 2 auto& sentence = c->sentence;
12775  
12776 // Tag
12777 2 tagger->tag(forms, sentence);
12778  
12779 2 ▶ if (sentence.size) {
Branch: 1 branch
BranchTrueFalseTotal
if (sentence.size) { 2 0 2
12780 2 sentence.clear_previous_stage();
12781  
12782 // Perform required NER stages
12783 6 ▶ for (auto&& network : networks) {
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& network : networks) { 4 2 6
12784 4 sentence.clear_features();
12785 4 sentence.clear_probabilities_local_filled();
12786  
12787 // Compute per-sentence feature templates
12788 4 ▶ templates.process_sentence(sentence, c->string_buffer);
Branch: 1 branch
BranchTrueFalseTotal
templates.process_sentence(sentence, c->string_buffer); 4 0 4
12789  
12790 // Sequentially classify sentence words
12791 18 ▶ for (unsigned i = 0; i < sentence.size; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) { 14 4 18
12792 14 ▶ if (!sentence.probabilities[i].local_filled) {
Branch: 1 branch
BranchTrueFalseTotal
if (!sentence.probabilities[i].local_filled) { 14 0 14
12793 14 ▶ network.classify(sentence.features[i], c->outcomes, c->network_buffer);
Branch: 1 branch
BranchTrueFalseTotal
network.classify(sentence.features[i], c->outcomes, c->network_buffer); 14 0 14
12794 14 fill_bilou_probabilities(c->outcomes, sentence.probabilities[i].local);
12795 14 sentence.probabilities[i].local_filled = true;
12796 }
12797  
12798 14 ▶ if (i == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (i == 0) { 4 10 14
12799 4 ▶ sentence.probabilities[i].global.init(sentence.probabilities[i].local);
Branch: 1 branch
BranchTrueFalseTotal
sentence.probabilities[i].global.init(sentence.probabilities[i].local); 4 0 4
12800 } else {
12801 10 sentence.probabilities[i].global.update(sentence.probabilities[i].local, sentence.probabilities[i - 1].global);
12802 }
12803 }
12804  
12805 4 sentence.compute_best_decoding();
12806 4 sentence.fill_previous_stage();
12807 }
12808  
12809 // Store entities in the output array
12810 9 ▶ for (unsigned i = 0; i < sentence.size; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < sentence.size; i++) 7 2 9
12811 7 ▶ if (sentence.probabilities[i].global.best == bilou_type_U) {
Branch: 1 branch
BranchTrueFalseTotal
if (sentence.probabilities[i].global.best == bilou_type_U) { 3 4 7
12812 3 ▶ entities.emplace_back(i, 1, named_entities.name(sentence.probabilities[i].global.bilou[bilou_type_U].entity));
Branch: 1 branch
BranchTrueFalseTotal
entities.emplace_back(i, 1, named_entities.name(sentence.probabilities[i].global.bilou[bilou_type_U].entity)); 3 0 3
12813 4 ▶ } else if (sentence.probabilities[i].global.best == bilou_type_B) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (sentence.probabilities[i].global.best == bilou_type_B) { 0 4 4
12814 0 unsigned start = i++;
12815 0 ▶ while (i < sentence.size && sentence.probabilities[i].global.best != bilou_type_L) i++;
Branch: 3 branches
BranchTrueFalseTotal
while (i < sentence.size && sentence.probabilities[i].global.best != bilou_type_L) i++; 0 0 0
while (i < sentence.size && sentence.probabilities[i].global.best != bilou_type_L) i++; 0 0 0
while (i < sentence.size && sentence.probabilities[i].global.best != bilou_type_L) i++; 0 0 0
12816 0 ▶ entities.emplace_back(start, i - start + (i < sentence.size), named_entities.name(sentence.probabilities[start].global.bilou[bilou_type_B].entity));
Branch: 1 branch
BranchTrueFalseTotal
entities.emplace_back(start, i - start + (i < sentence.size), named_entities.name(sentence.probabilities[start].global.bilou[bilou_type_B].entity)); 0 0 0
12817 }
12818  
12819 // Process the entities
12820 2 templates.process_entities(sentence, entities, c->entities_buffer);
12821 }
12822  
12823 2 caches.push(c);
12824 }
12825  
12826 3 tokenizer* bilou_ner::new_tokenizer() const {
12827 3 return new_tokenizer(id);
12828 }
12829  
12830 0 void bilou_ner::entity_types(vector<string>& types) const {
12831 0 types.resize(named_entities.size());
12832 0 ▶ for (unsigned i = 0; i < types.size(); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < types.size(); i++) 0 0 0
12833 0 types[i] = named_entities.name(i);
12834 0 }
12835  
12836 0 void bilou_ner::gazetteers(vector<string>& gazetteers, vector<int>* gazetteer_types) const {
12837 0 gazetteers.clear();
12838 0 ▶ if (gazetteer_types) gazetteer_types->clear();
Branch: 1 branch
BranchTrueFalseTotal
if (gazetteer_types) gazetteer_types->clear(); 0 0 0
12839  
12840 0 templates.gazetteers(gazetteers, gazetteer_types);
12841 0 }
12842  
12843 14 void bilou_ner::fill_bilou_probabilities(const vector<double>& outcomes, bilou_probabilities& prob) {
12844 84 ▶ for (auto&& prob_bilou : prob.bilou)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& prob_bilou : prob.bilou) 70 14 84
12845 70 prob_bilou.probability = -1;
12846  
12847 140 ▶ for (bilou_entity::value i = 0; i < outcomes.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (bilou_entity::value i = 0; i < outcomes.size(); i++) { 126 14 140
12848 126 auto bilou = bilou_entity::get_bilou(i);
12849 126 ▶ if (outcomes[i] > prob.bilou[bilou].probability) {
Branch: 1 branch
BranchTrueFalseTotal
if (outcomes[i] > prob.bilou[bilou].probability) { 70 56 126
12850 70 prob.bilou[bilou].probability = outcomes[i];
12851 70 prob.bilou[bilou].entity = bilou_entity::get_entity(i);
12852 }
12853 }
12854 14 }
12855  
12856 3 tokenizer* bilou_ner::new_tokenizer(ner_id id) {
12857 3 switch (id) {
12858 0 case ner_id::CZECH_NER:
12859 0 ▶ return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_czech_tokenizer());
Branch: 2 branches
BranchTrueFalseTotal
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_czech_tokenizer()); 0 0 0
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_czech_tokenizer()); 0 0 0
12860 0 case ner_id::ENGLISH_NER:
12861 0 ▶ return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_english_tokenizer());
Branch: 2 branches
BranchTrueFalseTotal
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_english_tokenizer()); 0 0 0
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_english_tokenizer()); 0 0 0
12862 3 case ner_id::GENERIC_NER:
12863 3 ▶ return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_generic_tokenizer());
Branch: 2 branches
BranchTrueFalseTotal
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_generic_tokenizer()); 3 0 3
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_generic_tokenizer()); 0 0 0
12864 }
12865  
12866 0 return nullptr;
12867 }
12868  
12869 /////////
12870 // File: ner/entity_map.cpp
12871 /////////
12872  
12873 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12874 //
12875 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12876 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12877 //
12878 // This Source Code Form is subject to the terms of the Mozilla Public
12879 // License, v. 2.0. If a copy of the MPL was not distributed with this
12880 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12881  
12882 0 entity_type entity_map::parse(const char* str, bool add_entity) const {
12883 0 ▶ auto it = str2id.find(str);
Branch: 2 branches
BranchTrueFalseTotal
auto it = str2id.find(str); 0 0 0
auto it = str2id.find(str); 0 0 0
12884 0 ▶ if (it == str2id.end() && add_entity) {
Branch: 3 branches
BranchTrueFalseTotal
if (it == str2id.end() && add_entity) { 0 0 0
if (it == str2id.end() && add_entity) { 0 0 0
if (it == str2id.end() && add_entity) { 0 0 0
12885 0 ▶ it = str2id.emplace(str, (int)id2str.size()).first;
Branch: 1 branch
BranchTrueFalseTotal
it = str2id.emplace(str, (int)id2str.size()).first; 0 0 0
12886 0 ▶ id2str.emplace_back(str);
Branch: 1 branch
BranchTrueFalseTotal
id2str.emplace_back(str); 0 0 0
12887 }
12888 0 ▶ return it == str2id.end() ? entity_type_unknown : it->second;
Branch: 1 branch
BranchTrueFalseTotal
return it == str2id.end() ? entity_type_unknown : it->second; 0 0 0
12889 }
12890  
12891 3 const string& entity_map::name(entity_type entity) const {
12892 3 ▶ return entity < id2str.size() ? id2str[entity] : empty;
Branch: 1 branch
BranchTrueFalseTotal
return entity < id2str.size() ? id2str[entity] : empty; 3 0 3
12893 }
12894  
12895 1 bool entity_map::load(istream& is) {
12896 1 binary_decoder data;
12897 1 ▶ if (!compressor::load(is, data)) return false;
Branch: 2 branches
BranchTrueFalseTotal
if (!compressor::load(is, data)) return false; 1 0 1
if (!compressor::load(is, data)) return false; 0 1 1
12898  
12899 try {
12900 1 str2id.clear();
12901 1 ▶ id2str.resize(data.next_4B());
Branch: 2 branches
BranchTrueFalseTotal
id2str.resize(data.next_4B()); 1 0 1
id2str.resize(data.next_4B()); 1 0 1
12902 4 ▶ for (unsigned i = 0; i < id2str.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < id2str.size(); i++) { 3 1 4
12903 3 ▶ data.next_str(id2str[i]);
Branch: 1 branch
BranchTrueFalseTotal
data.next_str(id2str[i]); 3 0 3
12904 3 ▶ str2id.emplace(id2str[i], i);
Branch: 1 branch
BranchTrueFalseTotal
str2id.emplace(id2str[i], i); 3 0 3
12905 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
12906 } catch (binary_decoder_error&) {
12907 return false;
12908 }
12909  
12910 1 return data.is_end();
12911 1 }
12912  
12913 2 entity_type entity_map::size() const {
12914 2 return id2str.size();
12915 }
12916  
12917 /////////
12918 // File: ner/ner.cpp
12919 /////////
12920  
12921 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12922 //
12923 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12924 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12925 //
12926 // This Source Code Form is subject to the terms of the Mozilla Public
12927 // License, v. 2.0. If a copy of the MPL was not distributed with this
12928 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12929  
12930 1 ner* ner::load(istream& is) {
12931 1 ner_id id = ner_id(is.get());
12932 1 ▶ switch (id) {
Branch: 1 branch
BranchTrueFalseTotal
switch (id) { 1 0 1
12933 1 case ner_ids::CZECH_NER:
12934 case ner_ids::ENGLISH_NER:
12935 case ner_ids::GENERIC_NER:
12936 {
12937 1 ▶ unique_ptr<bilou_ner> res(new bilou_ner(id));
Branch: 1 branch
BranchTrueFalseTotal
unique_ptr<bilou_ner> res(new bilou_ner(id)); 1 0 1
12938 1 ▶ if (res->load(is)) return res.release();
Branch: 2 branches
BranchTrueFalseTotal
if (res->load(is)) return res.release(); 1 0 1
if (res->load(is)) return res.release(); 1 0 1
12939 0 break;
12940 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 0 1
12941 }
12942  
12943 0 return nullptr;
12944 }
12945  
12946 1 ner* ner::load(const char* fname) {
12947 1 ▶ ifstream in(path_from_utf8(fname).c_str(), ifstream::in | ifstream::binary);
Branch: 2 branches
BranchTrueFalseTotal
ifstream in(path_from_utf8(fname).c_str(), ifstream::in | ifstream::binary); 1 0 1
ifstream in(path_from_utf8(fname).c_str(), ifstream::in | ifstream::binary); 1 0 1
12948 1 ▶ if (!in.is_open()) return nullptr;
Branch: 1 branch
BranchTrueFalseTotal
if (!in.is_open()) return nullptr; 0 1 1
12949  
12950 1 ▶ return load(in);
Branch: 1 branch
BranchTrueFalseTotal
return load(in); 1 0 1
12951 1 }
12952  
12953 /////////
12954 // File: tagger/external_tagger.h
12955 /////////
12956  
12957 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12958 //
12959 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12960 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12961 //
12962 // This Source Code Form is subject to the terms of the Mozilla Public
12963 // License, v. 2.0. If a copy of the MPL was not distributed with this
12964 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12965  
12966 class external_tagger : public tagger {
12967 public:
12968 virtual bool load(istream& is) override;
12969 virtual bool create_and_encode(const string& params, ostream& os) override;
12970 virtual void tag(const vector<string_piece>& forms, ner_sentence& sentence) const override;
12971 };
12972  
12973 /////////
12974 // File: tagger/external_tagger.cpp
12975 /////////
12976  
12977 // This file is part of NameTag <http://github.com/ufal/nametag/>.
12978 //
12979 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
12980 // Mathematics and Physics, Charles University in Prague, Czech Republic.
12981 //
12982 // This Source Code Form is subject to the terms of the Mozilla Public
12983 // License, v. 2.0. If a copy of the MPL was not distributed with this
12984 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
12985  
12986 0 inline static size_t strnchrpos(const char* str, char c, size_t len) {
12987 0 size_t pos = 0;
12988 0 ▶ for (; len--; str++, pos++)
Branch: 1 branch
BranchTrueFalseTotal
for (; len--; str++, pos++) 0 0 0
12989 0 ▶ if (*str == c)
Branch: 1 branch
BranchTrueFalseTotal
if (*str == c) 0 0 0
12990 0 return pos;
12991  
12992 0 return pos;
12993 }
12994  
12995 0 bool external_tagger::load(istream& /*is*/) {
12996 0 return true;
12997 }
12998  
12999 0 bool external_tagger::create_and_encode(const string& /*params*/, ostream& /*os*/) {
13000 0 return true;
13001 }
13002  
13003 0 void external_tagger::tag(const vector<string_piece>& forms, ner_sentence& sentence) const {
13004 0 sentence.resize(forms.size());
13005 0 ▶ for (unsigned i = 0; i < forms.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
13006 0 string_piece form = forms[i];
13007  
13008 0 size_t space = strnchrpos(form.str, ' ', form.len);
13009 0 ▶ if (space < form.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (space < form.len) { 0 0 0
13010 0 ▶ sentence.words[i].form.assign(form.str, space);
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].form.assign(form.str, space); 0 0 0
13011 0 form.len -= space + 1;
13012 0 form.str += space + 1;
13013  
13014 0 space = strnchrpos(form.str, ' ', form.len);
13015 0 ▶ if (space < form.len) {
Branch: 1 branch
BranchTrueFalseTotal
if (space < form.len) { 0 0 0
13016 0 ▶ sentence.words[i].raw_lemma.assign(form.str, space);
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].raw_lemma.assign(form.str, space); 0 0 0
13017 0 form.len -= space + 1;
13018 0 form.str += space + 1;
13019  
13020 0 ▶ sentence.words[i].tag.assign(form.str, strnchrpos(form.str, ' ', form.len));
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].tag.assign(form.str, strnchrpos(form.str, ' ', form.len)); 0 0 0
13021 } else {
13022 0 ▶ sentence.words[i].raw_lemma.assign(form.str, form.len);
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].raw_lemma.assign(form.str, form.len); 0 0 0
13023 0 sentence.words[i].tag.clear();
13024 }
13025 } else {
13026 0 ▶ sentence.words[i].form.assign(form.str, form.len);
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].form.assign(form.str, form.len); 0 0 0
13027 0 ▶ sentence.words[i].raw_lemma = sentence.words[i].form;
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].raw_lemma = sentence.words[i].form; 0 0 0
13028 0 sentence.words[i].tag.clear();
13029 }
13030 0 ▶ sentence.words[i].raw_lemmas_all.assign(1, sentence.words[i].raw_lemma);
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].raw_lemmas_all.assign(1, sentence.words[i].raw_lemma); 0 0 0
13031 0 ▶ sentence.words[i].lemma_id = sentence.words[i].raw_lemma;
Branch: 1 branch
BranchTrueFalseTotal
sentence.words[i].lemma_id = sentence.words[i].raw_lemma; 0 0 0
13032 0 sentence.words[i].lemma_comments.clear();
13033 }
13034 0 }
13035  
13036 /////////
13037 // File: tagger/morphodita_tagger.h
13038 /////////
13039  
13040 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13041 //
13042 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
13043 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13044 //
13045 // This Source Code Form is subject to the terms of the Mozilla Public
13046 // License, v. 2.0. If a copy of the MPL was not distributed with this
13047 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13048  
13049 class morphodita_tagger : public tagger {
13050 public:
13051 virtual void tag(const vector<string_piece>& forms, ner_sentence& sentence) const override;
13052  
13053 protected:
13054 virtual bool load(istream& is) override;
13055 virtual bool create_and_encode(const string& params, ostream& os) override;
13056  
13057 private:
13058 unique_ptr<morphodita::tagger> tagger;
13059 const morphodita::morpho* morpho;
13060  
13061 struct cache {
13062 vector<morphodita::tagged_lemma> tags, analyses;
13063 string lemma_cased;
13064 };
13065 mutable threadsafe_stack<cache> caches;
13066 };
13067  
13068 /////////
13069 // File: tagger/morphodita_tagger.cpp
13070 /////////
13071  
13072 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13073 //
13074 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
13075 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13076 //
13077 // This Source Code Form is subject to the terms of the Mozilla Public
13078 // License, v. 2.0. If a copy of the MPL was not distributed with this
13079 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13080  
13081 1 bool morphodita_tagger::load(istream& is) {
13082 1 tagger.reset(morphodita::tagger::load(is));
13083 1 ▶ morpho = tagger ? tagger->get_morpho() : nullptr;
Branch: 1 branch
BranchTrueFalseTotal
morpho = tagger ? tagger->get_morpho() : nullptr; 1 0 1
13084 1 ▶ return tagger && morpho;
Branch: 2 branches
BranchTrueFalseTotal
return tagger && morpho; 1 0 1
return tagger && morpho; 1 0 1
13085 }
13086  
13087 0 bool morphodita_tagger::create_and_encode(const string& params, ostream& os) {
13088 0 ▶ if (params.empty()) return cerr << "Missing tagger_file argument to morphodita_tagger!" << endl, false;
Branch: 3 branches
BranchTrueFalseTotal
if (params.empty()) return cerr << "Missing tagger_file argument to morphodita_tagger!" << endl, false; 0 0 0
if (params.empty()) return cerr << "Missing tagger_file argument to morphodita_tagger!" << endl, false; 0 0 0
if (params.empty()) return cerr << "Missing tagger_file argument to morphodita_tagger!" << endl, false; 0 0 0
13089  
13090 0 ▶ ifstream in(path_from_utf8(params).c_str(), ifstream::in | ifstream::binary);
Branch: 1 branch
BranchTrueFalseTotal
ifstream in(path_from_utf8(params).c_str(), ifstream::in | ifstream::binary); 0 0 0
13091 0 ▶ if (!in.is_open()) return cerr << "Cannot open morphodita tagger file '" << params << "'!" << endl, false;
Branch: 5 branches
BranchTrueFalseTotal
if (!in.is_open()) return cerr << "Cannot open morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.is_open()) return cerr << "Cannot open morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
13092 0 ▶ if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false;
Branch: 6 branches
BranchTrueFalseTotal
if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false; 0 0 0
if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false; 0 0 0
if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false; 0 0 0
if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false; 0 0 0
if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false; 0 0 0
if (!load(in)) return cerr << "Cannot load morphodita tagger from file '" << params << "'!" << endl, false; 0 0 0
13093  
13094 0 ▶ if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false;
Branch: 7 branches
BranchTrueFalseTotal
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
if (!in.seekg(0, ifstream::beg)) return cerr << "Cannot seek in morphodita tagger file '" << params << "'!" << endl, false; 0 0 0
13095 0 ▶ os << in.rdbuf();
Branch: 1 branch
BranchTrueFalseTotal
os << in.rdbuf(); 0 0 0
13096  
13097 0 ▶ return bool(os);
Branch: 1 branch
BranchTrueFalseTotal
return bool(os); 0 0 0
13098 0 }
13099  
13100 2 void morphodita_tagger::tag(const vector<string_piece>& forms, ner_sentence& sentence) const {
13101 2 sentence.resize(0);
13102 2 ▶ if (!tagger || !morpho) return;
Branch: 3 branches
BranchTrueFalseTotal
if (!tagger || !morpho) return; 2 0 2
if (!tagger || !morpho) return; 0 2 2
if (!tagger || !morpho) return; 0 2 2
13103  
13104 // Obtain a cache
13105 2 cache* c = caches.pop();
13106 2 ▶ if (!c) c = new cache();
Branch: 1 branch
BranchTrueFalseTotal
if (!c) c = new cache(); 1 1 2
13107  
13108 // Tag
13109 2 tagger->tag(forms, c->tags);
13110  
13111 // Fill sentence
13112 2 ▶ if (c->tags.size() >= forms.size()) {
Branch: 1 branch
BranchTrueFalseTotal
if (c->tags.size() >= forms.size()) { 2 0 2
13113 2 sentence.resize(forms.size());
13114 9 ▶ for (unsigned i = 0; i < forms.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) { 7 2 9
13115 7 sentence.words[i].form.assign(forms[i].str, morpho->raw_form_len(forms[i]));
13116  
13117 7 const string& lemma = c->tags[i].lemma;
13118  
13119 7 ▶ unsigned raw_lemma_len = morpho->raw_lemma_len(lemma);
Branch: 1 branch
BranchTrueFalseTotal
unsigned raw_lemma_len = morpho->raw_lemma_len(lemma); 7 0 7
13120 7 sentence.words[i].raw_lemma.assign(lemma, 0, raw_lemma_len);
13121  
13122 7 morpho->analyze(forms[i], morphodita::morpho::GUESSER, c->analyses);
13123 7 sentence.words[i].raw_lemmas_all.clear();
13124 18 ▶ for (auto&& analysis : c->analyses)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& analysis : c->analyses) 11 7 18
13125 11 ▶ sentence.words[i].raw_lemmas_all.emplace_back(analysis.lemma, 0, morpho->raw_lemma_len(analysis.lemma));
Branch: 2 branches
BranchTrueFalseTotal
sentence.words[i].raw_lemmas_all.emplace_back(analysis.lemma, 0, morpho->raw_lemma_len(analysis.lemma)); 11 0 11
sentence.words[i].raw_lemmas_all.emplace_back(analysis.lemma, 0, morpho->raw_lemma_len(analysis.lemma)); 11 0 11
13126 7 sort(sentence.words[i].raw_lemmas_all.begin(), sentence.words[i].raw_lemmas_all.end());
13127 14 ▶ sentence.words[i].raw_lemmas_all.erase(unique(sentence.words[i].raw_lemmas_all.begin(), sentence.words[i].raw_lemmas_all.end()),
Branch: 2 branches
BranchTrueFalseTotal
sentence.words[i].raw_lemmas_all.erase(unique(sentence.words[i].raw_lemmas_all.begin(), sentence.words[i].raw_lemmas_all.end()), 7 0 7
sentence.words[i].raw_lemmas_all.erase(unique(sentence.words[i].raw_lemmas_all.begin(), sentence.words[i].raw_lemmas_all.end()), 7 0 7
13128 7 sentence.words[i].raw_lemmas_all.end());
13129  
13130 7 ▶ unsigned lemma_id_len = morpho->lemma_id_len(lemma);
Branch: 1 branch
BranchTrueFalseTotal
unsigned lemma_id_len = morpho->lemma_id_len(lemma); 7 0 7
13131 7 sentence.words[i].lemma_id.assign(sentence.words[i].raw_lemma).append(lemma, raw_lemma_len, lemma_id_len - raw_lemma_len);
13132 7 sentence.words[i].lemma_comments.assign(lemma, lemma_id_len, string::npos);
13133 7 sentence.words[i].tag = c->tags[i].tag;
13134 }
13135 }
13136  
13137 2 caches.push(c);
13138 }
13139  
13140 /////////
13141 // File: tagger/trivial_tagger.h
13142 /////////
13143  
13144 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13145 //
13146 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
13147 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13148 //
13149 // This Source Code Form is subject to the terms of the Mozilla Public
13150 // License, v. 2.0. If a copy of the MPL was not distributed with this
13151 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13152  
13153 class trivial_tagger : public tagger {
13154 public:
13155 virtual bool load(istream& is) override;
13156 virtual bool create_and_encode(const string& params, ostream& os) override;
13157 virtual void tag(const vector<string_piece>& forms, ner_sentence& sentence) const override;
13158 };
13159  
13160 /////////
13161 // File: tagger/tagger.cpp
13162 /////////
13163  
13164 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13165 //
13166 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
13167 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13168 //
13169 // This Source Code Form is subject to the terms of the Mozilla Public
13170 // License, v. 2.0. If a copy of the MPL was not distributed with this
13171 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13172  
13173 1 tagger* tagger::load_instance(istream& is) {
13174 1 ▶ unique_ptr<tagger> res(create(tagger_id(is.get())));
Branch: 2 branches
BranchTrueFalseTotal
unique_ptr<tagger> res(create(tagger_id(is.get()))); 1 0 1
unique_ptr<tagger> res(create(tagger_id(is.get()))); 1 0 1
13175  
13176 1 ▶ if (!res) return nullptr;
Branch: 1 branch
BranchTrueFalseTotal
if (!res) return nullptr; 0 1 1
13177 1 ▶ if (!res->load(is)) return nullptr;
Branch: 2 branches
BranchTrueFalseTotal
if (!res->load(is)) return nullptr; 1 0 1
if (!res->load(is)) return nullptr; 0 1 1
13178  
13179 1 return res.release();
13180 1 }
13181  
13182 0 tagger* tagger::create_and_encode_instance(const string& tagger_id_and_params, ostream& os) {
13183 0 string tagger_id, params;
13184  
13185 // Split the id and params using optional :
13186 0 auto colon = tagger_id_and_params.find(':');
13187 0 ▶ if (colon == string::npos) {
Branch: 1 branch
BranchTrueFalseTotal
if (colon == string::npos) { 0 0 0
13188 0 ▶ tagger_id = tagger_id_and_params;
Branch: 1 branch
BranchTrueFalseTotal
tagger_id = tagger_id_and_params; 0 0 0
13189 } else {
13190 0 ▶ tagger_id = tagger_id_and_params.substr(0, colon);
Branch: 1 branch
BranchTrueFalseTotal
tagger_id = tagger_id_and_params.substr(0, colon); 0 0 0
13191 0 ▶ params = tagger_id_and_params.substr(colon + 1);
Branch: 1 branch
BranchTrueFalseTotal
params = tagger_id_and_params.substr(colon + 1); 0 0 0
13192 }
13193  
13194 // Parse tagger_id
13195 tagger_ids::tagger_id id;
13196 0 ▶ if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr;
Branch: 6 branches
BranchTrueFalseTotal
if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!tagger_ids::parse(tagger_id, id)) return cerr << "Unknown tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
13197  
13198 // Create instance
13199 0 ▶ unique_ptr<tagger> res(create(id));
Branch: 1 branch
BranchTrueFalseTotal
unique_ptr<tagger> res(create(id)); 0 0 0
13200 0 ▶ if (!res) return cerr << "Cannot create instance for tagger_id '" << tagger_id << "'!" << endl, nullptr;
Branch: 5 branches
BranchTrueFalseTotal
if (!res) return cerr << "Cannot create instance for tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res) return cerr << "Cannot create instance for tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res) return cerr << "Cannot create instance for tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res) return cerr << "Cannot create instance for tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res) return cerr << "Cannot create instance for tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
13201  
13202 // Load and encode the tagger
13203 0 ▶ os.put(id);
Branch: 1 branch
BranchTrueFalseTotal
os.put(id); 0 0 0
13204 0 ▶ if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr;
Branch: 6 branches
BranchTrueFalseTotal
if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
if (!res->create_and_encode(params, os)) return cerr << "Cannot encode instance of tagger_id '" << tagger_id << "'!" << endl, nullptr; 0 0 0
13205  
13206 0 return res.release();
13207 0 }
13208  
13209 1 tagger* tagger::create(tagger_id id) {
13210 1 switch (id) {
13211 0 case tagger_ids::TRIVIAL:
13212 0 return new trivial_tagger();
13213 0 case tagger_ids::EXTERNAL:
13214 0 return new external_tagger();
13215 1 case tagger_ids::MORPHODITA:
13216 1 return new morphodita_tagger();
13217 }
13218  
13219 0 return nullptr;
13220 }
13221  
13222 /////////
13223 // File: tagger/trivial_tagger.cpp
13224 /////////
13225  
13226 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13227 //
13228 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
13229 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13230 //
13231 // This Source Code Form is subject to the terms of the Mozilla Public
13232 // License, v. 2.0. If a copy of the MPL was not distributed with this
13233 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13234  
13235 0 bool trivial_tagger::load(istream& /*is*/) {
13236 0 return true;
13237 }
13238  
13239 0 bool trivial_tagger::create_and_encode(const string& /*params*/, ostream& /*os*/) {
13240 0 return true;
13241 }
13242  
13243 0 void trivial_tagger::tag(const vector<string_piece>& forms, ner_sentence& sentence) const {
13244 0 sentence.resize(forms.size());
13245 0 ▶ for (unsigned i = 0; i < forms.size(); i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (unsigned i = 0; i < forms.size(); i++) { 0 0 0
13246 0 sentence.words[i].form.assign(forms[i].str, forms[i].len);
13247 0 sentence.words[i].raw_lemma = sentence.words[i].form;
13248 0 sentence.words[i].raw_lemmas_all.assign(1, sentence.words[i].raw_lemma);
13249 0 sentence.words[i].lemma_id = sentence.words[i].form;
13250 0 sentence.words[i].lemma_comments.clear();
13251 0 sentence.words[i].tag.clear();
13252 }
13253 0 }
13254  
13255 /////////
13256 // File: tokenizer/morphodita_tokenizer_wrapper.cpp
13257 /////////
13258  
13259 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13260 //
13261 // Copyright 2017 Institute of Formal and Applied Linguistics, Faculty of
13262 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13263 //
13264 // This Source Code Form is subject to the terms of the Mozilla Public
13265 // License, v. 2.0. If a copy of the MPL was not distributed with this
13266 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13267  
13268 3 void morphodita_tokenizer_wrapper::set_text(string_piece text, bool make_copy) {
13269 3 morphodita_tokenizer->set_text(text, make_copy);
13270 3 }
13271  
13272 7 bool morphodita_tokenizer_wrapper::next_sentence(vector<string_piece>* forms, vector<token_range>* tokens) {
13273 7 return morphodita_tokenizer->next_sentence(forms, (vector<morphodita::token_range>*) tokens);
13274 }
13275  
13276 /////////
13277 // File: tokenizer/tokenizer.cpp
13278 /////////
13279  
13280 // This file is part of NameTag <http://github.com/ufal/nametag/>.
13281 //
13282 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
13283 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13284 //
13285 // This Source Code Form is subject to the terms of the Mozilla Public
13286 // License, v. 2.0. If a copy of the MPL was not distributed with this
13287 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13288  
13289 1 tokenizer* tokenizer::new_vertical_tokenizer() {
13290 1 ▶ return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_vertical_tokenizer());
Branch: 2 branches
BranchTrueFalseTotal
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_vertical_tokenizer()); 1 0 1
return new morphodita_tokenizer_wrapper(morphodita::tokenizer::new_vertical_tokenizer()); 0 0 0
13291 }
13292  
13293 /////////
13294 // File: unilib/unicode.cpp
13295 /////////
13296  
13297 // This file is part of UniLib <http://github.com/ufal/unilib/>.
13298 //
13299 // Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
13300 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13301 //
13302 // This Source Code Form is subject to the terms of the Mozilla Public
13303 // License, v. 2.0. If a copy of the MPL was not distributed with this
13304 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13305 //
13306 // UniLib version: 3.3.1
13307 // Unicode version: 15.0.0
13308  
13309 namespace unilib {
13310  
13311 const char32_t unicode::CHARS;
13312  
13313 const int32_t unicode::DEFAULT_CAT;
13314  
13315 const uint8_t unicode::category_index[unicode::CHARS >> 8] = {
13316 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,17,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,33,41,42,43,44,45,46,47,48,39,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,49,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,50,17,17,17,51,17,52,53,54,55,56,57,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,58,59,59,59,59,59,59,59,59,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,17,61,62,17,63,64,65,66,67,68,69,70,71,17,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,17,17,17,97,98,99,100,100,100,100,100,100,100,100,100,101,17,17,17,17,102,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,17,17,103,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,17,17,104,105,100,100,106,107,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,108,17,17,17,17,109,110,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,111,17,112,113,100,100,100,100,100,100,100,100,100,114,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,115,116,117,118,119,120,121,122,123,39,39,124,100,100,100,100,125,126,127,128,100,129,100,100,130,131,132,100,100,133,134,135,100,136,137,138,139,39,39,140,141,142,39,143,144,100,100,100,100,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
13317 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,145,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,146,147,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,148,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,149,100,100,100,100,100,100,100,100,100,100,100,100,17,17,150,100,100,100,100,100,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,151,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,152,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
13318 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
13319 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
13320 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
13321 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
13322 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,153,154,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
13323 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,155,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,
13324 60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,155
13325 };
13326  
13327 const uint8_t unicode::category_block[][256] = {
13328 {_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Cc,_Zs,_Po,_Po,_Po,_Sc,_Po,_Po,_Po,_Ps,_Pe,_Po,_Sm,_Po,_Pd,_Po,_Po,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Po,_Po,_Sm,_Sm,_Sm,_Po,_Po,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Lu,_Ps,_Po,_Pe,_Sk,_Pc,_Sk,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Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm},
13362 {_So,_So,_So,_So,_So,_So,_So,_So,_Ps,_Pe,_Ps,_Pe,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_Sm,_So,_So,_So,_So,_So,_So,_So,_Ps,_Pe,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So},
13363 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No},
13364 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm},
13365 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So},
13366 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sm,_Sm,_Sm,_Sm,_Sm,_Ps,_Pe,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm,_Sm},
13367 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,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_Po,_Po,_Po,_Po,_So,_So,_Po,_Po,_Po,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Ps,_Pe,_Pd,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13373 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,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,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_No,_No,_No,_No,_No,_No,_No,_No,_So,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So},
13377 {_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_L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So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13444 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13445 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Mc,_Mc,_Mn,_Mn,_Mn,_So,_So,_So,_Mc,_Mc,_Mc,_Mc,_Mc,_Mc,_Cf,_Cf,_Cf,_Cf,_Cf,_Cf,_Cf,_Cf,_Mn,_Mn,_Mn,_Mn,_Mn,_Mn,_Mn,_Mn,_So,_So,_Mn,_Mn,_Mn,_Mn,_Mn,_Mn,_Mn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Mn,_Mn,_Mn,_Mn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_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_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13464 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13465 {_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_No,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So},
13466 {_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_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,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Sk,_Sk,_Sk,_Sk,_Sk},
13468 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn},
13469 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_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cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13471 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13472 {_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_So,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Nd,_Cn,_Cn,_Cn,_Cn,_Cn,_Cn},
13473 {_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo,_Lo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
13494 const char32_t unicode::othercase_block[][256] = {
13495 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24833,25089,25345,25601,25857,26113,26369,26625,26881,27137,27393,27649,27905,28161,28417,28673,28929,29185,29441,29697,29953,30209,30465,30721,30977,31233,0,0,0,0,0,0,16642,16898,17154,17410,17666,17922,18178,18434,18690,18946,19202,19458,19714,19970,20226,20482,20738,20994,21250,21506,21762,22018,22274,22530,22786,23042,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236546,0,0,0,0,0,0,0,0,0,0,57345,57601,57857,58113,58369,58625,58881,59137,59393,59649,59905,60161,60417,60673,60929,61185,61441,61697,61953,62209,62465,62721,62977,0,63489,63745,64001,64257,64513,64769,65025,0,49154,49410,49666,49922,50178,50434,50690,50946,51202,51458,51714,51970,52226,52482,52738,52994,53250,53506,53762,54018,54274,54530,54786,0,55298,55554,55810,56066,56322,56578,56834,96258},
13496 {65793,65538,66305,66050,66817,66562,67329,67074,67841,67586,68353,68098,68865,68610,69377,69122,69889,69634,70401,70146,70913,70658,71425,71170,71937,71682,72449,72194,72961,72706,73473,73218,73985,73730,74497,74242,75009,74754,75521,75266,76033,75778,76545,76290,77057,76802,77569,77314,26881,18690,78593,78338,79105,78850,79617,79362,0,80385,80130,80897,80642,81409,81154,81921,81666,82433,82178,82945,82690,83457,83202,83969,83714,0,84737,84482,85249,84994,85761,85506,86273,86018,86785,86530,87297,87042,87809,87554,88321,88066,88833,88578,89345,89090,89857,89602,90369,90114,90881,90626,91393,91138,91905,91650,92417,92162,92929,92674,93441,93186,93953,93698,94465,94210,94977,94722,95489,95234,96001,95746,65281,96769,96514,97281,97026,97793,97538,21250,148226,152321,99073,98818,99585,99330,152577,100353,100098,153089,153345,101377,101122,0,122113,153857,154369,102913,102658,155649,156417,128514,157953,157697,104705,104450,146690,0,159489,160257,139266,161025,106753,106498,107265,107010,107777,107522,163841,108545,108290,164609,0,0,109825,109570,165889,110593,110338,166401,166657,111617,111362,112129,111874,168449,112897,112642,0,0,113921,113666,0,128770,0,0,0,0,115974,116228,115717,116742,116996,116485,117510,117764,117253,118273,118018,118785,118530,119297,119042,119809,119554,120321,120066,120833,120578,121345,121090,121857,121602,101890,122625,122370,123137,122882,123649,123394,124161,123906,124673,124418,125185,124930,125697,125442,126209,125954,126721,126466,0,127494,127748,127237,128257,128002,103681,114433,129281,129026,129793,129538,130305,130050,130817,130562},
13497 {131329,131074,131841,131586,132353,132098,132865,132610,133377,133122,133889,133634,134401,134146,134913,134658,135425,135170,135937,135682,136449,136194,136961,136706,137473,137218,137985,137730,138497,138242,139009,138754,105985,0,140033,139778,140545,140290,141057,140802,141569,141314,142081,141826,142593,142338,143105,142850,143617,143362,144129,143874,0,0,0,0,0,0,2909441,146433,146178,104961,2909697,2915842,2916098,147969,147714,98305,166145,166913,149249,148994,149761,149506,150273,150018,150785,150530,151297,151042,2912002,2911490,2912258,98562,99842,0,100610,100866,0,102146,0,102402,10988290,0,0,0,103170,10988546,0,103426,0,10980610,10988034,0,104194,103938,10989058,2908674,10988802,0,0,105474,0,2911746,105730,0,0,106242,0,0,0,0,0,0,0,2909186,0,0,108034,0,10994946,108802,0,0,0,10989826,110082,148482,110850,111106,148738,0,0,0,0,0,112386,0,0,0,0,0,0,0,0,0,0,10990082,10989570,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13498 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,235778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225537,225282,226049,225794,0,0,227073,226818,0,0,0,261378,261634,261890,0,258817,0,0,0,0,0,0,240641,0,240897,241153,241409,0,248833,0,249089,249345,0,241921,242177,242433,242689,242945,243201,243457,243713,243969,244225,244481,244737,244993,245249,245505,245761,246017,0,246529,246785,247041,247297,247553,247809,248065,248321,248577,230914,231426,231682,231938,0,233730,233986,234242,234498,234754,235010,235266,235522,235778,236034,236290,236546,236802,237058,237314,237570,237826,238338,238338,238594,238850,239106,239362,239618,239874,240130,240386,232450,232962,233218,251649,233986,235522,0,0,0,239106,237570,249602,252161,251906,252673,252418,253185,252930,253697,253442,254209,253954,254721,254466,255233,254978,255745,255490,256257,256002,256769,256514,257281,257026,257793,257538,236034,237826,260354,229122,243713,234754,0,260097,259842,258561,260865,260610,0,228097,228353,228609},
13499 {282625,282881,283137,283393,283649,283905,284161,284417,284673,284929,285185,285441,285697,285953,286209,286465,274433,274689,274945,275201,275457,275713,275969,276225,276481,276737,276993,277249,277505,277761,278017,278273,278529,278785,279041,279297,279553,279809,280065,280321,280577,280833,281089,281345,281601,281857,282113,282369,266242,266498,266754,267010,267266,267522,267778,268034,268290,268546,268802,269058,269314,269570,269826,270082,270338,270594,270850,271106,271362,271618,271874,272130,272386,272642,272898,273154,273410,273666,273922,274178,262146,262402,262658,262914,263170,263426,263682,263938,264194,264450,264706,264962,265218,265474,265730,265986,286977,286722,287489,287234,288001,287746,288513,288258,289025,288770,289537,289282,290049,289794,290561,290306,291073,290818,291585,291330,292097,291842,292609,292354,293121,292866,293633,293378,294145,293890,294657,294402,295169,294914,0,0,0,0,0,0,0,0,297729,297474,298241,297986,298753,298498,299265,299010,299777,299522,300289,300034,300801,300546,301313,301058,301825,301570,302337,302082,302849,302594,303361,303106,303873,303618,304385,304130,304897,304642,305409,305154,305921,305666,306433,306178,306945,306690,307457,307202,307969,307714,308481,308226,308993,308738,309505,309250,310017,309762,310529,310274,311041,310786,315137,311809,311554,312321,312066,312833,312578,313345,313090,313857,313602,314369,314114,314881,314626,311298,315649,315394,316161,315906,316673,316418,317185,316930,317697,317442,318209,317954,318721,318466,319233,318978,319745,319490,320257,320002,320769,320514,321281,321026,321793,321538,322305,322050,322817,322562,323329,323074,323841,323586,324353,324098,324865,324610,325377,325122,325889,325634,326401,326146,326913,326658,327425,327170},
13500 {327937,327682,328449,328194,328961,328706,329473,329218,329985,329730,330497,330242,331009,330754,331521,331266,332033,331778,332545,332290,333057,332802,333569,333314,334081,333826,334593,334338,335105,334850,335617,335362,336129,335874,336641,336386,337153,336898,337665,337410,338177,337922,338689,338434,339201,338946,339713,339458,0,352513,352769,353025,353281,353537,353793,354049,354305,354561,354817,355073,355329,355585,355841,356097,356353,356609,356865,357121,357377,357633,357889,358145,358401,358657,358913,359169,359425,359681,359937,360193,360449,360705,360961,361217,361473,361729,361985,0,0,0,0,0,0,0,0,0,0,340226,340482,340738,340994,341250,341506,341762,342018,342274,342530,342786,343042,343298,343554,343810,344066,344322,344578,344834,345090,345346,345602,345858,346114,346370,346626,346882,347138,347394,347650,347906,348162,348418,348674,348930,349186,349442,349698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13501 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13502 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2949121,2949377,2949633,2949889,2950145,2950401,2950657,2950913,2951169,2951425,2951681,2951937,2952193,2952449,2952705,2952961,2953217,2953473,2953729,2953985,2954241,2954497,2954753,2955009,2955265,2955521,2955777,2956033,2956289,2956545,2956801,2957057,2957313,2957569,2957825,2958081,2958337,2958593,0,2959105,0,0,0,0,0,2960641,0,0,1871875,1872131,1872387,1872643,1872899,1873155,1873411,1873667,1873923,1874179,1874435,1874691,1874947,1875203,1875459,1875715,1875971,1876227,1876483,1876739,1876995,1877251,1877507,1877763,1878019,1878275,1878531,1878787,1879043,1879299,1879555,1879811,1880067,1880323,1880579,1880835,1881091,1881347,1881603,1881859,1882115,1882371,1882627,0,0,1883395,1883651,1883907},
13503 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11235329,11235585,11235841,11236097,11236353,11236609,11236865,11237121,11237377,11237633,11237889,11238145,11238401,11238657,11238913,11239169,11239425,11239681,11239937,11240193,11240449,11240705,11240961,11241217,11241473,11241729,11241985,11242241,11242497,11242753,11243009,11243265,11243521,11243777,11244033,11244289,11244545,11244801,11245057,11245313,11245569,11245825,11246081,11246337,11246593,11246849,11247105,11247361,11247617,11247873,11248129,11248385,11248641,11248897,11249153,11249409,11249665,11249921,11250177,11250433,11250689,11250945,11251201,11251457,11251713,11251969,11252225,11252481,11252737,11252993,11253249,11253505,11253761,11254017,11254273,11254529,11254785,11255041,11255297,11255553,1308673,1308929,1309185,1309441,1309697,1309953,0,0,1306626,1306882,1307138,1307394,1307650,1307906,0,0},
13504 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,266754,267266,269826,270594,270850,270850,272898,287234,10897922,0,0,0,0,0,0,0,1101825,1102081,1102337,1102593,1102849,1103105,1103361,1103617,1103873,1104129,1104385,1104641,1104897,1105153,1105409,1105665,1105921,1106177,1106433,1106689,1106945,1107201,1107457,1107713,1107969,1108225,1108481,1108737,1108993,1109249,1109505,1109761,1110017,1110273,1110529,1110785,1111041,1111297,1111553,1111809,1112065,1112321,1112577,0,0,1113345,1113601,1113857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13505 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10976514,0,0,0,2908930,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10995202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13506 {1966337,1966082,1966849,1966594,1967361,1967106,1967873,1967618,1968385,1968130,1968897,1968642,1969409,1969154,1969921,1969666,1970433,1970178,1970945,1970690,1971457,1971202,1971969,1971714,1972481,1972226,1972993,1972738,1973505,1973250,1974017,1973762,1974529,1974274,1975041,1974786,1975553,1975298,1976065,1975810,1976577,1976322,1977089,1976834,1977601,1977346,1978113,1977858,1978625,1978370,1979137,1978882,1979649,1979394,1980161,1979906,1980673,1980418,1981185,1980930,1981697,1981442,1982209,1981954,1982721,1982466,1983233,1982978,1983745,1983490,1984257,1984002,1984769,1984514,1985281,1985026,1985793,1985538,1986305,1986050,1986817,1986562,1987329,1987074,1987841,1987586,1988353,1988098,1988865,1988610,1989377,1989122,1989889,1989634,1990401,1990146,1990913,1990658,1991425,1991170,1991937,1991682,1992449,1992194,1992961,1992706,1993473,1993218,1993985,1993730,1994497,1994242,1995009,1994754,1995521,1995266,1996033,1995778,1996545,1996290,1997057,1996802,1997569,1997314,1998081,1997826,1998593,1998338,1999105,1998850,1999617,1999362,2000129,1999874,2000641,2000386,2001153,2000898,2001665,2001410,2002177,2001922,2002689,2002434,2003201,2002946,2003713,2003458,2004225,2003970,0,0,0,0,0,1990658,0,0,57089,0,2007297,2007042,2007809,2007554,2008321,2008066,2008833,2008578,2009345,2009090,2009857,2009602,2010369,2010114,2010881,2010626,2011393,2011138,2011905,2011650,2012417,2012162,2012929,2012674,2013441,2013186,2013953,2013698,2014465,2014210,2014977,2014722,2015489,2015234,2016001,2015746,2016513,2016258,2017025,2016770,2017537,2017282,2018049,2017794,2018561,2018306,2019073,2018818,2019585,2019330,2020097,2019842,2020609,2020354,2021121,2020866,2021633,2021378,2022145,2021890,2022657,2022402,2023169,2022914,2023681,2023426,2024193,2023938,2024705,2024450,2025217,2024962,2025729,2025474,2026241,2025986,2026753,2026498,2027265,2027010,2027777,2027522,2028289,2028034,2028801,2028546,2029313,2029058,2029825,2029570,2030337,2030082,2030849,2030594,2031361,
13507 2031106},
13508 {2033666,2033922,2034178,2034434,2034690,2034946,2035202,2035458,2031617,2031873,2032129,2032385,2032641,2032897,2033153,2033409,2037762,2038018,2038274,2038530,2038786,2039042,0,0,2035713,2035969,2036225,2036481,2036737,2036993,0,0,2041858,2042114,2042370,2042626,2042882,2043138,2043394,2043650,2039809,2040065,2040321,2040577,2040833,2041089,2041345,2041601,2045954,2046210,2046466,2046722,2046978,2047234,2047490,2047746,2043905,2044161,2044417,2044673,2044929,2045185,2045441,2045697,2050050,2050306,2050562,2050818,2051074,2051330,0,0,2048001,2048257,2048513,2048769,2049025,2049281,0,0,0,2054402,0,2054914,0,2055426,0,2055938,0,2052353,0,2052865,0,2053377,0,2053889,2058242,2058498,2058754,2059010,2059266,2059522,2059778,2060034,2056193,2056449,2056705,2056961,2057217,2057473,2057729,2057985,2079234,2079490,2082818,2083074,2083330,2083586,2087426,2087682,2095106,2095362,2091522,2091778,2095618,2095874,0,0,2066434,2066690,2066946,2067202,2067458,2067714,2067970,2068226,2064385,2064641,2064897,2065153,2065409,2065665,2065921,2066177,2070530,2070786,2071042,2071298,2071554,2071810,2072066,2072322,2068481,2068737,2068993,2069249,2069505,2069761,2070017,2070273,2074626,2074882,2075138,2075394,2075650,2075906,2076162,2076418,2072577,2072833,2073089,2073345,2073601,2073857,2074113,2074369,2078722,2078978,0,2079746,0,0,0,0,2076673,2076929,2060289,2060545,2077441,0,235778,0,0,0,0,2083842,0,0,0,0,2060801,2061057,2061313,2061569,2081537,0,0,0,2086914,2087170,0,0,0,0,0,0,2084865,2085121,2061825,2062081,0,0,0,0,2091010,2091266,0,0,0,2092034,0,0,2088961,2089217,2062849,2063105,2090241,0,0,0,0,0,0,2096130,0,0,0,0,2062337,2062593,2063361,2063617,2093825,0,0,0},
13509 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248065,0,0,0,27393,58625,0,0,0,0,0,0,2182657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2175490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2191361,2191617,2191873,2192129,2192385,2192641,2192897,2193153,2193409,2193665,2193921,2194177,2194433,2194689,2194945,2195201,2187266,2187522,2187778,2188034,2188290,2188546,2188802,2189058,2189314,2189570,2189826,2190082,2190338,2190594,2190850,2191106,0,0,0,2196481,2196226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13510 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2412545,2412801,2413057,2413313,2413569,2413825,2414081,2414337,2414593,2414849,2415105,2415361,2415617,2415873,2416129,2416385,2416641,2416897,2417153,2417409,2417665,2417921,2418177,2418433,2418689,2418945,2405890,2406146,2406402,2406658,2406914,2407170,2407426,2407682,2407938,2408194,2408450,2408706,2408962,2409218,2409474,2409730,2409986,2410242,2410498,2410754,2411010,2411266,2411522,2411778,2412034,2412290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13511 {2895873,2896129,2896385,2896641,2896897,2897153,2897409,2897665,2897921,2898177,2898433,2898689,2898945,2899201,2899457,2899713,2899969,2900225,2900481,2900737,2900993,2901249,2901505,2901761,2902017,2902273,2902529,2902785,2903041,2903297,2903553,2903809,2904065,2904321,2904577,2904833,2905089,2905345,2905601,2905857,2906113,2906369,2906625,2906881,2907137,2907393,2907649,2907905,2883586,2883842,2884098,2884354,2884610,2884866,2885122,2885378,2885634,2885890,2886146,2886402,2886658,2886914,2887170,2887426,2887682,2887938,2888194,2888450,2888706,2888962,2889218,2889474,2889730,2889986,2890242,2890498,2890754,2891010,2891266,2891522,2891778,2892034,2892290,2892546,2892802,2893058,2893314,2893570,2893826,2894082,2894338,2894594,2894850,2895106,2895362,2895618,2908417,2908162,158465,1932545,163073,145922,146946,2910209,2909954,2910721,2910466,2911233,2910978,151809,160001,151553,152065,0,2913025,2912770,0,2913793,2913538,0,0,0,0,0,0,0,147201,147457,2916609,2916354,2917121,2916866,2917633,2917378,2918145,2917890,2918657,2918402,2919169,2918914,2919681,2919426,2920193,2919938,2920705,2920450,2921217,2920962,2921729,2921474,2922241,2921986,2922753,2922498,2923265,2923010,2923777,2923522,2924289,2924034,2924801,2924546,2925313,2925058,2925825,2925570,2926337,2926082,2926849,2926594,2927361,2927106,2927873,2927618,2928385,2928130,2928897,2928642,2929409,2929154,2929921,2929666,2930433,2930178,2930945,2930690,2931457,2931202,2931969,2931714,2932481,2932226,2932993,2932738,2933505,2933250,2934017,2933762,2934529,2934274,2935041,2934786,2935553,2935298,2936065,2935810,2936577,2936322,2937089,2936834,2937601,2937346,2938113,2937858,2938625,2938370,2939137,2938882,2939649,2939394,2940161,2939906,2940673,2940418,2941185,2940930,2941697,2941442,0,0,0,0,0,0,0,2944001,2943746,2944513,2944258,0,0,0,2945793,2945538,0,0,0,0,0,0,0,0,0,0,0,0},
13512 {1089538,1089794,1090050,1090306,1090562,1090818,1091074,1091330,1091586,1091842,1092098,1092354,1092610,1092866,1093122,1093378,1093634,1093890,1094146,1094402,1094658,1094914,1095170,1095426,1095682,1095938,1096194,1096450,1096706,1096962,1097218,1097474,1097730,1097986,1098242,1098498,1098754,1099010,0,1099522,0,0,0,0,0,1101058,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13513 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10895617,10895362,10896129,10895874,10896641,10896386,10897153,10896898,10897665,10897410,10898177,10897922,10898689,10898434,10899201,10898946,10899713,10899458,10900225,10899970,10900737,10900482,10901249,10900994,10901761,10901506,10902273,10902018,10902785,10902530,10903297,10903042,10903809,10903554,10904321,10904066,10904833,10904578,10905345,10905090,10905857,10905602,10906369,10906114,10906881,10906626,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10912001,10911746,10912513,10912258,10913025,10912770,10913537,10913282,10914049,10913794,10914561,10914306,10915073,10914818,10915585,10915330,10916097,10915842,10916609,10916354,10917121,10916866,10917633,10917378,10918145,10917890,10918657,10918402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13514 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10953473,10953218,10953985,10953730,10954497,10954242,10955009,10954754,10955521,10955266,10956033,10955778,10956545,10956290,0,0,10957569,10957314,10958081,10957826,10958593,10958338,10959105,10958850,10959617,10959362,10960129,10959874,10960641,10960386,10961153,10960898,10961665,10961410,10962177,10961922,10962689,10962434,10963201,10962946,10963713,10963458,10964225,10963970,10964737,10964482,10965249,10964994,10965761,10965506,10966273,10966018,10966785,10966530,10967297,10967042,10967809,10967554,10968321,10968066,10968833,10968578,10969345,10969090,10969857,10969602,10970369,10970114,10970881,10970626,10971393,10971138,10971905,10971650,10972417,10972162,10972929,10972674,0,0,0,0,0,0,0,0,0,10975745,10975490,10976257,10976002,1931521,10977025,10976770,10977537,10977282,10978049,10977794,10978561,10978306,10979073,10978818,0,0,0,10980353,10980098,156929,0,0,10981633,10981378,10982145,10981890,10994690,0,10983169,10982914,10983681,10983426,10984193,10983938,10984705,10984450,10985217,10984962,10985729,10985474,10986241,10985986,10986753,10986498,10987265,10987010,10987777,10987522,157185,154625,155905,158721,158209,0,171521,165633,171265,11227905,10990849,10990594,10991361,10991106,10991873,10991618,10992385,10992130,10992897,10992642,10993409,10993154,10993921,10993666,10994433,10994178,10982401,164353,1936897,10995713,10995458,10996225,10995970,0,0,0,0,0,10998017,10997762,0,0,0,0,10999553,10999298,11000065,10999810,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11007489,11007234,0,0,0,0,0,0,0,0,0},
13515 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10990338,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1286146,1286402,1286658,1286914,1287170,1287426,1287682,1287938,1288194,1288450,1288706,1288962,1289218,1289474,1289730,1289986,1290242,1290498,1290754,1291010,1291266,1291522,1291778,1292034,1292290,1292546,1292802,1293058,1293314,1293570,1293826,1294082,1294338,1294594,1294850,1295106,1295362,1295618,1295874,1296130,1296386,1296642,1296898,1297154,1297410,1297666,1297922,1298178,1298434,1298690,1298946,1299202,1299458,1299714,1299970,1300226,1300482,1300738,1300994,1301250,1301506,1301762,1302018,1302274,1302530,1302786,1303042,1303298,1303554,1303810,1304066,1304322,1304578,1304834,1305090,1305346,1305602,1305858,1306114,1306370,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13516 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16728321,16728577,16728833,16729089,16729345,16729601,16729857,16730113,16730369,16730625,16730881,16731137,16731393,16731649,16731905,16732161,16732417,16732673,16732929,16733185,16733441,16733697,16733953,16734209,16734465,16734721,0,0,0,0,0,0,16720130,16720386,16720642,16720898,16721154,16721410,16721666,16721922,16722178,16722434,16722690,16722946,16723202,16723458,16723714,16723970,16724226,16724482,16724738,16724994,16725250,16725506,16725762,16726018,16726274,16726530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13517 {17049601,17049857,17050113,17050369,17050625,17050881,17051137,17051393,17051649,17051905,17052161,17052417,17052673,17052929,17053185,17053441,17053697,17053953,17054209,17054465,17054721,17054977,17055233,17055489,17055745,17056001,17056257,17056513,17056769,17057025,17057281,17057537,17057793,17058049,17058305,17058561,17058817,17059073,17059329,17059585,17039362,17039618,17039874,17040130,17040386,17040642,17040898,17041154,17041410,17041666,17041922,17042178,17042434,17042690,17042946,17043202,17043458,17043714,17043970,17044226,17044482,17044738,17044994,17045250,17045506,17045762,17046018,17046274,17046530,17046786,17047042,17047298,17047554,17047810,17048066,17048322,17048578,17048834,17049090,17049346,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17094657,17094913,17095169,17095425,17095681,17095937,17096193,17096449,17096705,17096961,17097217,17097473,17097729,17097985,17098241,17098497,17098753,17099009,17099265,17099521,17099777,17100033,17100289,17100545,17100801,17101057,17101313,17101569,17101825,17102081,17102337,17102593,17102849,17103105,17103361,17103617,0,0,0,0,17084418,17084674,17084930,17085186,17085442,17085698,17085954,17086210,17086466,17086722,17086978,17087234,17087490,17087746,17088002,17088258,17088514,17088770,17089026,17089282,17089538,17089794,17090050,17090306,17090562,17090818,17091074,17091330,17091586,17091842,17092098,17092354,17092610,17092866,17093122,17093378,0,0,0,0},
13518 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17143553,17143809,17144065,17144321,17144577,17144833,17145089,17145345,17145601,17145857,17146113,0,17146625,17146881,17147137,17147393,17147649,17147905,17148161,17148417,17148673,17148929,17149185,17149441,17149697,17149953,17150209,0,17150721,17150977,17151233,17151489,17151745,17152001,17152257,0,17152769,17153025,0,17133570,17133826,17134082,17134338,17134594,17134850,17135106,17135362,17135618,17135874,17136130,0,17136642,17136898,17137154,17137410,17137666,17137922,17138178,17138434,17138690,17138946,17139202,17139458,17139714,17139970,17140226,0,17140738,17140994,17141250,17141506,17141762,17142018,17142274,0,17142786,17143042,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13519 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17612801,17613057,17613313,17613569,17613825,17614081,17614337,17614593,17614849,17615105,17615361,17615617,17615873,17616129,17616385,17616641,17616897,17617153,17617409,17617665,17617921,17618177,17618433,17618689,17618945,17619201,17619457,17619713,17619969,17620225,17620481,17620737,17620993,17621249,17621505,17621761,17622017,17622273,17622529,17622785,17623041,17623297,17623553,17623809,17624065,17624321,17624577,17624833,17625089,17625345,17625601,0,0,0,0,0,0,0,0,0,0,0,0,0,17596418,17596674,17596930,17597186,17597442,17597698,17597954,17598210,17598466,17598722,17598978,17599234,17599490,17599746,17600002,17600258,17600514,17600770,17601026,17601282,17601538,17601794,17602050,17602306,17602562,17602818,17603074,17603330,17603586,17603842,17604098,17604354,17604610,17604866,17605122,17605378,17605634,17605890,17606146,17606402,17606658,17606914,17607170,17607426,17607682,17607938,17608194,17608450,17608706,17608962,17609218,0,0,0,0,0,0,0,0,0,0,0,0,0},
13520 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18399233,18399489,18399745,18400001,18400257,18400513,18400769,18401025,18401281,18401537,18401793,18402049,18402305,18402561,18402817,18403073,18403329,18403585,18403841,18404097,18404353,18404609,18404865,18405121,18405377,18405633,18405889,18406145,18406401,18406657,18406913,18407169,18391042,18391298,18391554,18391810,18392066,18392322,18392578,18392834,18393090,18393346,18393602,18393858,18394114,18394370,18394626,18394882,18395138,18395394,18395650,18395906,18396162,18396418,18396674,18396930,18397186,18397442,18397698,18397954,18398210,18398466,18398722,18398978,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13521 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24010753,24011009,24011265,24011521,24011777,24012033,24012289,24012545,24012801,24013057,24013313,24013569,24013825,24014081,24014337,24014593,24014849,24015105,24015361,24015617,24015873,24016129,24016385,24016641,24016897,24017153,24017409,24017665,24017921,24018177,24018433,24018689,24002562,24002818,24003074,24003330,24003586,24003842,24004098,24004354,24004610,24004866,24005122,24005378,24005634,24005890,24006146,24006402,24006658,24006914,24007170,24007426,24007682,24007938,24008194,24008450,24008706,24008962,24009218,24009474,24009730,24009986,24010242,24010498,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
13522 {32055809,32056065,32056321,32056577,32056833,32057089,32057345,32057601,32057857,32058113,32058369,32058625,32058881,32059137,32059393,32059649,32059905,32060161,32060417,32060673,32060929,32061185,32061441,32061697,32061953,32062209,32062465,32062721,32062977,32063233,32063489,32063745,32064001,32064257,32047106,32047362,32047618,32047874,32048130,32048386,32048642,32048898,32049154,32049410,32049666,32049922,32050178,32050434,32050690,32050946,32051202,32051458,32051714,32051970,32052226,32052482,32052738,32052994,32053250,32053506,32053762,32054018,32054274,32054530,32054786,32055042,32055298,32055554,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
13523 };
13524  
13525 } // namespace unilib
13526  
13527 /////////
13528 // File: unilib/utf8.cpp
13529 /////////
13530  
13531 // This file is part of UniLib <http://github.com/ufal/unilib/>.
13532 //
13533 // Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
13534 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13535 //
13536 // This Source Code Form is subject to the terms of the Mozilla Public
13537 // License, v. 2.0. If a copy of the MPL was not distributed with this
13538 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13539 //
13540 // UniLib version: 3.3.1
13541 // Unicode version: 15.0.0
13542  
13543 namespace unilib {
13544  
13545 0 bool utf8::valid(const char* str) {
13546 0 ▶ for (; *str; str++)
Branch: 1 branch
BranchTrueFalseTotal
for (; *str; str++) 0 0 0
13547 0 ▶ if (((unsigned char)*str) >= 0x80) {
Branch: 1 branch
BranchTrueFalseTotal
if (((unsigned char)*str) >= 0x80) { 0 0 0
13548 0 ▶ if (((unsigned char)*str) < 0xC0) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (((unsigned char)*str) < 0xC0) return false; 0 0 0
13549 0 ▶ else if (((unsigned char)*str) < 0xE0) {
Branch: 1 branch
BranchTrueFalseTotal
else if (((unsigned char)*str) < 0xE0) { 0 0 0
13550 0 ▶ str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 2 branches
BranchTrueFalseTotal
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13551 0 ▶ } else if (((unsigned char)*str) < 0xF0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF0) { 0 0 0
13552 0 ▶ str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 2 branches
BranchTrueFalseTotal
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13553 0 ▶ str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 2 branches
BranchTrueFalseTotal
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13554 0 ▶ } else if (((unsigned char)*str) < 0xF8) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF8) { 0 0 0
13555 0 ▶ str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 2 branches
BranchTrueFalseTotal
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13556 0 ▶ str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 2 branches
BranchTrueFalseTotal
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13557 0 ▶ str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 2 branches
BranchTrueFalseTotal
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13558 0 } else return false;
13559 }
13560 0 return true;
13561 }
13562  
13563 0 bool utf8::valid(const char* str, size_t len) {
13564 0 ▶ for (; len > 0; str++, len--)
Branch: 1 branch
BranchTrueFalseTotal
for (; len > 0; str++, len--) 0 0 0
13565 0 ▶ if (((unsigned char)*str) >= 0x80) {
Branch: 1 branch
BranchTrueFalseTotal
if (((unsigned char)*str) >= 0x80) { 0 0 0
13566 0 ▶ if (((unsigned char)*str) < 0xC0) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (((unsigned char)*str) < 0xC0) return false; 0 0 0
13567 0 ▶ else if (((unsigned char)*str) < 0xE0) {
Branch: 1 branch
BranchTrueFalseTotal
else if (((unsigned char)*str) < 0xE0) { 0 0 0
13568 0 ▶ str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 4 branches
BranchTrueFalseTotal
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13569 0 ▶ } else if (((unsigned char)*str) < 0xF0) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF0) { 0 0 0
13570 0 ▶ str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 4 branches
BranchTrueFalseTotal
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13571 0 ▶ str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 4 branches
BranchTrueFalseTotal
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13572 0 ▶ } else if (((unsigned char)*str) < 0xF8) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (((unsigned char)*str) < 0xF8) { 0 0 0
13573 0 ▶ str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 4 branches
BranchTrueFalseTotal
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13574 0 ▶ str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 4 branches
BranchTrueFalseTotal
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13575 0 ▶ str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false;
Branch: 4 branches
BranchTrueFalseTotal
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
str++; if (!--len || ((unsigned char)*str) < 0x80 || ((unsigned char)*str) >= 0xC0) return false; 0 0 0
13576 0 } else return false;
13577 }
13578 0 return true;
13579 }
13580  
13581 0 void utf8::decode(const char* str, std::u32string& decoded) {
13582 0 decoded.clear();
13583  
13584 0 ▶ for (char32_t chr; (chr = decode(str)); )
Branch: 1 branch
BranchTrueFalseTotal
for (char32_t chr; (chr = decode(str)); ) 0 0 0
13585 0 decoded.push_back(chr);
13586 0 }
13587  
13588 0 void utf8::decode(const char* str, size_t len, std::u32string& decoded) {
13589 0 decoded.clear();
13590  
13591 0 ▶ while (len)
Branch: 1 branch
BranchTrueFalseTotal
while (len) 0 0 0
13592 0 decoded.push_back(decode(str, len));
13593 0 }
13594  
13595 0 void utf8::encode(const std::u32string& str, std::string& encoded) {
13596 0 encoded.clear();
13597  
13598 0 ▶ for (auto&& chr : str)
Branch: 1 branch
BranchTrueFalseTotal
for (auto&& chr : str) 0 0 0
13599 0 ▶ append(encoded, chr);
Branch: 1 branch
BranchTrueFalseTotal
append(encoded, chr); 0 0 0
13600 0 }
13601  
13602 const char utf8::REPLACEMENT_CHAR;
13603  
13604 } // namespace unilib
13605  
13606 /////////
13607 // File: unilib/version.cpp
13608 /////////
13609  
13610 // This file is part of UniLib <http://github.com/ufal/unilib/>.
13611 //
13612 // Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
13613 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13614 //
13615 // This Source Code Form is subject to the terms of the Mozilla Public
13616 // License, v. 2.0. If a copy of the MPL was not distributed with this
13617 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13618 //
13619 // UniLib version: 3.3.1
13620 // Unicode version: 15.0.0
13621  
13622 namespace unilib {
13623  
13624 // Returns current version.
13625 0 version version::current() {
13626 0 return {3, 3, 1, ""};
13627 0 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
13628  
13629 } // namespace unilib
13630  
13631 /////////
13632 // File: utils/compressor_load.cpp
13633 /////////
13634  
13635 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
13636 //
13637 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
13638 // Mathematics and Physics, Charles University in Prague, Czech Republic.
13639 //
13640 // This Source Code Form is subject to the terms of the Mozilla Public
13641 // License, v. 2.0. If a copy of the MPL was not distributed with this
13642 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
13643  
13644 namespace utils {
13645  
13646 // Start of LZMA compression library by Igor Pavlov
13647 namespace lzma {
13648  
13649 // Types.h -- Basic types
13650 // 2010-10-09 : Igor Pavlov : Public domain
13651 #ifndef UFAL_CPPUTILS_COMPRESSOR_LZMA_TYPES_H
13652 #define UFAL_CPPUTILS_COMPRESSOR_LZMA_TYPES_H
13653  
13654 #define SZ_OK 0
13655  
13656 #define SZ_ERROR_DATA 1
13657 #define SZ_ERROR_MEM 2
13658 #define SZ_ERROR_CRC 3
13659 #define SZ_ERROR_UNSUPPORTED 4
13660 #define SZ_ERROR_PARAM 5
13661 #define SZ_ERROR_INPUT_EOF 6
13662 #define SZ_ERROR_OUTPUT_EOF 7
13663 #define SZ_ERROR_READ 8
13664 #define SZ_ERROR_WRITE 9
13665 #define SZ_ERROR_PROGRESS 10
13666 #define SZ_ERROR_FAIL 11
13667 #define SZ_ERROR_THREAD 12
13668  
13669 #define SZ_ERROR_ARCHIVE 16
13670 #define SZ_ERROR_NO_ARCHIVE 17
13671  
13672 typedef int SRes;
13673  
13674 #ifndef RINOK
13675 #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
13676 #endif
13677  
13678 /* The following interfaces use first parameter as pointer to structure */
13679  
13680 struct IByteIn
13681 {
13682 uint8_t (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */
13683 };
13684  
13685 struct IByteOut
13686 {
13687 void (*Write)(void *p, uint8_t b);
13688 };
13689  
13690 struct ISeqInStream
13691 {
13692 SRes (*Read)(void *p, void *buf, size_t *size);
13693 /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
13694 (output(*size) < input(*size)) is allowed */
13695 };
13696  
13697 /* it can return SZ_ERROR_INPUT_EOF */
13698 SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
13699 SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
13700 SRes SeqInStream_ReadByte(ISeqInStream *stream, uint8_t *buf);
13701  
13702 struct ISeqOutStream
13703 {
13704 size_t (*Write)(void *p, const void *buf, size_t size);
13705 /* Returns: result - the number of actually written bytes.
13706 (result < size) means error */
13707 };
13708  
13709 enum ESzSeek
13710 {
13711 SZ_SEEK_SET = 0,
13712 SZ_SEEK_CUR = 1,
13713 SZ_SEEK_END = 2
13714 };
13715  
13716 struct ISeekInStream
13717 {
13718 SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
13719 SRes (*Seek)(void *p, int64_t *pos, ESzSeek origin);
13720 };
13721  
13722 struct ILookInStream
13723 {
13724 SRes (*Look)(void *p, const void **buf, size_t *size);
13725 /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
13726 (output(*size) > input(*size)) is not allowed
13727 (output(*size) < input(*size)) is allowed */
13728 SRes (*Skip)(void *p, size_t offset);
13729 /* offset must be <= output(*size) of Look */
13730  
13731 SRes (*Read)(void *p, void *buf, size_t *size);
13732 /* reads directly (without buffer). It's same as ISeqInStream::Read */
13733 SRes (*Seek)(void *p, int64_t *pos, ESzSeek origin);
13734 };
13735  
13736 SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
13737 SRes LookInStream_SeekTo(ILookInStream *stream, uint64_t offset);
13738  
13739 /* reads via ILookInStream::Read */
13740 SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
13741 SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
13742  
13743 #define LookToRead_BUF_SIZE (1 << 14)
13744  
13745 struct CLookToRead
13746 {
13747 ILookInStream s;
13748 ISeekInStream *realStream;
13749 size_t pos;
13750 size_t size;
13751 uint8_t buf[LookToRead_BUF_SIZE];
13752 };
13753  
13754 void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
13755 void LookToRead_Init(CLookToRead *p);
13756  
13757 struct CSecToLook
13758 {
13759 ISeqInStream s;
13760 ILookInStream *realStream;
13761 };
13762  
13763 void SecToLook_CreateVTable(CSecToLook *p);
13764  
13765 struct CSecToRead
13766 {
13767 ISeqInStream s;
13768 ILookInStream *realStream;
13769 };
13770  
13771 void SecToRead_CreateVTable(CSecToRead *p);
13772  
13773 struct ICompressProgress
13774 {
13775 SRes (*Progress)(void *p, uint64_t inSize, uint64_t outSize);
13776 /* Returns: result. (result != SZ_OK) means break.
13777 Value (uint64_t)(int64_t)-1 for size means unknown value. */
13778 };
13779  
13780 struct ISzAlloc
13781 {
13782 void *(*Alloc)(void *p, size_t size);
13783 void (*Free)(void *p, void *address); /* address can be 0 */
13784 };
13785  
13786 #define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
13787 #define IAlloc_Free(p, a) (p)->Free((p), a)
13788  
13789 #endif // UFAL_CPPUTILS_COMPRESSOR_LZMA_TYPES_H
13790  
13791 // LzmaDec.h -- LZMA Decoder
13792 // 2009-02-07 : Igor Pavlov : Public domain
13793  
13794 /* #define _LZMA_PROB32 */
13795 /* _LZMA_PROB32 can increase the speed on some CPUs,
13796 but memory usage for CLzmaDec::probs will be doubled in that case */
13797  
13798 #ifdef _LZMA_PROB32
13799 #define CLzmaProb uint32_t
13800 #else
13801 #define CLzmaProb uint16_t
13802 #endif
13803  
13804 /* ---------- LZMA Properties ---------- */
13805  
13806 #define LZMA_PROPS_SIZE 5
13807  
13808 struct CLzmaProps
13809 {
13810 unsigned lc, lp, pb;
13811 uint32_t dicSize;
13812 };
13813  
13814 /* LzmaProps_Decode - decodes properties
13815 Returns:
13816 SZ_OK
13817 SZ_ERROR_UNSUPPORTED - Unsupported properties
13818 */
13819  
13820 SRes LzmaProps_Decode(CLzmaProps *p, const uint8_t *data, unsigned size);
13821  
13822 /* ---------- LZMA Decoder state ---------- */
13823  
13824 /* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
13825 Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
13826  
13827 #define LZMA_REQUIRED_INPUT_MAX 20
13828  
13829 struct CLzmaDec
13830 {
13831 CLzmaProps prop;
13832 CLzmaProb *probs;
13833 uint8_t *dic;
13834 const uint8_t *buf;
13835 uint32_t range, code;
13836 size_t dicPos;
13837 size_t dicBufSize;
13838 uint32_t processedPos;
13839 uint32_t checkDicSize;
13840 unsigned state;
13841 uint32_t reps[4];
13842 unsigned remainLen;
13843 int needFlush;
13844 int needInitState;
13845 uint32_t numProbs;
13846 unsigned tempBufSize;
13847 uint8_t tempBuf[LZMA_REQUIRED_INPUT_MAX];
13848 };
13849  
13850 #define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
13851  
13852 void LzmaDec_Init(CLzmaDec *p);
13853  
13854 /* There are two types of LZMA streams:
13855 0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
13856 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
13857  
13858 enum ELzmaFinishMode
13859 {
13860 LZMA_FINISH_ANY, /* finish at any point */
13861 LZMA_FINISH_END /* block must be finished at the end */
13862 };
13863  
13864 /* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
13865  
13866 You must use LZMA_FINISH_END, when you know that current output buffer
13867 covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
13868  
13869 If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
13870 and output value of destLen will be less than output buffer size limit.
13871 You can check status result also.
13872  
13873 You can use multiple checks to test data integrity after full decompression:
13874 1) Check Result and "status" variable.
13875 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
13876 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
13877 You must use correct finish mode in that case. */
13878  
13879 enum ELzmaStatus
13880 {
13881 LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
13882 LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
13883 LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
13884 LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
13885 LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
13886 };
13887  
13888 /* ELzmaStatus is used only as output value for function call */
13889  
13890 /* ---------- Interfaces ---------- */
13891  
13892 /* There are 3 levels of interfaces:
13893 1) Dictionary Interface
13894 2) Buffer Interface
13895 3) One Call Interface
13896 You can select any of these interfaces, but don't mix functions from different
13897 groups for same object. */
13898  
13899 /* There are two variants to allocate state for Dictionary Interface:
13900 1) LzmaDec_Allocate / LzmaDec_Free
13901 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
13902 You can use variant 2, if you set dictionary buffer manually.
13903 For Buffer Interface you must always use variant 1.
13904  
13905 LzmaDec_Allocate* can return:
13906 SZ_OK
13907 SZ_ERROR_MEM - Memory allocation error
13908 SZ_ERROR_UNSUPPORTED - Unsupported properties
13909 */
13910
13911 SRes LzmaDec_AllocateProbs(CLzmaDec *p, const uint8_t *props, unsigned propsSize, ISzAlloc *alloc);
13912 void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
13913  
13914 SRes LzmaDec_Allocate(CLzmaDec *state, const uint8_t *prop, unsigned propsSize, ISzAlloc *alloc);
13915 void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
13916  
13917 /* ---------- Dictionary Interface ---------- */
13918  
13919 /* You can use it, if you want to eliminate the overhead for data copying from
13920 dictionary to some other external buffer.
13921 You must work with CLzmaDec variables directly in this interface.
13922  
13923 STEPS:
13924 LzmaDec_Constr()
13925 LzmaDec_Allocate()
13926 for (each new stream)
13927 {
13928 LzmaDec_Init()
13929 while (it needs more decompression)
13930 {
13931 LzmaDec_DecodeToDic()
13932 use data from CLzmaDec::dic and update CLzmaDec::dicPos
13933 }
13934 }
13935 LzmaDec_Free()
13936 */
13937  
13938 /* LzmaDec_DecodeToDic
13939
13940 The decoding to internal dictionary buffer (CLzmaDec::dic).
13941 You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
13942  
13943 finishMode:
13944 It has meaning only if the decoding reaches output limit (dicLimit).
13945 LZMA_FINISH_ANY - Decode just dicLimit bytes.
13946 LZMA_FINISH_END - Stream must be finished after dicLimit.
13947  
13948 Returns:
13949 SZ_OK
13950 status:
13951 LZMA_STATUS_FINISHED_WITH_MARK
13952 LZMA_STATUS_NOT_FINISHED
13953 LZMA_STATUS_NEEDS_MORE_INPUT
13954 LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
13955 SZ_ERROR_DATA - Data error
13956 */
13957  
13958 SRes LzmaDec_DecodeToDic(CLzmaDec *p, size_t dicLimit,
13959 const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
13960  
13961 /* ---------- Buffer Interface ---------- */
13962  
13963 /* It's zlib-like interface.
13964 See LzmaDec_DecodeToDic description for information about STEPS and return results,
13965 but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
13966 to work with CLzmaDec variables manually.
13967  
13968 finishMode:
13969 It has meaning only if the decoding reaches output limit (*destLen).
13970 LZMA_FINISH_ANY - Decode just destLen bytes.
13971 LZMA_FINISH_END - Stream must be finished after (*destLen).
13972 */
13973  
13974 SRes LzmaDec_DecodeToBuf(CLzmaDec *p, uint8_t *dest, size_t *destLen,
13975 const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
13976  
13977 /* ---------- One Call Interface ---------- */
13978  
13979 /* LzmaDecode
13980  
13981 finishMode:
13982 It has meaning only if the decoding reaches output limit (*destLen).
13983 LZMA_FINISH_ANY - Decode just destLen bytes.
13984 LZMA_FINISH_END - Stream must be finished after (*destLen).
13985  
13986 Returns:
13987 SZ_OK
13988 status:
13989 LZMA_STATUS_FINISHED_WITH_MARK
13990 LZMA_STATUS_NOT_FINISHED
13991 LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
13992 SZ_ERROR_DATA - Data error
13993 SZ_ERROR_MEM - Memory allocation error
13994 SZ_ERROR_UNSUPPORTED - Unsupported properties
13995 SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
13996 */
13997  
13998 SRes LzmaDecode(uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen,
13999 const uint8_t *propData, unsigned propSize, ELzmaFinishMode finishMode,
14000 ELzmaStatus *status, ISzAlloc *alloc);
14001  
14002 // LzmaDec.c -- LZMA Decoder
14003 // 2009-09-20 : Igor Pavlov : Public domain
14004  
14005 #define kNumTopBits 24
14006 #define kTopValue ((uint32_t)1 << kNumTopBits)
14007  
14008 #define kNumBitModelTotalBits 11
14009 #define kBitModelTotal (1 << kNumBitModelTotalBits)
14010 #define kNumMoveBits 5
14011  
14012 #define RC_INIT_SIZE 5
14013  
14014 #define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
14015  
14016 #define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
14017 #define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
14018 #define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
14019 #define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
14020 { UPDATE_0(p); i = (i + i); A0; } else \
14021 { UPDATE_1(p); i = (i + i) + 1; A1; }
14022 #define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
14023  
14024 #define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
14025 #define TREE_DECODE(probs, limit, i) \
14026 { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
14027  
14028 /* #define _LZMA_SIZE_OPT */
14029  
14030 #ifdef _LZMA_SIZE_OPT
14031 #define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
14032 #else
14033 #define TREE_6_DECODE(probs, i) \
14034 { i = 1; \
14035 TREE_GET_BIT(probs, i); \
14036 TREE_GET_BIT(probs, i); \
14037 TREE_GET_BIT(probs, i); \
14038 TREE_GET_BIT(probs, i); \
14039 TREE_GET_BIT(probs, i); \
14040 TREE_GET_BIT(probs, i); \
14041 i -= 0x40; }
14042 #endif
14043  
14044 #define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
14045  
14046 #define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
14047 #define UPDATE_0_CHECK range = bound;
14048 #define UPDATE_1_CHECK range -= bound; code -= bound;
14049 #define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
14050 { UPDATE_0_CHECK; i = (i + i); A0; } else \
14051 { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
14052 #define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
14053 #define TREE_DECODE_CHECK(probs, limit, i) \
14054 { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
14055  
14056 #define kNumPosBitsMax 4
14057 #define kNumPosStatesMax (1 << kNumPosBitsMax)
14058  
14059 #define kLenNumLowBits 3
14060 #define kLenNumLowSymbols (1 << kLenNumLowBits)
14061 #define kLenNumMidBits 3
14062 #define kLenNumMidSymbols (1 << kLenNumMidBits)
14063 #define kLenNumHighBits 8
14064 #define kLenNumHighSymbols (1 << kLenNumHighBits)
14065  
14066 #define LenChoice 0
14067 #define LenChoice2 (LenChoice + 1)
14068 #define LenLow (LenChoice2 + 1)
14069 #define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
14070 #define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
14071 #define kNumLenProbs (LenHigh + kLenNumHighSymbols)
14072  
14073 #define kNumStates 12
14074 #define kNumLitStates 7
14075  
14076 #define kStartPosModelIndex 4
14077 #define kEndPosModelIndex 14
14078 #define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
14079  
14080 #define kNumPosSlotBits 6
14081 #define kNumLenToPosStates 4
14082  
14083 #define kNumAlignBits 4
14084 #define kAlignTableSize (1 << kNumAlignBits)
14085  
14086 #define kMatchMinLen 2
14087 #define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
14088  
14089 #define IsMatch 0
14090 #define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
14091 #define IsRepG0 (IsRep + kNumStates)
14092 #define IsRepG1 (IsRepG0 + kNumStates)
14093 #define IsRepG2 (IsRepG1 + kNumStates)
14094 #define IsRep0Long (IsRepG2 + kNumStates)
14095 #define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
14096 #define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
14097 #define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
14098 #define LenCoder (Align + kAlignTableSize)
14099 #define RepLenCoder (LenCoder + kNumLenProbs)
14100 #define Literal (RepLenCoder + kNumLenProbs)
14101  
14102 #define LZMA_BASE_SIZE 1846
14103 #define LZMA_LIT_SIZE 768
14104  
14105 #define LzmaProps_GetNumProbs(p) ((uint32_t)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
14106  
14107 #if Literal != LZMA_BASE_SIZE
14108 StopCompilingDueBUG
14109 #endif
14110  
14111 #define LZMA_DIC_MIN (1 << 12)
14112  
14113 /* First LZMA-symbol is always decoded.
14114 And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
14115 Out:
14116 Result:
14117 SZ_OK - OK
14118 SZ_ERROR_DATA - Error
14119 p->remainLen:
14120 < kMatchSpecLenStart : normal remain
14121 = kMatchSpecLenStart : finished
14122 = kMatchSpecLenStart + 1 : Flush marker
14123 = kMatchSpecLenStart + 2 : State Init Marker
14124 */
14125  
14126 120 static int LzmaDec_DecodeReal(CLzmaDec *p, size_t limit, const uint8_t *bufLimit)
14127 {
14128 120 CLzmaProb *probs = p->probs;
14129  
14130 120 unsigned state = p->state;
14131 120 uint32_t rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
14132 120 unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
14133 120 unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;
14134 120 unsigned lc = p->prop.lc;
14135  
14136 120 uint8_t *dic = p->dic;
14137 120 size_t dicBufSize = p->dicBufSize;
14138 120 size_t dicPos = p->dicPos;
14139
14140 120 uint32_t processedPos = p->processedPos;
14141 120 uint32_t checkDicSize = p->checkDicSize;
14142 120 unsigned len = 0;
14143  
14144 120 const uint8_t *buf = p->buf;
14145 120 uint32_t range = p->range;
14146 120 uint32_t code = p->code;
14147  
14148 do
14149 {
14150 CLzmaProb *prob;
14151 uint32_t bound;
14152 unsigned ttt;
14153 32137 unsigned posState = processedPos & pbMask;
14154  
14155 32137 prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
14156 32137 ▶ IF_BIT_0(prob)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(prob) 244 31893 32137
IF_BIT_0(prob) 784 31353 32137
14157 {
14158 unsigned symbol;
14159 784 UPDATE_0(prob);
14160 784 prob = probs + Literal;
14161 784 ▶ if (checkDicSize != 0 || processedPos != 0)
Branch: 2 branches
BranchTrueFalseTotal
if (checkDicSize != 0 || processedPos != 0) 784 0 784
if (checkDicSize != 0 || processedPos != 0) 777 7 784
14162 1554 prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +
14163 777 ▶ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));
Branch: 1 branch
BranchTrueFalseTotal
(dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); 0 777 777
14164  
14165 784 ▶ if (state < kNumLitStates)
Branch: 1 branch
BranchTrueFalseTotal
if (state < kNumLitStates) 440 344 784
14166 {
14167 440 state -= (state < 4) ? state : 3;
14168 440 symbol = 1;
14169 3520 ▶ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
Branch: 3 branches
BranchTrueFalseTotal
do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); 385 3135 3520
do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); 2054 1466 3520
do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); 3080 440 3520
14170 }
14171 else
14172 {
14173 344 ▶ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
Branch: 1 branch
BranchTrueFalseTotal
unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; 0 344 344
14174 344 unsigned offs = 0x100;
14175 344 ▶ state -= (state < 10) ? 3 : 6;
Branch: 1 branch
BranchTrueFalseTotal
state -= (state < 10) ? 3 : 6; 249 95 344
14176 344 symbol = 1;
14177 do
14178 {
14179 unsigned bit;
14180 CLzmaProb *probLit;
14181 2752 matchByte <<= 1;
14182 2752 bit = (matchByte & offs);
14183 2752 probLit = prob + offs + bit + symbol;
14184 2752 ▶ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
Branch: 2 branches
BranchTrueFalseTotal
GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) 310 2442 2752
GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) 1825 927 2752
14185 }
14186 2752 ▶ while (symbol < 0x100);
Branch: 1 branch
BranchTrueFalseTotal
while (symbol < 0x100); 2408 344 2752
14187 }
14188 784 dic[dicPos++] = (uint8_t)symbol;
14189 784 processedPos++;
14190 784 continue;
14191 784 }
14192 else
14193 {
14194 31353 UPDATE_1(prob);
14195 31353 prob = probs + IsRep + state;
14196 31353 ▶ IF_BIT_0(prob)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(prob) 198 31155 31353
IF_BIT_0(prob) 267 31086 31353
14197 {
14198 267 UPDATE_0(prob);
14199 267 state += kNumStates;
14200 267 prob = probs + LenCoder;
14201 }
14202 else
14203 {
14204 31086 UPDATE_1(prob);
14205 31086 ▶ if (checkDicSize == 0 && processedPos == 0)
Branch: 2 branches
BranchTrueFalseTotal
if (checkDicSize == 0 && processedPos == 0) 31086 0 31086
if (checkDicSize == 0 && processedPos == 0) 0 31086 31086
14206 0 return SZ_ERROR_DATA;
14207 31086 prob = probs + IsRepG0 + state;
14208 31086 ▶ IF_BIT_0(prob)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(prob) 120 30966 31086
IF_BIT_0(prob) 30975 111 31086
14209 {
14210 30975 UPDATE_0(prob);
14211 30975 prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
14212 30975 ▶ IF_BIT_0(prob)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(prob) 123 30852 30975
IF_BIT_0(prob) 54 30921 30975
14213 {
14214 54 UPDATE_0(prob);
14215 54 ▶ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
Branch: 1 branch
BranchTrueFalseTotal
dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; 0 54 54
14216 54 dicPos++;
14217 54 processedPos++;
14218 54 ▶ state = state < kNumLitStates ? 9 : 11;
Branch: 1 branch
BranchTrueFalseTotal
state = state < kNumLitStates ? 9 : 11; 51 3 54
14219 54 continue;
14220 }
14221 30921 UPDATE_1(prob);
14222 }
14223 else
14224 {
14225 uint32_t distance;
14226 111 UPDATE_1(prob);
14227 111 prob = probs + IsRepG1 + state;
14228 111 ▶ IF_BIT_0(prob)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(prob) 22 89 111
IF_BIT_0(prob) 61 50 111
14229 {
14230 61 UPDATE_0(prob);
14231 61 distance = rep1;
14232 }
14233 else
14234 {
14235 50 UPDATE_1(prob);
14236 50 prob = probs + IsRepG2 + state;
14237 50 ▶ IF_BIT_0(prob)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(prob) 4 46 50
IF_BIT_0(prob) 31 19 50
14238 {
14239 31 UPDATE_0(prob);
14240 31 distance = rep2;
14241 }
14242 else
14243 {
14244 19 UPDATE_1(prob);
14245 19 distance = rep3;
14246 19 rep3 = rep2;
14247 }
14248 50 rep2 = rep1;
14249 }
14250 111 rep1 = rep0;
14251 111 rep0 = distance;
14252 }
14253 31032 ▶ state = state < kNumLitStates ? 8 : 11;
Branch: 1 branch
BranchTrueFalseTotal
state = state < kNumLitStates ? 8 : 11; 159 30873 31032
14254 31032 prob = probs + RepLenCoder;
14255 }
14256 {
14257 unsigned limit, offset;
14258 31299 CLzmaProb *probLen = prob + LenChoice;
14259 31299 ▶ IF_BIT_0(probLen)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(probLen) 206 31093 31299
IF_BIT_0(probLen) 276 31023 31299
14260 {
14261 276 UPDATE_0(probLen);
14262 276 probLen = prob + LenLow + (posState << kLenNumLowBits);
14263 276 offset = 0;
14264 276 limit = (1 << kLenNumLowBits);
14265 }
14266 else
14267 {
14268 31023 UPDATE_1(probLen);
14269 31023 probLen = prob + LenChoice2;
14270 31023 ▶ IF_BIT_0(probLen)
Branch: 2 branches
BranchTrueFalseTotal
IF_BIT_0(probLen) 111 30912 31023
IF_BIT_0(probLen) 54 30969 31023
14271 {
14272 54 UPDATE_0(probLen);
14273 54 probLen = prob + LenMid + (posState << kLenNumMidBits);
14274 54 offset = kLenNumLowSymbols;
14275 54 limit = (1 << kLenNumMidBits);
14276 }
14277 else
14278 {
14279 30969 UPDATE_1(probLen);
14280 30969 probLen = prob + LenHigh;
14281 30969 offset = kLenNumLowSymbols + kLenNumMidSymbols;
14282 30969 limit = (1 << kLenNumHighBits);
14283 }
14284 }
14285 248742 ▶ TREE_DECODE(probLen, limit, len);
Branch: 3 branches
BranchTrueFalseTotal
TREE_DECODE(probLen, limit, len); 1134 247608 248742
TREE_DECODE(probLen, limit, len); 1269 247473 248742
TREE_DECODE(probLen, limit, len); 217443 31299 248742
14286 31299 len += offset;
14287 }
14288  
14289 31299 ▶ if (state >= kNumStates)
Branch: 1 branch
BranchTrueFalseTotal
if (state >= kNumStates) 267 31032 31299
14290 {
14291 uint32_t distance;
14292 267 prob = probs + PosSlot +
14293 267 ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
14294 267 ▶ TREE_6_DECODE(prob, distance);
Branch: 12 branches
BranchTrueFalseTotal
TREE_6_DECODE(prob, distance); 34 233 267
TREE_6_DECODE(prob, distance); 194 73 267
TREE_6_DECODE(prob, distance); 39 228 267
TREE_6_DECODE(prob, distance); 244 23 267
TREE_6_DECODE(prob, distance); 22 245 267
TREE_6_DECODE(prob, distance); 169 98 267
TREE_6_DECODE(prob, distance); 29 238 267
TREE_6_DECODE(prob, distance); 112 155 267
TREE_6_DECODE(prob, distance); 25 242 267
TREE_6_DECODE(prob, distance); 154 113 267
TREE_6_DECODE(prob, distance); 30 237 267
TREE_6_DECODE(prob, distance); 178 89 267
14295 267 ▶ if (distance >= kStartPosModelIndex)
Branch: 1 branch
BranchTrueFalseTotal
if (distance >= kStartPosModelIndex) 229 38 267
14296 {
14297 229 unsigned posSlot = (unsigned)distance;
14298 229 int numDirectBits = (int)(((distance >> 1) - 1));
14299 229 distance = (2 | (distance & 1));
14300 229 ▶ if (posSlot < kEndPosModelIndex)
Branch: 1 branch
BranchTrueFalseTotal
if (posSlot < kEndPosModelIndex) 119 110 229
14301 {
14302 119 distance <<= numDirectBits;
14303 119 prob = probs + SpecPos + distance - posSlot - 1;
14304 {
14305 119 uint32_t mask = 1;
14306 119 unsigned i = 1;
14307 do
14308 {
14309 337 ▶ GET_BIT2(prob + i, i, ; , distance |= mask);
Branch: 2 branches
BranchTrueFalseTotal
GET_BIT2(prob + i, i, ; , distance |= mask); 41 296 337
GET_BIT2(prob + i, i, ; , distance |= mask); 147 190 337
14310 337 mask <<= 1;
14311 }
14312 337 ▶ while (--numDirectBits != 0);
Branch: 1 branch
BranchTrueFalseTotal
while (--numDirectBits != 0); 218 119 337
14313 }
14314 }
14315 else
14316 {
14317 110 numDirectBits -= kNumAlignBits;
14318 do
14319 {
14320 1135 ▶ NORMALIZE
Branch: 1 branch
BranchTrueFalseTotal
NORMALIZE 137 998 1135
14321 1135 range >>= 1;
14322
14323 {
14324 uint32_t t;
14325 1135 code -= range;
14326 1135 t = (0 - ((uint32_t)code >> 31)); /* (uint32_t)((int32_t)code >> 31) */
14327 1135 distance = (distance << 1) + (t + 1);
14328 1135 code += range & t;
14329 }
14330 /*
14331 distance <<= 1;
14332 if (code >= range)
14333 {
14334 code -= range;
14335 distance |= 1;
14336 }
14337 */
14338 }
14339 1135 ▶ while (--numDirectBits != 0);
Branch: 1 branch
BranchTrueFalseTotal
while (--numDirectBits != 0); 1025 110 1135
14340 110 prob = probs + Align;
14341 110 distance <<= kNumAlignBits;
14342 {
14343 110 unsigned i = 1;
14344 110 ▶ GET_BIT2(prob + i, i, ; , distance |= 1);
Branch: 2 branches
BranchTrueFalseTotal
GET_BIT2(prob + i, i, ; , distance |= 1); 14 96 110
GET_BIT2(prob + i, i, ; , distance |= 1); 53 57 110
14345 110 ▶ GET_BIT2(prob + i, i, ; , distance |= 2);
Branch: 2 branches
BranchTrueFalseTotal
GET_BIT2(prob + i, i, ; , distance |= 2); 20 90 110
GET_BIT2(prob + i, i, ; , distance |= 2); 51 59 110
14346 110 ▶ GET_BIT2(prob + i, i, ; , distance |= 4);
Branch: 2 branches
BranchTrueFalseTotal
GET_BIT2(prob + i, i, ; , distance |= 4); 9 101 110
GET_BIT2(prob + i, i, ; , distance |= 4); 66 44 110
14347 110 ▶ GET_BIT2(prob + i, i, ; , distance |= 8);
Branch: 2 branches
BranchTrueFalseTotal
GET_BIT2(prob + i, i, ; , distance |= 8); 18 92 110
GET_BIT2(prob + i, i, ; , distance |= 8); 70 40 110
14348 }
14349 110 ▶ if (distance == (uint32_t)0xFFFFFFFF)
Branch: 1 branch
BranchTrueFalseTotal
if (distance == (uint32_t)0xFFFFFFFF) 0 110 110
14350 {
14351 0 len += kMatchSpecLenStart;
14352 0 state -= kNumStates;
14353 0 break;
14354 }
14355 }
14356 }
14357 267 rep3 = rep2;
14358 267 rep2 = rep1;
14359 267 rep1 = rep0;
14360 267 rep0 = distance + 1;
14361 267 ▶ if (checkDicSize == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (checkDicSize == 0) 267 0 267
14362 {
14363 267 ▶ if (distance >= processedPos)
Branch: 1 branch
BranchTrueFalseTotal
if (distance >= processedPos) 0 267 267
14364 0 return SZ_ERROR_DATA;
14365 }
14366 0 ▶ else if (distance >= checkDicSize)
Branch: 1 branch
BranchTrueFalseTotal
else if (distance >= checkDicSize) 0 0 0
14367 0 return SZ_ERROR_DATA;
14368 267 ▶ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
Branch: 1 branch
BranchTrueFalseTotal
state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; 137 130 267
14369 }
14370  
14371 31299 len += kMatchMinLen;
14372  
14373 31299 ▶ if (limit == dicPos)
Branch: 1 branch
BranchTrueFalseTotal
if (limit == dicPos) 0 31299 31299
14374 0 return SZ_ERROR_DATA;
14375 {
14376 31299 size_t rem = limit - dicPos;
14377 31299 ▶ unsigned curLen = ((rem < len) ? (unsigned)rem : len);
Branch: 1 branch
BranchTrueFalseTotal
unsigned curLen = ((rem < len) ? (unsigned)rem : len); 0 31299 31299
14378 31299 ▶ size_t pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);
Branch: 1 branch
BranchTrueFalseTotal
size_t pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); 0 31299 31299
14379  
14380 31299 processedPos += curLen;
14381  
14382 31299 len -= curLen;
14383 31299 ▶ if (pos + curLen <= dicBufSize)
Branch: 1 branch
BranchTrueFalseTotal
if (pos + curLen <= dicBufSize) 31299 0 31299
14384 {
14385 31299 uint8_t *dest = dic + dicPos;
14386 31299 ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
14387 31299 const uint8_t *lim = dest + curLen;
14388 31299 dicPos += curLen;
14389 do
14390 8428629 *(dest) = (uint8_t)*(dest + src);
14391 8428629 ▶ while (++dest != lim);
Branch: 1 branch
BranchTrueFalseTotal
while (++dest != lim); 8397330 31299 8428629
14392 }
14393 else
14394 {
14395 do
14396 {
14397 0 dic[dicPos++] = dic[pos];
14398 0 ▶ if (++pos == dicBufSize)
Branch: 1 branch
BranchTrueFalseTotal
if (++pos == dicBufSize) 0 0 0
14399 0 pos = 0;
14400 }
14401 0 ▶ while (--curLen != 0);
Branch: 1 branch
BranchTrueFalseTotal
while (--curLen != 0); 0 0 0
14402 }
14403 }
14404 }
14405 }
14406 32137 ▶ while (dicPos < limit && buf < bufLimit);
Branch: 2 branches
BranchTrueFalseTotal
while (dicPos < limit && buf < bufLimit); 32130 7 32137
while (dicPos < limit && buf < bufLimit); 32017 113 32130
14407 120 ▶ NORMALIZE;
Branch: 1 branch
BranchTrueFalseTotal
NORMALIZE; 26 94 120
14408 120 p->buf = buf;
14409 120 p->range = range;
14410 120 p->code = code;
14411 120 p->remainLen = len;
14412 120 p->dicPos = dicPos;
14413 120 p->processedPos = processedPos;
14414 120 p->reps[0] = rep0;
14415 120 p->reps[1] = rep1;
14416 120 p->reps[2] = rep2;
14417 120 p->reps[3] = rep3;
14418 120 p->state = state;
14419  
14420 120 return SZ_OK;
14421 }
14422  
14423 127 static void LzmaDec_WriteRem(CLzmaDec *p, size_t limit)
14424 {
14425 127 ▶ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
Branch: 2 branches
BranchTrueFalseTotal
if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) 0 127 127
if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) 0 0 0
14426 {
14427 0 uint8_t *dic = p->dic;
14428 0 size_t dicPos = p->dicPos;
14429 0 size_t dicBufSize = p->dicBufSize;
14430 0 unsigned len = p->remainLen;
14431 0 uint32_t rep0 = p->reps[0];
14432 0 ▶ if (limit - dicPos < len)
Branch: 1 branch
BranchTrueFalseTotal
if (limit - dicPos < len) 0 0 0
14433 0 len = (unsigned)(limit - dicPos);
14434  
14435 0 ▶ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
Branch: 2 branches
BranchTrueFalseTotal
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) 0 0 0
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) 0 0 0
14436 0 p->checkDicSize = p->prop.dicSize;
14437  
14438 0 p->processedPos += len;
14439 0 p->remainLen -= len;
14440 0 ▶ while (len-- != 0)
Branch: 1 branch
BranchTrueFalseTotal
while (len-- != 0) 0 0 0
14441 {
14442 0 ▶ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
Branch: 1 branch
BranchTrueFalseTotal
dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; 0 0 0
14443 0 dicPos++;
14444 }
14445 0 p->dicPos = dicPos;
14446 }
14447 127 }
14448  
14449 120 static int LzmaDec_DecodeReal2(CLzmaDec *p, size_t limit, const uint8_t *bufLimit)
14450 {
14451 do
14452 {
14453 120 size_t limit2 = limit;
14454 120 ▶ if (p->checkDicSize == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->checkDicSize == 0) 120 0 120
14455 {
14456 120 uint32_t rem = p->prop.dicSize - p->processedPos;
14457 120 ▶ if (limit - p->dicPos > rem)
Branch: 1 branch
BranchTrueFalseTotal
if (limit - p->dicPos > rem) 0 120 120
14458 0 limit2 = p->dicPos + rem;
14459 }
14460 120 ▶ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));
Branch: 1 branch
BranchTrueFalseTotal
RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); 0 120 120
14461 120 ▶ if (p->processedPos >= p->prop.dicSize)
Branch: 1 branch
BranchTrueFalseTotal
if (p->processedPos >= p->prop.dicSize) 0 120 120
14462 0 p->checkDicSize = p->prop.dicSize;
14463 120 LzmaDec_WriteRem(p, limit);
14464 }
14465 120 ▶ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
Branch: 3 branches
BranchTrueFalseTotal
while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); 113 7 120
while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); 0 113 113
while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); 0 0 0
14466  
14467 120 ▶ if (p->remainLen > kMatchSpecLenStart)
Branch: 1 branch
BranchTrueFalseTotal
if (p->remainLen > kMatchSpecLenStart) 0 120 120
14468 {
14469 0 p->remainLen = kMatchSpecLenStart;
14470 }
14471 120 return 0;
14472 }
14473  
14474 enum ELzmaDummy
14475 {
14476 DUMMY_ERROR, /* unexpected end of input stream */
14477 DUMMY_LIT,
14478 DUMMY_MATCH,
14479 DUMMY_REP
14480 };
14481  
14482 110 static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const uint8_t *buf, size_t inSize)
14483 {
14484 110 uint32_t range = p->range;
14485 110 uint32_t code = p->code;
14486 110 const uint8_t *bufLimit = buf + inSize;
14487 110 CLzmaProb *probs = p->probs;
14488 110 unsigned state = p->state;
14489 ELzmaDummy res;
14490  
14491 {
14492 CLzmaProb *prob;
14493 uint32_t bound;
14494 unsigned ttt;
14495 110 unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);
14496  
14497 110 prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
14498 110 ▶ IF_BIT_0_CHECK(prob)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(prob) 0 110 110
IF_BIT_0_CHECK(prob) 0 0 0
IF_BIT_0_CHECK(prob) 69 41 110
14499 {
14500 69 UPDATE_0_CHECK
14501  
14502 /* if (bufLimit - buf >= 7) return DUMMY_LIT; */
14503  
14504 69 prob = probs + Literal;
14505 69 ▶ if (p->checkDicSize != 0 || p->processedPos != 0)
Branch: 2 branches
BranchTrueFalseTotal
if (p->checkDicSize != 0 || p->processedPos != 0) 69 0 69
if (p->checkDicSize != 0 || p->processedPos != 0) 68 1 69
14506 68 prob += (LZMA_LIT_SIZE *
14507 136 ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
14508 68 ▶ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
Branch: 1 branch
BranchTrueFalseTotal
(p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); 0 68 68
14509  
14510 69 ▶ if (state < kNumLitStates)
Branch: 1 branch
BranchTrueFalseTotal
if (state < kNumLitStates) 44 25 69
14511 {
14512 44 unsigned symbol = 1;
14513 352 ▶ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
Branch: 4 branches
BranchTrueFalseTotal
do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); 28 324 352
do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); 0 28 28
do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); 218 134 352
do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); 308 44 352
14514 }
14515 else
14516 {
14517 50 unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
14518 25 ▶ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];
Branch: 1 branch
BranchTrueFalseTotal
((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; 0 25 25
14519 25 unsigned offs = 0x100;
14520 25 unsigned symbol = 1;
14521 do
14522 {
14523 unsigned bit;
14524 CLzmaProb *probLit;
14525 200 matchByte <<= 1;
14526 200 bit = (matchByte & offs);
14527 200 probLit = prob + offs + bit + symbol;
14528 200 ▶ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)
Branch: 3 branches
BranchTrueFalseTotal
GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) 20 180 200
GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) 0 20 20
GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) 146 54 200
14529 }
14530 200 ▶ while (symbol < 0x100);
Branch: 1 branch
BranchTrueFalseTotal
while (symbol < 0x100); 175 25 200
14531 }
14532 69 res = DUMMY_LIT;
14533 }
14534 else
14535 {
14536 unsigned len;
14537 41 UPDATE_1_CHECK;
14538  
14539 41 prob = probs + IsRep + state;
14540 41 ▶ IF_BIT_0_CHECK(prob)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(prob) 3 38 41
IF_BIT_0_CHECK(prob) 0 3 3
IF_BIT_0_CHECK(prob) 20 21 41
14541 {
14542 20 UPDATE_0_CHECK;
14543 20 state = 0;
14544 20 prob = probs + LenCoder;
14545 20 res = DUMMY_MATCH;
14546 }
14547 else
14548 {
14549 21 UPDATE_1_CHECK;
14550 21 res = DUMMY_REP;
14551 21 prob = probs + IsRepG0 + state;
14552 21 ▶ IF_BIT_0_CHECK(prob)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(prob) 1 20 21
IF_BIT_0_CHECK(prob) 0 1 1
IF_BIT_0_CHECK(prob) 15 6 21
14553 {
14554 15 UPDATE_0_CHECK;
14555 15 prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
14556 15 ▶ IF_BIT_0_CHECK(prob)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(prob) 2 13 15
IF_BIT_0_CHECK(prob) 0 2 2
IF_BIT_0_CHECK(prob) 9 6 15
14557 {
14558 9 UPDATE_0_CHECK;
14559 9 ▶ NORMALIZE_CHECK;
Branch: 2 branches
BranchTrueFalseTotal
NORMALIZE_CHECK; 3 6 9
NORMALIZE_CHECK; 0 3 3
14560 9 return DUMMY_REP;
14561 }
14562 else
14563 {
14564 6 UPDATE_1_CHECK;
14565 }
14566 }
14567 else
14568 {
14569 6 UPDATE_1_CHECK;
14570 6 prob = probs + IsRepG1 + state;
14571 6 ▶ IF_BIT_0_CHECK(prob)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(prob) 2 4 6
IF_BIT_0_CHECK(prob) 0 2 2
IF_BIT_0_CHECK(prob) 2 4 6
14572 {
14573 2 UPDATE_0_CHECK;
14574 }
14575 else
14576 {
14577 4 UPDATE_1_CHECK;
14578 4 prob = probs + IsRepG2 + state;
14579 4 ▶ IF_BIT_0_CHECK(prob)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(prob) 1 3 4
IF_BIT_0_CHECK(prob) 0 1 1
IF_BIT_0_CHECK(prob) 3 1 4
14580 {
14581 3 UPDATE_0_CHECK;
14582 }
14583 else
14584 {
14585 1 UPDATE_1_CHECK;
14586 }
14587 }
14588 }
14589 12 state = kNumStates;
14590 12 prob = probs + RepLenCoder;
14591 }
14592 {
14593 unsigned limit, offset;
14594 32 CLzmaProb *probLen = prob + LenChoice;
14595 32 ▶ IF_BIT_0_CHECK(probLen)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(probLen) 2 30 32
IF_BIT_0_CHECK(probLen) 0 2 2
IF_BIT_0_CHECK(probLen) 23 9 32
14596 {
14597 23 UPDATE_0_CHECK;
14598 23 probLen = prob + LenLow + (posState << kLenNumLowBits);
14599 23 offset = 0;
14600 23 limit = 1 << kLenNumLowBits;
14601 }
14602 else
14603 {
14604 9 UPDATE_1_CHECK;
14605 9 probLen = prob + LenChoice2;
14606 9 ▶ IF_BIT_0_CHECK(probLen)
Branch: 3 branches
BranchTrueFalseTotal
IF_BIT_0_CHECK(probLen) 0 9 9
IF_BIT_0_CHECK(probLen) 0 0 0
IF_BIT_0_CHECK(probLen) 4 5 9
14607 {
14608 4 UPDATE_0_CHECK;
14609 4 probLen = prob + LenMid + (posState << kLenNumMidBits);
14610 4 offset = kLenNumLowSymbols;
14611 4 limit = 1 << kLenNumMidBits;
14612 }
14613 else
14614 {
14615 5 UPDATE_1_CHECK;
14616 5 probLen = prob + LenHigh;
14617 5 offset = kLenNumLowSymbols + kLenNumMidSymbols;
14618 5 limit = 1 << kLenNumHighBits;
14619 }
14620 }
14621 121 ▶ TREE_DECODE_CHECK(probLen, limit, len);
Branch: 4 branches
BranchTrueFalseTotal
TREE_DECODE_CHECK(probLen, limit, len); 15 106 121
TREE_DECODE_CHECK(probLen, limit, len); 0 15 15
TREE_DECODE_CHECK(probLen, limit, len); 75 46 121
TREE_DECODE_CHECK(probLen, limit, len); 89 32 121
14622 32 len += offset;
14623 }
14624  
14625 32 ▶ if (state < 4)
Branch: 1 branch
BranchTrueFalseTotal
if (state < 4) 20 12 32
14626 {
14627 unsigned posSlot;
14628 20 prob = probs + PosSlot +
14629 20 ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
14630 kNumPosSlotBits);
14631 120 ▶ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
Branch: 4 branches
BranchTrueFalseTotal
TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); 15 105 120
TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); 0 15 15
TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); 80 40 120
TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); 100 20 120
14632 20 ▶ if (posSlot >= kStartPosModelIndex)
Branch: 1 branch
BranchTrueFalseTotal
if (posSlot >= kStartPosModelIndex) 18 2 20
14633 {
14634 18 int numDirectBits = ((posSlot >> 1) - 1);
14635  
14636 /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
14637  
14638 18 ▶ if (posSlot < kEndPosModelIndex)
Branch: 1 branch
BranchTrueFalseTotal
if (posSlot < kEndPosModelIndex) 10 8 18
14639 {
14640 10 prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;
14641 }
14642 else
14643 {
14644 8 numDirectBits -= kNumAlignBits;
14645 do
14646 {
14647 55 ▶ NORMALIZE_CHECK
Branch: 2 branches
BranchTrueFalseTotal
NORMALIZE_CHECK 6 49 55
NORMALIZE_CHECK 0 6 6
14648 55 range >>= 1;
14649 55 code -= range & (((code - range) >> 31) - 1);
14650 /* if (code >= range) code -= range; */
14651 }
14652 55 ▶ while (--numDirectBits != 0);
Branch: 1 branch
BranchTrueFalseTotal
while (--numDirectBits != 0); 47 8 55
14653 8 prob = probs + Align;
14654 8 numDirectBits = kNumAlignBits;
14655 }
14656 {
14657 18 unsigned i = 1;
14658 do
14659 {
14660 63 ▶ GET_BIT_CHECK(prob + i, i);
Branch: 3 branches
BranchTrueFalseTotal
GET_BIT_CHECK(prob + i, i); 8 55 63
GET_BIT_CHECK(prob + i, i); 0 8 8
GET_BIT_CHECK(prob + i, i); 18 45 63
14661 }
14662 63 ▶ while (--numDirectBits != 0);
Branch: 1 branch
BranchTrueFalseTotal
while (--numDirectBits != 0); 45 18 63
14663 }
14664 }
14665 }
14666 }
14667 }
14668 101 ▶ NORMALIZE_CHECK;
Branch: 2 branches
BranchTrueFalseTotal
NORMALIZE_CHECK; 22 79 101
NORMALIZE_CHECK; 0 22 22
14669 101 return res;
14670 }
14671  
14672 7 static void LzmaDec_InitRc(CLzmaDec *p, const uint8_t *data)
14673 {
14674 7 p->code = ((uint32_t)data[1] << 24) | ((uint32_t)data[2] << 16) | ((uint32_t)data[3] << 8) | ((uint32_t)data[4]);
14675 7 p->range = 0xFFFFFFFF;
14676 7 p->needFlush = 0;
14677 7 }
14678  
14679 7 void LzmaDec_InitDicAndState(CLzmaDec *p, bool initDic, bool initState)
14680 {
14681 7 p->needFlush = 1;
14682 7 p->remainLen = 0;
14683 7 p->tempBufSize = 0;
14684  
14685 7 ▶ if (initDic)
Branch: 1 branch
BranchTrueFalseTotal
if (initDic) 7 0 7
14686 {
14687 7 p->processedPos = 0;
14688 7 p->checkDicSize = 0;
14689 7 p->needInitState = 1;
14690 }
14691 7 ▶ if (initState)
Branch: 1 branch
BranchTrueFalseTotal
if (initState) 7 0 7
14692 7 p->needInitState = 1;
14693 7 }
14694  
14695 7 void LzmaDec_Init(CLzmaDec *p)
14696 {
14697 7 p->dicPos = 0;
14698 7 LzmaDec_InitDicAndState(p, true, true);
14699 7 }
14700  
14701 7 static void LzmaDec_InitStateReal(CLzmaDec *p)
14702 {
14703 7 uint32_t numProbs = Literal + ((uint32_t)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));
14704 uint32_t i;
14705 7 CLzmaProb *probs = p->probs;
14706 55937 ▶ for (i = 0; i < numProbs; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < numProbs; i++) 55930 7 55937
14707 55930 probs[i] = kBitModelTotal >> 1;
14708 7 p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
14709 7 p->state = 0;
14710 7 p->needInitState = 0;
14711 7 }
14712  
14713 7 SRes LzmaDec_DecodeToDic(CLzmaDec *p, size_t dicLimit, const uint8_t *src, size_t *srcLen,
14714 ELzmaFinishMode finishMode, ELzmaStatus *status)
14715 {
14716 7 size_t inSize = *srcLen;
14717 7 (*srcLen) = 0;
14718 7 LzmaDec_WriteRem(p, dicLimit);
14719
14720 7 *status = LZMA_STATUS_NOT_SPECIFIED;
14721  
14722 127 ▶ while (p->remainLen != kMatchSpecLenStart)
Branch: 1 branch
BranchTrueFalseTotal
while (p->remainLen != kMatchSpecLenStart) 127 0 127
14723 {
14724 int checkEndMarkNow;
14725  
14726 127 ▶ if (p->needFlush != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->needFlush != 0) 7 120 127
14727 {
14728 42 ▶ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
Branch: 2 branches
BranchTrueFalseTotal
for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) 42 0 42
for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) 35 7 42
14729 35 p->tempBuf[p->tempBufSize++] = *src++;
14730 7 ▶ if (p->tempBufSize < RC_INIT_SIZE)
Branch: 1 branch
BranchTrueFalseTotal
if (p->tempBufSize < RC_INIT_SIZE) 0 7 7
14731 {
14732 0 *status = LZMA_STATUS_NEEDS_MORE_INPUT;
14733 0 return SZ_OK;
14734 }
14735 7 ▶ if (p->tempBuf[0] != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->tempBuf[0] != 0) 0 7 7
14736 0 return SZ_ERROR_DATA;
14737  
14738 7 LzmaDec_InitRc(p, p->tempBuf);
14739 7 p->tempBufSize = 0;
14740 }
14741  
14742 127 checkEndMarkNow = 0;
14743 127 ▶ if (p->dicPos >= dicLimit)
Branch: 1 branch
BranchTrueFalseTotal
if (p->dicPos >= dicLimit) 7 120 127
14744 {
14745 7 ▶ if (p->remainLen == 0 && p->code == 0)
Branch: 2 branches
BranchTrueFalseTotal
if (p->remainLen == 0 && p->code == 0) 7 0 7
if (p->remainLen == 0 && p->code == 0) 7 0 7
14746 {
14747 7 *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
14748 7 return SZ_OK;
14749 }
14750 0 ▶ if (finishMode == LZMA_FINISH_ANY)
Branch: 1 branch
BranchTrueFalseTotal
if (finishMode == LZMA_FINISH_ANY) 0 0 0
14751 {
14752 0 *status = LZMA_STATUS_NOT_FINISHED;
14753 0 return SZ_OK;
14754 }
14755 0 ▶ if (p->remainLen != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->remainLen != 0) 0 0 0
14756 {
14757 0 *status = LZMA_STATUS_NOT_FINISHED;
14758 0 return SZ_ERROR_DATA;
14759 }
14760 0 checkEndMarkNow = 1;
14761 }
14762  
14763 120 ▶ if (p->needInitState)
Branch: 1 branch
BranchTrueFalseTotal
if (p->needInitState) 7 113 120
14764 7 LzmaDec_InitStateReal(p);
14765
14766 120 ▶ if (p->tempBufSize == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->tempBufSize == 0) 120 0 120
14767 {
14768 size_t processed;
14769 const uint8_t *bufLimit;
14770 120 ▶ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
Branch: 2 branches
BranchTrueFalseTotal
if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) 10 110 120
if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) 0 10 10
14771 {
14772 110 int dummyRes = LzmaDec_TryDummy(p, src, inSize);
14773 110 ▶ if (dummyRes == DUMMY_ERROR)
Branch: 1 branch
BranchTrueFalseTotal
if (dummyRes == DUMMY_ERROR) 0 110 110
14774 {
14775 0 memcpy(p->tempBuf, src, inSize);
14776 0 p->tempBufSize = (unsigned)inSize;
14777 0 (*srcLen) += inSize;
14778 0 *status = LZMA_STATUS_NEEDS_MORE_INPUT;
14779 0 return SZ_OK;
14780 }
14781 110 ▶ if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
Branch: 2 branches
BranchTrueFalseTotal
if (checkEndMarkNow && dummyRes != DUMMY_MATCH) 0 110 110
if (checkEndMarkNow && dummyRes != DUMMY_MATCH) 0 0 0
14782 {
14783 0 *status = LZMA_STATUS_NOT_FINISHED;
14784 0 return SZ_ERROR_DATA;
14785 }
14786 110 bufLimit = src;
14787 110 }
14788 else
14789 10 bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
14790 120 p->buf = src;
14791 120 ▶ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) 0 120 120
14792 0 return SZ_ERROR_DATA;
14793 120 processed = (size_t)(p->buf - src);
14794 120 (*srcLen) += processed;
14795 120 src += processed;
14796 120 inSize -= processed;
14797 }
14798 else
14799 {
14800 0 unsigned rem = p->tempBufSize, lookAhead = 0;
14801 0 ▶ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
Branch: 2 branches
BranchTrueFalseTotal
while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) 0 0 0
while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) 0 0 0
14802 0 p->tempBuf[rem++] = src[lookAhead++];
14803 0 p->tempBufSize = rem;
14804 0 ▶ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
Branch: 2 branches
BranchTrueFalseTotal
if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) 0 0 0
if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) 0 0 0
14805 {
14806 0 int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);
14807 0 ▶ if (dummyRes == DUMMY_ERROR)
Branch: 1 branch
BranchTrueFalseTotal
if (dummyRes == DUMMY_ERROR) 0 0 0
14808 {
14809 0 (*srcLen) += lookAhead;
14810 0 *status = LZMA_STATUS_NEEDS_MORE_INPUT;
14811 0 return SZ_OK;
14812 }
14813 0 ▶ if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
Branch: 2 branches
BranchTrueFalseTotal
if (checkEndMarkNow && dummyRes != DUMMY_MATCH) 0 0 0
if (checkEndMarkNow && dummyRes != DUMMY_MATCH) 0 0 0
14814 {
14815 0 *status = LZMA_STATUS_NOT_FINISHED;
14816 0 return SZ_ERROR_DATA;
14817 }
14818 }
14819 0 p->buf = p->tempBuf;
14820 0 ▶ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) 0 0 0
14821 0 return SZ_ERROR_DATA;
14822 0 lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));
14823 0 (*srcLen) += lookAhead;
14824 0 src += lookAhead;
14825 0 inSize -= lookAhead;
14826 0 p->tempBufSize = 0;
14827 }
14828 }
14829 0 ▶ if (p->code == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->code == 0) 0 0 0
14830 0 *status = LZMA_STATUS_FINISHED_WITH_MARK;
14831 0 return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;
14832 }
14833  
14834 0 SRes LzmaDec_DecodeToBuf(CLzmaDec *p, uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
14835 {
14836 0 size_t outSize = *destLen;
14837 0 size_t inSize = *srcLen;
14838 0 *srcLen = *destLen = 0;
14839 for (;;)
14840 {
14841 0 size_t inSizeCur = inSize, outSizeCur, dicPos;
14842 ELzmaFinishMode curFinishMode;
14843 SRes res;
14844 0 ▶ if (p->dicPos == p->dicBufSize)
Branch: 1 branch
BranchTrueFalseTotal
if (p->dicPos == p->dicBufSize) 0 0 0
14845 0 p->dicPos = 0;
14846 0 dicPos = p->dicPos;
14847 0 ▶ if (outSize > p->dicBufSize - dicPos)
Branch: 1 branch
BranchTrueFalseTotal
if (outSize > p->dicBufSize - dicPos) 0 0 0
14848 {
14849 0 outSizeCur = p->dicBufSize;
14850 0 curFinishMode = LZMA_FINISH_ANY;
14851 }
14852 else
14853 {
14854 0 outSizeCur = dicPos + outSize;
14855 0 curFinishMode = finishMode;
14856 }
14857  
14858 0 res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);
14859 0 src += inSizeCur;
14860 0 inSize -= inSizeCur;
14861 0 *srcLen += inSizeCur;
14862 0 outSizeCur = p->dicPos - dicPos;
14863 0 memcpy(dest, p->dic + dicPos, outSizeCur);
14864 0 dest += outSizeCur;
14865 0 outSize -= outSizeCur;
14866 0 *destLen += outSizeCur;
14867 0 ▶ if (res != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (res != 0) 0 0 0
14868 0 return res;
14869 0 ▶ if (outSizeCur == 0 || outSize == 0)
Branch: 2 branches
BranchTrueFalseTotal
if (outSizeCur == 0 || outSize == 0) 0 0 0
if (outSizeCur == 0 || outSize == 0) 0 0 0
14870 0 return SZ_OK;
14871 0 }
14872 }
14873  
14874 14 void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
14875 {
14876 14 alloc->Free(alloc, p->probs);
14877 14 p->probs = 0;
14878 14 }
14879  
14880 0 static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc)
14881 {
14882 0 alloc->Free(alloc, p->dic);
14883 0 p->dic = 0;
14884 0 }
14885  
14886 0 void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc)
14887 {
14888 0 LzmaDec_FreeProbs(p, alloc);
14889 0 LzmaDec_FreeDict(p, alloc);
14890 0 }
14891  
14892 7 SRes LzmaProps_Decode(CLzmaProps *p, const uint8_t *data, unsigned size)
14893 {
14894 uint32_t dicSize;
14895 uint8_t d;
14896
14897 7 ▶ if (size < LZMA_PROPS_SIZE)
Branch: 1 branch
BranchTrueFalseTotal
if (size < LZMA_PROPS_SIZE) 0 7 7
14898 0 return SZ_ERROR_UNSUPPORTED;
14899 else
14900 7 dicSize = data[1] | ((uint32_t)data[2] << 8) | ((uint32_t)data[3] << 16) | ((uint32_t)data[4] << 24);
14901
14902 7 ▶ if (dicSize < LZMA_DIC_MIN)
Branch: 1 branch
BranchTrueFalseTotal
if (dicSize < LZMA_DIC_MIN) 0 7 7
14903 0 dicSize = LZMA_DIC_MIN;
14904 7 p->dicSize = dicSize;
14905  
14906 7 d = data[0];
14907 7 ▶ if (d >= (9 * 5 * 5))
Branch: 1 branch
BranchTrueFalseTotal
if (d >= (9 * 5 * 5)) 0 7 7
14908 0 return SZ_ERROR_UNSUPPORTED;
14909  
14910 7 p->lc = d % 9;
14911 7 d /= 9;
14912 7 p->pb = d / 5;
14913 7 p->lp = d % 5;
14914  
14915 7 return SZ_OK;
14916 }
14917  
14918 7 static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
14919 {
14920 7 uint32_t numProbs = LzmaProps_GetNumProbs(propNew);
14921 7 ▶ if (p->probs == 0 || numProbs != p->numProbs)
Branch: 2 branches
BranchTrueFalseTotal
if (p->probs == 0 || numProbs != p->numProbs) 0 7 7
if (p->probs == 0 || numProbs != p->numProbs) 0 0 0
14922 {
14923 7 LzmaDec_FreeProbs(p, alloc);
14924 7 p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb));
14925 7 p->numProbs = numProbs;
14926 7 ▶ if (p->probs == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->probs == 0) 0 7 7
14927 0 return SZ_ERROR_MEM;
14928 }
14929 7 return SZ_OK;
14930 }
14931  
14932 7 SRes LzmaDec_AllocateProbs(CLzmaDec *p, const uint8_t *props, unsigned propsSize, ISzAlloc *alloc)
14933 {
14934 CLzmaProps propNew;
14935 7 ▶ RINOK(LzmaProps_Decode(&propNew, props, propsSize));
Branch: 1 branch
BranchTrueFalseTotal
RINOK(LzmaProps_Decode(&propNew, props, propsSize)); 0 7 7
14936 7 ▶ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
Branch: 2 branches
BranchTrueFalseTotal
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); 7 0 7
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); 0 7 7
14937 7 p->prop = propNew;
14938 7 return SZ_OK;
14939 }
14940  
14941 0 SRes LzmaDec_Allocate(CLzmaDec *p, const uint8_t *props, unsigned propsSize, ISzAlloc *alloc)
14942 {
14943 CLzmaProps propNew;
14944 size_t dicBufSize;
14945 0 ▶ RINOK(LzmaProps_Decode(&propNew, props, propsSize));
Branch: 1 branch
BranchTrueFalseTotal
RINOK(LzmaProps_Decode(&propNew, props, propsSize)); 0 0 0
14946 0 ▶ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
Branch: 2 branches
BranchTrueFalseTotal
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); 0 0 0
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); 0 0 0
14947 0 dicBufSize = propNew.dicSize;
14948 0 ▶ if (p->dic == 0 || dicBufSize != p->dicBufSize)
Branch: 2 branches
BranchTrueFalseTotal
if (p->dic == 0 || dicBufSize != p->dicBufSize) 0 0 0
if (p->dic == 0 || dicBufSize != p->dicBufSize) 0 0 0
14949 {
14950 0 ▶ LzmaDec_FreeDict(p, alloc);
Branch: 1 branch
BranchTrueFalseTotal
LzmaDec_FreeDict(p, alloc); 0 0 0
14951 0 ▶ p->dic = (uint8_t *)alloc->Alloc(alloc, dicBufSize);
Branch: 1 branch
BranchTrueFalseTotal
p->dic = (uint8_t *)alloc->Alloc(alloc, dicBufSize); 0 0 0
14952 0 ▶ if (p->dic == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (p->dic == 0) 0 0 0
14953 {
14954 0 ▶ LzmaDec_FreeProbs(p, alloc);
Branch: 1 branch
BranchTrueFalseTotal
LzmaDec_FreeProbs(p, alloc); 0 0 0
14955 0 return SZ_ERROR_MEM;
14956 }
14957 }
14958 0 p->dicBufSize = dicBufSize;
14959 0 p->prop = propNew;
14960 0 return SZ_OK;
14961 }
14962  
14963 7 SRes LzmaDecode(uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen,
14964 const uint8_t *propData, unsigned propSize, ELzmaFinishMode finishMode,
14965 ELzmaStatus *status, ISzAlloc *alloc)
14966 {
14967 CLzmaDec p;
14968 SRes res;
14969 7 size_t inSize = *srcLen;
14970 7 size_t outSize = *destLen;
14971 7 *srcLen = *destLen = 0;
14972 7 ▶ if (inSize < RC_INIT_SIZE)
Branch: 1 branch
BranchTrueFalseTotal
if (inSize < RC_INIT_SIZE) 0 7 7
14973 0 return SZ_ERROR_INPUT_EOF;
14974  
14975 7 LzmaDec_Construct(&p);
14976 7 ▶ res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc);
Branch: 1 branch
BranchTrueFalseTotal
res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); 7 0 7
14977 7 ▶ if (res != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (res != 0) 0 7 7
14978 0 return res;
14979 7 p.dic = dest;
14980 7 p.dicBufSize = outSize;
14981  
14982 7 LzmaDec_Init(&p);
14983
14984 7 *srcLen = inSize;
14985 7 res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
14986  
14987 7 ▶ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
Branch: 2 branches
BranchTrueFalseTotal
if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) 7 0 7
if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) 0 7 7
14988 0 res = SZ_ERROR_INPUT_EOF;
14989  
14990 7 (*destLen) = p.dicPos;
14991 7 ▶ LzmaDec_FreeProbs(&p, alloc);
Branch: 1 branch
BranchTrueFalseTotal
LzmaDec_FreeProbs(&p, alloc); 7 0 7
14992 7 return res;
14993 }
14994  
14995 } // namespace lzma
14996 // End of LZMA compression library by Igor Pavlov
14997  
14998 #ifndef UFAL_CPPUTILS_COMPRESSOR_LZMA_ALLOCATOR_H
14999 #define UFAL_CPPUTILS_COMPRESSOR_LZMA_ALLOCATOR_H
15000 7 static void *LzmaAlloc(void* /*p*/, size_t size) { return new char[size]; }
15001 14 ▶static void LzmaFree(void* /*p*/, void *address) { delete[] (char*) address; }
Branch: 1 branch
BranchTrueFalseTotal
static void LzmaFree(void* /*p*/, void *address) { delete[] (char*) address; } 7 7 14
15002 static lzma::ISzAlloc lzmaAllocator = { LzmaAlloc, LzmaFree };
15003 #endif // UFAL_CPPUTILS_COMPRESSOR_LZMA_ALLOCATOR_H
15004  
15005 7 bool compressor::load(istream& is, binary_decoder& data) {
15006 uint32_t uncompressed_len, compressed_len, poor_crc;
15007 unsigned char props_encoded[LZMA_PROPS_SIZE];
15008  
15009 7 ▶ if (!is.read((char *) &uncompressed_len, sizeof(uncompressed_len))) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (!is.read((char *) &uncompressed_len, sizeof(uncompressed_len))) return false; 7 0 7
if (!is.read((char *) &uncompressed_len, sizeof(uncompressed_len))) return false; 7 0 7
if (!is.read((char *) &uncompressed_len, sizeof(uncompressed_len))) return false; 0 7 7
15010 7 ▶ if (!is.read((char *) &compressed_len, sizeof(compressed_len))) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (!is.read((char *) &compressed_len, sizeof(compressed_len))) return false; 7 0 7
if (!is.read((char *) &compressed_len, sizeof(compressed_len))) return false; 7 0 7
if (!is.read((char *) &compressed_len, sizeof(compressed_len))) return false; 0 7 7
15011 7 ▶ if (!is.read((char *) &poor_crc, sizeof(poor_crc))) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (!is.read((char *) &poor_crc, sizeof(poor_crc))) return false; 7 0 7
if (!is.read((char *) &poor_crc, sizeof(poor_crc))) return false; 7 0 7
if (!is.read((char *) &poor_crc, sizeof(poor_crc))) return false; 0 7 7
15012 7 ▶ if (poor_crc != uncompressed_len * 19991 + compressed_len * 199999991 + 1234567890) return false;
Branch: 1 branch
BranchTrueFalseTotal
if (poor_crc != uncompressed_len * 19991 + compressed_len * 199999991 + 1234567890) return false; 0 7 7
15013 7 ▶ if (!is.read((char *) props_encoded, sizeof(props_encoded))) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (!is.read((char *) props_encoded, sizeof(props_encoded))) return false; 7 0 7
if (!is.read((char *) props_encoded, sizeof(props_encoded))) return false; 7 0 7
if (!is.read((char *) props_encoded, sizeof(props_encoded))) return false; 0 7 7
15014  
15015 7 ▶ vector<unsigned char> compressed(compressed_len);
Branch: 1 branch
BranchTrueFalseTotal
vector<unsigned char> compressed(compressed_len); 7 0 7
15016 7 ▶ if (!is.read((char *) compressed.data(), compressed_len)) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (!is.read((char *) compressed.data(), compressed_len)) return false; 7 0 7
if (!is.read((char *) compressed.data(), compressed_len)) return false; 7 0 7
if (!is.read((char *) compressed.data(), compressed_len)) return false; 0 7 7
15017  
15018 lzma::ELzmaStatus status;
15019 7 size_t uncompressed_size = uncompressed_len, compressed_size = compressed_len;
15020 7 ▶ auto res = lzma::LzmaDecode(data.fill(uncompressed_len), &uncompressed_size, compressed.data(), &compressed_size, props_encoded, LZMA_PROPS_SIZE, lzma::LZMA_FINISH_ANY, &status, &lzmaAllocator);
Branch: 2 branches
BranchTrueFalseTotal
auto res = lzma::LzmaDecode(data.fill(uncompressed_len), &uncompressed_size, compressed.data(), &compressed_size, props_encoded, LZMA_PROPS_SIZE, lzma::LZMA_FINISH_ANY, &status, &lzmaAllocator); 7 0 7
auto res = lzma::LzmaDecode(data.fill(uncompressed_len), &uncompressed_size, compressed.data(), &compressed_size, props_encoded, LZMA_PROPS_SIZE, lzma::LZMA_FINISH_ANY, &status, &lzmaAllocator); 7 0 7
15021 7 ▶ if (res != SZ_OK || uncompressed_size != uncompressed_len || compressed_size != compressed_len) return false;
Branch: 3 branches
BranchTrueFalseTotal
if (res != SZ_OK || uncompressed_size != uncompressed_len || compressed_size != compressed_len) return false; 7 0 7
if (res != SZ_OK || uncompressed_size != uncompressed_len || compressed_size != compressed_len) return false; 7 0 7
if (res != SZ_OK || uncompressed_size != uncompressed_len || compressed_size != compressed_len) return false; 0 7 7
15022  
15023 7 return true;
15024 7 }
15025  
15026 } // namespace utils
15027  
15028 /////////
15029 // File: utils/url_detector.cpp
15030 /////////
15031  
15032 // This file is part of UFAL C++ Utils <http://github.com/ufal/cpp_utils/>.
15033 //
15034 // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
15035 // Mathematics and Physics, Charles University in Prague, Czech Republic.
15036 //
15037 // This Source Code Form is subject to the terms of the Mozilla Public
15038 // License, v. 2.0. If a copy of the MPL was not distributed with this
15039 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
15040  
15041 namespace utils {
15042  
15043 static const char _url_detector_actions[] = {
15044 0, 1, 0, 1, 3, 2, 0, 1,
15045 2, 2, 0, 2, 3, 0
15046 };
15047  
15048 static const char _url_detector_cond_offsets[] = {
15049 0, 0, 0, 0, 0, 0, 0, 0,
15050 0, 0, 0, 0, 1, 1, 1, 1,
15051 1, 1, 1, 1, 1, 1, 1, 1,
15052 1, 1, 1, 1, 1, 1, 1, 1,
15053 1, 1, 1, 1, 1, 1, 1, 1,
15054 1, 1, 1, 1, 1, 1, 1, 1,
15055 1, 1, 1, 1, 1, 1, 1, 1,
15056 1, 1, 1, 1, 1, 1, 1, 1,
15057 1, 1, 1, 1, 1, 1, 1, 1,
15058 1, 1, 1, 1, 1, 1, 1, 1,
15059 1, 1, 1, 1, 1, 1, 1, 1,
15060 1, 1, 1, 1, 1, 1, 1, 1,
15061 1, 1, 1, 1, 1, 1, 1, 1,
15062 1, 1, 1, 1, 1, 1, 1, 1,
15063 1, 1, 1, 1, 1, 1, 1, 1,
15064 1, 1, 1, 1, 1, 1, 1, 1,
15065 1, 1, 1, 1, 1, 1, 1, 1,
15066 1, 1, 1, 1, 1, 1, 1, 1,
15067 1, 1, 1, 1, 1, 1, 1, 1,
15068 1, 1, 1, 1, 1, 1, 1, 1,
15069 1, 1, 1, 1, 1, 1, 1, 1,
15070 1, 1, 1, 1, 1, 1, 1, 1,
15071 1, 1, 1, 1, 1, 1, 1, 1,
15072 1, 1, 1, 1, 1, 1, 1, 1,
15073 1, 1, 1, 1, 1, 1, 1, 1,
15074 1, 1, 1, 1, 1, 1, 1, 1,
15075 1, 1, 1, 1, 1, 1, 1, 1,
15076 1, 1, 1, 1, 1, 1, 1, 1,
15077 1, 1, 1, 1, 1, 1, 1, 1,
15078 1, 1, 1, 1, 1, 1, 1, 1,
15079 1, 1, 1, 1, 1, 1, 1, 1,
15080 1, 1, 1, 1, 1, 1, 1, 1,
15081 1, 1, 1, 1, 1, 1, 1, 1,
15082 1, 1, 1, 1, 1, 1, 1, 1,
15083 1, 1, 1, 1, 1, 1, 1, 1,
15084 1, 1, 1, 1, 1, 1, 1, 1,
15085 1, 1, 1, 1, 1, 1, 1, 1,
15086 1, 1, 1, 1, 1, 1, 1, 1,
15087 1, 1, 1, 1, 1, 1, 1, 1,
15088 1, 1, 1, 1, 1, 1, 1, 1,
15089 1, 1, 1, 1, 1, 1, 1, 1,
15090 1, 1, 1, 1, 1, 1, 1, 1,
15091 1, 1, 1, 1, 1, 1, 1, 1,
15092 1, 1, 1, 1, 1, 1, 1, 1,
15093 1, 1, 1, 1, 1, 1, 1, 1,
15094 1, 1, 1, 1, 1, 1, 1, 1,
15095 1, 2, 2, 2, 2, 2, 2, 2,
15096 2, 2, 2, 2, 2, 2, 2, 2,
15097 2, 2, 2, 2, 2, 2, 2, 2,
15098 2, 2
15099 };
15100  
15101 static const char _url_detector_cond_lengths[] = {
15102 0, 0, 0, 0, 0, 0, 0, 0,
15103 0, 0, 0, 1, 0, 0, 0, 0,
15104 0, 0, 0, 0, 0, 0, 0, 0,
15105 0, 0, 0, 0, 0, 0, 0, 0,
15106 0, 0, 0, 0, 0, 0, 0, 0,
15107 0, 0, 0, 0, 0, 0, 0, 0,
15108 0, 0, 0, 0, 0, 0, 0, 0,
15109 0, 0, 0, 0, 0, 0, 0, 0,
15110 0, 0, 0, 0, 0, 0, 0, 0,
15111 0, 0, 0, 0, 0, 0, 0, 0,
15112 0, 0, 0, 0, 0, 0, 0, 0,
15113 0, 0, 0, 0, 0, 0, 0, 0,
15114 0, 0, 0, 0, 0, 0, 0, 0,
15115 0, 0, 0, 0, 0, 0, 0, 0,
15116 0, 0, 0, 0, 0, 0, 0, 0,
15117 0, 0, 0, 0, 0, 0, 0, 0,
15118 0, 0, 0, 0, 0, 0, 0, 0,
15119 0, 0, 0, 0, 0, 0, 0, 0,
15120 0, 0, 0, 0, 0, 0, 0, 0,
15121 0, 0, 0, 0, 0, 0, 0, 0,
15122 0, 0, 0, 0, 0, 0, 0, 0,
15123 0, 0, 0, 0, 0, 0, 0, 0,
15124 0, 0, 0, 0, 0, 0, 0, 0,
15125 0, 0, 0, 0, 0, 0, 0, 0,
15126 0, 0, 0, 0, 0, 0, 0, 0,
15127 0, 0, 0, 0, 0, 0, 0, 0,
15128 0, 0, 0, 0, 0, 0, 0, 0,
15129 0, 0, 0, 0, 0, 0, 0, 0,
15130 0, 0, 0, 0, 0, 0, 0, 0,
15131 0, 0, 0, 0, 0, 0, 0, 0,
15132 0, 0, 0, 0, 0, 0, 0, 0,
15133 0, 0, 0, 0, 0, 0, 0, 0,
15134 0, 0, 0, 0, 0, 0, 0, 0,
15135 0, 0, 0, 0, 0, 0, 0, 0,
15136 0, 0, 0, 0, 0, 0, 0, 0,
15137 0, 0, 0, 0, 0, 0, 0, 0,
15138 0, 0, 0, 0, 0, 0, 0, 0,
15139 0, 0, 0, 0, 0, 0, 0, 0,
15140 0, 0, 0, 0, 0, 0, 0, 0,
15141 0, 0, 0, 0, 0, 0, 0, 0,
15142 0, 0, 0, 0, 0, 0, 0, 0,
15143 0, 0, 0, 0, 0, 0, 0, 0,
15144 0, 0, 0, 0, 0, 0, 0, 0,
15145 0, 0, 0, 0, 0, 0, 0, 0,
15146 0, 0, 0, 0, 0, 0, 0, 0,
15147 0, 0, 0, 0, 0, 0, 0, 0,
15148 1, 0, 0, 0, 0, 0, 0, 0,
15149 0, 0, 0, 0, 0, 0, 0, 0,
15150 0, 0, 0, 0, 0, 0, 0, 0,
15151 0, 0
15152 };
15153  
15154 static const short _url_detector_cond_keys[] = {
15155 41u, 41u, 41u, 41u, 0
15156 };
15157  
15158 static const char _url_detector_cond_spaces[] = {
15159 0, 0, 0
15160 };
15161  
15162 static const short _url_detector_key_offsets[] = {
15163 0, 0, 15, 29, 41, 54, 63, 71,
15164 78, 86, 92, 100, 153, 161, 167, 169,
15165 177, 184, 192, 196, 200, 204, 209, 214,
15166 223, 227, 231, 240, 242, 246, 248, 251,
15167 283, 285, 287, 289, 291, 297, 312, 327,
15168 346, 358, 374, 386, 402, 418, 439, 449,
15169 461, 477, 491, 506, 516, 529, 538, 550,
15170 552, 556, 577, 586, 596, 602, 608, 609,
15171 653, 657, 661, 669, 680, 690, 697, 703,
15172 709, 713, 717, 719, 723, 727, 731, 737,
15173 745, 754, 760, 762, 766, 768, 774, 778,
15174 782, 786, 790, 795, 802, 808, 810, 814,
15175 820, 824, 830, 841, 846, 860, 880, 885,
15176 889, 891, 907, 912, 914, 916, 918, 920,
15177 922, 926, 930, 935, 941, 945, 955, 965,
15178 966, 979, 987, 995, 999, 1003, 1009, 1011,
15179 1013, 1017, 1021, 1026, 1028, 1031, 1033, 1055,
15180 1057, 1059, 1063, 1068, 1072, 1078, 1080, 1084,
15181 1092, 1096, 1100, 1105, 1107, 1115, 1123, 1135,
15182 1141, 1147, 1151, 1155, 1159, 1178, 1180, 1191,
15183 1197, 1199, 1201, 1205, 1209, 1213, 1217, 1219,
15184 1223, 1227, 1229, 1237, 1253, 1295, 1304, 1308,
15185 1310, 1312, 1314, 1316, 1317, 1321, 1325, 1329,
15186 1335, 1339, 1343, 1345, 1349, 1358, 1364, 1368,
15187 1374, 1378, 1382, 1395, 1399, 1401, 1407, 1413,
15188 1417, 1419, 1421, 1425, 1427, 1452, 1457, 1461,
15189 1465, 1468, 1477, 1481, 1492, 1496, 1512, 1526,
15190 1531, 1535, 1538, 1542, 1548, 1551, 1558, 1560,
15191 1562, 1565, 1568, 1570, 1581, 1585, 1589, 1599,
15192 1601, 1605, 1607, 1611, 1613, 1617, 1623, 1643,
15193 1649, 1655, 1657, 1659, 1663, 1677, 1681, 1693,
15194 1700, 1704, 1711, 1717, 1723, 1729, 1735, 1739,
15195 1742, 1747, 1753, 1757, 1771, 1797, 1807, 1808,
15196 1811, 1813, 1817, 1819, 1822, 1824, 1827, 1829,
15197 1830, 1833, 1835, 1837, 1846, 1854, 1863, 1871,
15198 1880, 1888, 1896, 1907, 1917, 1925, 1933, 1944,
15199 1954, 1962, 1970, 1981, 1991, 2000, 2008, 2015,
15200 2023, 2029, 2037, 2046, 2054, 2063, 2071, 2080,
15201 2088, 2096, 2107, 2117, 2125, 2133, 2144, 2154,
15202 2162, 2170, 2181, 2191, 2207, 2222, 2238, 2252,
15203 2268, 2280, 2297, 2313, 2330, 2346, 2363, 2379,
15204 2395, 2414, 2432, 2448, 2464, 2483, 2501, 2517,
15205 2533, 2552, 2570, 2586, 2602, 2618, 2629, 2630,
15206 2645, 2659, 2675, 2690, 2706, 2720, 2736, 2753,
15207 2769, 2786, 2802, 2819, 2835, 2851, 2870, 2888,
15208 2904, 2920, 2939, 2957, 2973, 2989, 3008, 3026,
15209 3036, 3089, 3092, 3102, 3112, 3122, 3135, 3147,
15210 3157, 3167, 3177, 3187, 3200, 3212, 3229, 3243,
15211 3260, 3277, 3294, 3314, 3333, 3350, 3367, 3384,
15212 3401, 3421
15213 };
15214  
15215 static const short _url_detector_trans_keys[] = {
15216 33u, 48u, 49u, 50u, 95u, 36u, 37u, 39u,
15217 46u, 51u, 57u, 65u, 90u, 97u, 122u, 33u,
15218 58u, 64u, 95u, 36u, 37u, 39u, 46u, 48u,
15219 57u, 65u, 90u, 97u, 122u, 33u, 95u, 36u,
15220 37u, 39u, 46u, 48u, 57u, 65u, 90u, 97u,
15221 122u, 33u, 64u, 95u, 36u, 37u, 39u, 46u,
15222 48u, 57u, 65u, 90u, 97u, 122u, 48u, 49u,
15223 50u, 51u, 57u, 65u, 90u, 97u, 122u, 45u,
15224 46u, 48u, 57u, 65u, 90u, 97u, 122u, 45u,
15225 48u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
15226 48u, 57u, 65u, 90u, 97u, 122u, 48u, 57u,
15227 65u, 90u, 97u, 122u, 45u, 46u, 48u, 57u,
15228 65u, 90u, 97u, 122u, 33u, 39u, 40u, 44u,
15229 46u, 61u, 63u, 95u, 194u, 195u, 203u, 205u,
15230 206u, 207u, 210u, 212u, 213u, 214u, 215u, 216u,
15231 217u, 219u, 220u, 221u, 222u, 223u, 224u, 225u,
15232 226u, 227u, 228u, 233u, 234u, 237u, 239u, 240u,
15233 243u, 297u, 553u, 36u, 38u, 42u, 57u, 58u,
15234 59u, 64u, 90u, 97u, 122u, 196u, 218u, 229u,
15235 236u, 170u, 181u, 178u, 179u, 185u, 186u, 188u,
15236 190u, 128u, 150u, 152u, 182u, 184u, 191u, 128u,
15237 191u, 172u, 174u, 128u, 129u, 134u, 145u, 160u,
15238 164u, 191u, 128u, 180u, 182u, 183u, 186u, 189u,
15239 134u, 140u, 136u, 138u, 142u, 161u, 163u, 191u,
15240 128u, 181u, 183u, 191u, 128u, 129u, 131u, 191u,
15241 128u, 175u, 177u, 191u, 153u, 128u, 150u, 161u,
15242 191u, 191u, 128u, 135u, 145u, 189u, 135u, 129u,
15243 130u, 132u, 133u, 144u, 170u, 176u, 178u, 144u,
15244 154u, 160u, 191u, 128u, 169u, 174u, 191u, 191u,
15245 128u, 147u, 149u, 156u, 159u, 168u, 170u, 188u,
15246 144u, 191u, 128u, 138u, 141u, 191u, 128u, 177u,
15247 186u, 128u, 181u, 160u, 161u, 162u, 163u, 164u,
15248 165u, 166u, 167u, 168u, 169u, 170u, 171u, 172u,
15249 173u, 174u, 175u, 176u, 177u, 178u, 179u, 180u,
15250 181u, 182u, 183u, 184u, 185u, 186u, 187u, 188u,
15251 189u, 190u, 191u, 128u, 173u, 128u, 155u, 160u,
15252 180u, 163u, 191u, 128u, 163u, 166u, 175u, 177u,
15253 191u, 178u, 128u, 131u, 133u, 140u, 143u, 144u,
15254 147u, 168u, 170u, 176u, 182u, 185u, 188u, 191u,
15255 151u, 128u, 132u, 135u, 136u, 139u, 142u, 156u,
15256 157u, 159u, 163u, 166u, 177u, 180u, 185u, 188u,
15257 129u, 131u, 133u, 138u, 143u, 144u, 147u, 168u,
15258 170u, 176u, 178u, 179u, 181u, 182u, 184u, 185u,
15259 190u, 191u, 145u, 158u, 128u, 130u, 135u, 136u,
15260 139u, 141u, 153u, 156u, 166u, 181u, 129u, 131u,
15261 133u, 141u, 143u, 145u, 147u, 168u, 170u, 176u,
15262 178u, 179u, 181u, 185u, 188u, 191u, 144u, 185u,
15263 128u, 133u, 135u, 137u, 139u, 141u, 160u, 163u,
15264 166u, 175u, 129u, 131u, 133u, 140u, 143u, 144u,
15265 147u, 168u, 170u, 176u, 178u, 179u, 181u, 185u,
15266 188u, 191u, 128u, 132u, 135u, 136u, 139u, 141u,
15267 150u, 151u, 156u, 157u, 159u, 163u, 166u, 175u,
15268 177u, 183u, 156u, 130u, 131u, 133u, 138u, 142u,
15269 144u, 146u, 149u, 153u, 154u, 158u, 159u, 163u,
15270 164u, 168u, 170u, 174u, 185u, 190u, 191u, 144u,
15271 151u, 128u, 130u, 134u, 136u, 138u, 141u, 166u,
15272 178u, 128u, 131u, 133u, 140u, 142u, 144u, 146u,
15273 168u, 170u, 185u, 189u, 191u, 128u, 132u, 134u,
15274 136u, 138u, 141u, 149u, 150u, 152u, 154u, 160u,
15275 163u, 166u, 175u, 184u, 190u, 129u, 131u, 133u,
15276 140u, 142u, 144u, 146u, 168u, 170u, 179u, 181u,
15277 185u, 188u, 191u, 158u, 128u, 132u, 134u, 136u,
15278 138u, 141u, 149u, 150u, 160u, 163u, 166u, 175u,
15279 177u, 178u, 129u, 131u, 133u, 140u, 142u, 144u,
15280 146u, 186u, 189u, 191u, 151u, 128u, 132u, 134u,
15281 136u, 138u, 142u, 159u, 163u, 166u, 181u, 186u,
15282 191u, 189u, 130u, 131u, 133u, 150u, 154u, 177u,
15283 179u, 187u, 138u, 150u, 128u, 134u, 143u, 148u,
15284 152u, 159u, 166u, 175u, 178u, 179u, 129u, 186u,
15285 128u, 142u, 144u, 153u, 132u, 138u, 141u, 165u,
15286 167u, 129u, 130u, 135u, 136u, 148u, 151u, 153u,
15287 159u, 161u, 163u, 170u, 171u, 173u, 185u, 187u,
15288 189u, 134u, 128u, 132u, 136u, 141u, 144u, 153u,
15289 156u, 159u, 128u, 181u, 183u, 185u, 152u, 153u,
15290 160u, 179u, 190u, 191u, 128u, 135u, 137u, 172u,
15291 177u, 191u, 128u, 132u, 134u, 151u, 153u, 188u,
15292 134u, 129u, 130u, 131u, 137u, 138u, 139u, 140u,
15293 141u, 142u, 143u, 144u, 153u, 154u, 155u, 156u,
15294 157u, 159u, 160u, 161u, 162u, 163u, 164u, 165u,
15295 166u, 167u, 168u, 169u, 170u, 173u, 175u, 176u,
15296 177u, 179u, 183u, 188u, 189u, 190u, 191u, 128u,
15297 158u, 172u, 174u, 180u, 187u, 128u, 137u, 144u,
15298 191u, 128u, 157u, 160u, 191u, 135u, 141u, 128u,
15299 133u, 144u, 186u, 188u, 191u, 152u, 128u, 136u,
15300 138u, 141u, 144u, 150u, 154u, 157u, 160u, 191u,
15301 128u, 136u, 138u, 141u, 144u, 176u, 178u, 181u,
15302 184u, 190u, 128u, 130u, 133u, 136u, 150u, 152u,
15303 191u, 128u, 144u, 146u, 149u, 152u, 191u, 128u,
15304 154u, 157u, 159u, 169u, 188u, 128u, 143u, 160u,
15305 191u, 128u, 181u, 184u, 189u, 129u, 191u, 128u,
15306 172u, 175u, 191u, 129u, 154u, 160u, 191u, 128u,
15307 170u, 174u, 184u, 128u, 140u, 142u, 148u, 160u,
15308 180u, 128u, 147u, 160u, 172u, 174u, 176u, 178u,
15309 179u, 151u, 128u, 147u, 156u, 157u, 160u, 169u,
15310 176u, 185u, 139u, 141u, 144u, 153u, 160u, 191u,
15311 128u, 183u, 128u, 170u, 176u, 191u, 128u, 181u,
15312 128u, 158u, 160u, 171u, 176u, 187u, 134u, 173u,
15313 176u, 180u, 128u, 171u, 176u, 191u, 128u, 137u,
15314 144u, 154u, 128u, 155u, 160u, 191u, 191u, 128u,
15315 158u, 160u, 188u, 167u, 128u, 137u, 144u, 153u,
15316 176u, 190u, 128u, 139u, 144u, 153u, 171u, 179u,
15317 128u, 179u, 128u, 137u, 141u, 189u, 144u, 146u,
15318 148u, 182u, 184u, 185u, 128u, 181u, 188u, 191u,
15319 128u, 149u, 152u, 157u, 160u, 191u, 153u, 155u,
15320 157u, 128u, 133u, 136u, 141u, 144u, 151u, 159u,
15321 189u, 190u, 128u, 180u, 182u, 188u, 130u, 132u,
15322 134u, 140u, 144u, 147u, 150u, 155u, 160u, 172u,
15323 178u, 180u, 182u, 188u, 129u, 130u, 131u, 132u,
15324 133u, 134u, 145u, 146u, 147u, 157u, 158u, 176u,
15325 177u, 178u, 179u, 180u, 181u, 182u, 183u, 184u,
15326 191u, 176u, 177u, 180u, 185u, 128u, 137u, 144u,
15327 156u, 144u, 176u, 130u, 135u, 149u, 164u, 166u,
15328 168u, 138u, 147u, 153u, 157u, 170u, 173u, 175u,
15329 185u, 188u, 191u, 142u, 133u, 137u, 144u, 191u,
15330 128u, 137u, 160u, 191u, 170u, 191u, 182u, 191u,
15331 128u, 147u, 128u, 174u, 176u, 191u, 128u, 158u,
15332 160u, 191u, 189u, 128u, 164u, 171u, 179u, 167u,
15333 173u, 128u, 165u, 176u, 191u, 175u, 191u, 128u,
15334 167u, 128u, 150u, 160u, 166u, 168u, 174u, 176u,
15335 182u, 184u, 190u, 128u, 134u, 136u, 142u, 144u,
15336 150u, 152u, 158u, 160u, 191u, 175u, 128u, 129u,
15337 130u, 131u, 132u, 133u, 134u, 135u, 136u, 137u,
15338 138u, 144u, 191u, 133u, 135u, 161u, 175u, 177u,
15339 181u, 184u, 188u, 128u, 150u, 153u, 154u, 157u,
15340 159u, 161u, 191u, 128u, 186u, 188u, 191u, 133u,
15341 173u, 177u, 191u, 128u, 142u, 146u, 149u, 160u,
15342 186u, 176u, 191u, 160u, 169u, 136u, 143u, 145u,
15343 159u, 128u, 137u, 177u, 191u, 182u, 128u, 181u,
15344 184u, 191u, 128u, 191u, 191u, 128u, 190u, 128u,
15345 149u, 146u, 147u, 152u, 153u, 155u, 156u, 158u,
15346 159u, 160u, 161u, 163u, 164u, 165u, 167u, 168u,
15347 169u, 171u, 172u, 173u, 175u, 128u, 191u, 128u,
15348 140u, 144u, 189u, 128u, 140u, 144u, 171u, 191u,
15349 128u, 178u, 180u, 189u, 151u, 159u, 162u, 191u,
15350 128u, 136u, 139u, 173u, 176u, 183u, 183u, 191u,
15351 128u, 167u, 176u, 181u, 187u, 189u, 128u, 132u,
15352 144u, 153u, 160u, 183u, 128u, 173u, 176u, 191u,
15353 128u, 147u, 160u, 188u, 128u, 143u, 153u, 160u,
15354 190u, 128u, 182u, 128u, 141u, 144u, 153u, 160u,
15355 182u, 186u, 191u, 128u, 130u, 155u, 157u, 160u,
15356 175u, 178u, 182u, 129u, 134u, 137u, 142u, 145u,
15357 150u, 160u, 166u, 168u, 174u, 176u, 191u, 128u,
15358 154u, 156u, 165u, 176u, 191u, 128u, 170u, 172u,
15359 173u, 176u, 185u, 158u, 159u, 128u, 157u, 128u,
15360 163u, 176u, 191u, 128u, 134u, 139u, 187u, 169u,
15361 171u, 172u, 173u, 174u, 175u, 180u, 181u, 182u,
15362 183u, 184u, 185u, 187u, 188u, 189u, 190u, 191u,
15363 164u, 186u, 128u, 153u, 190u, 128u, 134u, 147u,
15364 151u, 157u, 168u, 170u, 182u, 184u, 188u, 128u,
15365 129u, 131u, 132u, 134u, 191u, 147u, 191u, 128u,
15366 189u, 128u, 143u, 146u, 191u, 128u, 135u, 176u,
15367 187u, 128u, 143u, 160u, 175u, 176u, 180u, 182u,
15368 191u, 128u, 188u, 144u, 153u, 161u, 186u, 129u,
15369 154u, 166u, 191u, 128u, 190u, 130u, 135u, 138u,
15370 143u, 146u, 151u, 154u, 156u, 144u, 145u, 146u,
15371 147u, 148u, 150u, 155u, 157u, 158u, 159u, 170u,
15372 171u, 172u, 175u, 160u, 169u, 128u, 129u, 130u,
15373 131u, 132u, 133u, 134u, 135u, 138u, 139u, 140u,
15374 141u, 142u, 143u, 146u, 148u, 149u, 156u, 157u,
15375 160u, 161u, 162u, 163u, 164u, 166u, 167u, 168u,
15376 169u, 170u, 171u, 172u, 173u, 174u, 176u, 177u,
15377 178u, 179u, 185u, 144u, 145u, 152u, 155u, 191u,
15378 128u, 139u, 141u, 166u, 168u, 186u, 188u, 189u,
15379 128u, 141u, 144u, 157u, 128u, 186u, 135u, 179u,
15380 128u, 184u, 138u, 139u, 189u, 128u, 156u, 160u,
15381 191u, 128u, 144u, 160u, 187u, 128u, 138u, 144u,
15382 186u, 128u, 131u, 136u, 143u, 145u, 149u, 128u,
15383 157u, 160u, 169u, 128u, 167u, 176u, 191u, 128u,
15384 163u, 128u, 149u, 160u, 167u, 136u, 188u, 191u,
15385 128u, 133u, 138u, 181u, 183u, 184u, 128u, 149u,
15386 152u, 182u, 185u, 191u, 128u, 158u, 167u, 175u,
15387 160u, 178u, 180u, 181u, 187u, 191u, 128u, 155u,
15388 160u, 185u, 128u, 183u, 188u, 191u, 191u, 128u,
15389 131u, 133u, 134u, 140u, 147u, 149u, 151u, 153u,
15390 179u, 184u, 186u, 128u, 135u, 160u, 190u, 128u,
15391 159u, 128u, 135u, 137u, 166u, 171u, 175u, 128u,
15392 149u, 152u, 178u, 184u, 191u, 128u, 145u, 169u,
15393 175u, 128u, 136u, 128u, 178u, 128u, 178u, 186u,
15394 191u, 160u, 190u, 129u, 130u, 131u, 132u, 133u,
15395 135u, 136u, 138u, 139u, 140u, 141u, 146u, 147u,
15396 150u, 151u, 152u, 153u, 154u, 155u, 156u, 162u,
15397 163u, 171u, 128u, 134u, 191u, 128u, 134u, 146u,
15398 175u, 144u, 168u, 176u, 185u, 128u, 180u, 182u,
15399 191u, 182u, 144u, 179u, 156u, 128u, 132u, 138u,
15400 140u, 144u, 154u, 161u, 180u, 128u, 145u, 147u,
15401 183u, 136u, 128u, 134u, 138u, 141u, 143u, 157u,
15402 159u, 168u, 176u, 191u, 128u, 170u, 176u, 185u,
15403 128u, 131u, 133u, 140u, 143u, 144u, 147u, 168u,
15404 170u, 176u, 178u, 179u, 181u, 185u, 188u, 191u,
15405 144u, 151u, 128u, 132u, 135u, 136u, 139u, 141u,
15406 157u, 163u, 166u, 172u, 176u, 180u, 135u, 128u,
15407 133u, 144u, 153u, 128u, 181u, 184u, 191u, 128u,
15408 152u, 157u, 128u, 132u, 144u, 153u, 128u, 153u,
15409 157u, 171u, 176u, 187u, 191u, 128u, 178u, 142u,
15410 145u, 149u, 128u, 141u, 144u, 148u, 128u, 174u,
15411 128u, 131u, 144u, 128u, 143u, 153u, 144u, 152u,
15412 128u, 134u, 168u, 169u, 171u, 172u, 173u, 174u,
15413 188u, 189u, 190u, 160u, 167u, 128u, 158u, 160u,
15414 169u, 144u, 173u, 176u, 180u, 128u, 131u, 144u,
15415 153u, 155u, 161u, 163u, 183u, 189u, 191u, 128u,
15416 143u, 128u, 132u, 144u, 190u, 143u, 159u, 128u,
15417 176u, 177u, 178u, 128u, 129u, 128u, 170u, 176u,
15418 188u, 128u, 136u, 144u, 153u, 157u, 158u, 133u,
15419 134u, 137u, 141u, 145u, 146u, 147u, 148u, 149u,
15420 154u, 155u, 156u, 157u, 158u, 159u, 168u, 169u,
15421 170u, 144u, 153u, 165u, 169u, 173u, 178u, 187u,
15422 191u, 128u, 130u, 133u, 139u, 170u, 173u, 130u,
15423 132u, 160u, 177u, 128u, 148u, 150u, 191u, 162u,
15424 187u, 128u, 156u, 158u, 159u, 165u, 166u, 169u,
15425 172u, 174u, 185u, 189u, 191u, 128u, 131u, 133u,
15426 191u, 128u, 133u, 135u, 138u, 141u, 148u, 150u,
15427 156u, 158u, 185u, 187u, 190u, 134u, 128u, 132u,
15428 138u, 144u, 146u, 191u, 128u, 165u, 168u, 191u,
15429 128u, 130u, 154u, 156u, 186u, 188u, 191u, 128u,
15430 148u, 150u, 180u, 182u, 191u, 128u, 142u, 144u,
15431 174u, 176u, 191u, 128u, 136u, 138u, 168u, 170u,
15432 191u, 128u, 130u, 132u, 139u, 142u, 191u, 128u,
15433 182u, 187u, 191u, 181u, 128u, 172u, 132u, 155u,
15434 159u, 161u, 175u, 163u, 184u, 185u, 186u, 160u,
15435 162u, 128u, 132u, 135u, 150u, 164u, 167u, 185u,
15436 187u, 128u, 131u, 133u, 159u, 161u, 162u, 169u,
15437 178u, 180u, 183u, 130u, 135u, 137u, 139u, 148u,
15438 151u, 153u, 155u, 157u, 159u, 164u, 190u, 141u,
15439 143u, 145u, 146u, 161u, 162u, 167u, 170u, 172u,
15440 178u, 180u, 183u, 185u, 188u, 128u, 137u, 139u,
15441 155u, 161u, 163u, 165u, 169u, 171u, 187u, 132u,
15442 155u, 128u, 191u, 128u, 150u, 156u, 160u, 128u,
15443 191u, 128u, 180u, 186u, 128u, 185u, 128u, 161u,
15444 168u, 160u, 167u, 128u, 157u, 160u, 135u, 132u,
15445 134u, 128u, 175u, 48u, 57u, 48u, 49u, 50u,
15446 51u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
15447 48u, 57u, 65u, 90u, 97u, 122u, 48u, 49u,
15448 50u, 51u, 57u, 65u, 90u, 97u, 122u, 45u,
15449 46u, 48u, 57u, 65u, 90u, 97u, 122u, 48u,
15450 49u, 50u, 51u, 57u, 65u, 90u, 97u, 122u,
15451 45u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15452 45u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15453 45u, 46u, 53u, 48u, 52u, 54u, 57u, 65u,
15454 90u, 97u, 122u, 45u, 46u, 48u, 53u, 54u,
15455 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15456 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15457 57u, 65u, 90u, 97u, 122u, 45u, 46u, 53u,
15458 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
15459 45u, 46u, 48u, 53u, 54u, 57u, 65u, 90u,
15460 97u, 122u, 45u, 46u, 48u, 57u, 65u, 90u,
15461 97u, 122u, 45u, 46u, 48u, 57u, 65u, 90u,
15462 97u, 122u, 45u, 46u, 53u, 48u, 52u, 54u,
15463 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15464 53u, 54u, 57u, 65u, 90u, 97u, 122u, 48u,
15465 49u, 50u, 51u, 57u, 65u, 90u, 97u, 122u,
15466 45u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15467 45u, 48u, 57u, 65u, 90u, 97u, 122u, 45u,
15468 46u, 48u, 57u, 65u, 90u, 97u, 122u, 48u,
15469 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15470 57u, 65u, 90u, 97u, 122u, 48u, 49u, 50u,
15471 51u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
15472 48u, 57u, 65u, 90u, 97u, 122u, 48u, 49u,
15473 50u, 51u, 57u, 65u, 90u, 97u, 122u, 45u,
15474 46u, 48u, 57u, 65u, 90u, 97u, 122u, 48u,
15475 49u, 50u, 51u, 57u, 65u, 90u, 97u, 122u,
15476 45u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15477 45u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15478 45u, 46u, 53u, 48u, 52u, 54u, 57u, 65u,
15479 90u, 97u, 122u, 45u, 46u, 48u, 53u, 54u,
15480 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15481 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15482 57u, 65u, 90u, 97u, 122u, 45u, 46u, 53u,
15483 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
15484 45u, 46u, 48u, 53u, 54u, 57u, 65u, 90u,
15485 97u, 122u, 45u, 46u, 48u, 57u, 65u, 90u,
15486 97u, 122u, 45u, 46u, 48u, 57u, 65u, 90u,
15487 97u, 122u, 45u, 46u, 53u, 48u, 52u, 54u,
15488 57u, 65u, 90u, 97u, 122u, 45u, 46u, 48u,
15489 53u, 54u, 57u, 65u, 90u, 97u, 122u, 33u,
15490 45u, 46u, 58u, 64u, 95u, 36u, 37u, 39u,
15491 44u, 48u, 57u, 65u, 90u, 97u, 122u, 33u,
15492 45u, 58u, 64u, 95u, 36u, 37u, 39u, 46u,
15493 48u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
15494 46u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15495 48u, 57u, 65u, 90u, 97u, 122u, 33u, 58u,
15496 64u, 95u, 36u, 37u, 39u, 46u, 48u, 57u,
15497 65u, 90u, 97u, 122u, 33u, 45u, 46u, 58u,
15498 64u, 95u, 36u, 37u, 39u, 44u, 48u, 57u,
15499 65u, 90u, 97u, 122u, 33u, 95u, 36u, 37u,
15500 39u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15501 33u, 48u, 49u, 50u, 58u, 64u, 95u, 36u,
15502 37u, 39u, 46u, 51u, 57u, 65u, 90u, 97u,
15503 122u, 33u, 45u, 46u, 58u, 64u, 95u, 36u,
15504 37u, 39u, 44u, 48u, 57u, 65u, 90u, 97u,
15505 122u, 33u, 48u, 49u, 50u, 58u, 64u, 95u,
15506 36u, 37u, 39u, 46u, 51u, 57u, 65u, 90u,
15507 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
15508 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
15509 97u, 122u, 33u, 48u, 49u, 50u, 58u, 64u,
15510 95u, 36u, 37u, 39u, 46u, 51u, 57u, 65u,
15511 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15512 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
15513 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15514 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
15515 90u, 97u, 122u, 33u, 45u, 46u, 53u, 58u,
15516 64u, 95u, 36u, 37u, 39u, 44u, 48u, 52u,
15517 54u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
15518 46u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15519 48u, 53u, 54u, 57u, 65u, 90u, 97u, 122u,
15520 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15521 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
15522 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15523 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
15524 33u, 45u, 46u, 53u, 58u, 64u, 95u, 36u,
15525 37u, 39u, 44u, 48u, 52u, 54u, 57u, 65u,
15526 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15527 95u, 36u, 37u, 39u, 44u, 48u, 53u, 54u,
15528 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15529 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
15530 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15531 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
15532 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15533 53u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15534 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
15535 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15536 39u, 44u, 48u, 53u, 54u, 57u, 65u, 90u,
15537 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
15538 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
15539 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
15540 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
15541 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
15542 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
15543 97u, 122u, 33u, 47u, 95u, 36u, 37u, 39u,
15544 57u, 65u, 90u, 97u, 122u, 47u, 33u, 48u,
15545 49u, 50u, 95u, 36u, 37u, 39u, 46u, 51u,
15546 57u, 65u, 90u, 97u, 122u, 33u, 58u, 64u,
15547 95u, 36u, 37u, 39u, 46u, 48u, 57u, 65u,
15548 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15549 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
15550 90u, 97u, 122u, 33u, 45u, 58u, 64u, 95u,
15551 36u, 37u, 39u, 46u, 48u, 57u, 65u, 90u,
15552 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
15553 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
15554 97u, 122u, 33u, 58u, 64u, 95u, 36u, 37u,
15555 39u, 46u, 48u, 57u, 65u, 90u, 97u, 122u,
15556 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15557 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
15558 33u, 48u, 49u, 50u, 58u, 64u, 95u, 36u,
15559 37u, 39u, 46u, 51u, 57u, 65u, 90u, 97u,
15560 122u, 33u, 45u, 46u, 58u, 64u, 95u, 36u,
15561 37u, 39u, 44u, 48u, 57u, 65u, 90u, 97u,
15562 122u, 33u, 48u, 49u, 50u, 58u, 64u, 95u,
15563 36u, 37u, 39u, 46u, 51u, 57u, 65u, 90u,
15564 97u, 122u, 33u, 45u, 46u, 58u, 64u, 95u,
15565 36u, 37u, 39u, 44u, 48u, 57u, 65u, 90u,
15566 97u, 122u, 33u, 48u, 49u, 50u, 58u, 64u,
15567 95u, 36u, 37u, 39u, 46u, 51u, 57u, 65u,
15568 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15569 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
15570 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15571 95u, 36u, 37u, 39u, 44u, 48u, 57u, 65u,
15572 90u, 97u, 122u, 33u, 45u, 46u, 53u, 58u,
15573 64u, 95u, 36u, 37u, 39u, 44u, 48u, 52u,
15574 54u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
15575 46u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15576 48u, 53u, 54u, 57u, 65u, 90u, 97u, 122u,
15577 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15578 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
15579 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15580 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
15581 33u, 45u, 46u, 53u, 58u, 64u, 95u, 36u,
15582 37u, 39u, 44u, 48u, 52u, 54u, 57u, 65u,
15583 90u, 97u, 122u, 33u, 45u, 46u, 58u, 64u,
15584 95u, 36u, 37u, 39u, 44u, 48u, 53u, 54u,
15585 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15586 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
15587 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15588 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
15589 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15590 53u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15591 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
15592 33u, 45u, 46u, 58u, 64u, 95u, 36u, 37u,
15593 39u, 44u, 48u, 53u, 54u, 57u, 65u, 90u,
15594 97u, 122u, 45u, 46u, 47u, 58u, 48u, 57u,
15595 65u, 90u, 97u, 122u, 33u, 39u, 40u, 44u,
15596 46u, 61u, 63u, 95u, 194u, 195u, 203u, 205u,
15597 206u, 207u, 210u, 212u, 213u, 214u, 215u, 216u,
15598 217u, 219u, 220u, 221u, 222u, 223u, 224u, 225u,
15599 226u, 227u, 228u, 233u, 234u, 237u, 239u, 240u,
15600 243u, 297u, 553u, 36u, 38u, 42u, 57u, 58u,
15601 59u, 64u, 90u, 97u, 122u, 196u, 218u, 229u,
15602 236u, 47u, 48u, 57u, 45u, 46u, 47u, 58u,
15603 48u, 57u, 65u, 90u, 97u, 122u, 45u, 46u,
15604 47u, 58u, 48u, 57u, 65u, 90u, 97u, 122u,
15605 45u, 46u, 47u, 58u, 48u, 57u, 65u, 90u,
15606 97u, 122u, 45u, 46u, 47u, 53u, 58u, 48u,
15607 52u, 54u, 57u, 65u, 90u, 97u, 122u, 45u,
15608 46u, 47u, 58u, 48u, 53u, 54u, 57u, 65u,
15609 90u, 97u, 122u, 45u, 46u, 47u, 58u, 48u,
15610 57u, 65u, 90u, 97u, 122u, 45u, 46u, 47u,
15611 58u, 48u, 57u, 65u, 90u, 97u, 122u, 45u,
15612 46u, 47u, 58u, 48u, 57u, 65u, 90u, 97u,
15613 122u, 45u, 46u, 47u, 58u, 48u, 57u, 65u,
15614 90u, 97u, 122u, 45u, 46u, 47u, 53u, 58u,
15615 48u, 52u, 54u, 57u, 65u, 90u, 97u, 122u,
15616 45u, 46u, 47u, 58u, 48u, 53u, 54u, 57u,
15617 65u, 90u, 97u, 122u, 33u, 45u, 46u, 47u,
15618 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
15619 57u, 65u, 90u, 97u, 122u, 33u, 47u, 64u,
15620 95u, 36u, 37u, 39u, 46u, 48u, 57u, 65u,
15621 90u, 97u, 122u, 33u, 45u, 46u, 47u, 58u,
15622 64u, 95u, 36u, 37u, 39u, 44u, 48u, 57u,
15623 65u, 90u, 97u, 122u, 33u, 45u, 46u, 47u,
15624 58u, 64u, 95u, 36u, 37u, 39u, 44u, 48u,
15625 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15626 47u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15627 48u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
15628 46u, 47u, 53u, 58u, 64u, 95u, 36u, 37u,
15629 39u, 44u, 48u, 52u, 54u, 57u, 65u, 90u,
15630 97u, 122u, 33u, 45u, 46u, 47u, 58u, 64u,
15631 95u, 36u, 37u, 39u, 44u, 48u, 53u, 54u,
15632 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15633 47u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15634 48u, 57u, 65u, 90u, 97u, 122u, 33u, 45u,
15635 46u, 47u, 58u, 64u, 95u, 36u, 37u, 39u,
15636 44u, 48u, 57u, 65u, 90u, 97u, 122u, 33u,
15637 45u, 46u, 47u, 58u, 64u, 95u, 36u, 37u,
15638 39u, 44u, 48u, 57u, 65u, 90u, 97u, 122u,
15639 33u, 45u, 46u, 47u, 58u, 64u, 95u, 36u,
15640 37u, 39u, 44u, 48u, 57u, 65u, 90u, 97u,
15641 122u, 33u, 45u, 46u, 47u, 53u, 58u, 64u,
15642 95u, 36u, 37u, 39u, 44u, 48u, 52u, 54u,
15643 57u, 65u, 90u, 97u, 122u, 33u, 45u, 46u,
15644 47u, 58u, 64u, 95u, 36u, 37u, 39u, 44u,
15645 48u, 53u, 54u, 57u, 65u, 90u, 97u, 122u,
15646 0
15647 };
15648  
15649 static const char _url_detector_single_lengths[] = {
15650 0, 5, 4, 2, 3, 3, 2, 1,
15651 2, 0, 2, 39, 2, 0, 0, 2,
15652 1, 2, 0, 0, 0, 1, 1, 1,
15653 0, 0, 1, 0, 0, 0, 1, 32,
15654 0, 0, 0, 0, 0, 1, 1, 1,
15655 2, 0, 2, 0, 0, 1, 2, 0,
15656 0, 0, 1, 0, 1, 1, 2, 0,
15657 0, 5, 1, 4, 0, 0, 1, 38,
15658 0, 0, 2, 1, 0, 1, 0, 0,
15659 0, 0, 0, 0, 0, 0, 0, 0,
15660 1, 0, 0, 0, 0, 0, 0, 0,
15661 0, 0, 1, 1, 0, 0, 0, 0,
15662 0, 0, 3, 1, 0, 20, 1, 0,
15663 0, 6, 1, 0, 0, 0, 0, 0,
15664 0, 0, 1, 2, 2, 0, 0, 1,
15665 11, 0, 0, 0, 0, 0, 0, 0,
15666 0, 0, 1, 0, 1, 0, 20, 0,
15667 0, 0, 1, 0, 0, 0, 0, 2,
15668 0, 0, 1, 0, 0, 0, 0, 0,
15669 0, 2, 0, 0, 17, 0, 1, 0,
15670 0, 0, 0, 0, 0, 0, 0, 0,
15671 0, 0, 0, 14, 38, 1, 0, 0,
15672 0, 0, 0, 1, 0, 0, 0, 0,
15673 0, 0, 0, 0, 3, 0, 0, 0,
15674 0, 0, 1, 0, 0, 0, 0, 0,
15675 0, 0, 0, 0, 23, 1, 0, 0,
15676 1, 1, 0, 1, 0, 0, 2, 1,
15677 0, 1, 2, 0, 1, 3, 0, 0,
15678 1, 1, 0, 9, 0, 0, 0, 0,
15679 0, 0, 4, 0, 0, 0, 18, 0,
15680 0, 0, 0, 0, 2, 0, 0, 1,
15681 0, 1, 0, 0, 0, 0, 0, 1,
15682 1, 4, 0, 4, 12, 0, 1, 1,
15683 0, 2, 0, 1, 0, 1, 0, 1,
15684 1, 0, 0, 3, 2, 3, 2, 3,
15685 2, 2, 3, 2, 2, 2, 3, 2,
15686 2, 2, 3, 2, 3, 2, 1, 2,
15687 0, 2, 3, 2, 3, 2, 3, 2,
15688 2, 3, 2, 2, 2, 3, 2, 2,
15689 2, 3, 2, 6, 5, 6, 4, 6,
15690 2, 7, 6, 7, 6, 7, 6, 6,
15691 7, 6, 6, 6, 7, 6, 6, 6,
15692 7, 6, 6, 6, 6, 3, 1, 5,
15693 4, 6, 5, 6, 4, 6, 7, 6,
15694 7, 6, 7, 6, 6, 7, 6, 6,
15695 6, 7, 6, 6, 6, 7, 6, 4,
15696 39, 1, 4, 4, 4, 5, 4, 4,
15697 4, 4, 4, 5, 4, 7, 4, 7,
15698 7, 7, 8, 7, 7, 7, 7, 7,
15699 8, 7
15700 };
15701  
15702 static const char _url_detector_range_lengths[] = {
15703 0, 5, 5, 5, 5, 3, 3, 3,
15704 3, 3, 3, 7, 3, 3, 1, 3,
15705 3, 3, 2, 2, 2, 2, 2, 4,
15706 2, 2, 4, 1, 2, 1, 1, 0,
15707 1, 1, 1, 1, 3, 7, 7, 9,
15708 5, 8, 5, 8, 8, 10, 4, 6,
15709 8, 7, 7, 5, 6, 4, 5, 1,
15710 2, 8, 4, 3, 3, 3, 0, 3,
15711 2, 2, 3, 5, 5, 3, 3, 3,
15712 2, 2, 1, 2, 2, 2, 3, 4,
15713 4, 3, 1, 2, 1, 3, 2, 2,
15714 2, 2, 2, 3, 3, 1, 2, 3,
15715 2, 3, 4, 2, 7, 0, 2, 2,
15716 1, 5, 2, 1, 1, 1, 1, 1,
15717 2, 2, 2, 2, 1, 5, 5, 0,
15718 1, 4, 4, 2, 2, 3, 1, 1,
15719 2, 2, 2, 1, 1, 1, 1, 1,
15720 1, 2, 2, 2, 3, 1, 2, 3,
15721 2, 2, 2, 1, 4, 4, 6, 3,
15722 3, 1, 2, 2, 1, 1, 5, 3,
15723 1, 1, 2, 2, 2, 2, 1, 2,
15724 2, 1, 4, 1, 2, 4, 2, 1,
15725 1, 1, 1, 0, 2, 2, 2, 3,
15726 2, 2, 1, 2, 3, 3, 2, 3,
15727 2, 2, 6, 2, 1, 3, 3, 2,
15728 1, 1, 2, 1, 1, 2, 2, 2,
15729 1, 4, 2, 5, 2, 8, 6, 2,
15730 2, 1, 1, 3, 1, 2, 1, 1,
15731 1, 1, 1, 1, 2, 2, 5, 1,
15732 2, 1, 0, 1, 2, 3, 1, 3,
15733 3, 1, 1, 2, 6, 2, 6, 3,
15734 2, 3, 3, 3, 3, 3, 2, 1,
15735 2, 1, 2, 5, 7, 5, 0, 1,
15736 1, 1, 1, 1, 1, 1, 1, 0,
15737 1, 1, 1, 3, 3, 3, 3, 3,
15738 3, 3, 4, 4, 3, 3, 4, 4,
15739 3, 3, 4, 4, 3, 3, 3, 3,
15740 3, 3, 3, 3, 3, 3, 3, 3,
15741 3, 4, 4, 3, 3, 4, 4, 3,
15742 3, 4, 4, 5, 5, 5, 5, 5,
15743 5, 5, 5, 5, 5, 5, 5, 5,
15744 6, 6, 5, 5, 6, 6, 5, 5,
15745 6, 6, 5, 5, 5, 4, 0, 5,
15746 5, 5, 5, 5, 5, 5, 5, 5,
15747 5, 5, 5, 5, 5, 6, 6, 5,
15748 5, 6, 6, 5, 5, 6, 6, 3,
15749 7, 1, 3, 3, 3, 4, 4, 3,
15750 3, 3, 3, 4, 4, 5, 5, 5,
15751 5, 5, 6, 6, 5, 5, 5, 5,
15752 6, 6
15753 };
15754  
15755 static const short _url_detector_index_offsets[] = {
15756 0, 0, 11, 21, 29, 38, 45, 51,
15757 56, 62, 66, 72, 119, 125, 129, 131,
15758 137, 142, 148, 151, 154, 157, 161, 165,
15759 171, 174, 177, 183, 185, 188, 190, 193,
15760 226, 228, 230, 232, 234, 238, 247, 256,
15761 267, 275, 284, 292, 301, 310, 322, 329,
15762 336, 345, 353, 362, 368, 376, 382, 390,
15763 392, 395, 409, 415, 423, 427, 431, 433,
15764 475, 478, 481, 487, 494, 500, 505, 509,
15765 513, 516, 519, 521, 524, 527, 530, 534,
15766 539, 545, 549, 551, 554, 556, 560, 563,
15767 566, 569, 572, 576, 581, 585, 587, 590,
15768 594, 597, 601, 609, 613, 621, 642, 646,
15769 649, 651, 663, 667, 669, 671, 673, 675,
15770 677, 680, 683, 687, 692, 696, 702, 708,
15771 710, 723, 728, 733, 736, 739, 743, 745,
15772 747, 750, 753, 757, 759, 762, 764, 786,
15773 788, 790, 793, 797, 800, 804, 806, 809,
15774 815, 818, 821, 825, 827, 832, 837, 844,
15775 848, 852, 856, 859, 862, 881, 883, 890,
15776 894, 896, 898, 901, 904, 907, 910, 912,
15777 915, 918, 920, 925, 941, 982, 988, 991,
15778 993, 995, 997, 999, 1001, 1004, 1007, 1010,
15779 1014, 1017, 1020, 1022, 1025, 1032, 1036, 1039,
15780 1043, 1046, 1049, 1057, 1060, 1062, 1066, 1070,
15781 1073, 1075, 1077, 1080, 1082, 1107, 1111, 1114,
15782 1117, 1120, 1126, 1129, 1136, 1139, 1148, 1157,
15783 1161, 1164, 1167, 1171, 1175, 1178, 1184, 1186,
15784 1188, 1191, 1194, 1196, 1207, 1210, 1213, 1219,
15785 1221, 1224, 1226, 1231, 1233, 1236, 1240, 1260,
15786 1264, 1268, 1270, 1272, 1275, 1284, 1287, 1294,
15787 1299, 1302, 1307, 1311, 1315, 1319, 1323, 1326,
15788 1329, 1333, 1339, 1342, 1352, 1372, 1378, 1380,
15789 1383, 1385, 1389, 1391, 1394, 1396, 1399, 1401,
15790 1403, 1406, 1408, 1410, 1417, 1423, 1430, 1436,
15791 1443, 1449, 1455, 1463, 1470, 1476, 1482, 1490,
15792 1497, 1503, 1509, 1517, 1524, 1531, 1537, 1542,
15793 1548, 1552, 1558, 1565, 1571, 1578, 1584, 1591,
15794 1597, 1603, 1611, 1618, 1624, 1630, 1638, 1645,
15795 1651, 1657, 1665, 1672, 1684, 1695, 1707, 1717,
15796 1729, 1737, 1750, 1762, 1775, 1787, 1800, 1812,
15797 1824, 1838, 1851, 1863, 1875, 1889, 1902, 1914,
15798 1926, 1940, 1953, 1965, 1977, 1989, 1997, 1999,
15799 2010, 2020, 2032, 2043, 2055, 2065, 2077, 2090,
15800 2102, 2115, 2127, 2140, 2152, 2164, 2178, 2191,
15801 2203, 2215, 2229, 2242, 2254, 2266, 2280, 2293,
15802 2301, 2348, 2351, 2359, 2367, 2375, 2385, 2394,
15803 2402, 2410, 2418, 2426, 2436, 2445, 2458, 2468,
15804 2481, 2494, 2507, 2522, 2536, 2549, 2562, 2575,
15805 2588, 2603
15806 };
15807  
15808 static const short _url_detector_indicies[] = {
15809 0, 2, 3, 4, 0, 0, 0, 5,
15810 6, 6, 1, 0, 7, 8, 0, 0,
15811 0, 0, 0, 0, 1, 9, 9, 9,
15812 9, 9, 9, 9, 1, 9, 10, 9,
15813 9, 9, 9, 9, 9, 1, 11, 12,
15814 13, 14, 15, 15, 1, 16, 17, 15,
15815 15, 15, 1, 16, 15, 15, 15, 1,
15816 16, 18, 15, 15, 15, 1, 15, 19,
15817 19, 1, 16, 18, 15, 20, 20, 1,
15818 21, 21, 23, 21, 21, 22, 21, 22,
15819 24, 25, 27, 28, 29, 30, 31, 32,
15820 33, 34, 35, 36, 37, 38, 39, 40,
15821 41, 42, 43, 44, 45, 46, 47, 49,
15822 50, 51, 52, 53, 54, 55, 56, 22,
15823 22, 21, 22, 22, 26, 48, 1, 22,
15824 22, 22, 22, 22, 1, 22, 22, 22,
15825 1, 22, 1, 22, 22, 22, 22, 22,
15826 1, 22, 22, 22, 22, 1, 22, 22,
15827 22, 22, 22, 1, 22, 22, 1, 22,
15828 22, 1, 22, 22, 1, 22, 22, 22,
15829 1, 22, 22, 22, 1, 22, 22, 22,
15830 22, 22, 1, 22, 22, 1, 22, 22,
15831 1, 22, 22, 22, 22, 22, 1, 22,
15832 1, 22, 22, 1, 22, 1, 22, 22,
15833 1, 57, 58, 59, 60, 26, 61, 62,
15834 63, 64, 65, 66, 67, 68, 69, 70,
15835 71, 72, 73, 74, 75, 76, 77, 78,
15836 79, 80, 81, 82, 83, 84, 85, 86,
15837 87, 1, 22, 1, 22, 1, 22, 1,
15838 22, 1, 22, 22, 22, 1, 22, 22,
15839 22, 22, 22, 22, 22, 22, 1, 22,
15840 22, 22, 22, 22, 22, 22, 22, 1,
15841 22, 22, 22, 22, 22, 22, 22, 22,
15842 22, 22, 1, 22, 22, 22, 22, 22,
15843 22, 22, 1, 22, 22, 22, 22, 22,
15844 22, 22, 22, 1, 22, 22, 22, 22,
15845 22, 22, 22, 1, 22, 22, 22, 22,
15846 22, 22, 22, 22, 1, 22, 22, 22,
15847 22, 22, 22, 22, 22, 1, 22, 22,
15848 22, 22, 22, 22, 22, 22, 22, 22,
15849 22, 1, 22, 22, 22, 22, 22, 22,
15850 1, 22, 22, 22, 22, 22, 22, 1,
15851 22, 22, 22, 22, 22, 22, 22, 22,
15852 1, 22, 22, 22, 22, 22, 22, 22,
15853 1, 22, 22, 22, 22, 22, 22, 22,
15854 22, 1, 22, 22, 22, 22, 22, 1,
15855 22, 22, 22, 22, 22, 22, 22, 1,
15856 22, 22, 22, 22, 22, 1, 22, 22,
15857 22, 22, 22, 22, 22, 1, 22, 1,
15858 22, 22, 1, 22, 22, 22, 22, 22,
15859 22, 22, 22, 22, 22, 22, 22, 22,
15860 1, 22, 22, 22, 22, 22, 1, 22,
15861 22, 22, 22, 22, 22, 22, 1, 22,
15862 22, 22, 1, 22, 22, 22, 1, 22,
15863 1, 88, 89, 90, 91, 92, 93, 94,
15864 95, 96, 97, 98, 99, 100, 101, 102,
15865 103, 104, 105, 106, 107, 108, 109, 110,
15866 111, 112, 113, 114, 115, 116, 117, 106,
15867 118, 119, 120, 121, 122, 123, 124, 26,
15868 26, 26, 1, 22, 22, 1, 22, 22,
15869 1, 22, 22, 22, 22, 22, 1, 22,
15870 22, 22, 22, 22, 22, 1, 22, 22,
15871 22, 22, 22, 1, 22, 22, 22, 22,
15872 1, 22, 22, 22, 1, 22, 22, 22,
15873 1, 22, 22, 1, 22, 22, 1, 22,
15874 1, 22, 22, 1, 22, 22, 1, 22,
15875 22, 1, 22, 22, 22, 1, 22, 22,
15876 22, 22, 1, 22, 22, 22, 22, 22,
15877 1, 22, 22, 22, 1, 22, 1, 22,
15878 22, 1, 22, 1, 22, 22, 22, 1,
15879 22, 22, 1, 22, 22, 1, 22, 22,
15880 1, 22, 22, 1, 22, 22, 22, 1,
15881 22, 22, 22, 22, 1, 22, 22, 22,
15882 1, 22, 1, 22, 22, 1, 22, 22,
15883 22, 1, 22, 22, 1, 22, 22, 22,
15884 1, 22, 22, 22, 22, 22, 22, 22,
15885 1, 22, 22, 22, 1, 22, 22, 22,
15886 22, 22, 22, 22, 1, 125, 126, 127,
15887 128, 129, 130, 131, 58, 132, 133, 134,
15888 135, 136, 26, 137, 138, 139, 140, 141,
15889 142, 1, 22, 22, 22, 1, 22, 22,
15890 1, 22, 1, 22, 22, 22, 22, 22,
15891 22, 22, 22, 22, 22, 22, 1, 22,
15892 22, 22, 1, 22, 1, 22, 1, 22,
15893 1, 22, 1, 22, 1, 22, 22, 1,
15894 22, 22, 1, 22, 22, 22, 1, 22,
15895 22, 22, 22, 1, 22, 22, 22, 1,
15896 22, 22, 22, 22, 22, 1, 22, 22,
15897 22, 22, 22, 1, 22, 1, 143, 98,
15898 144, 145, 146, 26, 147, 148, 149, 150,
15899 151, 26, 1, 22, 22, 22, 22, 1,
15900 22, 22, 22, 22, 1, 22, 22, 1,
15901 22, 22, 1, 22, 22, 22, 1, 22,
15902 1, 22, 1, 22, 22, 1, 22, 22,
15903 1, 108, 26, 26, 1, 26, 1, 152,
15904 26, 1, 22, 1, 153, 154, 155, 156,
15905 41, 157, 158, 159, 160, 117, 161, 162,
15906 163, 164, 165, 166, 167, 168, 169, 170,
15907 26, 1, 22, 1, 22, 1, 22, 22,
15908 1, 22, 22, 22, 1, 22, 22, 1,
15909 22, 22, 22, 1, 22, 1, 22, 22,
15910 1, 22, 22, 22, 22, 22, 1, 22,
15911 22, 1, 22, 22, 1, 22, 22, 22,
15912 1, 22, 1, 22, 22, 22, 22, 1,
15913 22, 22, 22, 22, 1, 22, 22, 22,
15914 22, 22, 22, 1, 22, 22, 22, 1,
15915 22, 22, 22, 1, 171, 172, 26, 1,
15916 22, 22, 1, 22, 22, 1, 162, 173,
15917 174, 175, 41, 176, 177, 39, 178, 179,
15918 180, 181, 182, 183, 184, 185, 186, 26,
15919 1, 22, 1, 22, 22, 22, 22, 22,
15920 22, 1, 22, 22, 22, 1, 22, 1,
15921 22, 1, 22, 22, 1, 22, 22, 1,
15922 22, 22, 1, 22, 22, 1, 22, 1,
15923 22, 22, 1, 22, 22, 1, 22, 1,
15924 22, 22, 22, 22, 1, 187, 188, 189,
15925 190, 191, 192, 193, 194, 195, 196, 197,
15926 198, 199, 200, 48, 1, 201, 202, 26,
15927 203, 204, 205, 206, 207, 208, 209, 171,
15928 210, 89, 211, 212, 213, 214, 165, 215,
15929 216, 217, 218, 219, 220, 221, 178, 222,
15930 223, 224, 225, 108, 226, 227, 26, 228,
15931 229, 230, 231, 26, 26, 1, 22, 22,
15932 22, 22, 22, 1, 22, 22, 1, 22,
15933 1, 22, 1, 22, 1, 22, 1, 22,
15934 1, 22, 22, 1, 22, 22, 1, 22,
15935 22, 1, 22, 22, 22, 1, 22, 22,
15936 1, 22, 22, 1, 22, 1, 22, 22,
15937 1, 22, 22, 22, 22, 22, 22, 1,
15938 22, 22, 22, 1, 22, 22, 1, 22,
15939 22, 22, 1, 22, 22, 1, 22, 22,
15940 1, 22, 22, 22, 22, 22, 22, 22,
15941 1, 22, 22, 1, 22, 1, 22, 22,
15942 22, 1, 22, 22, 22, 1, 22, 22,
15943 1, 22, 1, 22, 1, 22, 22, 1,
15944 22, 1, 232, 203, 233, 234, 235, 236,
15945 237, 238, 239, 240, 241, 26, 242, 243,
15946 244, 26, 245, 106, 130, 246, 131, 247,
15947 205, 26, 1, 22, 22, 22, 1, 22,
15948 22, 1, 22, 22, 1, 22, 22, 1,
15949 22, 22, 22, 22, 22, 1, 22, 22,
15950 1, 22, 22, 22, 22, 22, 22, 1,
15951 22, 22, 1, 22, 22, 22, 22, 22,
15952 22, 22, 22, 1, 22, 22, 22, 22,
15953 22, 22, 22, 22, 1, 22, 22, 22,
15954 1, 22, 22, 1, 22, 22, 1, 22,
15955 22, 22, 1, 22, 22, 22, 1, 22,
15956 22, 1, 173, 248, 249, 26, 26, 1,
15957 22, 1, 22, 1, 248, 26, 1, 250,
15958 26, 1, 22, 1, 205, 251, 252, 165,
15959 253, 254, 26, 255, 256, 26, 1, 22,
15960 22, 1, 22, 22, 1, 22, 22, 22,
15961 22, 22, 1, 22, 1, 22, 22, 1,
15962 22, 1, 257, 26, 258, 259, 1, 22,
15963 1, 22, 22, 1, 22, 22, 22, 1,
15964 260, 261, 262, 263, 264, 265, 266, 267,
15965 268, 269, 270, 271, 272, 273, 274, 275,
15966 276, 277, 26, 1, 22, 22, 22, 1,
15967 22, 22, 22, 1, 22, 1, 22, 1,
15968 22, 22, 1, 22, 22, 22, 22, 22,
15969 22, 22, 22, 1, 22, 22, 1, 22,
15970 22, 22, 22, 22, 22, 1, 22, 22,
15971 22, 22, 1, 22, 22, 1, 22, 22,
15972 22, 22, 1, 22, 22, 22, 1, 22,
15973 22, 22, 1, 22, 22, 22, 1, 22,
15974 22, 22, 1, 22, 22, 1, 22, 22,
15975 1, 22, 22, 22, 1, 278, 279, 280,
15976 281, 26, 1, 22, 22, 1, 22, 22,
15977 22, 22, 22, 22, 22, 22, 22, 1,
15978 22, 22, 22, 22, 22, 22, 22, 22,
15979 22, 22, 22, 22, 22, 22, 22, 22,
15980 22, 22, 22, 1, 22, 22, 22, 22,
15981 22, 1, 153, 1, 282, 26, 1, 22,
15982 1, 283, 89, 26, 1, 22, 1, 284,
15983 26, 1, 22, 1, 285, 26, 1, 22,
15984 1, 286, 1, 287, 26, 1, 22, 1,
15985 288, 1, 289, 290, 291, 292, 19, 19,
15986 1, 16, 293, 15, 15, 15, 1, 294,
15987 295, 296, 297, 19, 19, 1, 16, 298,
15988 15, 15, 15, 1, 299, 300, 301, 302,
15989 19, 19, 1, 16, 298, 297, 15, 15,
15990 1, 16, 298, 294, 15, 15, 1, 16,
15991 298, 303, 297, 294, 15, 15, 1, 16,
15992 298, 294, 15, 15, 15, 1, 16, 293,
15993 292, 15, 15, 1, 16, 293, 289, 15,
15994 15, 1, 16, 293, 304, 292, 289, 15,
15995 15, 1, 16, 293, 289, 15, 15, 15,
15996 1, 16, 17, 14, 15, 15, 1, 16,
15997 17, 11, 15, 15, 1, 16, 17, 305,
15998 14, 11, 15, 15, 1, 16, 17, 11,
15999 15, 15, 15, 1, 306, 307, 308, 309,
16000 310, 310, 1, 311, 312, 310, 310, 310,
16001 1, 311, 310, 310, 310, 1, 311, 313,
16002 310, 310, 310, 1, 310, 314, 314, 1,
16003 311, 313, 310, 315, 315, 1, 316, 317,
16004 318, 319, 314, 314, 1, 311, 320, 310,
16005 310, 310, 1, 321, 322, 323, 324, 314,
16006 314, 1, 311, 325, 310, 310, 310, 1,
16007 326, 327, 328, 329, 314, 314, 1, 311,
16008 325, 324, 310, 310, 1, 311, 325, 321,
16009 310, 310, 1, 311, 325, 330, 324, 321,
16010 310, 310, 1, 311, 325, 321, 310, 310,
16011 310, 1, 311, 320, 319, 310, 310, 1,
16012 311, 320, 316, 310, 310, 1, 311, 320,
16013 331, 319, 316, 310, 310, 1, 311, 320,
16014 316, 310, 310, 310, 1, 311, 312, 309,
16015 310, 310, 1, 311, 312, 306, 310, 310,
16016 1, 311, 312, 332, 309, 306, 310, 310,
16017 1, 311, 312, 306, 310, 310, 310, 1,
16018 0, 333, 334, 7, 8, 0, 0, 0,
16019 335, 335, 335, 1, 0, 333, 7, 8,
16020 0, 0, 0, 335, 335, 335, 1, 0,
16021 333, 336, 7, 8, 0, 0, 0, 335,
16022 335, 335, 1, 0, 7, 8, 0, 0,
16023 0, 335, 337, 337, 1, 0, 333, 336,
16024 7, 8, 0, 0, 0, 335, 338, 338,
16025 1, 9, 9, 9, 9, 339, 9, 9,
16026 1, 0, 340, 341, 342, 7, 8, 0,
16027 0, 0, 343, 337, 337, 1, 0, 333,
16028 344, 7, 8, 0, 0, 0, 335, 335,
16029 335, 1, 0, 345, 346, 347, 7, 8,
16030 0, 0, 0, 348, 337, 337, 1, 0,
16031 333, 349, 7, 8, 0, 0, 0, 335,
16032 335, 335, 1, 0, 350, 351, 352, 7,
16033 8, 0, 0, 0, 353, 337, 337, 1,
16034 0, 333, 349, 7, 8, 0, 0, 0,
16035 348, 335, 335, 1, 0, 333, 349, 7,
16036 8, 0, 0, 0, 345, 335, 335, 1,
16037 0, 333, 349, 354, 7, 8, 0, 0,
16038 0, 348, 345, 335, 335, 1, 0, 333,
16039 349, 7, 8, 0, 0, 0, 345, 335,
16040 335, 335, 1, 0, 333, 344, 7, 8,
16041 0, 0, 0, 343, 335, 335, 1, 0,
16042 333, 344, 7, 8, 0, 0, 0, 340,
16043 335, 335, 1, 0, 333, 344, 355, 7,
16044 8, 0, 0, 0, 343, 340, 335, 335,
16045 1, 0, 333, 344, 7, 8, 0, 0,
16046 0, 340, 335, 335, 335, 1, 0, 333,
16047 334, 7, 8, 0, 0, 0, 5, 335,
16048 335, 1, 0, 333, 334, 7, 8, 0,
16049 0, 0, 2, 335, 335, 1, 0, 333,
16050 334, 356, 7, 8, 0, 0, 0, 5,
16051 2, 335, 335, 1, 0, 333, 334, 7,
16052 8, 0, 0, 0, 2, 335, 335, 335,
16053 1, 0, 333, 336, 7, 8, 0, 0,
16054 0, 335, 357, 357, 1, 0, 333, 336,
16055 7, 8, 0, 0, 0, 335, 358, 358,
16056 1, 0, 333, 336, 359, 8, 0, 0,
16057 0, 335, 358, 358, 1, 9, 360, 9,
16058 9, 9, 9, 9, 1, 361, 1, 362,
16059 363, 364, 365, 362, 362, 362, 366, 367,
16060 367, 1, 362, 7, 10, 362, 362, 362,
16061 362, 362, 362, 1, 362, 368, 369, 7,
16062 10, 362, 362, 362, 367, 367, 367, 1,
16063 362, 368, 7, 10, 362, 362, 362, 367,
16064 367, 367, 1, 362, 368, 370, 7, 10,
16065 362, 362, 362, 367, 367, 367, 1, 362,
16066 7, 10, 362, 362, 362, 367, 371, 371,
16067 1, 362, 368, 370, 7, 10, 362, 362,
16068 362, 367, 372, 372, 1, 362, 373, 374,
16069 375, 7, 10, 362, 362, 362, 376, 371,
16070 371, 1, 362, 368, 377, 7, 10, 362,
16071 362, 362, 367, 367, 367, 1, 362, 378,
16072 379, 380, 7, 10, 362, 362, 362, 381,
16073 371, 371, 1, 362, 368, 382, 7, 10,
16074 362, 362, 362, 367, 367, 367, 1, 362,
16075 383, 384, 385, 7, 10, 362, 362, 362,
16076 386, 371, 371, 1, 362, 368, 382, 7,
16077 10, 362, 362, 362, 381, 367, 367, 1,
16078 362, 368, 382, 7, 10, 362, 362, 362,
16079 378, 367, 367, 1, 362, 368, 382, 387,
16080 7, 10, 362, 362, 362, 381, 378, 367,
16081 367, 1, 362, 368, 382, 7, 10, 362,
16082 362, 362, 378, 367, 367, 367, 1, 362,
16083 368, 377, 7, 10, 362, 362, 362, 376,
16084 367, 367, 1, 362, 368, 377, 7, 10,
16085 362, 362, 362, 373, 367, 367, 1, 362,
16086 368, 377, 388, 7, 10, 362, 362, 362,
16087 376, 373, 367, 367, 1, 362, 368, 377,
16088 7, 10, 362, 362, 362, 373, 367, 367,
16089 367, 1, 362, 368, 369, 7, 10, 362,
16090 362, 362, 366, 367, 367, 1, 362, 368,
16091 369, 7, 10, 362, 362, 362, 363, 367,
16092 367, 1, 362, 368, 369, 389, 7, 10,
16093 362, 362, 362, 366, 363, 367, 367, 1,
16094 362, 368, 369, 7, 10, 362, 362, 362,
16095 363, 367, 367, 367, 1, 16, 18, 22,
16096 390, 15, 20, 20, 1, 21, 21, 23,
16097 21, 21, 22, 21, 22, 24, 25, 27,
16098 28, 29, 30, 31, 32, 33, 34, 35,
16099 36, 37, 38, 39, 40, 41, 42, 43,
16100 44, 45, 46, 47, 49, 50, 51, 52,
16101 53, 54, 55, 56, 22, 22, 21, 22,
16102 22, 26, 48, 1, 22, 288, 1, 16,
16103 18, 22, 390, 15, 15, 15, 1, 16,
16104 18, 22, 390, 302, 15, 15, 1, 16,
16105 18, 22, 390, 299, 15, 15, 1, 16,
16106 18, 22, 391, 390, 302, 299, 15, 15,
16107 1, 16, 18, 22, 390, 299, 15, 15,
16108 15, 1, 311, 313, 22, 390, 310, 315,
16109 315, 1, 311, 313, 22, 390, 310, 310,
16110 310, 1, 311, 313, 22, 390, 329, 310,
16111 310, 1, 311, 313, 22, 390, 326, 310,
16112 310, 1, 311, 313, 22, 392, 390, 329,
16113 326, 310, 310, 1, 311, 313, 22, 390,
16114 326, 310, 310, 310, 1, 0, 333, 336,
16115 22, 393, 8, 0, 0, 0, 335, 338,
16116 338, 1, 9, 22, 10, 9, 9, 9,
16117 339, 9, 9, 1, 0, 333, 336, 22,
16118 393, 8, 0, 0, 0, 335, 335, 335,
16119 1, 0, 333, 336, 22, 393, 8, 0,
16120 0, 0, 353, 335, 335, 1, 0, 333,
16121 336, 22, 393, 8, 0, 0, 0, 350,
16122 335, 335, 1, 0, 333, 336, 22, 394,
16123 393, 8, 0, 0, 0, 353, 350, 335,
16124 335, 1, 0, 333, 336, 22, 393, 8,
16125 0, 0, 0, 350, 335, 335, 335, 1,
16126 362, 368, 370, 22, 393, 10, 362, 362,
16127 362, 367, 372, 372, 1, 362, 368, 370,
16128 22, 393, 10, 362, 362, 362, 367, 367,
16129 367, 1, 362, 368, 370, 22, 393, 10,
16130 362, 362, 362, 386, 367, 367, 1, 362,
16131 368, 370, 22, 393, 10, 362, 362, 362,
16132 383, 367, 367, 1, 362, 368, 370, 22,
16133 395, 393, 10, 362, 362, 362, 386, 383,
16134 367, 367, 1, 362, 368, 370, 22, 393,
16135 10, 362, 362, 362, 383, 367, 367, 367,
16136 1, 0
16137 };
16138  
16139 static const short _url_detector_trans_targs[] = {
16140 2, 0, 315, 334, 336, 335, 338, 3,
16141 292, 4, 5, 6, 288, 290, 289, 8,
16142 7, 275, 9, 10, 367, 11, 368, 368,
16143 12, 13, 14, 15, 16, 17, 18, 19,
16144 20, 21, 22, 23, 24, 25, 26, 27,
16145 28, 29, 30, 31, 63, 101, 120, 130,
16146 131, 132, 134, 153, 156, 171, 271, 11,
16147 368, 32, 33, 34, 35, 36, 37, 38,
16148 39, 40, 41, 42, 43, 44, 45, 46,
16149 47, 48, 49, 50, 51, 52, 53, 54,
16150 55, 56, 57, 58, 59, 60, 61, 62,
16151 64, 65, 66, 67, 68, 69, 70, 71,
16152 72, 73, 74, 75, 76, 77, 78, 79,
16153 80, 81, 82, 83, 84, 85, 86, 87,
16154 88, 89, 90, 91, 92, 93, 94, 95,
16155 96, 97, 98, 99, 100, 102, 103, 104,
16156 105, 106, 107, 108, 109, 110, 111, 112,
16157 113, 114, 115, 116, 117, 118, 119, 121,
16158 122, 123, 124, 125, 126, 127, 128, 129,
16159 133, 135, 136, 137, 138, 139, 140, 141,
16160 142, 143, 144, 145, 146, 147, 148, 149,
16161 150, 151, 152, 154, 155, 157, 158, 159,
16162 160, 161, 162, 163, 164, 165, 166, 167,
16163 168, 169, 170, 172, 204, 221, 224, 225,
16164 227, 234, 238, 257, 262, 263, 265, 267,
16165 269, 173, 174, 175, 176, 177, 178, 179,
16166 180, 181, 182, 183, 184, 185, 186, 187,
16167 188, 189, 190, 191, 192, 193, 194, 195,
16168 196, 197, 198, 199, 200, 201, 202, 203,
16169 205, 206, 207, 208, 209, 210, 211, 212,
16170 213, 214, 215, 216, 217, 218, 219, 220,
16171 222, 223, 226, 228, 229, 230, 231, 232,
16172 233, 235, 236, 237, 239, 240, 241, 242,
16173 243, 244, 245, 246, 247, 248, 249, 250,
16174 251, 252, 253, 254, 255, 256, 258, 259,
16175 260, 261, 264, 266, 268, 270, 272, 273,
16176 369, 276, 284, 286, 285, 277, 278, 280,
16177 282, 281, 279, 370, 371, 373, 372, 283,
16178 287, 291, 293, 311, 313, 312, 295, 294,
16179 298, 296, 297, 375, 299, 307, 309, 308,
16180 300, 301, 303, 305, 304, 302, 376, 377,
16181 379, 378, 306, 310, 314, 316, 321, 317,
16182 318, 319, 381, 382, 322, 330, 332, 331,
16183 323, 324, 326, 328, 327, 325, 383, 384,
16184 386, 385, 329, 333, 337, 339, 340, 341,
16185 342, 343, 344, 345, 363, 365, 364, 347,
16186 346, 350, 348, 349, 388, 351, 359, 361,
16187 360, 352, 353, 355, 357, 356, 354, 389,
16188 390, 392, 391, 358, 362, 366, 274, 374,
16189 380, 320, 387, 393
16190 };
16191  
16192 static const char _url_detector_trans_actions[] = {
16193 0, 0, 0, 0, 0, 0, 0, 0,
16194 0, 0, 0, 0, 0, 0, 0, 0,
16195 0, 0, 0, 0, 1, 0, 1, 8,
16196 0, 0, 0, 0, 0, 0, 0, 0,
16197 0, 0, 0, 0, 0, 0, 0, 0,
16198 0, 0, 0, 0, 0, 0, 0, 0,
16199 0, 0, 0, 0, 0, 0, 0, 3,
16200 11, 0, 0, 0, 0, 0, 0, 0,
16201 0, 0, 0, 0, 0, 0, 0, 0,
16202 0, 0, 0, 0, 0, 0, 0, 0,
16203 0, 0, 0, 0, 0, 0, 0, 0,
16204 0, 0, 0, 0, 0, 0, 0, 0,
16205 0, 0, 0, 0, 0, 0, 0, 0,
16206 0, 0, 0, 0, 0, 0, 0, 0,
16207 0, 0, 0, 0, 0, 0, 0, 0,
16208 0, 0, 0, 0, 0, 0, 0, 0,
16209 0, 0, 0, 0, 0, 0, 0, 0,
16210 0, 0, 0, 0, 0, 0, 0, 0,
16211 0, 0, 0, 0, 0, 0, 0, 0,
16212 0, 0, 0, 0, 0, 0, 0, 0,
16213 0, 0, 0, 0, 0, 0, 0, 0,
16214 0, 0, 0, 0, 0, 0, 0, 0,
16215 0, 0, 0, 0, 0, 0, 0, 0,
16216 0, 0, 0, 0, 0, 0, 0, 0,
16217 0, 0, 0, 0, 0, 0, 0, 0,
16218 0, 0, 0, 0, 0, 0, 0, 0,
16219 0, 0, 0, 0, 0, 0, 0, 0,
16220 0, 0, 0, 0, 0, 0, 0, 0,
16221 0, 0, 0, 0, 0, 0, 0, 0,
16222 0, 0, 0, 0, 0, 0, 0, 0,
16223 0, 0, 0, 0, 0, 0, 0, 0,
16224 0, 0, 0, 0, 0, 0, 0, 0,
16225 0, 0, 0, 0, 0, 0, 0, 0,
16226 0, 0, 0, 0, 0, 0, 0, 0,
16227 0, 0, 0, 0, 0, 0, 0, 0,
16228 0, 0, 0, 0, 0, 0, 0, 0,
16229 1, 0, 0, 0, 0, 0, 0, 0,
16230 0, 0, 0, 1, 1, 1, 1, 0,
16231 0, 0, 0, 0, 0, 0, 0, 0,
16232 0, 0, 0, 5, 0, 0, 0, 0,
16233 0, 0, 0, 0, 0, 0, 1, 1,
16234 1, 1, 0, 0, 0, 0, 0, 0,
16235 0, 0, 1, 1, 0, 0, 0, 0,
16236 0, 0, 0, 0, 0, 0, 1, 1,
16237 1, 1, 0, 0, 0, 0, 0, 0,
16238 0, 0, 0, 0, 0, 0, 0, 0,
16239 0, 0, 0, 0, 1, 0, 0, 0,
16240 0, 0, 0, 0, 0, 0, 0, 1,
16241 1, 1, 1, 0, 0, 0, 0, 1,
16242 1, 0, 1, 1
16243 };
16244  
16245 static const int url_detector_start = 1;
16246  
16247 14 url_detector::url_type url_detector::detect(string_piece str, size_t* length) {
16248 int cs;
16249 14 const char* p = str.str;
16250  
16251 14 url_type result = NO_URL;
16252 14 size_t result_length = 0, parens = 0;
16253
16254 {
16255 14 cs = url_detector_start;
16256 }
16257  
16258 {
16259 int _klen;
16260 unsigned int _trans;
16261 short _widec;
16262 const char *_acts;
16263 unsigned int _nacts;
16264 const short *_keys;
16265  
16266 14 ▶ if ( p == ( (str.str + str.len)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( p == ( (str.str + str.len)) ) 0 14 14
16267 0 goto _test_eof;
16268 14 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 14 0 14
16269 0 goto _out;
16270 14 _resume:
16271 38 _widec = (*p);
16272 38 _klen = _url_detector_cond_lengths[cs];
16273 38 _keys = _url_detector_cond_keys + (_url_detector_cond_offsets[cs]*2);
16274 38 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 38 38
16275 0 const short *_lower = _keys;
16276 const short *_mid;
16277 0 const short *_upper = _keys + (_klen<<1) - 2;
16278 while (1) {
16279 0 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 0 0 0
16280 0 break;
16281  
16282 0 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
16283 0 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 0 0 0
16284 0 _upper = _mid - 2;
16285 0 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 0 0 0
16286 0 _lower = _mid + 2;
16287 else {
16288 0 ▶ switch ( _url_detector_cond_spaces[_url_detector_cond_offsets[cs] + ((_mid - _keys)>>1)] ) {
Branch: 1 branch
BranchTrueFalseTotal
switch ( _url_detector_cond_spaces[_url_detector_cond_offsets[cs] + ((_mid - _keys)>>1)] ) { 0 0 0
16289 0 case 0: {
16290 0 _widec = (short)(256u + ((*p) - 0u));
16291 0 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ( 0 0 0
16292 0 parens ) _widec += 256;
16293 0 break;
16294 }
16295 }
16296 0 break;
16297 }
16298 }
16299 }
16300  
16301 38 _keys = _url_detector_trans_keys + _url_detector_key_offsets[cs];
16302 38 _trans = _url_detector_index_offsets[cs];
16303  
16304 38 _klen = _url_detector_single_lengths[cs];
16305 38 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 38 0 38
16306 38 const short *_lower = _keys;
16307 const short *_mid;
16308 38 const short *_upper = _keys + _klen - 1;
16309 while (1) {
16310 142 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 38 104 142
16311 38 break;
16312  
16313 104 _mid = _lower + ((_upper-_lower) >> 1);
16314 104 ▶ if ( _widec < *_mid )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < *_mid ) 32 72 104
16315 32 _upper = _mid - 1;
16316 72 ▶ else if ( _widec > *_mid )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > *_mid ) 72 0 72
16317 72 _lower = _mid + 1;
16318 else {
16319 0 _trans += (unsigned int)(_mid - _keys);
16320 0 goto _match;
16321 }
16322 }
16323 38 _keys += _klen;
16324 38 _trans += _klen;
16325 }
16326  
16327 38 _klen = _url_detector_range_lengths[cs];
16328 38 ▶ if ( _klen > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( _klen > 0 ) { 0 38 38
16329 38 const short *_lower = _keys;
16330 const short *_mid;
16331 38 const short *_upper = _keys + (_klen<<1) - 2;
16332 while (1) {
16333 110 ▶ if ( _upper < _lower )
Branch: 1 branch
BranchTrueFalseTotal
if ( _upper < _lower ) 10 100 110
16334 10 break;
16335  
16336 100 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
16337 100 ▶ if ( _widec < _mid[0] )
Branch: 1 branch
BranchTrueFalseTotal
if ( _widec < _mid[0] ) 24 76 100
16338 24 _upper = _mid - 2;
16339 76 ▶ else if ( _widec > _mid[1] )
Branch: 1 branch
BranchTrueFalseTotal
else if ( _widec > _mid[1] ) 48 28 76
16340 48 _lower = _mid + 2;
16341 else {
16342 28 _trans += (unsigned int)((_mid - _keys)>>1);
16343 28 goto _match;
16344 }
16345 }
16346 10 _trans += _klen;
16347 }
16348  
16349 0 _match:
16350 38 _trans = _url_detector_indicies[_trans];
16351 38 cs = _url_detector_trans_targs[_trans];
16352  
16353 38 ▶ if ( _url_detector_trans_actions[_trans] == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( _url_detector_trans_actions[_trans] == 0 ) 38 0 38
16354 38 goto _again;
16355  
16356 0 _acts = _url_detector_actions + _url_detector_trans_actions[_trans];
16357 0 _nacts = (unsigned int) *_acts++;
16358 0 ▶ while ( _nacts-- > 0 )
Branch: 1 branch
BranchTrueFalseTotal
while ( _nacts-- > 0 ) 0 0 0
16359 {
16360 0 switch ( *_acts++ )
16361 {
16362 0 case 0:
16363 0 { result = URL; result_length = p - str.str + 1; }
16364 0 break;
16365 0 case 1:
16366 0 { result = EMAIL; result_length = p - str.str + 1; }
16367 0 break;
16368 0 case 2:
16369 0 {parens++;}
16370 0 break;
16371 0 case 3:
16372 0 {parens-=!!parens;}
16373 0 break;
16374 }
16375 }
16376  
16377 0 _again:
16378 38 ▶ if ( cs == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ( cs == 0 ) 10 28 38
16379 10 goto _out;
16380 28 ▶ if ( ++p != ( (str.str + str.len)) )
Branch: 1 branch
BranchTrueFalseTotal
if ( ++p != ( (str.str + str.len)) ) 24 4 28
16381 24 goto _resume;
16382 4 _test_eof: {}
16383 14 _out: {}
16384 }
16385  
16386 // if (result == URL) {
16387 // // Ignore the last character if it is one of [.!',;?:)],
16388 // // and the ) only if it is unmatched.
16389 // size_t unmatched_parens = 0;
16390 // bool unmatched_parens_computed = false;
16391 // do {
16392 // if (str.str[result_length-1] == ')' && !unmatched_parens_computed) {
16393 // for (size_t i =
16394 //
16395 //
16396 // unmatched_parens_computed = true;
16397 // }
16398 // } while ();
16399 // while (result_length) {
16400 //
16401 //
16402 // }
16403 //
16404 // if (str.str[result_length-1] == '.' ||
16405 //
16406 // // Also ignore ) is ignored only if there is not a matching left one.
16407 // }
16408 //
16409 14 ▶ if (length) *length = result_length;
Branch: 1 branch
BranchTrueFalseTotal
if (length) *length = result_length; 0 14 14
16410 14 ▶ return length || result_length == str.len ? result : NO_URL;
Branch: 2 branches
BranchTrueFalseTotal
return length || result_length == str.len ? result : NO_URL; 14 0 14
return length || result_length == str.len ? result : NO_URL; 0 14 14
16411 }
16412  
16413 } // namespace utils
16414  
16415 /////////
16416 // File: version/version.h
16417 /////////
16418  
16419 // This file is part of NameTag <http://github.com/ufal/nametag/>.
16420 //
16421 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
16422 // Mathematics and Physics, Charles University in Prague, Czech Republic.
16423 //
16424 // This Source Code Form is subject to the terms of the Mozilla Public
16425 // License, v. 2.0. If a copy of the MPL was not distributed with this
16426 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
16427  
16428 class version {
16429 public:
16430 unsigned major;
16431 unsigned minor;
16432 unsigned patch;
16433 string prerelease;
16434  
16435 // Returns current NameTag version.
16436 static version current();
16437  
16438 // Returns multi-line formated version and copyright string.
16439 static string version_and_copyright(const string& other_libraries = string());
16440 };
16441  
16442 /////////
16443 // File: version/version.cpp
16444 /////////
16445  
16446 // This file is part of NameTag <http://github.com/ufal/nametag/>.
16447 //
16448 // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of
16449 // Mathematics and Physics, Charles University in Prague, Czech Republic.
16450 //
16451 // This Source Code Form is subject to the terms of the Mozilla Public
16452 // License, v. 2.0. If a copy of the MPL was not distributed with this
16453 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
16454  
16455 0 version version::current() {
16456 0 return {1, 2, 1, ""};
16457 0 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
16458  
16459 // Returns multi-line formated version and copyright string.
16460 0 string version::version_and_copyright(const string& other_libraries) {
16461 0 ▶ ostringstream info;
Branch: 1 branch
BranchTrueFalseTotal
ostringstream info; 0 0 0
16462  
16463 0 ▶ auto nametag = version::current();
Branch: 1 branch
BranchTrueFalseTotal
auto nametag = version::current(); 0 0 0
16464 0 ▶ auto unilib = unilib::version::current();
Branch: 1 branch
BranchTrueFalseTotal
auto unilib = unilib::version::current(); 0 0 0
16465 0 ▶ auto morphodita = morphodita::version::current();
Branch: 1 branch
BranchTrueFalseTotal
auto morphodita = morphodita::version::current(); 0 0 0
16466  
16467 0 ▶ info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch
Branch: 6 branches
BranchTrueFalseTotal
info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch 0 0 0
info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch 0 0 0
info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch 0 0 0
info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch 0 0 0
info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch 0 0 0
info << "NameTag version " << nametag.major << '.' << nametag.minor << '.' << nametag.patch 0 0 0
16468 0 << (nametag.prerelease.empty() ? "" : "-") << nametag.prerelease
16469 0 ▶ << " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch
Branch: 9 branches
BranchTrueFalseTotal
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
<< " (using UniLib " << unilib.major << '.' << unilib.minor << '.' << unilib.patch 0 0 0
16470 0 << (unilib.prerelease.empty() ? "" : "-") << unilib.prerelease
16471 0 ▶ << ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch
Branch: 9 branches
BranchTrueFalseTotal
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
<< ", MorphoDiTa " << morphodita.major << '.' << morphodita.minor << '.' << unilib.patch 0 0 0
16472 0 << (morphodita.prerelease.empty() ? "" : "-") << morphodita.prerelease
16473 0 << (other_libraries.empty() ? "" : "\nand ") << other_libraries << ")\n"
16474 "Copyright 2016 by Institute of Formal and Applied Linguistics, Faculty of\n"
16475 0 ▶ "Mathematics and Physics, Charles University in Prague, Czech Republic.";
Branch: 7 branches
BranchTrueFalseTotal
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
"Mathematics and Physics, Charles University in Prague, Czech Republic."; 0 0 0
16476  
16477 0 ▶ return info.str();
Branch: 1 branch
BranchTrueFalseTotal
return info.str(); 0 0 0
16478 0 }
16479  
16480 } // namespace nametag
16481 } // namespace ufal
« lib/Ufal/NameTag.c ↑ Summary