22#include "SerializableDict.hpp"
31 virtual ~MarisaDict();
52 static MarisaDictPtr NewFromFile(FILE* fp);
61 std::unique_ptr<MarisaInternal> internal;
Abstract class of dictionary.
Definition Dict.hpp:29
virtual Optional< const DictEntry * > MatchPrefix(const char *word, size_t len) const
Matches the longest matched prefix of a word.
Definition MarisaDict.cpp:63
static MarisaDictPtr NewFromDict(const Dict &thatDict)
Constructs a MarisaDict from another dictionary.
Definition MarisaDict.cpp:129
virtual void SerializeToFile(FILE *fp) const
Serializes the dictionary and writes in to a file.
Definition MarisaDict.cpp:160
virtual Optional< const DictEntry * > Match(const char *word, size_t len) const
Matches a word exactly and returns the DictEntry or Optional::Null().
Definition MarisaDict.cpp:48
virtual LexiconPtr GetLexicon() const
Returns all entries in the dictionary.
Definition MarisaDict.cpp:92
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).
Definition MarisaDict.cpp:79
virtual size_t KeyMaxLength() const
Returns the length of the longest key in the dictionary.
Definition MarisaDict.cpp:46
A class that wraps type T into a nullable type.
Definition Optional.hpp:26
Serializable dictionary interface.
Definition SerializableDict.hpp:28