WangDingchun/srt-reader-java ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Java library for reading SRT subtitle files.
I want it to parse subtitle files reliably, including subtitles that span multiple lines, and make it easy to look up the subtitle for a given playback time, like one second at a time while a video is playing. Please keep the lookup fast, since this may be used in a player. If it makes sense, use a map based structure to organize the subtitle times so reading is efficient.
I’d like a simple reader class that loads an SRT file and returns subtitle info in a way that is easy to use from a player or other app. Also add a small demo or test class so I can see how to call it and get the right subtitle for a given timestamp. Keep the code clean and straightforward, and include whatever basic handling is needed so it works with normal SRT files. If you need to check current Java best practices, feel free to look them up online.
Are you gonna build this?
make sure you review the code using coderabbit