2021-06-17 04:55:44 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Spencer Dixon <spencercdixon@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2022-04-16 23:01:20 +03:00
|
|
|
#pragma once
|
|
|
|
|
2022-09-18 20:44:23 +03:00
|
|
|
#include <AK/StringView.h>
|
2022-04-16 23:01:20 +03:00
|
|
|
|
|
|
|
namespace AK {
|
2021-06-17 04:55:44 +03:00
|
|
|
|
2022-04-16 23:01:20 +03:00
|
|
|
struct FuzzyMatchResult {
|
|
|
|
bool matched { false };
|
|
|
|
int score { 0 };
|
|
|
|
};
|
2021-06-17 04:55:44 +03:00
|
|
|
|
2022-09-18 20:44:23 +03:00
|
|
|
FuzzyMatchResult fuzzy_match(StringView needle, StringView haystack);
|
2021-06-17 04:55:44 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-11-26 14:18:30 +03:00
|
|
|
#if USING_AK_GLOBALLY
|
2022-04-16 23:01:20 +03:00
|
|
|
using AK::fuzzy_match;
|
|
|
|
using AK::FuzzyMatchResult;
|
2022-11-26 14:18:30 +03:00
|
|
|
#endif
|