SubtitleEdit/libse/Forms/RemoveTextForHISettings.cs

54 lines
3.4 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
2018-02-03 22:35:44 +01:00
using Nikse.SubtitleEdit.Core.Dictionaries;
namespace Nikse.SubtitleEdit.Core.Forms
{
public class RemoveTextForHISettings
{
public bool OnlyIfInSeparateLine { get; set; }
public bool RemoveIfAllUppercase { get; set; }
public bool RemoveTextBeforeColon { get; set; }
public bool RemoveTextBeforeColonOnlyUppercase { get; set; }
public bool ColonSeparateLine { get; set; }
public bool RemoveWhereContains { get; set; }
public List<string> RemoveIfTextContains { get; set; }
public bool RemoveTextBetweenCustomTags { get; set; }
public bool RemoveInterjections { get; set; }
2018-02-03 22:35:44 +01:00
public bool RemoveInterjectionsOnlySeparateLine { get; set; }
public bool RemoveTextBetweenSquares { get; set; }
public bool RemoveTextBetweenBrackets { get; set; }
public bool RemoveTextBetweenQuestionMarks { get; set; }
public bool RemoveTextBetweenParentheses { get; set; }
public string CustomStart { get; set; }
public string CustomEnd { get; set; }
2018-02-03 22:35:44 +01:00
public NameList NameList { get; set; }
2018-02-03 22:35:44 +01:00
public RemoveTextForHISettings(Subtitle subtitle)
{
OnlyIfInSeparateLine = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenOnlySeperateLines;
RemoveIfAllUppercase = Configuration.Settings.RemoveTextForHearingImpaired.RemoveIfAllUppercase;
RemoveTextBeforeColon = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBeforeColon;
RemoveTextBeforeColonOnlyUppercase = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBeforeColonOnlyIfUppercase;
ColonSeparateLine = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBeforeColonOnlyOnSeparateLine;
RemoveWhereContains = Configuration.Settings.RemoveTextForHearingImpaired.RemoveIfContains;
RemoveIfTextContains = new List<string>();
2016-05-03 14:56:37 +02:00
foreach (string item in Configuration.Settings.RemoveTextForHearingImpaired.RemoveIfContainsText.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
RemoveIfTextContains.Add(item.Trim());
}
RemoveTextBetweenCustomTags = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenCustom;
RemoveInterjections = Configuration.Settings.RemoveTextForHearingImpaired.RemoveInterjections;
RemoveTextBetweenSquares = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenBrackets;
RemoveTextBetweenBrackets = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenCurlyBrackets;
RemoveTextBetweenQuestionMarks = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenQuestionMarks;
RemoveTextBetweenParentheses = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenParentheses;
CustomStart = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenCustomBefore;
CustomEnd = Configuration.Settings.RemoveTextForHearingImpaired.RemoveTextBetweenCustomAfter;
2018-02-03 22:35:44 +01:00
var languageName = LanguageAutoDetect.AutoDetectGoogleLanguage(subtitle);
NameList = new NameList(Configuration.DictionariesDirectory, languageName, Configuration.Settings.WordLists.UseOnlineNames, Configuration.Settings.WordLists.NamesUrl);
}
}
2016-01-24 11:51:04 +01:00
}