#include "../LemClient/LemClient.hpp" #include int main(int argc, char ** argv) { using namespace std; using namespace lem; try { if (argc != 2) { cerr << "usage: " << argv[0] << " word" << endl; exit(1); } // Конструктор cout << "Initializing..."; cout.flush(); Lemmatizer oLemmatizer("", C_RUS_GRAM_TAB | C_ENG_GRAM_TAB | C_GER_GRAM_TAB); cout << " done." << endl; vector vResult = oLemmatizer.Lemmatize(argv[1]); vector::const_iterator itvResult = vResult.begin(); while (itvResult != vResult.end()) { cout << "1-st form: " << itvResult -> first_form << endl; cout << "Lang: " << itvResult -> lang << endl; cout << "Part of speech: " << itvResult -> part_of_speech_str << endl; cout << "Ancode: " << itvResult -> src_ancode << endl; cout << "Vocabulary: " << itvResult -> vocabulary << endl; cout << "Ancodes: "; std::vector::const_iterator itvAllAncodes = itvResult -> all_ancodes.begin(); while (itvAllAncodes != itvResult -> all_ancodes.end()) { cout << *itvAllAncodes << " "; itvAllAncodes++; } cout << endl << "Forms: "; std::vector::const_iterator itvAllWords = itvResult -> all_words.begin(); while (itvAllWords != itvResult -> all_words.end()) { cout << *itvAllWords << " "; itvAllWords++; } cout << endl << endl;; itvResult++; } } catch(exception &e) { cerr << "!: " << e.what() << endl; } }