00001
00011
00012 #include "config.h"
00013
00014 #include "notifier.h"
00015
00016 #include "utils.h"
00017
00018 namespace ace {
00019
00020
00021 using constants::eol;
00022
00023 #ifdef _BOOST_ON
00024
00025 boost::progress_timer ProgressNotifier::_timer;
00026 #endif
00027
00028 void Notifier::fatal_error(const std::string& message) const {
00029 _output << "FATAL ERROR: " << message << std::endl;
00030 }
00031
00032 void Notifier::info(const std::string& message) const {
00033 _output << message << std::endl;
00034 }
00035
00036 void Notifier::warning(const std::string& message) const {
00037 _output << "WARNING: " << message << std::endl;
00038 }
00039
00040 void ProgressNotifier::elapsed(const std::string& message) const {
00041 #ifdef _BOOST_ON
00042 _output << message << eol << _timer.elapsed() << " secs elapsed." << std::endl;
00043 #else
00044 _output << message << std::endl;
00045 #endif
00046 }
00047
00048 void print_usage(void) {
00049 std::string option_margin = " ", description_margin = " ";
00050 std::cout << "Usage: pace [options]" << eol
00051 << eol
00052 << "Mandatory options:" << eol
00053 << option_margin << "-i input-file-path" << eol
00054 << description_margin << "Path to file with list of input datafile names." << eol
00055 << option_margin << "-n size" << eol
00056 << description_margin << "Size of extracted N-grams. Minimum value is 2, maximum value is " << constants::max_grammity << "." << eol
00057 << option_margin << "-o output-file-path" << eol
00058 << description_margin << "Path to output datafile." << eol
00059 << eol
00060 << "Auxiliary options:" << eol
00061 << option_margin << "-c context-output-file" << eol
00062 << description_margin << "Output datafile for contexts storage." << eol
00063 << option_margin << "-cf context-morphologic-filter-file-path" << eol
00064 << description_margin << "Path to file with morphologic rules to filtrate stored context words." << eol
00065 << option_margin << "-cs context-radius-size-in-sentences" << eol
00066 << description_margin << "Size of context radius in sentences, may be from 0 to " << constants::sentences_radius_max_size << "." << eol
00067
00068
00069 << description_margin << "'" << constants::significant_position_mark << "' determines significant position, '" << constants::insignificant_position_mark << "' determines insignificant position." << eol
00070 << option_margin << "-cw context-radius-size-in-words" << eol
00071 << description_margin << "Size of context radius in words, may be from 1 to " << constants::words_radius_max_size << "." << eol
00072 << option_margin << "-d path-to-datafiles-directory" << eol
00073 << description_margin << "String that shall be prepended to all paths founded in input file." << eol
00074 << option_margin << "-f n-grams-morphologic-filter-file-path" << eol
00075 << description_margin << "Path to file with morphologic rules to filtrate parsed N-grams." << eol
00076 << description_margin << "Must be specified in order to -fs parameter has any effect!" << eol
00077 << option_margin << "-fs n-grams-morphologic-filter-stats-file-path" << eol
00078 << description_margin << "Path to file for saving statistics of applied morphologic rules." << eol
00079 << option_margin << "-m morphologic-tag-mask" << eol
00080 << description_margin << "Mask determines morphologic tag positions significant for n-grams equality." << eol
00081 << description_margin << "Must be specified in order to -cf, -ct, -f parameters have any effect!" << eol
00082 << description_margin << "'" << constants::significant_position_mark << "' determines significant position, '" << constants::insignificant_position_mark << "' determines insignificant position." << eol
00083 << option_margin << "-p unsigned-number" << eol
00084 << description_margin << "Output statistics precision (default is " << constants::default_precision << ")." << eol
00085 << option_margin << "-s stats-output-file" << eol
00086 << description_margin << "Path to file, where statistics should be stored." << eol
00087 << option_margin << "-ta" << eol
00088 << description_margin << "Reaching all of given thresholds is required." << eol
00089 << option_margin << "-tc floating-point-number" << eol
00090 << description_margin << "Pearson's chi square test threshold." << eol
00091 << option_margin << "-te floating-point-number" << eol
00092 << description_margin << "Only N-grams with at least given estimated frequency will be evaluted." << eol
00093 << option_margin << "-tf unsigned-number" << eol
00094 << description_margin << "Only N-grams with at least given frequency will be evaluted." << eol
00095 << option_margin << "-tl floating-point-number" << eol
00096 << description_margin << "Log likelihood ratio threshold." << eol
00097 << option_margin << "-tm floating-point-number" << eol
00098 << description_margin << "Mutual information threshold." << eol
00099 << option_margin << "-to" << eol
00100 << description_margin << "Reaching anyone of given thresholds is required." << eol
00101 << option_margin << "-tp floating-point-number" << eol
00102 << description_margin << "Pearson's coeficient threshold." << eol
00103 << option_margin << "-tt floating-point-number" << eol
00104 << description_margin << "Student's t-test threshold." << eol
00105 << option_margin << "-tz floating-point-number" << eol
00106 << description_margin << "Z score threshold." << eol
00107 #ifdef _SURFACE_MODE
00108 << option_margin << "-w unsigned-number" << eol
00109 << description_margin << "Collocation window size." << eol
00110 #endif
00111
00112 << std::endl;
00113 }
00114
00115 namespace notifier {
00116
00117
00118
00119 Notifier error(std::cerr);
00120
00121
00122 ProgressNotifier progress(std::cout);
00123
00124 }
00125
00126 }