Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
You may get more words by searching.
From my own personal dictionary, including lots of arcane, obsolete, and dubious entries:
Longest: 6
archchronicler
bergschrund
festschrift
fruchtschiefer
latchstring
lengthsman
postphthisic
veldtschoen
Funny how many of these seem to be Germanic in origin.

Here's the code I used:

#!/your/perl/here # find word with most consecutive vowels and/or consonants use strict; use warnings; # treat y as a vowel, not a consonant my $VOWELS = qr/([aeiouy]+)/i; my $CONSONANTS = qr/([b-df-hj-np-tv-xz]+)/i; my $longest_vowels = {}; my $longest_consonants = {}; while (<>) { # only lower case (no proper names) # only single words next unless /^[a-z]+$/; $longest_vowels = find_longest( $_, $VOWELS, $longest_vowe +ls ); $longest_consonants = find_longest( $_, $CONSONANTS, $longest_cons +onants ); } foreach my $record ($longest_vowels, $longest_consonants) { my $length = (keys %{$record})[0]; print "($length) ", join( '', sort @{$record->{$length}}), "\n"; } ###################### # given word, regex, and hashref, # return a hashref with words having the longest consecutive regex mat +ch # hash should only have 1 key (longest length run), # hash value is array of words with "length" run sub find_longest { my $word = shift; my $regex = shift; my $previous = shift; # hashref # only one key should exist my ($length) = (keys %{$previous})[0] or 0; # find all matches in the current word my @matches = $word =~ /$regex/g; # reverse sort matches by length @matches = sort { length($b) <=> length($a) } @matches; foreach my $match ( @matches ) { # no more interesting matches? last if ($length > length($match)); # equal length, add to list if ( $length == length($match) ) { push @{$previous->{$length}}, $word; } else # new length, start new list { $length = length($match); $previous = { $length => [$word] }; } # uncomment to watch it run # print STDERR "$regex) ($length) $word"; } return $previous; }

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^2: Renaming the Schwartzian Transform by QM
in thread Renaming the Schwartzian Transform by EvanCarroll

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (6)
    As of 2014-07-23 01:55 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (131 votes), past polls