Open Chinese Convert: opencc::DictGroup Class Reference

Open Chinese Convert 1.3.0+g2c978160d.dirty A project for conversion between Traditional and Simplified Chinese

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
opencc::DictGroup Class Reference
OpenCC C++ Comprehensive API

Group of dictionaries. More...

`#include <DictGroup.hpp>`

Inheritance diagram for opencc::DictGroup:

## Public Member Functions
| DictGroup (const std::list< DictPtr > &dicts)
virtual size_t | KeyMaxLength () const
| Returns the length of the longest key in the dictionary.
virtual Optional< const DictEntry * > | Match (const char *word, size_t len) const
| Matches a word exactly and returns the DictEntry or Optional::Null().
virtual Optional< const DictEntry * > | MatchPrefix (const char *word, size_t len) const
| Matches the longest matched prefix of a word.
virtual std::vector< const DictEntry * > | MatchAllPrefixes (const char *word, size_t len) const
| Returns all matched prefixes of a word, sorted by the length (desc).
virtual LexiconPtr | GetLexicon () const
| Returns all entries in the dictionary.
const std::list< DictPtr > | GetDicts () const
Public Member Functions inherited from opencc::Dict
Optional< const DictEntry * > | Match (const std::string &word) const
| Matches a word exactly and returns the DictEntry or Optional::Null().
Optional< const DictEntry * > | MatchPrefix (const char *word) const
| Matches the longest matched prefix of a word.
Optional< const DictEntry * > | MatchPrefix (const std::string &word) const
| Matches the longest matched prefix of a word.
std::vector< const DictEntry * > | MatchAllPrefixes (const std::string &word) const
| Returns all matched prefixes of a word, sorted by the length (desc).

## Static Public Member Functions
static DictGroupPtr | NewFromDict (const Dict &dict)

## Detailed Description

Group of dictionaries.

## Member Function Documentation

## ◆ GetLexicon()

LexiconPtr DictGroup::GetLexicon | ( |  | ) | const
| virtual

Returns all entries in the dictionary.

Implements opencc::Dict.

## ◆ KeyMaxLength()

size_t DictGroup::KeyMaxLength | ( |  | ) | const
| virtual

Returns the length of the longest key in the dictionary.

Implements opencc::Dict.

## ◆ Match()

Optional< const DictEntry * > DictGroup::Match | ( | const char * | word,
|  | size_t | len ) const
| virtual

Matches a word exactly and returns the DictEntry or Optional::Null().

Implements opencc::Dict.

## ◆ MatchAllPrefixes()

std::vector< const DictEntry * > DictGroup::MatchAllPrefixes | ( | const char * | word,
|  | size_t | len ) const
| virtual

Returns all matched prefixes of a word, sorted by the length (desc).

For example given a dictionary having "a", "an", "b", "ba", "ban", "bana", all the matched prefixes of "banana" are "bana", "ban", "ba", "b".

Reimplemented from opencc::Dict.

## ◆ MatchPrefix()

Optional< const DictEntry * > DictGroup::MatchPrefix | ( | const char * | word,
|  | size_t | len ) const
| virtual

Matches the longest matched prefix of a word.

For example given a dictionary having "a", "an", "b", "ba", "ban", "bana", the longest prefix of "banana" matched is "bana".

Reimplemented from opencc::Dict.

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

- DictGroup.hpp
- DictGroup.cpp