diff --git a/Wox.Infrastructure/Alphabet.cs b/Wox.Infrastructure/Alphabet.cs index 91979bf526..d7fae882cb 100644 --- a/Wox.Infrastructure/Alphabet.cs +++ b/Wox.Infrastructure/Alphabet.cs @@ -117,6 +117,12 @@ namespace Wox.Infrastructure 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) .Any(p => p != null); return chinese; diff --git a/Wox.Infrastructure/StringMatcher.cs b/Wox.Infrastructure/StringMatcher.cs index 9c49b4119b..5b82b18918 100644 --- a/Wox.Infrastructure/StringMatcher.cs +++ b/Wox.Infrastructure/StringMatcher.cs @@ -131,12 +131,6 @@ namespace Wox.Infrastructure { 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)) { var combination = Alphabet.PinyinComination(source);