-
Add include and external/stfrie/include to your include path
-
Include header
#include <trimatch/index.hpp>
- Build index
std::vector<std::string> texts; // you can also use u16string, u32string, etc.
...
auto index = trimatch::set::build(texts);
- Search texts
std::string query = "...";
auto searcher = index.searcher();
for(const auto& [text, distance]: searcher.approx(query))
std::cout << "text=" << text << ", distance=" << distance << std::endl;