【发布时间】:2013-12-27 16:00:59
【问题描述】:
我用这个命令列出了文本中的所有标点符号
perl -CSD -nE '$seen{$1}++ while /(\pP)/g; END { say "$_ $seen{$_}" for keys %seen }' file.txt
然后如何用一个空格''替换它
例如
Said Mr. Nkumbula last night: "We want to discuss what to do
if the British Government gives in to Sir Roy and the talks fall
through. There are bound to be demonstrations."
会变成
Said Mr Nkumbula last night We want to discuss what to do
if the British Government gives in to Sir Roy and the talks fall
through There are bound to be demonstrations
【问题讨论】:
-
“发音”没有意义。你说的是标点符号吗?你能给我们一个小样本输入和预期输出吗?