【发布时间】:2018-01-08 20:45:52
【问题描述】:
我想对包含 2000 行的 Weka arff 文件进行预处理 用于nlp项目(情绪分析)
我想要一个只在每个句子的开头和结尾添加一个单引号的代码。例如,这是我的数据集的示例:
The Da Vinci Code is one of the most beautiful movies ive ever seen.,1
The Da Vinci Code is an * amazing * book, do not get me wrong.,1
then I turn on the light and the radio and enjoy my Da Vinci Code.,1
The Da Vinci Code was REALLY good.,1
i love da vinci code....,1
我希望输出是:
'The Da Vinci Code is one of the most beautiful movies ive ever seen.',1
'The Da Vinci Code is an * amazing * book, do not get me wrong.',1
'then I turn on the light and the radio and enjoy my Da Vinci Code.',1
'The Da Vinci Code was REALLY good.',1
'i love da vinci code....',1
只想在每个句子的开头和结尾添加一个单引号(在 1 之前)。
如果你能帮我做,我将不胜感激
有什么工具可以代替编写代码吗?
【问题讨论】:
-
您能否编辑您的问题,并提供有关您尝试完成的任务以及失败的地方的信息?还请解释为什么特别提到 C++。