Skip to content

Commit

Permalink
build: load all resources if they end with .dll
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Feb 2, 2024
1 parent b3f0b9f commit 97b93ef
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 527 deletions.
4 changes: 2 additions & 2 deletions lc-hax/Scripts/Helpers/FuzzyMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ static int LongestCommonSubstring(ReadOnlySpan<char> query, ReadOnlySpan<char> o
return result;
}

static int GetSimilarityWeight(ReadOnlySpan<char> query, ReadOnlySpan<char> original) {
static int GetSimilarityWeight(string query, string original) {
int distancePenalty = Levenshtein.GetDistance(query, original);
int commonalityReward = Helper.LongestCommonSubstring(query, original) * -2;

return distancePenalty + commonalityReward;
}

public static string FuzzyMatch(ReadOnlySpan<char> query, StringArray strings) {
public static string FuzzyMatch(string query, StringArray strings) {
string closestMatch = strings[0];
int lowestWeight = Helper.GetSimilarityWeight(query, strings[0]);

Expand Down
82 changes: 0 additions & 82 deletions lc-hax/Scripts/Libraries/Quickenshtein/DataHelper.cs

This file was deleted.

Loading

0 comments on commit 97b93ef

Please sign in to comment.