Add check box for "SE handles text merge"

Related to #6449
This commit is contained in:
niksedk 2022-11-25 22:00:54 +01:00
parent 6adb81221d
commit 59618ea817
7 changed files with 28 additions and 0 deletions

View File

@ -3046,6 +3046,7 @@ Keep changes?</KeepChangesMessage>
<CloudVisionApi>Google Cloud Vision API</CloudVisionApi>
<ApiKey>API key</ApiKey>
<SendOriginalImages>Send original images</SendOriginalImages>
<SeHandlesTextMerge>SE handles text merge</SeHandlesTextMerge>
</VobSubOcr>
<VobSubOcrCharacter>
<Title>OCR - Manual image to text</Title>

View File

@ -437,6 +437,7 @@ namespace Nikse.SubtitleEdit.Core.Common
SpellCheckAutoChangeNameCasing = false;
SpellCheckAutoChangeNamesUseSuggestions = false;
OcrFixUseHardcodedRules = true;
OcrGoogleCloudVisionSeHandlesTextMerge = true;
OcrBinaryImageCompareRgbThreshold = 200;
OcrTesseract4RgbThreshold = 200;
OcrAddLetterRow1 = "♪;á;é;í;ó;ö;ő;ú;ü;ű;ç;ñ;å;¿";

View File

@ -177,6 +177,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
this.underlineToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.timerHideStatus = new System.Windows.Forms.Timer(this.components);
this.checkBoxSeHandlesTextMerge = new System.Windows.Forms.CheckBox();
this.contextMenuStripListview.SuspendLayout();
this.groupBoxOcrMethod.SuspendLayout();
this.groupBoxCloudVision.SuspendLayout();
@ -531,6 +532,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
//
// groupBoxCloudVision
//
this.groupBoxCloudVision.Controls.Add(this.checkBoxSeHandlesTextMerge);
this.groupBoxCloudVision.Controls.Add(this.checkBoxCloudVisionSendOriginalImages);
this.groupBoxCloudVision.Controls.Add(this.comboBoxCloudVisionLanguage);
this.groupBoxCloudVision.Controls.Add(this.labelCloudVisionLanguage);
@ -2032,6 +2034,17 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
this.timerHideStatus.Interval = 2000;
this.timerHideStatus.Tick += new System.EventHandler(this.timerHideStatus_Tick);
//
// checkBoxSeHandlesTextMerge
//
this.checkBoxSeHandlesTextMerge.AutoSize = true;
this.checkBoxSeHandlesTextMerge.Location = new System.Drawing.Point(7, 105);
this.checkBoxSeHandlesTextMerge.Name = "checkBoxSeHandlesTextMerge";
this.checkBoxSeHandlesTextMerge.Size = new System.Drawing.Size(134, 17);
this.checkBoxSeHandlesTextMerge.TabIndex = 5;
this.checkBoxSeHandlesTextMerge.Text = "SE handles text merge";
this.checkBoxSeHandlesTextMerge.UseVisualStyleBackColor = true;
this.checkBoxSeHandlesTextMerge.CheckedChanged += new System.EventHandler(this.checkBoxSeHandlesTextMerge_CheckedChanged);
//
// VobSubOcr
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -2270,5 +2283,6 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
private System.Windows.Forms.ComboBox comboBoxCloudVisionLanguage;
private System.Windows.Forms.Label labelCloudVisionLanguage;
private System.Windows.Forms.CheckBox checkBoxCloudVisionSendOriginalImages;
private System.Windows.Forms.CheckBox checkBoxSeHandlesTextMerge;
}
}

View File

@ -592,9 +592,11 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
labelCloudVisionApiKey.Text = language.ApiKey;
labelCloudVisionLanguage.Text = language.Language;
checkBoxCloudVisionSendOriginalImages.Text = language.SendOriginalImages;
checkBoxSeHandlesTextMerge.Text = language.SeHandlesTextMerge;
textBoxCloudVisionApiKey.Text = Configuration.Settings.VobSubOcr.CloudVisionApiKey;
checkBoxCloudVisionSendOriginalImages.Checked = Configuration.Settings.VobSubOcr.CloudVisionSendOriginalImages;
checkBoxSeHandlesTextMerge.Checked = Configuration.Settings.Tools.OcrGoogleCloudVisionSeHandlesTextMerge;
comboBoxTesseractLanguages.Left = labelTesseractLanguage.Left + labelTesseractLanguage.Width;
buttonGetTesseractDictionaries.Left = comboBoxTesseractLanguages.Left + comboBoxTesseractLanguages.Width + 5;
@ -9758,5 +9760,10 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
// Toggle subtitle image refresh
SubtitleListView1SelectedIndexChanged(sender, e);
}
private void checkBoxSeHandlesTextMerge_CheckedChanged(object sender, EventArgs e)
{
Configuration.Settings.Tools.OcrGoogleCloudVisionSeHandlesTextMerge = checkBoxSeHandlesTextMerge.Checked;
}
}
}

View File

@ -3424,6 +3424,7 @@ Keep changes?",
CloudVisionApi = "Google Cloud Vision API",
ApiKey = "API key",
SendOriginalImages = "Send original images",
SeHandlesTextMerge = "SE handles text merge",
};
VobSubOcrCharacter = new LanguageStructure.VobSubOcrCharacter

View File

@ -8335,6 +8335,9 @@ namespace Nikse.SubtitleEdit.Logic
case "VobSubOcr/SendOriginalImages":
language.VobSubOcr.SendOriginalImages = reader.Value;
break;
case "VobSubOcr/SeHandlesTextMerge":
language.VobSubOcr.SeHandlesTextMerge = reader.Value;
break;
case "VobSubOcrCharacter/Title":
language.VobSubOcrCharacter.Title = reader.Value;
break;

View File

@ -3270,6 +3270,7 @@ namespace Nikse.SubtitleEdit.Logic
public string CloudVisionApi { get; set; }
public string ApiKey { get; set; }
public string SendOriginalImages { get; set; }
public string SeHandlesTextMerge { get; set; }
}
public class VobSubOcrCharacter