Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion subtle_gui/gui/subsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def processNewTrackLoaded(self) -> None:
self.subEntries.clear()
for frame in track.iterFrames():
item = QTreeWidgetItem()
item.setText(self.C_ID, str(self.subEntries.topLevelItemCount()))
item.setText(self.C_ID, str(self.subEntries.topLevelItemCount() + 1))
item.setText(self.C_TIME, formatTS(frame.start))
item.setText(self.C_LENGTH, f"{frame.length / 1000.0:.3f} s")
item.setData(self.C_DATA, self.D_INDEX, frame.index)
Expand Down
2 changes: 2 additions & 0 deletions subtle_gui/gui/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def setEditorText(self, frame: FrameBase) -> None:
bFmt.setLineHeight(120.0, 1)
cursor.select(QTextCursor.SelectionType.Document)
cursor.mergeBlockFormat(bFmt)
if document := self.textEdit.document():
document.clearUndoRedoStacks()

self._block = False

Expand Down
5 changes: 0 additions & 5 deletions subtle_gui/ocr/tesseract.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

RX_REPLACE = {
"all": [
# (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
Expand All @@ -70,10 +69,6 @@
(re.compile(r"\b(fo)\b", re.UNICODE), "to"),
(re.compile(r"\b(lf)\b", re.UNICODE), "If"),
(re.compile(r"\b(l)\b", re.UNICODE), "I"),
# Wrong capitalisation at the start of words
(re.compile(r"(?<![.!?\)\]-])\s(K)now", re.UNICODE), "k"),
(re.compile(r"(?<![.!?\)\]-])\s(I)t+", re.UNICODE), "i"),
(re.compile(r"(?<![.!?\)\]-])\s(S)o+", re.UNICODE), "s"),
# Missing apostrophe
(re.compile(r"\b[D|d]id(nt)\b", re.UNICODE), "n't"),
(re.compile(r"\b[T|t]hey(re)\b", re.UNICODE), "'re"),
Expand Down