| 217 | } |
| 218 | |
| 219 | py::UniqueObj DocumentObject::getMultiMetadata() const |
| 220 | { |
| 221 | if (!doc) throw py::RuntimeError{ "doc is null!" }; |
| 222 | auto inst = corpus->tm->getInst<tomoto::IDMRModel>(); |
| 223 | |
| 224 | if(auto ret = docVisit<tomoto::DocumentDMR>(getBoundDoc(), [&](auto* doc) |
| 225 | { |
| 226 | return py::buildPyValueTransform(doc->multiMetadata.begin(), doc->multiMetadata.end(), [&](uint64_t x) |
| 227 | { |
| 228 | return inst->getMultiMetadataDict().toWord(x); |
| 229 | }); |
| 230 | })) return ret; |
| 231 | throw py::AttributeError{ "doc has no `multi_metadata` field!" }; |
| 232 | } |
nothing calls this directly
no test coverage detected