Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl: the Markov chain saw
 
PerlMonks

Ubbi Dubbi

by cciulla (Pilgrim)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

on May 14, 2003 at 13:09 UTC ( #258065=CUFP: print w/ replies, xml ) Need Help??

After showing my wife that other spouses think their perl-savvy signifigant others are dorks (Yoda Speak Translator), she (of all people) suggested that I write an "Ubbi Dubbi" converter.

Here's the result:

$_ = shift; s/(a|e|i|o|u|y)/ub\1/gi; s/^\s+//; ucfirst; print;

Jubust ubanubothuber Puberl hubackuber

Comment on Ubbi Dubbi
Download Code
Re: Ubbi Dubbi
by hv (Parson) on May 14, 2003 at 16:08 UTC

    Cool. :)

    A couple of little points, which -w would have told you about: "\1" is a way to refer to regexp backreferences within the regexp itself, but in the replacement part of a substitution it is preferable to refer to them as "$1". Also, ucfirst() does not modify a string in place but returns the modified form of the string, so that call does nothing: you could fix that by replacing the last two lines with print ucfirst;.

    Note also that this would translate "The Angel" to "Thube ubAngubel"; assuming that "Thube Ubangel" would be preferred, you could use this trick to fix it up (not recommended for production code):

    s/([aeiouy])/("ub"^$1^lc$1).lc$1/gie;

    Hugo

    ubbi "Rik ce"

      ++hv.

      Doh!

      Here's the corrections as suggested (suggestions as corrected?) by the excellent Mr. hv.

      $_ = shift; s/([aeiouy])/("ub"^$1^lc$1).lc$1/gie; s/^\s+//; print ucfirst;

      Thubanks, Hubugubo!

Re: Ubbi Dubbi
by YuckFoo (Abbot) on May 14, 2003 at 19:14 UTC
    It's a start, but you aren't there yet. 'ub' precedes vowel sounds not each vowel, so you might want to '+' your vowel matching expression. Now, how to deal with silent e's and consonant y's...

    Gubood Lubuck,

    YubuckFuboo

Re: Ubbi Dubbi
by halley (Prior) on May 14, 2003 at 19:34 UTC

    The earliest place I've heard this is from the 60s albums and 70s TV cartoon series from Bill Cosby, with the character "Mushmouth." Was this an actual voice game which some kids of that era played, akin to Pig Latin, or was this just Cosby's invention?

    --
    [ e d @ h a l l e y . c c ]

      "Ubbi Dubbi" is a voice game that the kids on a PBS show called "Zoom". The "Mushmouth" character's speech does sound similar, but I don't think they're related.

      If memory serves, "Mushmouth" ended words with either a "be" or "ba" sound.

      I'll have to do some research and get back to you.

Re: Ubbi Dubbi
by mojotoad (Monsignor) on May 14, 2003 at 19:47 UTC
    Let's bump up the cadence and make a Sinatra module. Dooby Doowah.

    Matt

Login:
Password
remember me
What's my password?
Create A New User

Node Status?
node history
Node Type: CUFP [id://258065]
Approved by smitz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (21)
jdporter
holli
Gavin
JavaFan
CardinalNumber
jwkrahn
kennethk
thezip
Eyck
LanX
hangon
pemungkah
state-o-dis-array
ssandv
draegtun
BenHopkins
MikeDexter
jmccarrell
tomerb
David S
Spakz
As of 2010-02-09 22:51 GMT
Sections?
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information?
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes?
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers?
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth?

What level of existential comfort do you require?

Palace
Executive suite at the best hotel
Regular hotel in a decent part of town
Motel
Boarding house
Sleeping Bag on Couch in Basement
Any port in a storm
Camping under the freeway overpass
Jail
Other

Results (283 votes), past polls