#ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "hunspell_maker.h" using namespace std; string version = "$Revision$"; int main (int argc, char *argv[]) { string str; hunspell_maker hsp_maker(argv[1]); int line_count = 0; int prev_line_count = 0; cout << "Processing " << argv[1] << endl; fstream infile(argv[2]); getline (infile, str); vector strings = hsp_maker.parse_string(str); string prev_first_letters = strings[0].substr(0,2); do { line_count++; int pos; if((pos = str.find("\t")) != string::npos) { if(pos != 2) { str = hsp_maker.clean_cruft(str); strings = hsp_maker.parse_string(str); string first_letters = strings[0].substr(0,2); if (first_letters != prev_first_letters) { hsp_maker.flush(); prev_first_letters = first_letters; cerr << "Flushing ... " << line_count - prev_line_count << " " << str << endl; prev_line_count = line_count; } hsp_maker.add_to_dic(strings); if((line_count % 100000) == 0) cerr << line_count << endl; } else { cerr << "Strings with only one letter, not wanted" << str << endl; } } else { cerr << "Strange string that has no tab: " << str << endl; } } while(getline (infile,str)); hsp_maker.flush(); hsp_maker.print_files(); return 0; }