|
Open Chinese Convert 1.4.2+g71621a0e1.dirty
A project for conversion between Traditional and Simplified Chinese
|
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. | |
| size_t | SkipUnmatchable (const char *word, size_t len) const |
Returns the number of leading bytes of word that are guaranteed not to begin any dictionary key: whole UTF-8 characters whose lead byte starts no key (ideographic description operators excluded, so the caller's IDS grouping is preserved). | |
| 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:
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.| size_t opencc::PrefixMatch::SkipUnmatchable | ( | const char * | word, |
| size_t | len ) const |
Returns the number of leading bytes of word that are guaranteed not to begin any dictionary key: whole UTF-8 characters whose lead byte starts no key (ideographic description operators excluded, so the caller's IDS grouping is preserved).
Callers may consume the returned run without calling MatchPrefixView() at any position inside it. The scan is word-at-a-time for ASCII runs. Returns 0 when the next character requires a real lookup.