| 38 | } |
| 39 | |
| 40 | size_t DocumentObject::getPseudoDocId() const |
| 41 | { |
| 42 | if (corpus->isIndependent()) throw py::AttributeError{ "doc has no `pseudoDoc` field!" }; |
| 43 | if (!doc) throw py::RuntimeError{ "doc is null!" }; |
| 44 | if (auto ret = docVisit<tomoto::DocumentPT>(getBoundDoc(), [](auto* doc) -> std::optional<size_t> |
| 45 | { |
| 46 | return doc->pseudoDoc; |
| 47 | })) return *ret; |
| 48 | throw py::AttributeError{ "doc has no `pseudoDoc` field!" }; |
| 49 | } |
| 50 | |
| 51 | std::vector<std::pair<tomoto::Tid, tomoto::Float>> DocumentObject::getTopicsFromPseudoDoc(size_t topN) const |
| 52 | { |
nothing calls this directly
no test coverage detected