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

Method save

src/python/handler/py_utils.cpp:1247–1256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1245}
1246
1247void PhraserObject::save(const std::string& path) const
1248{
1249 ofstream ofs{ path, ios_base::binary };
1250 if (!ofs) throw py::OSError{ string{"cannot write to '"} + path + "'" };
1251 tomoto::serializer::writeMany(ofs, tomoto::serializer::to_keyz("tph1"),
1252 vocabs,
1253 cand_info,
1254 trie_nodes
1255 );
1256}
1257
1258py::UniqueCObj<PhraserObject> PhraserObject::load(PyObject* cls, const std::string& path)
1259{

Callers

nothing calls this directly

Calls 2

writeManyFunction · 0.85
to_keyzFunction · 0.85

Tested by

no test coverage detected