topic id -> human title, read from each corpus file's header.
()
| 165 | |
| 166 | /** topic id -> human title, read from each corpus file's header. */ |
| 167 | function loadTopicTitles(): Map<string, string> { |
| 168 | const titles = new Map<string, string>(); |
| 169 | const dir = path.join(CORPUS_DIR, 'corpus'); |
| 170 | for (const f of fs.readdirSync(dir)) { |
| 171 | if (!f.endsWith('.json')) continue; |
| 172 | const data = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf8')); |
| 173 | if (data.topic) titles.set(data.topic, data.title ?? data.topic); |
| 174 | } |
| 175 | return titles; |
| 176 | } |
| 177 | |
| 178 | /** head name -> description, from both the shell and built-in audit tables. */ |
| 179 | function loadHeadDescriptions(decl: Declarations): Map<string, string> { |
no test coverage detected