Skip to content

Commit

Permalink
Fix length error bab2min/kiwipiepy#172
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Sep 4, 2024
1 parent 7574cf9 commit 01d4d1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/KTrie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ size_t kiwi::splitByTrie(
lastSpecialEndPos * posMultiplier, specialStartPos * posMultiplier,
str.substr(nonSpaces[lastSpecialEndPos], nonSpaces[specialStartPos] - nonSpaces[lastSpecialEndPos]));
}
if (appendNewNode(out, endPosMap,
if (specialStartPos < nonSpaces.size() && appendNewNode(out, endPosMap,
specialStartPos * posMultiplier, nonSpaces.size() * posMultiplier,
U16StringView{ &str[nonSpaces[specialStartPos]], n - nonSpaces[specialStartPos] }))
{
Expand Down

0 comments on commit 01d4d1e

Please sign in to comment.