| 185 | const add = (text: string) => { for (const word of text.match(/[\p{L}\p{N}_][\p{L}\p{N}_.-]*/gu) ?? []) words.add(word.toLowerCase()); }; |
| 186 | sources.texts.forEach(add); |
| 187 | const lastPart = (name: string) => (name.split(/[/.:]/).filter(Boolean).pop() ?? name).toLowerCase(); |
| 188 | sources.names.forEach(name => { words.add(name.toLowerCase()); words.add(lastPart(name)); }); |
| 189 | const galaxy = sources.galaxy; |
| 190 | if (galaxy) for (const group of [...galaxy.relationships.incoming, ...galaxy.relationships.outgoing]) for (const file of group.files) file.symbols.forEach(symbol => words.add(symbol.name.toLowerCase())); |