diff options
Diffstat (limited to 'bin/sentences')
| -rwxr-xr-x | bin/sentences | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/bin/sentences b/bin/sentences deleted file mode 100755 index a02d061..0000000 --- a/bin/sentences +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | my $pont=qr{[.!?]+}; ## pontuation | ||
| 5 | my $abrev=qr{\b(?:Pr|Dr|Mr|[A-Z])\.}; ## abreviations | ||
| 6 | |||
| 7 | $/=""; | ||
| 8 | |||
| 9 | while(<>){ chomp; ## for each paragraph, | ||
| 10 | |||
| 11 | s/\h*\n\h*/ /g; ## remove \n | ||
| 12 | s/($pont)\h+(\S)/$1\n$2/g; ## pontuation+space | ||
| 13 | s/($abrev)\n/$1 /g; ## undo \n after abreviations | ||
| 14 | |||
| 15 | print "$_\n\n"; | ||
| 16 | } | ||
