24 ms·
> not sure of an easy way to deal with the PDF part of it. If you aren't doing this so often that you need automation, you could sidestep that issue by just ta
by lucb1e 4y ago
> not sure of an easy way to deal with the PDF part of it.
If you aren't doing this so often that you need automation, you could sidestep that issue by just taking screenshots at 400% zoom or so and accurately measure how many pixels each letter (a-z) takes, as well as how many pixels a space is (the censored part might be into the spacing on each side of the word), and measure how many pixels the gap is between the words surrounding the censored part, then
for word in wordlist do
# Start by accounting for the spaces
wordsize = charwidths[' '] * 2
for char in word do
wordsize += charwidths[char]
done
if wordsize == gap_size then
print("Possible word: " + word)
endif
done
Probably want to do the gap_size +/- 1 or so, but that's how I'd approach this for a given document. A starting point for a wordlist on many linux systems could be `/usr/share/dict/words`.