MCPcopy Create free account
hub / github.com/Voine/ChatWaifu_Mobile / init

Method init

VITS/src/main/cpp/openjtalk/api/api.cpp:165–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165bool OpenJtalk::init(const char* path, AssetJNI* assetjni) {
166 if (mecab != nullptr && njd != nullptr && jpcommon != nullptr) return true;
167
168 mecab = new Mecab();
169 njd = new NJD();
170 jpcommon = new JPCommon();
171
172 Mecab_initialize(mecab);
173 NJD_initialize(njd);
174 JPCommon_initialize(jpcommon);
175
176 int r = Mecab_load(mecab, path, assetjni);
177 if (r != 1) {
178 _clear();
179 cerr << path << " not found!" << endl;
180 return false;
181 }
182 return true;
183}
184
185void OpenJtalk::_clear() {
186 Mecab_clear(mecab);

Calls 4

Mecab_initializeFunction · 0.85
NJD_initializeFunction · 0.85
JPCommon_initializeFunction · 0.85
Mecab_loadFunction · 0.85

Tested by

no test coverage detected