Пример #1
0
void cut(const ISegment& seg, const char * const filePath)
{
    ifstream ifile(filePath);
    vector<string> words;
    string line;
    string res;
	string s(filePath);
	s += ".seg";
	ofstream outfile(s.c_str());
    while(getline(ifile, line))
    {
        if(!line.empty())
        {
            words.clear();
            seg.cut(line, words);
            join(words.begin(), words.end(), res, " ");
            //cout<< res <<endl;
			outfile << res;
        }
    }
}