forked from GitHub/gf-core
Predic
This commit is contained in:
49
lib/resource/abstract/Predic.gf
Normal file
49
lib/resource/abstract/Predic.gf
Normal file
@@ -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
|
||||
}
|
||||
43
lib/resource/english/DeptypEng.gf
Normal file
43
lib/resource/english/DeptypEng.gf
Normal file
@@ -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
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
66
lib/resource/english/PredicEng.gf
Normal file
66
lib/resource/english/PredicEng.gf
Normal file
@@ -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_} ;
|
||||
-}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user