From f5461eb3d4eb2605b546a4ed202c12bcdaa1f4e4 Mon Sep 17 00:00:00 2001 From: "john.j.camilleri" Date: Mon, 16 Sep 2013 07:17:27 +0000 Subject: Remove contribs and examples Everything has now been moved to a separate repository at https://github.com/GrammaticalFramework/gf-contrib The contents of the examples folder are build during SetupWeb --- examples/foods/FoodsGle.gf | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 examples/foods/FoodsGle.gf (limited to 'examples/foods/FoodsGle.gf') diff --git a/examples/foods/FoodsGle.gf b/examples/foods/FoodsGle.gf new file mode 100644 index 000000000..e48c0c21b --- /dev/null +++ b/examples/foods/FoodsGle.gf @@ -0,0 +1,59 @@ +concrete FoodsGle of Foods = open MutationsGle, CharactersGle in { + param Gender = Masc|Fem ; + param Number = Sg|Pl ; + param Breadth = Broad|Slender|NoBreadth ; + + lincat Comment = Str; + lin Pred item quality = "tá" ++ item ++ quality.s!Sg!Unmutated ; + + lincat Item = Str; + lin + This kind = (addArticleSg kind) ++ "seo" ; + That kind = (addArticleSg kind) ++ "sin"; + These kind = (addArticlePl kind) ++ "seo" ; + Those kind = (addArticlePl kind) ++ "sin" ; + oper addArticleSg : {s : Number => Mutation => Str; g : Gender} -> Str = + \kind -> "an" ++ case kind.g of { Masc => kind.s!Sg!PrefixT; Fem => kind.s!Sg!Lenition1DNTLS } ; + oper addArticlePl : {s : Number => Mutation => Str; g : Gender} -> Str = + \kind -> "na" ++ kind.s!Pl!PrefixH ; + + lincat Kind = {s : Number => Mutation => Str; g : Gender; pe : Breadth} ; + lin + Mod quality kind = { + s = table{ + Sg => table{mutation => kind.s!Sg!mutation ++ case kind.g of {Masc => quality.s!Sg!Unmutated; Fem => quality.s!Sg!Lenition1} }; + Pl => table{mutation => kind.s!Pl!mutation ++ case kind.pe of {Slender => quality.s!Pl!Lenition1; _ => quality.s!Pl!Unmutated} } + }; + g = kind.g; + pe = kind.pe + } ; + Wine = makeNoun "fíon" "fíonta" Masc ; + Cheese = makeNoun "cáis" "cáiseanna" Fem ; + Fish = makeNoun "iasc" "éisc" Masc ; + Pizza = makeNoun "píotsa" "píotsaí" Masc ; + oper makeNoun : Str -> Str -> Gender -> {s : Number => Mutation => Str; g : Gender; pe : Breadth} = + \sg,pl,g -> { + s = table{Sg => (mutate sg); Pl => (mutate pl)}; + g = g; + pe = case pl of { + _ + v@(#broadVowel) + c@(#consonant*) + #consonant => Broad; + _ + v@(#slenderVowel) + c@(#consonant*) + #consonant => Slender; + _ => NoBreadth + } + } ; + + lincat Quality = {s : Number => Mutation => Str; sVery : Number => Str} ; + lin + Very quality = {s=table{number => table{_ => quality.sVery!number}}; sVery=quality.sVery } ; + Fresh = makeAdjective "úr" "úra" ; + Warm = makeAdjective "te" "te" ; + Italian = makeAdjective "Iodálach" "Iodálacha" ; + Expensive = makeAdjective "daor" "daora" ; + Delicious = makeAdjective "blasta" "blasta" ; + Boring = makeAdjective "leamh" "leamha" ; + oper makeAdjective : Str -> Str -> {s : Number => Mutation => Str; sVery : Number => Str} = + \sg,pl -> { + s=table{Sg => (mutate sg); Pl => (mutate pl)}; + sVery=table{Sg => "an-"+(lenition1dntls sg); Pl => "an-"+(lenition1dntls pl)} + } ; +} \ No newline at end of file -- cgit v1.2.3