Skip to content

Commit

Permalink
Add regex_program java APIs and unit tests (#12548)
Browse files Browse the repository at this point in the history
Adds a set of java regex APIs that take in a `regex_program` as parameter and java unit tests. This is part of the solution for NVIDIA/spark-rapids#7295.

Authors:
  - Cindy Jiang (https://github.com/cindyyuanjiang)

Approvers:
  - MithunR (https://github.com/mythrocks)
  - Robert (Bobby) Evans (https://github.com/revans2)

URL: #12548
  • Loading branch information
cindyyuanjiang authored Jan 26, 2023
1 parent f7d434d commit 20c945b
Show file tree
Hide file tree
Showing 6 changed files with 799 additions and 274 deletions.
36 changes: 36 additions & 0 deletions java/src/main/java/ai/rapids/cudf/CaptureGroups.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package ai.rapids.cudf;

/**
* Capture groups setting, closely following cudf::strings::capture_groups.
*
* For processing a regex pattern containing capture groups. These can be used
* to optimize the generated regex instructions where the capture groups do not
* require extracting the groups.
*/
public enum CaptureGroups {
EXTRACT(0), // capture groups processed normally for extract
NON_CAPTURE(1); // convert all capture groups to non-capture groups

final int nativeId; // Native id, for use with libcudf.
private CaptureGroups(int nativeId) { // Only constant values should be used
this.nativeId = nativeId;
}
}
Loading

0 comments on commit 20c945b

Please sign in to comment.