MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / tryLoadDictFromDisk

Function tryLoadDictFromDisk

packages/node-runtime/src/nlp/segmenter.ts:46–55  ·  view source on GitHub ↗
(dictId: string)

Source from the content-addressed store, hash-verified

44}
45
46function tryLoadDictFromDisk(dictId: string): Buffer | null {
47 if (!_nlpDir) return null
48 const dictPath = path.join(_nlpDir, `${dictId}.dict`)
49 if (!fs.existsSync(dictPath)) return null
50 try {
51 return fs.readFileSync(dictPath)
52 } catch {
53 return null
54 }
55}
56
57/**
58 * 获取 Jieba 实例(支持多词库)

Callers 1

getJiebaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected