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

Invalid idx when suffix is longer than word #4

Open
ghost opened this issue Jun 20, 2016 · 1 comment
Open

Invalid idx when suffix is longer than word #4

ghost opened this issue Jun 20, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 20, 2016

bool Porter2Stemmer::internal::replaceIfExists(std::string& word, const std::string& suffix, const std::string& replacement, size_t start)

contains size_t idx = word.size() - suffix.size(); but since size_t is an unsigned type, a error occurs when the word is shorter than the suffix. For example:

bool Porter2Stemmer::internal::replaceIfExists("Ryuuko", "ational", "ate", 5);
@smassung
Copy link
Owner

Thanks! I will merge a PR that fixes this.

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

No branches or pull requests

1 participant