#!/usr/bin/perl use strict; use warnings; my $s; my @arr; open(FILE, "<test"); while(<FILE>) { chomp $_; $s .= $_; } @arr = $s =~ m/[A-Z].+?[.;]/g; foreach (@arr) { print $_, "\n"; }
However as you can see it stumbles on abbreviations and acronyms.
I have a list of abbreviations which I would like to integrate in the script but since I am a newbie to Perl, I have not been able to integrate them. I am giving below the list of such cases. The syntax is clear in the given cases
Abbr["followed by the abbreviation];How do I integrate such cases in the script. A couple of examples would suffice. Many thanks for helpAbbr["Co."]; Abbr["Corp."]; Abbr["vs."]; Abbr["e.g."]; Abbr["etc."]; Abbr["ex."]; Abbr["cf."]; Abbr["eg."]; Abbr["Jan."]; Abbr["Feb."]; Abbr["Mar."]; Abbr["Apr."]; Abbr["Jun."]; Abbr["Jul."]; Abbr["Aug."]; Abbr["Sep."]; Abbr["Sept."]; Abbr["Oct."]; Abbr["Nov."]; Abbr["Dec."]; Abbr["jan."]; Abbr["feb."]; Abbr["mar."]; Abbr["apr."]; Abbr["jun."]; Abbr["jul."]; Abbr["aug."]; Abbr["sep."]; Abbr["sept."]; Abbr["oct."]; Abbr["nov."]; Abbr["dec."]; Abbr["ed."]; Abbr["eds."]; Abbr["repr."]; Abbr["trans."]; Abbr["vol."]; Abbr["vols."]; Abbr["rev."]; Abbr["est."]; Abbr["b."]; Abbr["m."]; Abbr["bur."]; Abbr["d."]; Abbr["r."]; Abbr["M."]; Abbr["Dept."]; Abbr["MM."]; Abbr["U."]; Abbr["Mr."]; Abbr["Jr."]; Abbr["Ms."]; Abbr["Mme."]; Abbr["Mrs."]; Abbr["Dr."];
In reply to Splitting a Sentence by ardibehest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |