amebalabs / TRex

Copy any text on your screen, stop retyping.
https://trex.ameba.co
MIT License
1.24k stars 40 forks source link

Code transcription: Braces, semicolons #27

Closed pavelloz closed 1 year ago

pavelloz commented 1 year ago

Hey, thanks for Trex, great tool :)

Ive been trying recently to use it also to transcript some code during screenshare session and it seems to me like OCR is not taking { ( [ ; ] ) } characters into account.

Here is an example of code that you can test on - the image is very high resolution: https://www.marclittlemore.com/images/posts/codesnap-screenshot.png

For some reason at the end, where we have

        }
    }
}

Trex translates it to M, Ma, Man and some similar strings.

Is the issue connected to any specific type of font type? I think if OCR is able to detect piece of code (ie. by statistical analysis of special characters, which are much more commonly used in code, than in normal language), it could be a huge improvement for developers.

Again, thanks for your work :)

melonamin commented 1 year ago

Hey @pavelloz.

At this moment, TRex uses Apple's built-in text recognition engine, which is fast, pretty accurate, and works offline but sucks for code... And unfortunately, I can't customize it much.

Copying the code from screenshots was one of the use cases I had in mind when building TRex, but unfortunately, it is still a dream... I though to bring in a third-party OCR, but this would greatly overcomplicate things

pavelloz commented 1 year ago

Oh, i understand. Adding external ocr to a small app is a different game entirely.