#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;
}
}
文本转换为CRF ++ 格式
最新推荐文章于 2020-11-14 16:20:42 发布