Names containing the given segment (rare-single-word tier).
(segment: string, limit: number)
| 1162 | |
| 1163 | /** Names containing the given segment (rare-single-word tier). */ |
| 1164 | getNamesForSegment(segment: string, limit: number): string[] { |
| 1165 | if (!this.hasSchema('name_segment_vocab')) return []; |
| 1166 | const rows = this.db |
| 1167 | .prepare('SELECT name FROM name_segment_vocab WHERE segment = ? ORDER BY length(name) ASC LIMIT ?') |
| 1168 | .all(segment, limit) as Array<{ name: string }>; |
| 1169 | return rows.map((r) => r.name); |
| 1170 | } |
| 1171 | |
| 1172 | /** |
| 1173 | * Get a node by ID |
no test coverage detected