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