Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified char_splitter to support UTF-8 (implements #299) #304

Merged
merged 5 commits into from
Jul 21, 2016

Conversation

kmaehashi
Copy link
Member

Implements #299

@kmaehashi kmaehashi added this to the 0.3.3 milestone Jul 20, 2016
if (end == std::string::npos) {
size_t len = string.size() - begin;
bounds.push_back(std::make_pair(begin, len));
size_t len_bytes = ustring_to_string(target.substr(begin, len)).size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this target.substr(begin, len) is equal to target.substr(begin) because this code get the substring of target from begin to the end of target.
And also the variable len is not necessary in this condition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! Fixed.

@kmaehashi
Copy link
Member Author

As a future work, we can speed-up this feature extraction by couting bytes of ustrings without converting it into std::string. Such feature can be implemented injubatus::util::data::string::ustring.

@TkrUdagawa TkrUdagawa merged commit 7bd4473 into develop Jul 21, 2016
@TkrUdagawa
Copy link
Contributor

👍

@kmaehashi kmaehashi deleted the support_utf8_work branch July 21, 2016 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants