summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2023-09-18 12:30:00 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2023-09-18 13:21:04 +0000
commita51ec7e464737d864924139c06d932d71275d20a (patch)
treec439767b8f18d077de6821ba9c1e2e28625aaffb
parent23a0c0dfe271fe301cde7537a43269ca4cb14432 (diff)
Add UTF-32 exact suffix output to DFA concept
-rw-r--r--vespalib/src/vespa/vespalib/fuzzy/dfa_matcher.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/fuzzy/dfa_matcher.h b/vespalib/src/vespa/vespalib/fuzzy/dfa_matcher.h
index 4ff689b1e01..6c7e8a35b4e 100644
--- a/vespalib/src/vespa/vespalib/fuzzy/dfa_matcher.h
+++ b/vespalib/src/vespa/vespalib/fuzzy/dfa_matcher.h
@@ -3,12 +3,14 @@
#include <concepts>
#include <cstdint>
+#include <string>
+#include <vector>
namespace vespalib::fuzzy {
// Concept that all DFA matcher implementations must satisfy
template <typename T>
-concept DfaMatcher = requires(T a, std::string u8str) {
+concept DfaMatcher = requires(T a, std::string u8str, std::vector<uint32_t> u32str) {
typename T::StateType;
typename T::StateParamType;
typename T::EdgeType;
@@ -85,6 +87,9 @@ concept DfaMatcher = requires(T a, std::string u8str) {
// Precondition: implies_match_suffix(state) == true, i.e. the state is guaranteed to
// afford no edits anywhere.
{ a.emit_exact_match_suffix(typename T::StateType{}, u8str) } -> std::same_as<void>;
+
+ // Same as above, but for raw UTF-32 code point output
+ { a.emit_exact_match_suffix(typename T::StateType{}, u32str) } -> std::same_as<void>;
};
}