-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictionary.h
More file actions
34 lines (30 loc) · 881 Bytes
/
Dictionary.h
File metadata and controls
34 lines (30 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef DICTIONARY_H
#define DICTIONARY_H
#include<string>
#include<vector>
#include"BST.h"
template <typename Key, typename Data>
class Dictionary
{
public:
Dictionary();
~Dictionary();
void Dictionary_generation( string &filename);
void Dictionary_update(Key word,int i);
void Dictionary_save( std::string&file);
void Dictionary_read(string & file);
void Dictionary_generation_save( string &filename);
int wordCount();
bool check(const Key& word, vector<string>& suggestions);
std:: vector<std::string> suggest(const string & wrongword);
BST<Key, Data>* operator[](int index) {
if (index >= 1 && index <= 27) {
return dictionary[index];
}
return nullptr;
}
private:
BST< Key, Data> *dictionary[28];
};
#include "Dictionary.cpp"
#endif // DICTIONARY_H