| 80 | (codepoint >= 0xAC00 && codepoint <= 0xD7AF); |
| 81 | } |
| 82 | |
| 83 | bool is_kept_char(uint32_t codepoint) { |
| 84 | return codepoint == '\'' || is_ascii_alnum(codepoint) || is_cjk(codepoint) || |
| 85 | is_kept_non_ascii_letter_or_number(codepoint); |
| 86 | } |
| 87 | |
| 88 | std::string clean_token(const std::string & token) { |
| 89 | std::string out; |
| 90 | for (const auto & ch : utf8_chars(token)) { |
| 91 | if (is_kept_char(ch.codepoint)) { |
| 92 | out += ch.text; |
| 93 | } |
no test coverage detected