MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / sz_py_export_strings_as_sequence

Function sz_py_export_strings_as_sequence

python/stringzilla.c:536–551  ·  view source on GitHub ↗

* @brief Helper function to export a `Strs` or similar sequence objects into a `sz_sequence_t`. */

Source from the content-addressed store, hash-verified

534 * @brief Helper function to export a `Strs` or similar sequence objects into a `sz_sequence_t`.
535 */
536SZ_DYNAMIC sz_bool_t sz_py_export_strings_as_sequence(PyObject *object, sz_sequence_t *sequence) {
537 if (!sequence) return sz_false_k;
538
539 if (PyObject_TypeCheck(object, &StrsType)) {
540 Strs *strs = (Strs *)object;
541 sz_assert_(strs->layout == STRS_FRAGMENTED && "View as tapes!");
542
543 sequence->handle = strs;
544 sequence->count = strs->data.fragmented.count;
545 sequence->get_start = sz_py_strs_sequence_member_start_if_fragmented;
546 sequence->get_length = sz_py_strs_sequence_member_length_if_fragmented;
547 return sz_true_k;
548 }
549
550 return sz_false_k;
551}
552
553/**
554 * @brief Helper function to export a `Strs` object into `sz_sequence_u32tape_t` components.

Callers 5

NeedlemanWunsch_callFunction · 0.85
SmithWaterman_callFunction · 0.85
Fingerprints_callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…