MCPcopy Create free account
hub / github.com/bab2min/tomotopy / getSpan

Method getSpan

src/python/handler/py_utils.cpp:890–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888}
889
890py::UniqueObj DocumentObject::getSpan() const
891{
892 auto starts = doc->origWordPos;
893 auto lengthes = doc->origWordLen;
894 byte2Char(doc->rawStr, starts, lengthes);
895
896 auto ret = py::UniqueObj{ PyList_New(starts.size()) };
897 for (size_t i = 0; i < starts.size(); ++i)
898 {
899 size_t begin = starts[i], end = begin + lengthes[i];
900 PyList_SetItem(ret.get(), i, py::buildPyTuple(begin, end).release());
901 }
902 return ret;
903}
904
905tomoto::Float DocumentObject::getWeight() const
906{

Callers

nothing calls this directly

Calls 5

byte2CharFunction · 0.85
buildPyTupleFunction · 0.85
sizeMethod · 0.45
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected