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