forked from hanmin0822/MisakaTranslator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAfterTransHandle.cs
41 lines (34 loc) · 1.05 KB
/
AfterTransHandle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TransOptimizationLibrary
{
public class AfterTransHandle
{
NounTransOptimization nto;
BeforeTransHandle bth;
public AfterTransHandle(BeforeTransHandle b)
{
bth = b;
}
/// <summary>
/// 外部调用的共用方法,自动进行翻译后处理
/// </summary>
/// <param name="text">通过翻译接口翻译后的句子</param>
/// <returns>处理后句子</returns>
public string AutoHandle(string text)
{
if (text == null || text == "")
{
return "";
}
//目前只支持名词的预处理,处理后检查是否有对话人名,如果有则加上
if (bth.GetPeopleChatName() != "") {
text = bth.GetPeopleChatName() + ": " + text;
}
return text;
}
}
}