char_types.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2021, 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 
22 namespace cudf {
23 namespace strings {
39 enum string_character_types : uint32_t {
40  DECIMAL = 1 << 0,
41  NUMERIC = 1 << 1,
42  DIGIT = 1 << 2,
43  ALPHA = 1 << 3,
44  SPACE = 1 << 4,
45  UPPER = 1 << 5,
46  LOWER = 1 << 6,
50 };
51 
56 
61 
93 std::unique_ptr<column> all_characters_of_type(
94  strings_column_view const& strings,
97  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
98 
137 std::unique_ptr<column> filter_characters_of_type(
138  strings_column_view const& strings,
139  string_character_types types_to_remove,
140  string_scalar const& replacement = string_scalar(""),
142  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
143  // end of doxygen group
145 } // namespace strings
146 } // namespace cudf
cudf::strings::NUMERIC
@ NUMERIC
all numeric characters
Definition: char_types.hpp:41
cudf::strings::LOWER
@ LOWER
all lower case characters
Definition: char_types.hpp:46
strings_column_view.hpp
Class definition for cudf::strings_column_view.
scalar.hpp
Class definitions for cudf::scalar.
column.hpp
Class definition for cudf::column.
cudf::strings::all_characters_of_type
std::unique_ptr< column > all_characters_of_type(strings_column_view const &strings, string_character_types types, string_character_types verify_types=string_character_types::ALL_TYPES, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a boolean column identifying strings entries in which all characters are of the type specifie...
cudf::strings::CASE_TYPES
@ CASE_TYPES
all case-able characters
Definition: char_types.hpp:48
cudf::strings::SPACE
@ SPACE
all space characters
Definition: char_types.hpp:44
cudf::strings::ALPHANUM
@ ALPHANUM
all alphanumeric characters
Definition: char_types.hpp:47
cudf::strings::DIGIT
@ DIGIT
all digit characters
Definition: char_types.hpp:42
cudf::strings::operator|
string_character_types operator|(string_character_types lhs, string_character_types rhs)
OR operator for combining string_character_types.
cudf::strings::ALL_TYPES
@ ALL_TYPES
all character types
Definition: char_types.hpp:49
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::strings::UPPER
@ UPPER
all upper case characters
Definition: char_types.hpp:45
cudf::strings::ALPHA
@ ALPHA
all alphabetic characters
Definition: char_types.hpp:43
cudf::strings::filter_characters_of_type
std::unique_ptr< column > filter_characters_of_type(strings_column_view const &strings, string_character_types types_to_remove, string_scalar const &replacement=string_scalar(""), string_character_types types_to_keep=string_character_types::ALL_TYPES, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Filter specific character types from a column of strings.
cudf::strings::DECIMAL
@ DECIMAL
all decimal characters
Definition: char_types.hpp:40
cudf::strings_column_view
Given a column-view of strings type, an instance of this class provides a wrapper on this compound co...
Definition: strings_column_view.hpp:36
cudf::strings::operator|=
string_character_types & operator|=(string_character_types &lhs, string_character_types rhs)
Compound assignment OR operator for combining string_character_types.
cudf::string_scalar
An owning class to represent a string in device memory.
Definition: scalar.hpp:427
rmm::mr::device_memory_resource
cudf::strings::string_character_types
string_character_types
Character type values. These types can be or'd to check for any combination of types.
Definition: char_types.hpp:39