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

Method getWordForms

src/python/handler/py_LDA.cpp:522–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522py::UniqueObj LDAModelObject::getWordForms(size_t idx) const
523{
524 auto* inst = getInst<tomoto::ILDAModel>();
525 if (idx == (size_t)-1)
526 {
527 return py::buildPyValue(inst->getWordFormCnts());
528 }
529 else
530 {
531 if (idx >= inst->getWordFormCnts().size())
532 {
533 throw py::ValueError{ "`idx` must be less than the `len(used_vocabs)`." };
534 }
535 return py::buildPyValue(inst->getWordFormCnts()[idx]);
536 }
537}
538
539py::UniqueObj LDAModelObject::getHash() const
540{

Callers

nothing calls this directly

Calls 2

buildPyValueFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected