mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-31 14:35:18 +00:00
init
This commit is contained in:
@@ -42,6 +42,8 @@ public partial class SettingsModel : ObservableObject
|
||||
|
||||
public bool IgnoreShortcutWhenFullscreen { get; set; }
|
||||
|
||||
public bool IsePinYinInput { get; set; } = true;
|
||||
|
||||
public Dictionary<string, ProviderSettings> ProviderSettings { get; set; } = [];
|
||||
|
||||
public Dictionary<string, CommandAlias> Aliases { get; set; } = [];
|
||||
|
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
public enum MatchLanguage
|
||||
{
|
||||
English,
|
||||
|
||||
// CJK will be matched by the CJK language pack
|
||||
Chinese,
|
||||
Japanese,
|
||||
Korean,
|
||||
}
|
@@ -22,4 +22,6 @@ public partial class MatchOption
|
||||
public string Suffix { get; set; } = string.Empty;
|
||||
|
||||
public bool IgnoreCase { get; set; } = true;
|
||||
|
||||
public MatchLanguage Language { get; set; } = MatchLanguage.English;
|
||||
}
|
||||
|
@@ -38,6 +38,16 @@ public partial class StringMatcher
|
||||
return Instance.FuzzyMatch(query, stringToCompare);
|
||||
}
|
||||
|
||||
public static MatchResult FuzzySearch(string query, string stringToCompare, MatchLanguage language)
|
||||
{
|
||||
var opt = new MatchOption
|
||||
{
|
||||
Language = language,
|
||||
};
|
||||
|
||||
return Instance.FuzzyMatch(query, stringToCompare, opt);
|
||||
}
|
||||
|
||||
public MatchResult FuzzyMatch(string query, string stringToCompare)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user