#ifndef _EVAL_H_ #define _EVAL_H_ #include "resa.h" #include "eTuple.h" #include #include #include #include #include enum TripleType {SENT, TOK, POS, DEP, PS}; void compareTuples(std::map > > &gelts, std::map > > &telts, std::map > &equivlabels, bool stats, bool multi, bool unlabelled, std::string delimchars, bool sent_counts); bool equiv (std::string a, std::string b, std::map > &equivlabels, std::string delimchars, bool unlabelled=false); bool tagoverlap (std::set >ags, std::set &ttags, std::map > &equivlabels); void calcScores(int tcount, int gcount, int correct, double *p, double *r, double *f); void printSortedUnmatched(std::map > > &gelts, std::map > > &telts, std::ostream &out); class Sentence { public: IndexType start; IndexType end; int correct; int gold; int test; bool exact; int sscorrect; int ssgold; int sstest; bool ssexact; int tscorrect; int tsgold; int tstest; bool tsexact; int ptcorrect; int ptgold; int pttest; bool ptexact; int depcorrect; int depgold; int deptest; bool depexact; int pscorrect; int psgold; int pstest; bool psexact; Sentence():start(-1), end(-1), correct(0), gold(0), test(0), exact(false), sscorrect(0), ssgold(0), sstest(0), ssexact(false), tscorrect(0), tsgold(0), tstest(0), tsexact(false), ptcorrect(0), ptgold(0), pttest(0), ptexact(false), depcorrect(0), depgold(0), deptest(0), depexact(false), pscorrect(0), psgold(0), pstest(0), psexact(false) {}; }; //for debugging class UnmatchedRecord { public: char source; //G or T int sent; IndexType first; IndexType second; std::string third; std::string comment; IndexType fourth; IndexType fifth; UnmatchedRecord(char s, int sent, IndexType a, IndexType b, std::string c, std::string com = "", IndexType d = -1, IndexType e = -1): source(s), sent(sent), first(a), second(b), third(c), comment(com), fourth(d), fifth(e) {}; void printRecord(std::ostream &out) const; bool operator< (UnmatchedRecord const &b) const { if (first != b.first) return first < b.first; if (second != b.second) return second < b.second; if (third.compare(b.third) != 0) return third < b.third; if (comment.compare(b.comment) != 0) return comment < b.comment; if (fourth != b.fourth) return fourth < b.fourth; if (fifth != b.fifth) return fifth < b.fifth; if (source != b.source) return source < b.source; } }; #endif