Open Chinese Convert
1.0.1
A project for conversion between Traditional and Simplified Chinese
|
Abstract class of dictionary. More...
#include <Dict.hpp>
Public Member Functions | |
virtual Optional< const DictEntry * > | Match (const char *word) const =0 |
Matches a word exactly and returns the DictEntry or Optional::Null(). | |
Optional< const DictEntry * > | Match (const string &word) const |
Matches a word exactly and returns the DictEntry or Optional::Null(). | |
virtual Optional< const DictEntry * > | MatchPrefix (const char *word) const |
Matches the longest matched prefix of a word. More... | |
Optional< const DictEntry * > | MatchPrefix (const string &word) const |
Matches the longest matched prefix of a word. | |
virtual vector< const DictEntry * > | MatchAllPrefixes (const char *word) const |
Returns all matched prefixes of a word, sorted by the length (desc). More... | |
vector< const DictEntry * > | MatchAllPrefixes (const string &word) const |
Returns all matched prefixes of a word, sorted by the length (desc). | |
virtual size_t | KeyMaxLength () const =0 |
Returns the length of the longest key in the dictionary. | |
virtual LexiconPtr | GetLexicon () const =0 |
Returns all entries in the dictionary. | |
Abstract class of dictionary.
|
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 in opencc::DictGroup.
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 in opencc::DictGroup, and opencc::DartsDict.