sepsen.pl
来自「用于对输入的一个文本进行断句操作,根据句号,叹号,问号来断句」· PL 代码 · 共 42 行
PL
42 行
#!/usr/bin/perlopen(in,$ARGV[0]);open(out,">".$ARGV[0].".sepsen");while($line = <in>){ chomp $line; if($line eq "") { next; } $line =~s/e\.g\./:=:/; $line =~s/\d+\.\d+/:++:/; @temp = split(/\.|\;|\。|!|?|/,$line); for($i =0;$i<@temp;$i++) { chomp $temp[$i]; if($temp[$i] eq "\n") { next; } # print out $temp[$i]."\n"; if($temp[$i] =~/:=:/) { $temp[$i]=~s/:=:/e\.g\./; print out $temp[$i]."\n"; next; } if($i!= @temp-1) { print out $temp[$i]."\n"; } else { print out $temp[$i]; } }}close in,out;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?