| 25 | const RESTATED_WORDS = 3; |
| 26 | |
| 27 | const wordsOf = (text: string): string[] => (text.match(/`[^`]+`|[\p{L}\p{N}_][\p{L}\p{N}_.:/-]*/gu) ?? []).map(word => word.replace(/[.:/-]+$/, '')).filter(Boolean); |
| 28 | /** A name, path or number: something the question did not say is information, however short the answer. */ |
| 29 | const codeShaped = (word: string): boolean => /^`|\p{N}|_|[./:]|\p{Ll}\p{Lu}|\p{Lu}{2}\p{Ll}/u.test(word); |
| 30 | /** The same word, mistyped or inflected: "Heirarchy" for "heirarchie", "erklärt" for "erkläre". */ |