Contains
This commit is contained in:
parent
b843fc98e0
commit
5b669caddb
1 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue