Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Ubbi Dubbi

by cciulla (Friar)
on May 14, 2003 at 13:09 UTC ( [id://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

Replies are listed 'Best First'.
Re: Ubbi Dubbi
by hv (Prior) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found