diff --git a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/capitalize.rst b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/capitalize.rst new file mode 100644 index 00000000000..578b2b75e37 --- /dev/null +++ b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/capitalize.rst @@ -0,0 +1,6 @@ +========== +capitalize +========== + +.. automodule:: cudf._lib.pylibcudf.strings.capitalize + :members: diff --git a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/char_types.rst b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/char_types.rst new file mode 100644 index 00000000000..577ec34915b --- /dev/null +++ b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/char_types.rst @@ -0,0 +1,6 @@ +========== +char_types +========== + +.. automodule:: cudf._lib.pylibcudf.strings.char_types + :members: diff --git a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/find.rst b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/find.rst new file mode 100644 index 00000000000..61d4079e9a3 --- /dev/null +++ b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/find.rst @@ -0,0 +1,6 @@ +==== +find +==== + +.. automodule:: cudf._lib.pylibcudf.strings.find + :members: diff --git a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/index.rst b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/index.rst index cecf1ccc9bb..462a756a092 100644 --- a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/index.rst +++ b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/index.rst @@ -4,6 +4,11 @@ strings .. toctree:: :maxdepth: 1 + capitalize + char_types contains + find + regex_flags + regex_program replace slice diff --git a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/regex_flags.rst b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/regex_flags.rst new file mode 100644 index 00000000000..0126b6a3706 --- /dev/null +++ b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/regex_flags.rst @@ -0,0 +1,6 @@ +=========== +regex_flags +=========== + +.. automodule:: cudf._lib.pylibcudf.strings.regex_flags + :members: diff --git a/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/regex_program.rst b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/regex_program.rst new file mode 100644 index 00000000000..2f398186d51 --- /dev/null +++ b/docs/cudf/source/user_guide/api_docs/pylibcudf/strings/regex_program.rst @@ -0,0 +1,6 @@ +============= +regex_program +============= + +.. automodule:: cudf._lib.pylibcudf.strings.regex_program + :members: diff --git a/python/cudf/cudf/_lib/pylibcudf/strings/capitalize.pyx b/python/cudf/cudf/_lib/pylibcudf/strings/capitalize.pyx index d3f79088018..ccf84d25572 100644 --- a/python/cudf/cudf/_lib/pylibcudf/strings/capitalize.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/strings/capitalize.pyx @@ -22,7 +22,22 @@ cpdef Column capitalize( # TODO: default scalar values # https://github.com/rapidsai/cudf/issues/15505 ): - + """Returns a column of capitalized strings. + + For details, see :cpp:func:`cudf::strings::capitalize`. + + Parameters + ---------- + input : Column + String column + delimiters : Scalar, default None + Characters for identifying words to capitalize + + Returns + ------- + pylibcudf.Column + Column of strings capitalized from the input column + """ cdef unique_ptr[column] c_result if delimiters is None: @@ -47,6 +62,23 @@ cpdef Column title( Column input, string_character_types sequence_type=string_character_types.ALPHA ): + """Modifies first character of each word to upper-case and lower-cases + the rest. + + For details, see :cpp:func:`cudf::strings::title`. + + Parameters + ---------- + input : Column + String column + sequence_type : string_character_types, default string_character_types.ALPHA + The character type that is used when identifying words + + Returns + ------- + pylibcudf.Column + Column of titled strings + """ cdef unique_ptr[column] c_result with nogil: c_result = cpp_capitalize.title(input.view(), sequence_type) @@ -55,6 +87,20 @@ cpdef Column title( cpdef Column is_title(Column input): + """Checks if the strings in the input column are title formatted. + + For details, see :cpp:func:`cudf::strings::is_title`. + + Parameters + ---------- + input : Column + String column + + Returns + ------- + pylibcudf.Column + Column of type BOOL8 + """ cdef unique_ptr[column] c_result with nogil: c_result = cpp_capitalize.is_title(input.view()) diff --git a/python/cudf/cudf/_lib/pylibcudf/strings/regex_program.pyx b/python/cudf/cudf/_lib/pylibcudf/strings/regex_program.pyx index d605b0aba02..5f0b8868452 100644 --- a/python/cudf/cudf/_lib/pylibcudf/strings/regex_program.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/strings/regex_program.pyx @@ -13,12 +13,31 @@ from cudf._lib.pylibcudf.strings.regex_flags cimport regex_flags cdef class RegexProgram: + """Regex program class. + This is the Cython representation of + :cpp:class:`cudf::strings::regex_program`. + + Do not instantiate this class directly, use the `create` method. + + """ def __init__(self, *args, **kwargs): raise ValueError("Do not instantiate RegexProgram directly, use create") @staticmethod def create(str pattern, int flags): + """Create a program from a pattern. + + For detils, see :cpp:func:`cudf::strings::regex_program::create`. + + Parameters + ---------- + pattern : str + Regex pattern + flags : Uniont[int, RegexFlags] + Regex flags for interpreting special characters in the pattern + + """ cdef unique_ptr[regex_program] c_prog cdef regex_flags c_flags cdef string c_pattern = pattern.encode()