Names containing the given segment (rare-single-word tier).
(segment: string, limit: number)
| 1228 | |
| 1229 | /** Names containing the given segment (rare-single-word tier). */ |
| 1230 | getNamesForSegment(segment: string, limit: number): string[] { |
| 1231 | if (!this.hasSchema('name_segment_vocab')) return []; |
| 1232 | const rows = this.db |
| 1233 | .prepare('SELECT name FROM name_segment_vocab WHERE segment = ? ORDER BY length(name) ASC LIMIT ?') |
| 1234 | .all(segment, limit) as Array<{ name: string }>; |
| 1235 | return rows.map((r) => r.name); |
| 1236 | } |
| 1237 | |
| 1238 | /** |
| 1239 | * Get a node by ID |
no test coverage detected