added Facebook grammar from SummerSchool tutorial on best practices for grammar writing

This commit is contained in:
ramona.enache
2013-08-21 13:05:22 +00:00
parent 1f4b55735e
commit 9f1a2e5b67
6 changed files with 109 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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") ;
}

View File

@@ -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 ;
}

View File

@@ -0,0 +1,8 @@
interface LexFacebook = open Syntax in
{
oper
nounFromS : S -> NP ;
checkIn : NP -> VP ;
beFriends : NP -> VP ;
like : NP -> NP -> S ;
}

View File

@@ -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)) ;
}

View File

@@ -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.