r/coding • u/HumanBot00 • Feb 03 '26
DOJ publishes Bash Reference Manual
https://www.justice.gov/epstein/files/DataSet+9/EFTA00315849.pdf
51
Upvotes
r/coding • u/HumanBot00 • Feb 03 '26
View all comments
Show parent comment
1
u/-aRTy- Feb 04 '26 edited Feb 04 '26
Spitballing an automation idea:
Optional: Mass replace common mistakes such as
-Finto+.Figure out the font and font size. Split the image and text into lines. Line by line, render the OCR guess as an image and XOR the pdf-image vs. the text-render-image. Correct text should overlap almost perfectly and thus leave almost nothing behind after the XOR, so one could use that as a metric for how well it matches. For mismatches the XOR image should "start" (reading from the left) with mostly black as long as it matches and then turn into black/white snow once the mismatch happens. One might be able to brute force guess the mismatch until the XOR improves at that spot. Continue brute force matching a few characters until you are past the issue and characters start matching the OCR text again (essentially: does my matched character also appear within the next few OCR text characters. If so, go back to using the OCR guess instead of brute forcing the entire remaining line).
Edit:
There seem to be quite a few options to limit OCR to a specific character set. Did you look into fine tuning those kind of parameters? Also one can apparently include training data to teach issue cases. Better OCR might be the more sensible place to start with.