From 21a2a81a27ef03f808f7ad37dc1db1987199dfe9 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 2 Sep 2005 13:04:49 +0000 Subject: [PATCH] Predic --- lib/resource/abstract/Predic.gf | 49 +++++++++++++++++++++++ lib/resource/english/DeptypEng.gf | 43 ++++++++++++++++++++ lib/resource/english/PredicEng.gf | 66 +++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 lib/resource/abstract/Predic.gf create mode 100644 lib/resource/english/DeptypEng.gf create mode 100644 lib/resource/english/PredicEng.gf diff --git a/lib/resource/abstract/Predic.gf b/lib/resource/abstract/Predic.gf new file mode 100644 index 000000000..eca746fc0 --- /dev/null +++ b/lib/resource/abstract/Predic.gf @@ -0,0 +1,49 @@ +abstract Predic = Categories ** { + + cat + VType ; + CType ; + Verb VType ; + Compl VType ; + + fun + Vt_ : VType ; + Vt : CType -> VType ; + VtN : CType -> VType ; + + CtN, + CtS, + CtV, + CtQ, + CtA : CType ; + + SPredVerb : (v : VType) -> NP -> Verb v -> Compl v -> Cl ; + + QPredVerb : (v : VType) -> IP -> Verb v -> Compl v -> QCl ; + RPredVerb : (v : VType) -> RP -> Verb v -> Compl v -> RCl ; + IPredVerb : (v : VType) -> Verb v -> Compl v -> VCl ; + + ComplNil : Compl Vt_ ; + ComplNP : NP -> Compl (Vt CtN) ; + ComplS : S -> Compl (Vt CtS) ; + ComplQ : QS -> Compl (Vt CtQ) ; + ComplA : AP -> Compl (Vt CtQ) ; + + ComplAdd : (c : CType) -> NP -> Compl (Vt c) -> Compl (VtN c) ; + +{- + MkSlash3 : NG NtS -> VG (VtN CtN) -> CG (Vt CtN) -> Slash ; + MkSlash2 : (c : CType) -> NG NtS -> VG (VtN c) -> CG (Vt c) -> Slash ; + MkSlash1 : NG NtS -> VG (Vt CtN) -> Slash ; + SlashQ : NG NtQ -> Slash -> SG NtQ ; +-} + + + UseV1 : V -> Verb Vt_ ; + UseV2 : V2 -> Verb (Vt CtN) ; + UseVS : VS -> Verb (Vt CtS) ; + UseV3 : V3 -> Verb (VtN CtN) ; + UseV2S : V2S -> Verb (VtN CtS) ; + UseV2Q : V2Q -> Verb (VtN CtQ) ; + ---- etc +} diff --git a/lib/resource/english/DeptypEng.gf b/lib/resource/english/DeptypEng.gf new file mode 100644 index 000000000..fe721bf1b --- /dev/null +++ b/lib/resource/english/DeptypEng.gf @@ -0,0 +1,43 @@ +---- to be merged in TypesEng + +resource DeptypEng = open Prelude, TypesEng in { + + param + VComp = + CVt_ + | CVt CComp + | CVtN CPrep CComp ; + + CComp = + CCtN CPrep + | CCtS + | CCtV + | CCtQ + | CCtA ; + + CPrep = CP_ | CP_at | CP_in | CP_on | CP_to ; + + oper + strCPrep : CPrep -> Str = \p -> case p of { + CP_ => [] ; + CP_at => "at" ; + CP_in => "in" ; + CP_on => "on" ; + CP_to => "to" + } ; + + cprep1, cprep2 : VComp -> Str -> Str ; + + cprep1 c s = case c of { + CVt (CCtN cp) => strCPrep cp ++ s ; + CVtN cp _ => strCPrep cp ++ s ; + _ => s + } ; + + cprep2 c s = case c of { + CVtN _ (CCtN cp) => strCPrep cp ++ s ; + _ => s + } ; + + +} \ No newline at end of file diff --git a/lib/resource/english/PredicEng.gf b/lib/resource/english/PredicEng.gf new file mode 100644 index 000000000..95a1f36f6 --- /dev/null +++ b/lib/resource/english/PredicEng.gf @@ -0,0 +1,66 @@ +--# -path=.:../abstract:../../prelude +--# -opt + +concrete PredicEng of Predic = CategoriesEng ** + open Prelude, SyntaxEng, DeptypEng in { + + flags optimize=all ; + + lincat + VType, CType = SS ; + Verb = {s : VForm => Str ; isAux : Bool ; s1 : Particle ; c : VComp} ; + Compl = {s1, s2 : Agr => Str} ; + + lin + + CtN, CtV, CtS, CtQ, CtA = ss [] ; + Vt, VtN = \x -> x ; + Vt_ = ss [] ; + + ComplNil = {s1, s2 = \\_ => []} ; + ComplNP np = {s1 = \\_ => np.s ! AccP ; s2 = \\_ => []} ; + ComplA ap = {s1 = ap.s ; s2 = \\_ => []} ; + ComplQ q = {s1 = \\_ => q.s ! DirQ ; s2 = \\_ => []} ; + ComplS s = {s1 = \\_ => "that" ++ s.s ; s2 = \\_ => []} ; + + ComplAdd c np co = {s1 = \\_ => c.s ++ np.s ! AccP ; s2 = co.s1} ; + + + SPredVerb vt np verb compl = + predVerbClause np verb + (\\a => vt.s ++ + cprep1 verb.c (compl.s1 ! a) ++ + cprep2 verb.c (compl.s2 ! a) + ) ; + QPredVerb vt np verb compl = + intVerbClause np verb + (\\a => vt.s ++ + cprep1 verb.c (compl.s1 ! a) ++ + cprep2 verb.c (compl.s2 ! a) + ) ; + RPredVerb vt np verb compl = + relVerbClause np verb + (\\a => vt.s ++ + cprep1 verb.c (compl.s1 ! a) ++ + cprep2 verb.c (compl.s2 ! a) + ) ; + IPredVerb vt verb compl = + predVerbI verb + (\\a => vt.s ++ + cprep1 verb.c (compl.s1 ! a) ++ + cprep2 verb.c (compl.s2 ! a) + ) ; + + UseV1 v = v ** {isAux = False ; c = CVt_} ; + UseV2 v = v ** {isAux = False ; c = CVt (CCtN CP_)} ; ---- other preps + +{- + Walk = {s = "walks" ; c = VC_} ; + Love = {s = "loves" ; c = VC1 C_} ; + Know = {s = "knows" ; c = VC_} ; + Give = {s = "gives" ; c = VC2 C_ C_to} ; + Tell = {s = "tells" ; c = VC_} ; + Ask = {s = "asks" ; c = VC_} ; +-} + +}