Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Capitalization Clusters

by LameNerd (Hermit)
on Aug 05, 2003 at 23:03 UTC ( [id://281211]=note: print w/replies, xml ) Need Help??


in reply to Capitalization Clusters

I think this almost what you want ...
#!/usr/bin/perl -w use strict; $_ = <DATA>; my @matches = /([A-Z].*? )[a-z].*?/g; my $biggest = 0; my $biggestCluster; for my $m ( @matches ) { print "$m\n"; $_ = $m; my @cs = /([A-Z].*? )/g; if ( $#cs > $biggest ) { $biggestCluster = $m; $biggest = $#cs; } } print "Biggest Cluster is [$biggestCluster]\n"; __DATA__ Douglas built five Douglas World Cruisers to attempt his first flight +to Buenos Aires. There were the predecessor of the modern AH-64D and +AH-64D Apache.
... it has a problem picking up AH-64D Apache, but hopefully you will still find this somewhat helpful.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://281211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-24 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found