00001 00010 #ifndef _STATS_H 00011 #define _STATS_H 00012 00013 #include <string> 00014 #include <vector> 00015 00016 namespace ace { 00017 00020 struct DataFileStats { 00023 size_t words; 00026 size_t sentences; 00029 struct NGramsStats { 00032 size_t extracted; 00035 size_t passed; 00038 size_t filtered; 00041 NGramsStats(void): extracted(0), passed(0), filtered(0) {} 00046 inline NGramsStats& operator+=(const NGramsStats& rhs) { 00047 extracted += rhs.extracted; 00048 passed += rhs.passed; 00049 filtered += rhs.filtered; 00050 return *this; 00051 } 00052 } ngrams; 00055 DataFileStats(void): words(0), sentences(0), ngrams() {} 00060 inline DataFileStats& operator+=(const DataFileStats& rhs) { 00061 words += rhs.words; 00062 sentences += rhs.sentences; 00063 ngrams += rhs.ngrams; 00064 return *this; 00065 } 00066 }; 00067 00070 struct NamedDataFileStats: public DataFileStats { 00073 std::string filename; 00074 00078 NamedDataFileStats(const std::string& file_name): DataFileStats(), filename(file_name) {} 00079 }; 00080 00083 typedef std::vector<NamedDataFileStats> stats_t; 00084 00085 } // namespace ace 00086 00087 #endif
1.5.6