#ifndef _TOKEN_H_ #define _TOKEN_H_ #include #include #include enum tTokenFormat { STRING, PET, FSC, CANDC, TNT, CONLL }; class tToken { std::string _surface; std::string _carg; std::vector _tags; std::vector _morph; std::vector _probs; std::vector _supertags; std::vector _superprobs; int _start; int _end; int _id; std::vector _tids; public: tToken():_start(-1), _end(-1){}; tToken(std::string surface): _surface(surface), _start(-1), _end(-1){}; std::string surface() {return _surface;}; void surface(std::string s) {_surface = s;}; std::string carg() {return _carg;}; void carg(std::string s) {_carg = s;}; std::string tag(); void tag(std::string t) { _tags.push_back(t);}; std::vector &tags() { return _tags;} std::string supertag(); void supertag(std::string t) { _supertags.push_back(t);}; std::vector &supertags() { return _supertags;} std::string morph() { return _morph[0];}; void morph(std::string t) { _morph.push_back(t);}; std::vector &morphs() { return _morph;} std::string prob() { return _probs[0];}; void prob(std::string p) { _probs.push_back(p);}; std::vector probs() { return _probs;}; std::string superprob() { return _superprobs[0];}; void superprob(std::string p) { _superprobs.push_back(p);}; std::vector superprobs() { return _superprobs;}; int tid() { return _tids[0];}; void tid(int t) {_tids.push_back(t);}; std::vector tids() { return _tids;}; void print(tTokenFormat=STRING); const char *separator(tTokenFormat=STRING); void print(tTokenFormat format, std::pairstag); int start() { return _start;} void start(int i) {_start = i;} int end() { return _end;} void end(int i) {_end = i;} int id() { return _id;} void id(int i) {_id = i;} private: void printStringToken(std::pair stag); void printCandCToken(std::pair stag); void printConllToken(std::pair stag); void printTnTToken(std::pair stag); void printPETToken(); void printFSCToken(std::pair stag); }; void print_header(tTokenFormat format, std::string &itemno, std::string &sent, int n); void print_footer(tTokenFormat format); #endif