examples/letter: convert grammar files to UTF-8

This commit is contained in:
hallgren
2013-11-26 12:52:05 +00:00
parent 24a10d20a0
commit bfea06561d
3 changed files with 39 additions and 39 deletions

View File

@@ -5,7 +5,7 @@ concrete LetterFin of Letter = {
-- This file defines the Finnish syntax of the grammar set
-- whose abstract syntax is $letter.Abs.gf$.
flags lexer=textlit ; unlexer=textlit ;
flags lexer=textlit ; unlexer=textlit ; coding=utf8;
-- modified from French in 20 min, 15/6/2002
@@ -33,10 +33,10 @@ oper
egosum : Num => Str =
table {sg => "olen" ; pl => "olemme"} ;
egohabeo : Num => Str =
table {sg => "minulla" ++ "on" ; pl => "meillä" ++ "on"} ;
table {sg => "minulla" ++ "on" ; pl => "meillä" ++ "on"} ;
fuisti : Num => Str =
table {sg => "sinut" ++ "on"; pl => "teidät" ++ "on"} ;
quePrep = "että" ; ----
table {sg => "sinut" ++ "on"; pl => "teidät" ++ "on"} ;
quePrep = "että" ; ----
tuinformare : Num => Str =
table {sg => "ilmoittaa" ++ "sinulle" ; pl => "ilmoittaa" ++ "teille"} ;
@@ -45,13 +45,13 @@ oper
avoir : Num => Str =
table {sg => "on"; pl => "ovat"} ;
mes : Num => Str = table {sg => "minun" ; pl => "meidän"} ;
mes : Num => Str = table {sg => "minun" ; pl => "meidän"} ;
teamo : Num => Num => Str = table {
sg => table {sg => "rakastan" ++ "sinua" ;
pl => "rakastan" ++ "teitä"} ;
pl => "rakastan" ++ "teitä"} ;
pl => table {sg => "rakastamme" ++ "sinua" ;
pl => "rakastamme" ++ "teitä"}
pl => "rakastamme" ++ "teitä"}
} ;
constNG : Str -> Num -> Gen -> SSSrc2 = \str,num,gen ->
@@ -132,7 +132,7 @@ Regret = {s =
President = constNG ["presidentti"] sg masc ;
Mother = constNG ["äiti"] sg fem ;
Mother = constNG ["äiti"] sg fem ;
Spouse = {s = table {
sg => table {fem => ["miehesi"] ; masc => ["vaimosi"]} ;
pl => table {fem => ["miehenne"] ; masc => ["vaimonne"]}
@@ -174,8 +174,8 @@ Senior = {s = table {sg => table {g => ["vanhemmaksi tutkijaksi"]} ;
ProjectManager = {s =
table {
sg => table {_ => ["projektipäälliköksi"]} ;
pl => table {_ => ["projektipäälliköiksi"]}
sg => table {_ => ["projektipäälliköksi"]} ;
pl => table {_ => ["projektipäälliköiksi"]}
}} ;
}

View File

@@ -6,7 +6,7 @@ concrete LetterFre of Letter = {
-- whose abstract syntax is $letter.Abs.gf$.
flags lexer=textlit ; unlexer=textlit ;
flags lexer=textlit ; unlexer=textlit ; coding=utf8;
param Gen = masc | fem ;
param Num = sg | pl ;
@@ -24,7 +24,7 @@ oper SSSrcGen = {s : Str ; n : Num ; g : Gen} ; -- gives Num and Gen
oper
ss : Str -> SS = \s -> {s = s} ;
cher : Num => Gen => Tok =
table {n => table {masc => regNom "cher" ! n ; fem => regNom "chère" ! n}};
table {n => table {masc => regNom "cher" ! n ; fem => regNom "chère" ! n}};
regAdj : Str -> Gen => Num => Str = \s ->
table {masc => regNom s ; fem => regNom (s + "e")} ;
regNom : Str -> Num => Str = \s -> table {sg => s ; pl => s + "s"} ;
@@ -33,7 +33,7 @@ oper
egohabeo : Num => Str =
table {sg => "j'ai" ; pl => "nous" ++ "avons"} ;
fuisti : Num => Str =
table {sg => "tu" ++ "as" ++ "été"; pl => "vous" ++ "avez" ++ "été"} ;
table {sg => "tu" ++ "as" ++ "été"; pl => "vous" ++ "avez" ++ "été"} ;
quePrep = "que" ; ----
tuinformare : Num => Str =
table {sg => "t'informer"; pl => "vous" ++ "informer"} ;
@@ -102,18 +102,18 @@ FormalEnding auth =
{s =
table {n => table {g =>
"avec" ++ mes ! dep2num auth.n n ++
["salutations distinguées"] ++ RET ++ auth.s ! n ! g}} ;
["salutations distinguées"] ++ RET ++ auth.s ! n ! g}} ;
n = auth.n ; g = auth.g} ;
InformalEnding auth =
{s = table {n => table {g => ["Amicalement"] ++ RET ++ auth.s ! n ! g}} ;
n = auth.n ; g = auth.g} ;
ColleaguesHe = {s = regNom "collègue" ! pl ; n = pl ; g = masc} ;
ColleaguesShe = {s = regNom "collègue" ! pl ; n = pl ; g = fem} ;
ColleagueHe = {s = regNom "collègue" ! sg ; n = sg ; g = masc} ;
ColleagueShe = {s = regNom "collègue" ! sg ; n = sg ; g = fem} ;
DarlingHe = {s = "chéri" ; n = sg ; g = masc} ;
DarlingShe = {s = "chérie" ; n = sg ; g = fem} ;
ColleaguesHe = {s = regNom "collègue" ! pl ; n = pl ; g = masc} ;
ColleaguesShe = {s = regNom "collègue" ! pl ; n = pl ; g = fem} ;
ColleagueHe = {s = regNom "collègue" ! sg ; n = sg ; g = masc} ;
ColleagueShe = {s = regNom "collègue" ! sg ; n = sg ; g = fem} ;
DarlingHe = {s = "chéri" ; n = sg ; g = masc} ;
DarlingShe = {s = "chérie" ; n = sg ; g = fem} ;
NameHe s = {s = s.s ; n = sg ; g = masc} ;
NameShe s = {s = s.s ; n = sg ; g = fem} ;
@@ -126,12 +126,12 @@ Honour = {s =
Regret = {s =
table {na => table {ga => table {nr => table {gr =>
let {dga = dep2gen ga gr ; dna = dep2num na nr} in
egosum ! dna ++ regAdj "désolé" ! dga ! dna ++
egosum ! dna ++ regAdj "désolé" ! dga ! dna ++
["d'informer"] ++ quePrep}}}}
} ;
President = constNG ["le président"] sg masc ;
President = constNG ["le président"] sg masc ;
Mother = constNG ["maman"] sg fem ;
Spouse = {s = table {
sg => table {fem => ["ton mari"] ; masc => ["ta femme"]} ;
@@ -155,7 +155,7 @@ ILoveYou = {s =
} ;
Company = {s = ["notre entreprise"] ; n = sg ; g = fem} ;
Competitor = {s = ["notre pire compétiteur"] ; n = sg ; g = masc} ;
Competitor = {s = ["notre pire compétiteur"] ; n = sg ; g = masc} ;
OurCustomers = {s = ["nos clients"] ; n = pl ; g = masc} ;
Senior = {s = table {sg => table {g => ["responsable scientifique"]} ;

View File

@@ -6,7 +6,7 @@ concrete LetterSwe of Letter = {
-- whose abstract syntax is $letter.Abs.gf$.
flags lexer=textlit ; unlexer=textlit ;
flags lexer=textlit ; unlexer=textlit ; coding=utf8;
printname cat Letter = "Brev" ;
printname fun MkLetter = "brevmall" ;
@@ -70,30 +70,30 @@ PlainSent sent = sent ;
FormalEnding auth =
{s = table {n => table {x =>
["Med vänlig hälsning"] ++ RET ++ auth.s ! n ! x}} ; n = auth.n ; x = auth.x} ;
["Med vänlig hälsning"] ++ RET ++ auth.s ! n ! x}} ; n = auth.n ; x = auth.x} ;
InformalEnding auth =
{s = table {n => table {x =>
["Med hälsningar"] ++ RET ++ auth.s ! n ! x}} ; n = auth.n ; x = auth.x} ;
["Med hälsningar"] ++ RET ++ auth.s ! n ! x}} ; n = auth.n ; x = auth.x} ;
ColleaguesHe = {s = kollega ! pl ; n = pl ; x = masc} ;
ColleaguesShe = {s = kollega ! pl ; n = pl ; x = fem} ;
ColleagueHe = {s = kollega ! sg ; n = sg ; x = masc} ;
ColleagueShe = {s = kollega ! sg ; n = sg ; x = fem} ;
DarlingHe = {s = "älskling" ; n = sg ; x = masc} ;
DarlingShe = {s = "älskling" ; n = sg ; x = fem} ;
DarlingHe = {s = "älskling" ; n = sg ; x = masc} ;
DarlingShe = {s = "älskling" ; n = sg ; x = fem} ;
NameHe s = {s = s.s ; n = sg ; x = masc} ;
NameShe s = {s = s.s ; n = sg ; x = fem} ;
Honour = {s =
table {na => table {xa => table {nr => table {xr =>
jag ! dep2num na nr ! nom ++ ["har äran att meddela"] ++
jag ! dep2num na nr ! nom ++ ["har äran att meddela"] ++
du ! nr ! acc ++ "att"}}}}
} ;
Regret = {s =
table {na => table {xa => table {nr => table {xr =>
jag ! dep2num na nr ! nom ++ ["måste tyvärr meddela"] ++
jag ! dep2num na nr ! nom ++ ["måste tyvärr meddela"] ++
du ! nr ! acc ++ "att"}}}}
} ;
@@ -102,7 +102,7 @@ President = constNX ["Presidenten"] sg masc ;
Mother = constNX ["Mamma"] sg fem ;
Spouse = {s = table {
sg => table {fem => ["din man"] ; masc => ["din hustru"]} ;
pl => table {fem => ["era män"] ; masc => ["era hustrur"]}
pl => table {fem => ["era män"] ; masc => ["era hustrur"]}
} ; n = depnum ; x = masc} ; -- sex does not matter here
Dean = constNX ["Dekanus"] sg masc ;
Name s = constNX s.s sg masc ; ---
@@ -114,18 +114,18 @@ BePromoted pos = {s =
} ;
GoBankrupt np = {s =
table {na => table {xa => table {nr => table {xr =>
np.s ++ ["har gått i konkurs"]}}}}
np.s ++ ["har gått i konkurs"]}}}}
} ;
ILoveYou = {s =
table {na => table {xa => table {nr => table {xr =>
jag ! dep2num na nr ! nom ++ ["älskar"] ++ du ! nr ! acc}}}}
jag ! dep2num na nr ! nom ++ ["älskar"] ++ du ! nr ! acc}}}}
} ;
Company = {s = ["vårt företag"] ; n = sg ; g = ett} ;
Competitor = {s = ["vår värsta konkurrent"] ; n = sg ; g = en} ;
OurCustomers = {s = ["våra kunder"] ; n = pl ; g = en} ;
Company = {s = ["vårt företag"] ; n = sg ; g = ett} ;
Competitor = {s = ["vår värsta konkurrent"] ; n = sg ; g = en} ;
OurCustomers = {s = ["våra kunder"] ; n = pl ; g = en} ;
Senior = {s = table {n => table {x => ["äldre forskare"]}}} ;
Senior = {s = table {n => table {x => ["äldre forskare"]}}} ;
ProjectManager = {s =
table {
sg => table {_ => "projektchef"} ;
@@ -137,8 +137,8 @@ oper
kaer :
Num => Sex => Str =
table {
sg => table {masc => "Käre" ; fem => "Kära"} ;
pl => table {_ => "Kära"}
sg => table {masc => "Käre" ; fem => "Kära"} ;
pl => table {_ => "Kära"}
} ;
kollega :