| 424 | } |
| 425 | |
| 426 | PrefixMatchView PrefixMatch::MatchPrefixView(const char* word, |
| 427 | size_t len) const { |
| 428 | if (singleDict != nullptr) { |
| 429 | return singleDict->MatchPrefixValue(word, len); |
| 430 | } |
| 431 | const Tables::Matcher::Candidate candidate = |
| 432 | tables->matcher->MatchPrefixCandidate(word, len); |
| 433 | if (candidate.hasValue) { |
| 434 | return {true, candidate.keyLength, |
| 435 | std::string_view(*candidate.key), |
| 436 | std::string_view(*candidate.value)}; |
| 437 | } |
| 438 | return {false, 0, std::string_view(), std::string_view()}; |
| 439 | } |
| 440 | |
| 441 | void PrefixMatch::AppendCacheKey(const DictPtr& dict, std::string* output) { |
| 442 | const std::list<DictPtr>* dictGroupItems = dict->GetDictGroupItems(); |