| 656 | } |
| 657 | |
| 658 | uint32_t unicode_tolower(uint32_t cpt) { |
| 659 | // binary search |
| 660 | auto it = std::lower_bound(unicode_map_lowercase.begin(), unicode_map_lowercase.end(), cpt, |
| 661 | [](const std::pair<uint32_t, uint32_t> & pair, uint32_t value) { |
| 662 | return pair.first < value; |
| 663 | }); |
| 664 | if (it != unicode_map_lowercase.end() && it->first == cpt) { |
| 665 | return it->second; |
| 666 | } |
| 667 | return cpt; // Return the original code point if no lowercase mapping is found |
| 668 | } |
| 669 | |
| 670 | std::vector<std::string> unicode_regex_split(const std::string & text, const std::vector<std::string> & regex_exprs) { |
| 671 | // unicode categories |
no test coverage detected