(nlpDir: string)
| 153 | * 自动下载默认词库(应用启动时调用) |
| 154 | */ |
| 155 | export 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 | } |
no test coverage detected