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());
74 virtual size_t KeyMaxLength()
const = 0;
79 virtual LexiconPtr GetLexicon()
const = 0;
Optional< const DictEntry * > Match(const string &word) const
Matches a word exactly and returns the DictEntry or Optional::Null().
Definition: Dict.hpp:39
Definition: BinaryDict.hpp:24
Abstract class of dictionary.
Definition: Dict.hpp:29
A class that wraps type T into a nullable type.
Definition: Optional.hpp:27
vector< const DictEntry * > MatchAllPrefixes(const string &word) const
Returns all matched prefixes of a word, sorted by the length (desc).
Definition: Dict.hpp:67
Optional< const DictEntry * > MatchPrefix(const string &word) const
Matches the longest matched prefix of a word.
Definition: Dict.hpp:53