// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "i_enum_store.h" #include #include namespace search::attribute { /** * Less-than comparator used for comparing next candidate string * (successor) from vespa::fuzzy::LevenshteinDfa with strings stored * in an enum store as part of a dictionary iterator seek, skipping * entries that don't match the fuzzy term. * * The code points from the candidate string are not folded during * the comparison. */ class DfaStringComparator : public vespalib::datastore::UniqueStoreStringComparator { public: using ParentType = vespalib::datastore::UniqueStoreStringComparator; using DataStoreType = ParentType::DataStoreType; private: using ParentType::get; std::reference_wrapper> _candidate; bool _cased; public: DfaStringComparator(const DataStoreType& data_store, const std::vector& candidate, bool cased) noexcept; bool less(const vespalib::datastore::EntryRef lhs, const vespalib::datastore::EntryRef rhs) const noexcept override; }; }