Phil Factor's Phrenetic Phoughts

Simple-Talk columnist
The wilder shores of Transact SQL

Eggy Peggy :Leaves from a programmer's notebook

Published Thursday, May 25, 2006 9:30 AM

/* Eggy Peggy Language is a secret language rather like Pig Latin or Cockney Rhyming slang. It takes a while to master, but was once used, in particular, by schoolgirls to talk privately when there was a chance of being overheard by outsiders, and it could be spoken and understood very rapidly, but was unintelligible to the untrained ear.

In essence, the string 'egg' is inserted before every vowel.

There are dialects of Eggy Peggy language and the same sort of idea is used in Pig Latin, Jeringozo, Verlan, and Ubbi Dubbi.

Here is a simple translator into Eggy Peggy language, using a device which came to me almost by accident.

You will realise, of course that the system can be used for all sorts of serious programming applications, including macro processing.

I've kept things simple just to show the principle, but of course I've ignored the problems of processing words with capital letters. We'd also need a back-translator or decoder. I'd be interested to see these.

What about a Pig Latin Translator? */

DECLARE @SampleParagraph VARCHAR(8000)

SELECT @SampleParagraph='"One must clearly state that the 
assessment of any significant weaknesses in the central 
monologism cannot be shown to be relevant. This has to be
considered in contrast to the apprehension of the 
deterministic aspect
"Dean Carson in 
The Journal Of The Collaborative Integrated Transposition 
(1997)
'
DECLARE @EggyPeggy TABLE (vowel CHAR(1),replacement VARCHAR(4))
INSERT INTO @EggyPeggy (vowel,ReplacementSELECT 'e''egge'
INSERT INTO @EggyPeggy (vowel,ReplacementSELECT 'a''egga'
INSERT INTO @EggyPeggy (vowel,ReplacementSELECT 'i''eggi'
INSERT INTO @EggyPeggy (vowel,ReplacementSELECT 'o''eggo'
INSERT INTO @EggyPeggy (vowel,ReplacementSELECT 'u''eggu'


SELECT @SampleParagraph=REPLACE
                       
(@SampleParagraph,vowel,replacement
       
FROM @EggyPeggy 
       
WHERE CHARINDEX(vowel,@SampleParagraph)>0
SELECT @SampleParagraph
"eggonegge meggust cleggeeggarly steggategge theggat thegge eggasseggessmeggent eggof eggany seggigneggifeggiceggant weggeeggakneggessegges eggin thegge ceggentreggal meggoneggoleggogeggism cegganneggot begge sheggown teggo begge reggeleggeveggant. Theggis heggas teggo begge ceggonseggideggeregged eggin ceggontreggast teggo thegge eggappreggeheggenseggieggon eggof thegge deggeteggermeggineggisteggic eggaspeggect" Deggeeggan Ceggarseggon eggin Thegge Jeggoeggurneggal eggof Thegge Ceggolleggabeggoreggateggivegge egginteggegreggategged Tregganspeggoseggiteggieggon (1997)*/

Comments

 

J Walker said:

/*here is the decoder, written as a function. I wish one could format the code so nicely in a comment but here goes!
*/
alter FUNCTION [dbo].[ufsDecodedFromEggyPeggy]
(
@Paragraph varchar(8000)
)
RETURNS varchar(8000)
AS
BEGIN
declare @EggyPeggy table (vowel char(1),code varchar(4))
insert into @EggyPeggy (vowel,code) select 'e', 'egge'
insert into @EggyPeggy (vowel,code) select 'a', 'egga'
insert into @EggyPeggy (vowel,code) select 'i', 'eggi'
insert into @EggyPeggy (vowel,code) select 'o', 'eggo'
insert into @EggyPeggy (vowel,code) select 'u', 'eggu'


select @Paragraph= replace (@Paragraph,code,vowel)
from @EggyPeggy
where charindex(code,@Paragraph)>0
return @Paragraph
end
/*
-------------------------------------------------------------
select dbo.ufsDecodedFromEggyPeggy('"eggonegge meggust
cleggeeggarly steggategge theggat thegge
eggasseggessmeggent eggof eggany seggigneggifeggiceggant
weggeeggakneggessegges eggin thegge ceggentreggal meggoneggoleggogeggism
cegganneggot begge sheggown teggo begge reggeleggeveggant.
Theggis heggas teggo begge ceggonseggideggeregged eggin
ceggontreggast teggo thegge eggappreggeheggenseggieggon eggof
thegge deggeteggermeggineggisteggic eggaspeggect"
Deggeeggan Ceggarseggon eggin
Thegge Jeggoeggurneggal eggof Thegge Ceggolleggabeggoreggateggivegge
egginteggegreggategged Tregganspeggoseggiteggieggon (1997)')*/
May 25, 2006 6:50 PM
 

Arthur M. said:

I think the definition of Eggy Peggy language is incorrect, Phil. This shows once and for all that you are not, and never have been, a schoolgirl.

In fact it is the vowel-sound from every syllable that has a 'egg' prefixed to it. This means that your table idea simply wont work, because you will find yourself converting the e from the 'egg' into 'egge' if you process the single-vowels after the vowel combinations involving the letter E.

To give an example: 'oil' should become 'Eggoil' and not 'Eggoeggil'
May 26, 2006 9:21 AM
 

Grant Matthews said:

the euouae, which everyone knows is the term for the closing words of the Doxology in a gregorian chant should be, in Arthur's definition, 'eggeuouae', but in Phil's definition it would be eggeeggueggoeggueggaegge.
May 26, 2006 2:21 PM
 

Phil Factor said:

I've had another look at the Eggy Peggy translator in view of the criticism received, and I've added a new blog entry with a different approach to the problem. This is because one cannot really post clear formatted code into a comment. See the blog entry on Obenglobish....
May 30, 2006 3:23 PM
 

Phil Factor's Phrenetic Phoughts said:

In my last blog entry, 'Eggy Peggy', I gave an example of how one might replace into text from an entire...
July 31, 2006 11:32 AM
You need to sign in to comment on this blog

















<May 2006>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Ziggurats, Batman and the Town Crier
 We asked Brian for a description of the Help System for the software he's working on and ends up... Read more...

The Future of NET Reflector
 Simple Talk asked freelance writer Bob Cramblitt to sit down with the two people behind the agreement... Read more...

Software Tool Design: Remote User Testing
 If you are developing a software product, you'll know that the sooner you can get feedback from the... Read more...

SQL Toolbelt 2008: Predominantly an Engineering Task
 The conversion of the Red-Gate tools to be compatible with SQL Server 2008 might not seem, on first... Read more...

Andrew Tanenbaum: Geek of the Week
 Andrew Tanenbaum has had an immense influence on the way that operating systems are designed. He... Read more...