Skip to main content

Module classify

Module classify 

Source

Functions§

isalnum
Return true where every character is alphanumeric and the string is non-empty. Matches numpy.strings.isalnum / CPython str.isalnum(): every character is alphabetic (isalpha) OR a decimal/digit/numeric character (isdecimal/isdigit/isnumeric). Composes the corrected predicates: ½ (numeric) and (digit) are alphanumeric.
isalpha
Return true where every character is alphabetic (Unicode general category L*) and the string is non-empty. Matches numpy.strings.isalpha, which delegates per element to CPython’s str.isalpha(). NARROWER than Rust’s char::is_alphabetic: roman numerals like (category Nl) and combining marks return false. See [is_alpha_char]/[ALPHA_RANGES].
isdecimal
Return true where every character is a Unicode decimal digit (Numeric_Type = Decimal) and the string is non-empty. Matches numpy.strings.isdecimal / CPython str.isdecimal() (Py_UNICODE_ISDECIMAL). Stricter than isdigit: superscripts (²), circled digits () and fractions (½) return false, while non-ASCII positional decimals such as fullwidth and Arabic-Indic ٣ return true. See [is_decimal_char]/[DECIMAL_RANGES].
isdigit
Return true where every character is a digit and the string is non-empty. Matches numpy.strings.isdigit, which delegates per element to CPython’s str.isdigit() (Py_UNICODE_ISDIGIT): Unicode Numeric_Type of Decimal or Digit. This is broader than isdecimal (it accepts superscripts/subscripts like ²³, circled digits like , and parenthesized digits) and narrower than isnumeric (it rejects fractions like ½ and letter-numerals like ). See [is_digit_char]/[DIGIT_RANGES].
islower
Return true where the string is lowercased and the string is non-empty. Matches numpy.strings.islower / CPython str.islower() (do_islower): at least one cased character and no cased character is uppercase or titlecase.
isnumeric
Return true where every character is numeric and the string is non-empty. Matches numpy.strings.isnumeric, which delegates per element to CPython’s str.isnumeric() (Unicode Numeric_Type = Decimal, Digit, or Numeric): superscripts/fractions like ² and ½, roman numerals like , and ideographic numerals like are numeric, while ., +, and - are not. Backed by the 15.1.0-locked [NUMERIC_TYPE_RANGES] table via [is_numeric_char], NOT Rust’s char::is_numeric (which tests the Nd|Nl|No categories against a newer Unicode revision: it misses the Lo ideographic numerals and wrongly accepts codepoints assigned after Unicode 15.1.0).
isspace
Return true where every character is whitespace and the string is non-empty. Matches numpy.strings.isspace, which delegates per element to CPython’s str.isspace() (Py_UNICODE_ISSPACE): the Unicode White_Space property plus the bidi separators U+001C..U+001F. See [is_space_char]/[WHITESPACE_RANGES].
istitle
Return true where the string is titlecased and non-empty. Matches numpy.strings.istitle / CPython str.istitle() (do_istitle): uppercase/titlecase characters may only follow an uncased character (they open a word), lowercase characters may only follow a cased character, and at least one cased character is present. Titlecase (Lt) characters such as Dž count as an opening (uppercase-position) character, so "Dž" and "Džx" are titlecased.
isupper
Return true where the string is uppercased and the string is non-empty. Matches numpy.strings.isupper / CPython str.isupper() (do_isupper): there is at least one cased character and no cased character is lowercase or titlecase. Uncased characters (digits, punctuation, roman numerals like which has the Uppercase property) do not disqualify the string.