find.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2023, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <cudf/column/column.hpp>
19 #include <cudf/scalar/scalar.hpp>
21 
23 
24 namespace cudf {
25 namespace strings {
55 std::unique_ptr<column> find(
56  strings_column_view const& input,
57  string_scalar const& target,
58  size_type start = 0,
59  size_type stop = -1,
62 
86 std::unique_ptr<column> rfind(
87  strings_column_view const& input,
88  string_scalar const& target,
89  size_type start = 0,
90  size_type stop = -1,
93 
114 std::unique_ptr<column> find(
115  strings_column_view const& input,
116  strings_column_view const& target,
117  size_type start = 0,
120 
136 std::unique_ptr<column> contains(
137  strings_column_view const& input,
138  string_scalar const& target,
141 
161 std::unique_ptr<column> contains(
162  strings_column_view const& input,
163  strings_column_view const& targets,
166 
183 std::unique_ptr<column> starts_with(
184  strings_column_view const& input,
185  string_scalar const& target,
188 
209 std::unique_ptr<column> starts_with(
210  strings_column_view const& input,
211  strings_column_view const& targets,
214 
231 std::unique_ptr<column> ends_with(
232  strings_column_view const& input,
233  string_scalar const& target,
236 
257 std::unique_ptr<column> ends_with(
258  strings_column_view const& input,
259  strings_column_view const& targets,
263 } // namespace strings
264 } // namespace cudf
An owning class to represent a string in device memory.
Definition: scalar.hpp:429
Given a column-view of strings type, an instance of this class provides a wrapper on this compound co...
Class definition for cudf::column.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
device_memory_resource * get_current_device_resource()
std::unique_ptr< column > starts_with(strings_column_view const &input, string_scalar const &target, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a column of boolean values for each string where true indicates the target string was found a...
std::unique_ptr< column > find(strings_column_view const &input, string_scalar const &target, size_type start=0, size_type stop=-1, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a column of character position values where the target string is first found in each string o...
std::unique_ptr< column > rfind(strings_column_view const &input, string_scalar const &target, size_type start=0, size_type stop=-1, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a column of character position values where the target string is first found searching from t...
std::unique_ptr< column > contains(strings_column_view const &input, string_scalar const &target, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a column of boolean values for each string where true indicates the target string was found w...
std::unique_ptr< column > ends_with(strings_column_view const &input, string_scalar const &target, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a column of boolean values for each string where true indicates the target string was found a...
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:93
cuDF interfaces
Definition: aggregation.hpp:34
Class definitions for cudf::scalar.
Class definition for cudf::strings_column_view.