Open Chinese Convert: opencc::PrefixMatch Class Reference

Open Chinese Convert 1.3.2+gad37fd0a6.dirty A project for conversion between Traditional and Simplified Chinese

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
opencc::PrefixMatch Class Reference

## Classes
struct | Match

## Public Member Functions
| PrefixMatch (const DictPtr &dict)
Match | MatchPrefix (const char *word, size_t len) const
PrefixMatchView | MatchPrefixView (const char *word, size_t len) const
| Like MatchPrefix but returns non-owning string_view fields without copying key or value into thread-local storage.

## Member Function Documentation

## ◆ MatchPrefixView()

PrefixMatchView opencc::PrefixMatch::MatchPrefixView | ( | const char * | word,
|  | size_t | len ) const

Like MatchPrefix but returns non-owning string_view fields without copying key or value into thread-local storage.

Lifetime of the returned views:

- key: points into the caller's input buffer (fast-path singleDict, where both MarisaDict and DartsDict return a slice of `word`) or into PrefixMatch-owned table storage (table-path LeafMatcher). Callers must not assume one or the other; copy if the key needs to outlive the current input position.
- value: valid for the lifetime of the underlying dictionary (fast-path) or the lifetime of this PrefixMatch's tables (table-path).

The documentation for this class was generated from the following file:

- PrefixMatch.hpp