文件 | |
文件 | char_types.hpp |
文件 | char_types_enum.hpp |
枚举 | |
枚举 | cudf::strings::string_character_types : uint32_t { cudf::strings::DECIMAL = 1 << 0 , cudf::strings::NUMERIC = 1 << 1 , cudf::strings::DIGIT = 1 << 2 , cudf::strings::ALPHA = 1 << 3 , cudf::strings::SPACE = 1 << 4 , cudf::strings::UPPER = 1 << 5 , cudf::strings::LOWER = 1 << 6 , cudf::strings::ALPHANUM = DECIMAL | NUMERIC | DIGIT | ALPHA , cudf::strings::CASE_TYPES = UPPER | LOWER , cudf::strings::ALL_TYPES = ALPHANUM | CASE_TYPES | SPACE } |
字符类型值。这些类型可以进行或运算以检查任何类型的组合。 更多... | |
enum cudf::strings::string_character_types : uint32_t |
字符类型值。这些类型可以进行或运算以检查任何类型的组合。
这不能转换为枚举类,因为或运算的条目可能导致类中不存在的值。例如,组合 NUMERIC|SPACE 是一个有效且合理的组合,但它不匹配任何显式命名的枚举成员。
枚举成员 | |
---|---|
DECIMAL | 所有十进制字符 |
NUMERIC | 所有数字字符 |
DIGIT | 所有数字字符(0-9) |
ALPHA | 所有字母字符 |
SPACE | 所有空格字符 |
UPPER | 所有大写字符 |
LOWER | 所有小写字符 |
ALPHANUM | 所有字母数字字符 |
CASE_TYPES | 所有可区分大小写的字符 |
ALL_TYPES | 所有字符类型 |
定义于文件 char_types_enum.hpp 的第 38 行。
std::unique_ptr<column> cudf::strings::all_characters_of_type | ( | strings_column_view const & | input, |
string_character_types | types, | ||
string_character_types | verify_types = string_character_types::ALL_TYPES , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
返回一个布尔列,标识其中所有字符都是指定类型的字符串条目。
如果对应的字符串元素为空或包含至少一个非指定类型的字符,则输出行条目将被设置为 false。如果所有字符都符合类型,则在输出行条目中设置为 true。
要忽略除特定类型之外的所有类型,请将 verify_types
设置为应检查的那些类型。否则,默认的 ALL_TYPES
将验证所有字符是否都匹配 types
。
任何空行都将导致输出列中该行的条目为空。
input | 此操作的字符串实例 |
types | 在每个字符串中要检查的字符类型 |
verify_types | 仅对照这些字符类型进行验证。默认值 ALL_TYPES 表示当且仅当所有字符都匹配 types 时才返回 true 。 |
stream | 用于设备内存操作和内核启动的 CUDA 流 |
mr | 用于分配返回列设备内存的设备内存资源 |
std::unique_ptr<column> cudf::strings::filter_characters_of_type | ( | strings_column_view const & | input, |
string_character_types | types_to_remove, | ||
string_scalar const & | replacement = string_scalar("") , |
||
string_character_types | types_to_keep = string_character_types::ALL_TYPES , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
从字符串列中过滤特定字符类型。
要移除特定类型的所有字符,请在 types_to_remove
中设置该类型,并将 types_to_keep
设置为 ALL_TYPES
。
要过滤掉非特定类型的字符,请为 types_to_remove
指定 ALL_TYPES
,并在 types_to_keep
中指定不应移除的类型。
在 s1
中,所有 NUMERIC 类型的字符都被移除。在 s2
中,所有非 LOWER 类型的字符都被替换。
参数 types_to_remove
和 types_to_keep
必须有一个且只有一个设置为 ALL_TYPES
。
任何空行都将导致输出列中该行的条目为空。
cudf::logic_error | 如果 types_to_remove 和 types_to_keep 都没有或都设置为 ALL_TYPES 。 |
input | 此操作的字符串实例 |
types_to_remove | 在每个字符串中要检查的字符类型。此处使用 ALL_TYPES 来替代指定 types_to_keep 。 |
replacement | 移除字符时使用的替换字符 |
types_to_keep | 默认值 ALL_TYPES 表示将过滤掉 types_to_remove 的所有字符。 |
mr | 用于分配返回列设备内存的设备内存资源 |
stream | 用于设备内存操作和内核启动的 CUDA 流 |
|
constexpr |
用于组合 string_character_types 的 OR 运算符。
lhs | OR 操作的左操作数 |
rhs | OR 操作的右操作数 |
定义于文件 char_types_enum.hpp 的第 58 行。
|
constexpr |
用于组合 string_character_types 的复合赋值 OR 运算符。
lhs | OR 操作的左操作数 |
rhs | OR 操作的右操作数 |
lhs
与 rhs
组合后对 lhs
的引用定义于文件 char_types_enum.hpp 的第 72 行。