文本转换为CRF ++ 格式

#include <string>
#include <iostream>
#include <istream>
#include <fstream>;
using namespace std;
int main()
{
        char low=0x81;
        char up=0xfe;
  
		string  str;
       ifstream cin("in.txt");
       ofstream fout("out.txt");
       while(getline(cin,str))
       {
		   if(str == "") continue;
        bool flag=true;
          for(int i=0;i<str.size()-1;i++)
          {
             if(str[i]>=low&&str[i]<=up)
                   {
                    string temp=str.substr(i,2);
                    i++;  
    if(temp=="("||temp==")"||temp=="。"||temp==","||temp==":"||temp=="》"||temp=="《"||temp=="、"||temp==">    !")             //如果是各种标点符号或者其他符号
                           fout<<endl;
                      else fout<<temp<<endl;
                   }
             else {
                     if(str[i]==','||str[i]=='.')
                          fout<<endl;
               }
         }
        fout<<endl;
  }
}

你可能感兴趣的:(String,UP,include)