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

Function loadDictBuffer

packages/node-runtime/src/nlp/dict-manager.ts:49–58  ·  view source on GitHub ↗
(nlpDir: string, dictId: string)

Source from the content-addressed store, hash-verified

47}
48
49export function loadDictBuffer(nlpDir: string, dictId: string): Buffer | null {
50 const filePath = getDictFilePath(nlpDir, dictId)
51 if (!fs.existsSync(filePath)) return null
52 try {
53 return fs.readFileSync(filePath)
54 } catch (error) {
55 console.error(`[NLP DictManager] Failed to read dict file: ${filePath}`, error)
56 return null
57 }
58}
59
60export async function downloadDict(
61 nlpDir: string,

Callers

nothing calls this directly

Calls 2

getDictFilePathFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected