| 63 | } |
| 64 | |
| 65 | void VocabObject::setstate(PyObject* dict) |
| 66 | { |
| 67 | PyObject* id2word = PyDict_GetItemString(dict, "id2word"); |
| 68 | this->~VocabObject(); |
| 69 | vocabs = new tomoto::Dictionary; |
| 70 | dep = {}; |
| 71 | size = -1; |
| 72 | py::foreach<std::string>(id2word, [&](const std::string& str) |
| 73 | { |
| 74 | vocabs->add(str); |
| 75 | }, ""); |
| 76 | if (PyErr_Occurred()) throw py::ExcPropagation{}; |
| 77 | } |
| 78 | |
| 79 | size_t VocabObject::len() const |
| 80 | { |
nothing calls this directly
no test coverage detected