MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / unicode_tolower

Function unicode_tolower

smallthinker/src/unicode.cpp:658–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658uint32_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
670std::vector<std::string> unicode_regex_split(const std::string & text, const std::vector<std::string> & regex_exprs) {
671 // unicode categories

Callers 2

preprocessMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected