|
Open Chinese Convert
1.0.5
A project for conversion between Traditional and Simplified Chinese
|
22 #include "DictEntry.hpp"
40 return Match(word.c_str());
54 return MatchPrefix(word.c_str());
62 virtual vector<const DictEntry*> MatchAllPrefixes(
const char* word)
const;
68 return MatchAllPrefixes(word.c_str());
Optional< const DictEntry * > MatchPrefix(const string &word) const
Matches the longest matched prefix of a word.
Definition: Dict.hpp:53
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().
Definition: Dict.hpp:39
Abstract class of dictionary.
Definition: Dict.hpp:29
vector< const DictEntry * > MatchAllPrefixes(const string &word) const
Returns all matched prefixes of a word, sorted by the length (desc).
Definition: Dict.hpp:67
A class that wraps type T into a nullable type.
Definition: Optional.hpp:26
virtual LexiconPtr GetLexicon() const =0
Returns all entries in the dictionary.
virtual size_t KeyMaxLength() const =0
Returns the length of the longest key in the dictionary.