mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
added log into Alphabet service since it can induce a large perf hit
This commit is contained in:
@@ -117,6 +117,12 @@ namespace Wox.Infrastructure
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (word.Length > 40)
|
||||||
|
{
|
||||||
|
Log.Debug($"|Wox.Infrastructure.StringMatcher.ScoreForPinyin|skip too long string: {word}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var chinese = word.Select(PinyinHelper.toHanyuPinyinStringArray)
|
var chinese = word.Select(PinyinHelper.toHanyuPinyinStringArray)
|
||||||
.Any(p => p != null);
|
.Any(p => p != null);
|
||||||
return chinese;
|
return chinese;
|
||||||
|
|||||||
@@ -131,12 +131,6 @@ namespace Wox.Infrastructure
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(source) && !string.IsNullOrEmpty(target))
|
if (!string.IsNullOrEmpty(source) && !string.IsNullOrEmpty(target))
|
||||||
{
|
{
|
||||||
if(source.Length > 40)
|
|
||||||
{
|
|
||||||
Log.Debug($"|Wox.Infrastructure.StringMatcher.ScoreForPinyin|skip too long string: {source}");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Alphabet.ContainsChinese(source))
|
if (Alphabet.ContainsChinese(source))
|
||||||
{
|
{
|
||||||
var combination = Alphabet.PinyinComination(source);
|
var combination = Alphabet.PinyinComination(source);
|
||||||
|
|||||||
Reference in New Issue
Block a user