diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2023-09-18 12:30:00 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2023-09-18 13:21:04 +0000 |
commit | a51ec7e464737d864924139c06d932d71275d20a (patch) | |
tree | c439767b8f18d077de6821ba9c1e2e28625aaffb /vespalib/src | |
parent | 23a0c0dfe271fe301cde7537a43269ca4cb14432 (diff) |
Add UTF-32 exact suffix output to DFA concept
Diffstat (limited to 'vespalib/src')
-rw-r--r-- | vespalib/src/vespa/vespalib/fuzzy/dfa_matcher.h | 7 |
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>; }; } |