struct

Crysda::StringCol

Inherits Crysda::DataCol / Struct / Value / Object

=========================================================================== String Column

Constructors

interned(name : String, data : Array(String), bitmap : NullBitmap) : StringCol

Create from raw data with interning

Source
interned(name : String, val : Array(String | Nil)) : StringCol

Create StringCol with string interning for categorical data

Source
new(name : String, val : Array(String | Nil))
Source

Instance methods

<(val : String)
Source
<(val : StringCol)
Source
<=(val : String)
Source
<=(val : StringCol)
Source
>(val : String)
Source
>(val : StringCol)
Source
>=(val : String)
Source
>=(val : StringCol)
Source
categorical?(threshold : Float64 = 0.5) : Bool

Check if this column is categorical (low cardinality)

Source
compare(left : Int32, right : Int32, null_last = true) : Int32
Source
contains(pattern : String, case_sensitive : Bool = true) : Array(Bool)

Check if strings contain a pattern (string or regex)

Source
contains(pattern : Regex) : Array(Bool)

Check if strings contain a regex pattern

Source
count(pattern : String) : Int32Col

Count occurrences of pattern in each string

Source
downcase

Convert to lowercase

Source
each

Lazy iteration - yields values without materializing full array

Source
each_non_null

Lazy iteration over non-null values only (fast path)

Source
each_with_index

Lazy iteration with index

Source
ends_with(suffix : String, case_sensitive : Bool = true) : Array(Bool)

Check if strings end with suffix

Source
extract(pattern : Regex) : StringCol

Extract first match of regex pattern, returns StringCol If regex has capture groups, returns the first capture group

Source
has_nulls?
Source
len

Get string length

Source
lstrip

Strip whitespace from left

Source
matches(pattern : Regex) : Array(Bool)

Check if strings match regex exactly

Source
pad_left(width : Int32, pad_char : Char = ' ') : StringCol

Pad string to specified width (left pad)

Source
pad_right(width : Int32, pad_char : Char = ' ') : StringCol

Pad string to specified width (right pad)

Source
plus(val : DataCol)
Source
replace(pattern : String, replacement : String) : StringCol

Replace pattern with replacement string

Source
replace(pattern : Regex, replacement : String) : StringCol

Replace regex pattern with replacement string

Source
rstrip

Strip whitespace from right

Source
slice(start : Int32, length : Int32 | Nil = nil) : StringCol

Substring extraction

Source
starts_with(prefix : String, case_sensitive : Bool = true) : Array(Bool)

Check if strings start with prefix

Source
strip

Strip whitespace from both ends

Source
unique_count

Get unique values count (useful for determining if interning is beneficial)

Source
unsafe_fetch(index : Int32) : String | Nil

Direct index access without array materialization

Source
upcase

Convert to uppercase

Source
values
Source