From 9f1a2e5b67a1808e65606e9884e85eccd501bb72 Mon Sep 17 00:00:00 2001 From: "ramona.enache" Date: Wed, 21 Aug 2013 13:05:22 +0000 Subject: [PATCH] added Facebook grammar from SummerSchool tutorial on best practices for grammar writing --- .../2013/bestPractices/Facebook.gf | 35 +++++++++++++++++++ .../2013/bestPractices/FacebookEng.gf | 14 ++++++++ .../2013/bestPractices/FacebookI.gf | 29 +++++++++++++++ .../2013/bestPractices/LexFacebook.gf | 8 +++++ .../2013/bestPractices/LexFacebookEng.gf | 16 +++++++++ .../2013/bestPractices/corpus.txt | 7 ++++ 6 files changed, 109 insertions(+) create mode 100644 contrib/summerschool/2013/bestPractices/Facebook.gf create mode 100644 contrib/summerschool/2013/bestPractices/FacebookEng.gf create mode 100644 contrib/summerschool/2013/bestPractices/FacebookI.gf create mode 100644 contrib/summerschool/2013/bestPractices/LexFacebook.gf create mode 100644 contrib/summerschool/2013/bestPractices/LexFacebookEng.gf create mode 100644 contrib/summerschool/2013/bestPractices/corpus.txt diff --git a/contrib/summerschool/2013/bestPractices/Facebook.gf b/contrib/summerschool/2013/bestPractices/Facebook.gf new file mode 100644 index 000000000..859f6abff --- /dev/null +++ b/contrib/summerschool/2013/bestPractices/Facebook.gf @@ -0,0 +1,35 @@ +abstract Facebook = { + +flags startcat = Action ; + +cat + SPerson; + Person; + Place; + Page; + Action; + Item ; + +fun + CheckIn : SPerson -> Place -> Action ; + BeFriends : SPerson -> Person -> Action ; + Like : SPerson -> Item -> Action ; + + SPersonToPerson : SPerson -> Person ; + MorePersons : SPerson -> Person -> Person ; + + PlaceToItem : Place -> Item ; + PageToItem : Page -> Item ; + ActionToItem : Action -> Item ; + + +--------- + +You : SPerson ; +John : SPerson; +Mary : SPerson; + +Frauinsel : Place; +GF : Page; + +} \ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/FacebookEng.gf b/contrib/summerschool/2013/bestPractices/FacebookEng.gf new file mode 100644 index 000000000..6f4a448d8 --- /dev/null +++ b/contrib/summerschool/2013/bestPractices/FacebookEng.gf @@ -0,0 +1,14 @@ + +concrete FacebookEng of Facebook = FacebookI with + (Syntax = SyntaxEng), + (LexFacebook = LexFacebookEng) ** + open ParadigmsEng in { + +lin +You = you_NP ; +John = mkNP (mkPN "John") ; +Mary = mkNP (mkPN "Mary") ; +Frauinsel = mkNP (mkPN "Frauinsel") ; +GF = mkNP (mkPN "GF") ; + +} \ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/FacebookI.gf b/contrib/summerschool/2013/bestPractices/FacebookI.gf new file mode 100644 index 000000000..5c798e1e3 --- /dev/null +++ b/contrib/summerschool/2013/bestPractices/FacebookI.gf @@ -0,0 +1,29 @@ +incomplete concrete FacebookI of Facebook = + open + Syntax, + Prelude, + LexFacebook + in +{ +lincat + SPerson = NP ; + Person = NP ; + Place = NP ; + Page = NP ; + Action = S ; + Item = NP ; + + +lin +SPersonToPerson sperson = sperson ; +MorePersons sperson person = mkNP and_Conj sperson person ; + +PlaceToItem place = place ; +PageToItem page = page ; +ActionToItem action = nounFromS action ; + +CheckIn sperson place = mkS pastTense (mkCl sperson (checkIn place)) ; +BeFriends sperson person = mkS pastTense (mkCl sperson (beFriends person)) ; +Like sperson item = like sperson item ; + +} \ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/LexFacebook.gf b/contrib/summerschool/2013/bestPractices/LexFacebook.gf new file mode 100644 index 000000000..e6ee7b5c8 --- /dev/null +++ b/contrib/summerschool/2013/bestPractices/LexFacebook.gf @@ -0,0 +1,8 @@ +interface LexFacebook = open Syntax in +{ +oper +nounFromS : S -> NP ; +checkIn : NP -> VP ; +beFriends : NP -> VP ; +like : NP -> NP -> S ; +} \ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/LexFacebookEng.gf b/contrib/summerschool/2013/bestPractices/LexFacebookEng.gf new file mode 100644 index 000000000..1d065fdb4 --- /dev/null +++ b/contrib/summerschool/2013/bestPractices/LexFacebookEng.gf @@ -0,0 +1,16 @@ +instance LexFacebookEng of LexFacebook = + open SyntaxEng, + ParadigmsEng, + --ExtraEng, + IrregEng in +{ +oper + nounFromS s = mkNP (mkNP the_Det (mkCN (mkN "fact"))) (SyntaxEng.mkAdv that_Subj s) ; + + checkIn np = mkVP (mkV2 (partV (mkV "check") "in") (mkPrep "to")) np ; + + beFriends np = mkVP (mkVP (dirV2 become_V) (mkNP a_Art plNum (mkCN (mkN "friend")))) (SyntaxEng.mkAdv (mkPrep "with") np) ; + + like np1 np2 = mkS (mkCl np1 (mkVP (dirV2 (mkV "like")) np2)) ; + +} \ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/corpus.txt b/contrib/summerschool/2013/bestPractices/corpus.txt new file mode 100644 index 000000000..7ff207000 --- /dev/null +++ b/contrib/summerschool/2013/bestPractices/corpus.txt @@ -0,0 +1,7 @@ +You and John are now friends. You became friends with John. +You became friends with John and Mary. +You checked in to Frauinsel. +You like GF. +You like Frauinsel. +You like that John checked in to Frauinsel. +You like that you became friends with John and Mary.