diff --git a/subtle_gui/formats/pgssubs.py b/subtle_gui/formats/pgssubs.py index a8d9cf1..8923d67 100644 --- a/subtle_gui/formats/pgssubs.py +++ b/subtle_gui/formats/pgssubs.py @@ -122,8 +122,10 @@ def _readData(self, path: Path) -> None: frames = [] for ds in data: state = ds.pcs.compState - if state == COMP_EPOCH: + if state == COMP_EPOCH or (state == COMP_ACQ and not frame): # Start of a new subtitles frame. + # We assume that acquisition frames after closed frames are also valid subtitles. + # These sometimes occur, and I'm not really sure why. frame = PGSFrame(len(frames), ds) frames.append(frame) elif ds.isClearFrame() and frame: diff --git a/subtle_gui/ocr/tesseract.py b/subtle_gui/ocr/tesseract.py index 17bb20f..df48082 100644 --- a/subtle_gui/ocr/tesseract.py +++ b/subtle_gui/ocr/tesseract.py @@ -51,7 +51,7 @@ RX_REPLACE = { "all": [ - (re.compile(r"^(-\s)[\w]", re.UNICODE), "-"), + # (re.compile(r"^(-\s)[\w]", re.UNICODE), "-"), (re.compile(r"^(\.{2})[\s\w]", re.UNICODE), "..."), (re.compile(r"^(\.{3}\s)\w", re.UNICODE), "..."), # Wrong capitalisation in the middle of words