26 lines
462 B
C++
26 lines
462 B
C++
#ifndef DICTIONARY_H
|
|
#define DICTIONARY_H
|
|
|
|
#include "word.h"
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#define MAXLEN 30
|
|
|
|
using std::vector;
|
|
using std::filesystem::path;
|
|
|
|
class Dictionary {
|
|
public:
|
|
Dictionary();
|
|
bool contains(const std::string &word) const;
|
|
std::vector<std::string> get_suggestions(const std::string &word) const;
|
|
int slurp(path p);
|
|
int spit(path p);
|
|
|
|
private:
|
|
vector<Word> words[MAXLEN];
|
|
};
|
|
|
|
#endif
|