Add space for pinyin translation

This commit is contained in:
弘韬 张 2020-12-08 19:48:42 +08:00
parent 2608d961d0
commit eaf3267353

View file

@ -36,8 +36,8 @@ namespace Flow.Launcher.Infrastructure
{
if (WordsHelper.HasChinese(content))
{
var result = WordsHelper.GetPinyin(content, ";");
result = GetFirstPinyinChar(result) + result.Replace(";", "");
var result = WordsHelper.GetPinyin(content, " ");
result = GetFirstPinyinChar(result) + result;
_pinyinCache[content] = result;
return result;
}
@ -59,7 +59,7 @@ namespace Flow.Launcher.Infrastructure
private string GetFirstPinyinChar(string content)
{
return string.Concat(content.Split(';').Select(x => x.First()));
return string.Concat(content.Split(' ').Select(x => x.First()));
}
}
}