{"id":2300,"date":"2006-05-25T03:30:00","date_gmt":"2006-05-25T03:30:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/eggy-peggy-leaves-from-a-programmers-notebook\/"},"modified":"2021-09-29T16:22:25","modified_gmt":"2021-09-29T16:22:25","slug":"eggy-peggy-leaves-from-a-programmers-notebook","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/eggy-peggy-leaves-from-a-programmers-notebook\/","title":{"rendered":"Eggy Peggy :Leaves from a programmer&#8217;s notebook"},"content":{"rendered":"<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true  \">\/* Eggy Peggy Language is a secret language rather like Pig Latin or Cockney Rhyming slang. \r\nIt takes a while to master, but was once used, in particular, by schoolgirls to talk \r\nprivately when there was a chance of being overheard by outsiders, and it could be spoken\r\n and understood very rapidly, but was unintelligible to the untrained ear.\r\n\r\nIn essence, the string 'egg' is inserted before every vowel. \r\nThere are dialects of Eggy Peggy language and the same sort of idea is used in Pig Latin, \r\nJeringozo, Verlan, and Ubbi Dubbi. \r\nHere is a simple translator into Eggy Peggy language, using a device which came to me almost \r\nby accident. \r\n\r\nYou will realise, of course that the system can be used for all sorts of serious programming \r\napplications, including macro processing. \r\nI've kept things simple just to show the principle, but of course I've ignored the problems \r\nof processing words with capital letters. We'd also need a back-translator or decoder.\r\n I'd be interested to see these.\r\n\r\nWhat about a Pig Latin Translator? *\/\r\n\r\nDECLARE @SampleParagraph VARCHAR(8000);\r\n\r\nSELECT @SampleParagraph =\r\n  '\"One must clearly state that the assessment of any significant weaknesses in the central monologism of ODBC cannot be shown to be relevant. This has to be considered in contrast to the apprehension of the deterministic aspect\"\r\n     Dean Carson in The Journal Of The Collaborative Integrated Transposition (1997)\r\n';\r\n\r\nDECLARE @EggyPeggy TABLE\r\n  (\r\n  vowel CHAR(1),\r\n  replacement VARCHAR(4),\r\n  theorder INT\r\n  );\r\nINSERT INTO @EggyPeggy\r\n  (vowel, replacement, theorder)\r\n  SELECT f.vowel, f.Replacement, f.theorder\r\n  FROM\r\n    (VALUES\r\n       ('e', 'egge', 1),\r\n       ('a', 'egga', 2),\r\n       ('i', 'eggi', 3),\r\n       ('o', 'eggo', 4),\r\n       ('u', 'eggu', 5),\r\n       ('E', 'Egge', 6),\r\n       ('A', 'Egga', 7),\r\n       ('I', 'Eggi', 8),\r\n       ('O', 'Eggo', 9),\r\n       ('U', 'Eggu', 10)\r\n    ) f(vowel, Replacement, theorder);\r\nSELECT @SampleParagraph =\r\n  REPLACE(\r\n           @SampleParagraph COLLATE Latin1_General_CS_AS,\r\n           [@EggyPeggy].vowel COLLATE Latin1_General_CS_AS,\r\n           [@EggyPeggy].replacement COLLATE Latin1_General_CS_AS\r\n         )\r\n  FROM @EggyPeggy\r\n  WHERE CHARINDEX([@EggyPeggy].vowel, @SampleParagraph) &gt; 0\r\n  ORDER BY [@EggyPeggy].theorder;\r\n\r\nSELECT @SampleParagraph;\r\n\r\n--\"Eggonegge meggust cleggeeggarly steggategge theggat thegge eggasseggessmeggent eggof eggany seggigneggifeggiceggant weggeeggakneggessegges eggin thegge ceggentreggal meggoneggoleggogeggism eggof EggoDBC cegganneggot begge sheggown teggo begge reggeleggeve\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/* 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&#8230;&hellip;<\/p>\n","protected":false},"author":154613,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,143531],"tags":[],"coauthors":[6813],"class_list":["post-2300","post","type-post","status-publish","format-standard","hentry","category-blogs","category-t-sql-programming-sql-server"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/154613"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=2300"}],"version-history":[{"count":6,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2300\/revisions"}],"predecessor-version":[{"id":71206,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2300\/revisions\/71206"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=2300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=2300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=2300"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}