const Trie * Trie::FindWord(const string newword) { map::iterator childit; Trie * child; if (newword.size() < 1) { if (fullword) return this; else return NULL; } char first = newword.substr(0,1).c_str()[0]; childit = children.find(first); if ( childit == children.end()) return NULL; string rest = newword.substr(1); child = (*childit).second; return child->FindWord(rest); }