Browse Source

修改 MaxCompareDialogue 默认值为 3

Signed-off-by: allan716 <[email protected]>
allan716 4 years ago
parent
commit
065b45f340

+ 2 - 2
internal/pkg/sub_timeline_fixer/fixer.go

@@ -286,13 +286,13 @@ func (s *SubTimelineFixer) GetOffsetTime(infoBase, infoSrc *subparser.FileInfo,
 	//perMatch := float64(matchIndexLineCount) / float64(len(infoSrc.DialoguesEx))
 	perMatch := float64(matchIndexLineCount) / float64(len(baseCorpus))
 	if perMatch < s.fixerConfig.MinMatchedPercent {
-		tmpContent := infoSrc.Name + fmt.Sprintf("Sequence match %d dialogues (< %f%%), Skip,", s.fixerConfig.MaxCompareDialogue, s.fixerConfig.MinMatchedPercent*100) + fmt.Sprintf(" %f%% ", perMatch*100)
+		tmpContent := infoSrc.Name + fmt.Sprintf(" Sequence match %d dialogues (< %f%%), Skip,", s.fixerConfig.MaxCompareDialogue, s.fixerConfig.MinMatchedPercent*100) + fmt.Sprintf(" %f%% ", perMatch*100)
 
 		debugInfos = append(debugInfos, tmpContent)
 
 		log_helper.GetLogger().Debugln(tmpContent)
 	} else {
-		tmpContent := infoSrc.Name + fmt.Sprintf("Sequence match %d dialogues,", s.fixerConfig.MaxCompareDialogue) + fmt.Sprintf(" %f%% ", perMatch*100)
+		tmpContent := infoSrc.Name + fmt.Sprintf(" Sequence match %d dialogues,", s.fixerConfig.MaxCompareDialogue) + fmt.Sprintf(" %f%% ", perMatch*100)
 
 		debugInfos = append(debugInfos, tmpContent)
 

+ 2 - 2
internal/types/sub_timeline_fiexer/sub_timeline_fixer_config.go

@@ -1,7 +1,7 @@
 package sub_timeline_fiexer
 
 type SubTimelineFixerConfig struct {
-	MaxCompareDialogue int     // 最大需要匹配的连续对白,默认5
+	MaxCompareDialogue int     // 最大需要匹配的连续对白,默认3
 	MaxStartTimeDiffSD float64 // 对白开始时间的统计 SD 最大误差,超过则不进行修正
 	MinMatchedPercent  float64 // 两个文件的匹配百分比(src/base),高于这个才比例进行修正
 	MinOffset          float64 // 超过这个(+-)偏移的时间轴才校正,否则跳过,单位秒
@@ -10,7 +10,7 @@ type SubTimelineFixerConfig struct {
 // CheckDefault 检测默认值(比如某些之默认不能为0),不对就重置到默认值上
 func (s *SubTimelineFixerConfig) CheckDefault() {
 	if s.MaxCompareDialogue == 0 {
-		s.MaxCompareDialogue = 5
+		s.MaxCompareDialogue = 3
 	}
 	if s.MaxStartTimeDiffSD == 0 {
 		s.MaxStartTimeDiffSD = 0.1