-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust the valid range of group index for replace_with_backrefs (#10530)
Current PR is to adjust to the valid range of group index for cuDF API `cudf::strings::replace_with_backrefs`. 1. enable 0 as group index For now, the range of group index starts with 1, which doesn't include the special value 0. Zero-value as backref index usually refers the entire matching pattern. So does cuDF regexp system. Therefore, what we only need to do is lifting the restrictions to allow zero-value passed as the group index of back references. Example of zero-value index: input: `aa-11 b2b-345` pattern: `([a-z]+)-([0-9]+)` replacement: `${0}:${1}:${2};` output: ```aa-11:aa:11; b2b-345:b:345;``` 2. group index should not exceed group count For now, group indices can exceed group count. The exceeding ones will end up to be empty string. IMHO, it is better to throw an exception under this circumstance instead of ignoring these overflow indices. Authors: - Alfred Xu (https://github.com/sperlingxx) Approvers: - Jason Lowe (https://github.com/jlowe) - David Wendt (https://github.com/davidwendt) URL: #10530
- Loading branch information
1 parent
1355191
commit bc8f578
Showing
4 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters