MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / ensureDefaultDict

Function ensureDefaultDict

packages/node-runtime/src/nlp/dict-manager.ts:155–164  ·  view source on GitHub ↗
(nlpDir: string)

Source from the content-addressed store, hash-verified

153 * 自动下载默认词库(应用启动时调用)
154 */
155export async function ensureDefaultDict(nlpDir: string): Promise<void> {
156 if (isDictDownloaded(nlpDir, 'zh-CN')) return
157 console.log('[NLP DictManager] zh-CN dict not found, starting background download...')
158 const result = await downloadDict(nlpDir, 'zh-CN')
159 if (result.success) {
160 console.log('[NLP DictManager] zh-CN dict auto-downloaded successfully')
161 } else {
162 console.warn('[NLP DictManager] zh-CN dict auto-download failed:', result.error)
163 }
164}

Callers 1

registerNlpRoutesFunction · 0.90

Calls 3

isDictDownloadedFunction · 0.70
downloadDictFunction · 0.70
warnMethod · 0.65

Tested by

no test coverage detected