int Internals::lastSpellCheckProcessedSequence(Document* document, ExceptionCode& ec) { SpellChecker* checker = spellchecker(document); if (!checker) { ec = INVALID_ACCESS_ERR; return -1; } return checker->lastProcessedSequence(); }
int main(int argc, char *argv[]) { if(argc < 2) return 1; std::ifstream in_file(argv[1], std::ifstream::in); std::istream_iterator<std::string> in_iter_file(in_file), in_iter_eof; std::unordered_set<std::string> uset_words(in_iter_file, in_iter_eof); std::vector<std::string> text = get_words(); std::cout << "Found errors:" << std::endl; for(auto word_iter = text.begin(); word_iter < text.end(); ++word_iter) { if(!spellchecker(*word_iter, uset_words)) { std::cout << print_with_context(word_iter, text.begin(), text.end()); } } return 0; //Huge success! }