googlefonts / googlefonts/diffenator2
Trimming substrings is unsound
- Dominant language
- Python
- Stars
- 68
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Random thought: you go through the wordlist and remove words which are substrings of another string. I guess the thinking is “rats has all the letters of rat so we don’t need to test rat by itself.” This is *probably* true for Latin but unsound in general. The easiest way to see why is to imagine your input is Arabic. “rat” has a final t but “rats” has a medial t; the t is doing different things in the two cases, so it’s not correct to use a super-string to “include” a test for a substring. Similarly for anything which does contextual stuff based on letter position - including Latin handwriting fonts…
I don’t know how much difference this makes in practice given a big enough word list, but I’m not convinced it’s something that there’s a logical basis for doing.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.