Pass "ShouldUsePinyin" to StringMatcher

Flag is used in method "ShouldUsePinyin()" to avoid calling Alphabet
service. Otherwise, tests applying to StringMatcher.FuzzySearch() would
fail because the pinyin helper library fails to initialize.
This commit is contained in:
SysC0mp
2019-12-09 20:57:59 +01:00
parent 78f243651e
commit 49c5c5bbde
3 changed files with 19 additions and 2 deletions

View File

@@ -24,7 +24,17 @@ namespace Wox.Infrastructure.UserSettings
/// <summary>
/// when false Alphabet static service will always return empty results
/// </summary>
public bool ShouldUsePinyin { get; set; } = true;
private bool _shouldUsePinyin = true;
public bool ShouldUsePinyin
{
get { return _shouldUsePinyin; }
set
{
_shouldUsePinyin = value;
StringMatcher.ShouldUsePinyin = value;
}
}
private string _querySearchPrecision { get; set; } = StringMatcher.SearchPrecisionScore.Regular.ToString();
public string QuerySearchPrecision