This commit is contained in:
Imbus 2024-11-21 07:48:49 +01:00
parent b843fc98e0
commit 5b669caddb

View file

@ -12,7 +12,15 @@ using std::vector;
Dictionary::Dictionary() {} Dictionary::Dictionary() {}
bool Dictionary::contains(const string &word) const { return true; } bool Dictionary::contains(const string &word) const {
int l = word.length();
Word w = Word(word);
if (std::find(this->words[l].begin(), this->words[l].end(), w) !=
std::end(this->words[l])) {
return true;
}
return false;
}
vector<string> Dictionary::get_suggestions(const string &word) const { vector<string> Dictionary::get_suggestions(const string &word) const {
vector<string> suggestions; vector<string> suggestions;