Skip to content

Commit c4fd3cd

Browse files
Iteration 147: strSplitExpand, strExtractGroups, strPartition, strRPartition, strMultiReplace, strIndent, strDedent
Added src/stats/string_ops_extended.ts — 7 standalone advanced string operations: - strSplitExpand: split strings and expand parts to DataFrame columns (mirrors pandas str.split(expand=True)) - strExtractGroups: extract regex capture groups (named or numbered) to DataFrame (mirrors pandas str.extract) - strPartition / strRPartition: split at first/last occurrence of sep → (before, sep, after) tuple or DataFrame - strMultiReplace: apply multiple find/replace pairs in sequence (string literals or RegExp) - strIndent: prefix every non-empty line with a string (mirrors textwrap.indent) - strDedent: remove common leading whitespace from all lines (mirrors textwrap.dedent) All functions use TypeScript overloads for scalar vs Series/array dispatch. 50+ unit tests + 4 property-based tests (fast-check). Playground page string_ops_extended.html with interactive demos for all 7 functions. Run: https://github.com/githubnext/tsessebe/actions/runs/24206383170 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b6229d commit c4fd3cd

6 files changed

Lines changed: 1312 additions & 0 deletions

File tree

playground/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ <h3><a href="string_ops.html" style="color: var(--accent); text-decoration: none
304304
<p>Module-level string utilities: <code>strNormalize</code> (Unicode NFC/NFD/NFKC/NFKD), <code>strGetDummies</code> (one-hot DataFrame), <code>strExtractAll</code> (all regex matches), <code>strRemovePrefix</code>, <code>strRemoveSuffix</code>, <code>strTranslate</code> (char-level substitution), <code>strCharWidth</code> (CJK-aware display width), <code>strByteLength</code>. Works on Series, arrays, or scalars.</p>
305305
<div class="status done">✅ Complete</div>
306306
</div>
307+
<div class="feature-card">
308+
<h3><a href="string_ops_extended.html" style="color: var(--accent); text-decoration: none;">🔤 string_ops_extended — Extended String Ops</a></h3>
309+
<p>Advanced string utilities: <code>strSplitExpand</code> (split → DataFrame columns), <code>strExtractGroups</code> (regex capture groups → DataFrame), <code>strPartition</code> / <code>strRPartition</code> (split into before/sep/after), <code>strMultiReplace</code> (batch replacements), <code>strIndent</code> / <code>strDedent</code> (line-level indentation). Works on Series, arrays, or scalars.</p>
310+
<div class="status done">✅ Complete</div>
311+
</div>
307312
<div class="feature-card">
308313
<h3><a href="pipe_apply.html" style="color: var(--accent); text-decoration: none;">🔗 pipe_apply — Pipeline &amp; Apply Utilities</a></h3>
309314
<p>Standalone equivalents of pandas' <code>pipe()</code> / <code>apply()</code> / <code>applymap()</code>: <code>pipe</code> (variadic type-safe pipeline), <code>seriesApply</code> (element-wise with label/pos context), <code>seriesTransform</code>, <code>dataFrameApply</code> (axis 0/1), <code>dataFrameApplyMap</code> (cell-wise), <code>dataFrameTransform</code> (column-wise), <code>dataFrameTransformRows</code> (row-wise).</p>

0 commit comments

Comments
 (0)