Re: [tied] Re: The Swedish Chef

From: Miguel Carrasquer
Message: 14316
Date: 2002-08-13

On Tue, 13 Aug 2002 16:48:13 +0200, "Milos Bogdanovic" <milos@...> wrote:

>Thank you all for the explanations.
>
>Dalarna dialect also has its characteristics, besides the melodical accentuation,
>which is the consequence of its aboriginal population.
>
>On internet I found the presentation that do the sound changes (Dialectize Text),
>typical for the Swedish Chef from the Muppwet Show (and other funny "dialects"),
>so I aminterested is there a bit of truth in that joke, how much and by which
>attributes Dalarna dialect differs from the speech from the other population:
>
>http://www.rinkworks.com/dialect/

You mean chef.lex?

%{
/* chef.x - convert English on stdin to Mock Swedish on stdout
*
* The WC definition matches any word character, and the NW definition matches
* any non-word character. Two start conditions are maintained: INW (in word)
* and NIW (not in word). The first rule passes TeX commands without change.
*
* HISTORY
*
* Apr 15, 1992; John Hagerman: Created.
*/

static int i_seen = 0;
%}

WC [A-Za-z']
NW [^A-Za-z']

%start INW NIW

%%

\\[^ \n]+ ECHO;

{NW} { BEGIN NIW; i_seen = 0; ECHO; }
"."$ { BEGIN NIW; i_seen = 0; printf(".\nBork Bork Bork!"); }

<NIW>"bork"/{NW} ECHO;
<NIW>"Bork"/{NW} ECHO;

"an" { BEGIN INW; printf("un"); }
"An" { BEGIN INW; printf("Un"); }
"au" { BEGIN INW; printf("oo"); }
"Au" { BEGIN INW; printf("Oo"); }
"a"/{WC} { BEGIN INW; printf("e"); }
"A"/{WC} { BEGIN INW; printf("E"); }
"en"/{NW} { BEGIN INW; printf("ee"); }
<INW>"ew" { BEGIN INW; printf("oo"); }
<INW>"e"/{NW} { BEGIN INW; printf("e-a"); }
<NIW>"e" { BEGIN INW; printf("i"); }
<NIW>"E" { BEGIN INW; printf("I"); }
<INW>"f" { BEGIN INW; printf("ff"); }
<INW>"ir" { BEGIN INW; printf("ur"); }
<INW>"i" { BEGIN INW; printf(i_seen++ ? "i" : "ee"); }
<INW>"ow" { BEGIN INW; printf("oo"); }
<NIW>"o" { BEGIN INW; printf("oo"); }
<NIW>"O" { BEGIN INW; printf("Oo"); }
<INW>"o" { BEGIN INW; printf("u"); }
"the" { BEGIN INW; printf("zee"); }
"The" { BEGIN INW; printf("Zee"); }
"th"/{NW} { BEGIN INW; printf("t"); }
<INW>"tion" { BEGIN INW; printf("shun"); }
<INW>"u" { BEGIN INW; printf("oo"); }
<INW>"U" { BEGIN INW; printf("Oo"); }
"v" { BEGIN INW; printf("f"); }
"V" { BEGIN INW; printf("F"); }
"w" { BEGIN INW; printf("v"); }
"W" { BEGIN INW; printf("V"); }

. { BEGIN INW; ECHO; }
%%

main()
{
yylex();
}



The above text is translated by this lex program into:


"Thunk yuoo ell fur zee ixpluneshuns.

Delerna deeelect elsu hes its cherectereestics, beseedes zee meludeecel
eccentooeshun,
vheech is zee cunseqooence-a ooff its ebureeginel pupooleshun.

Oon internet I fuoond zee presenteshun thet du zee suoond chunges (Deeelectize-a
Text),
typeecel fur zee Svedeesh Cheff frum zee Mooppvet Shoo (und oozeer foonny
"deeelects"),
su I emeenterested is zeere-a a beet ooff troot in thet juke-a, hoo mooch und by
vheech
ettreebootes Delerna deeelect deeffffers frum zee speech frum zee oozeer
pupooleshun"



=======================
Miguel Carrasquer Vidal
mcv@...