mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 02:02:51 -06:00
New things in english and german resources.
This commit is contained in:
@@ -396,4 +396,3 @@ oper
|
||||
-}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -190,6 +190,11 @@ oper
|
||||
tvDir : V -> TV ; -- umbringen
|
||||
tvDirReg : Str -> TV ; -- lieben
|
||||
|
||||
-- Three-place verbs require two prepositions and cases.
|
||||
|
||||
mkV3 : V -> Str -> Case -> Str -> Case -> TV ; -- geben,[],dative,[],accusative
|
||||
|
||||
|
||||
--2 Adverbials
|
||||
--
|
||||
-- Adverbials for modifying verbs, adjectives, and sentences can be formed
|
||||
@@ -292,6 +297,7 @@ oper
|
||||
tvReg = \hören, zu, dat -> mkTV (vReg hören) zu dat ;
|
||||
tvDir = \v -> mkTV v [] accusative ;
|
||||
tvDirReg = \v -> tvReg v [] accusative ;
|
||||
mkV3 = mkDitransVerb ;
|
||||
|
||||
mkAdV = ss ;
|
||||
mkPP = prepPhrase ;
|
||||
|
||||
@@ -13,16 +13,17 @@ resource Predication = open Deutsch in {
|
||||
-- We first define a set of predication patterns.
|
||||
|
||||
oper
|
||||
predV1 : V -> NP -> S ; -- one-place verb: "John walks"
|
||||
predV2 : TV -> NP -> NP -> S ; -- two-place verb: "John loves Mary"
|
||||
predVColl : V -> NP -> NP -> S ; -- collective verb: "John and Mary fight"
|
||||
predA1 : Adj1 -> NP -> S ; -- one-place adjective: "John is old"
|
||||
predA2 : Adj2 -> NP -> NP -> S ; -- two-place adj: "John is married to Mary"
|
||||
predV1 : V -> NP -> S ; -- one-place verb: "John walks"
|
||||
predV2 : TV -> NP -> NP -> S ; -- two-place verb: "John loves Mary"
|
||||
predV3 : TV -> NP -> NP -> NP -> S ; -- three-place verb: "John gives Mary beer"
|
||||
predVColl : V -> NP -> NP -> S ; -- collective verb: "John and Mary fight"
|
||||
predA1 : Adj1 -> NP -> S ; -- one-place adjective: "John is old"
|
||||
predA2 : Adj2 -> NP -> NP -> S ; -- two-place adj: "John is married to Mary"
|
||||
predAComp : AdjDeg -> NP -> NP -> S ; -- compar adj: "John is older than Mary"
|
||||
predAColl : Adj1 -> NP -> NP -> S ; -- collective adj: "John and Mary are married"
|
||||
predN1 : N -> NP -> S ; -- one-place noun: "John is a man"
|
||||
predN2 : Fun -> NP -> NP -> S ; -- two-place noun: "John is a lover of Mary"
|
||||
predNColl : N -> NP -> NP -> S ; -- collective noun: "John and Mary are lovers"
|
||||
predAColl : Adj1 -> NP -> NP -> S ; -- collect adj: "John and Mary are married"
|
||||
predN1 : N -> NP -> S ; -- one-place noun: "John is a man"
|
||||
predN2 : Fun -> NP -> NP -> S ; -- two-place noun: "John is a lover of Mary"
|
||||
predNColl : N -> NP -> NP -> S ; -- collect noun: "John and Mary are lovers"
|
||||
|
||||
-- Individual-valued function applications.
|
||||
|
||||
@@ -42,9 +43,13 @@ oper
|
||||
|
||||
-- Logical connectives on two sentences.
|
||||
|
||||
conjS : S -> S -> S ;
|
||||
disjS : S -> S -> S ;
|
||||
implS : S -> S -> S ;
|
||||
conjS : S -> S -> S ; -- A and B
|
||||
disjS : S -> S -> S ; -- A or B
|
||||
implS : S -> S -> S ; -- if A, B
|
||||
|
||||
-- A variant of implication.
|
||||
|
||||
ifThenS : S -> S -> S ; -- if A, then B
|
||||
|
||||
-- As an auxiliary, we need two-place conjunction of names ("John and Mary"),
|
||||
-- used in collective predication.
|
||||
@@ -80,6 +85,8 @@ oper
|
||||
disjS = \A, B -> ConjS OrConj (TwoS A B) ;
|
||||
implS = \A, B -> SubjS IfSubj A B ;
|
||||
|
||||
ifThenS = \A,B -> SubjS IfSubj A {s = \\o => "then" ++ B.s ! o} ; --- not in Res
|
||||
|
||||
constrTyp1 = \F, A -> AppFun F (IndefManyNP A) ;
|
||||
|
||||
conjNP = \x, y -> ConjNP AndConj (TwoNP x y) ;
|
||||
|
||||
@@ -46,7 +46,9 @@ lincat
|
||||
V = Verb ;
|
||||
-- = {s : VForm => Str ; s2 : Particle} ;
|
||||
VP = Verb ** {s3 : Number => Str} ;
|
||||
TV = Verb ** {s3 : Preposition ; c : Case} ;
|
||||
TV = TransVerb ;
|
||||
-- = Verb ** {s3 : Preposition ; c : Case} ;
|
||||
V3 = TransVerb ** {s4 : Preposition ; c2 : Case} ;
|
||||
VS = Verb ;
|
||||
AdV = {s : Str} ;
|
||||
|
||||
@@ -110,6 +112,9 @@ lin
|
||||
NegNP = predNounPhrase False ;
|
||||
PosVS = complSentVerb True ;
|
||||
NegVS = complSentVerb False ;
|
||||
PosV3 = complDitransVerb True ;
|
||||
NegV3 = complDitransVerb False ;
|
||||
VTrans = transAsVerb ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
LocNP = locativeNounPhrase ;
|
||||
|
||||
@@ -29,7 +29,6 @@ oper
|
||||
n2n = noun2CommNounPhrase ;
|
||||
|
||||
|
||||
|
||||
--2 Noun phrases
|
||||
--
|
||||
-- The worst case is pronouns, which have inflection in the possessive
|
||||
@@ -70,6 +69,26 @@ oper
|
||||
mkProperName : Str -> ProperName = \horst ->
|
||||
{s = table {Gen => horst + "s" ; _ => horst}} ;
|
||||
|
||||
--2 Mass nouns
|
||||
--
|
||||
-- Mass nouns are morphologically similar to nouns, but they have one special
|
||||
-- rule of noun phrase formation, using the bare singular (in German).
|
||||
-- Example: "Bier ist gut".
|
||||
-- They can also be coerced to common nouns: "ein Mexikanisches Bier".
|
||||
|
||||
MassNounPhrase : Type = CommNounPhrase ;
|
||||
|
||||
massNounPhrase : MassNounPhrase -> NounPhrase = \bier -> {
|
||||
s = \\c => let {nc = caseNP c} in
|
||||
bier.s ! adjfCas Strong nc ! Sg ! nc ;
|
||||
p = P3 ;
|
||||
n = Sg ;
|
||||
pro = False
|
||||
} ;
|
||||
|
||||
massCommNoun : MassNounPhrase -> CommNounPhrase = \x -> x ;
|
||||
|
||||
|
||||
--2 Determiners
|
||||
--
|
||||
-- Determiners are inflected according to the nouns they determine.
|
||||
@@ -77,14 +96,15 @@ oper
|
||||
|
||||
Determiner : Type = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
||||
|
||||
detNounPhrase : Determiner -> CommNounPhrase -> NounPhrase = \ein, mann ->
|
||||
{s = \\c => let {nc = caseNP c} in
|
||||
detNounPhrase : Determiner -> CommNounPhrase -> NounPhrase = \ein, mann -> {
|
||||
s = \\c => let {nc = caseNP c} in
|
||||
ein.s ! mann.g ! nc ++ mann.s ! adjfCas ein.a nc ! ein.n ! nc ;
|
||||
p = P3 ;
|
||||
n = ein.n ;
|
||||
pro = False
|
||||
} ;
|
||||
|
||||
|
||||
-- The adjectival form after a determiner depends both on the inferent form
|
||||
-- and on the case ("ein alter Mann" but "einem alten Mann").
|
||||
|
||||
@@ -400,6 +420,40 @@ oper
|
||||
s3 = \\_ => negation b ++ lieben.s ! VPart APred
|
||||
} ;
|
||||
|
||||
-- Transitive verb can be used elliptically as a verb. The semantics
|
||||
-- is left to applications. The definition is trivial, due to record
|
||||
-- subtyping.
|
||||
|
||||
transAsVerb : TransVerb -> Verb = \lieben ->
|
||||
lieben ;
|
||||
|
||||
-- *Ditransitive verbs* are verbs with three argument places.
|
||||
-- We treat so far only the rule in which the ditransitive
|
||||
-- verb takes both complements to form a verb phrase.
|
||||
|
||||
DitransVerb = TransVerb ** {s4 : Preposition ; c2 : Case} ;
|
||||
|
||||
mkDitransVerb :
|
||||
Verb -> Preposition -> Case -> Preposition -> Case -> DitransVerb =
|
||||
\v,p1,c1,p2,c2 -> v ** {s3 = p1 ; c = c1 ; s4 = p2 ; c2 = c2} ;
|
||||
|
||||
complDitransVerb :
|
||||
Bool -> DitransVerb -> NounPhrase -> NounPhrase -> VerbPhrase =
|
||||
\b,geben,dir,bier ->
|
||||
let {
|
||||
zudir = geben.s3 ++ dir.s ! NPCase geben.c ;
|
||||
dasbier = geben.s4 ++ bier.s ! NPCase geben.c2 ;
|
||||
nicht = negation b
|
||||
} in
|
||||
{s = geben.s ;
|
||||
s2 = geben.s2 ;
|
||||
s3 = \\_ => variants {
|
||||
nicht ++ zudir ++ dasbier ;
|
||||
zudir ++ nicht ++ dasbier ;
|
||||
zudir ++ dasbier ++ nicht
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
--2 Adverbials
|
||||
--
|
||||
@@ -699,7 +753,7 @@ oper
|
||||
|
||||
--2 Sentence adverbials
|
||||
--
|
||||
-- This class covers adverbials such as "sonst", "folgelich", which are prefixed
|
||||
-- This class covers adverbials such as "sonst", "deshalb", which are prefixed
|
||||
-- to a sentence to form a phrase; the sentence gets inverted word order.
|
||||
|
||||
advSentence : Adverb -> Sentence -> Utterance = \sonst,ist1gerade ->
|
||||
|
||||
@@ -9,6 +9,9 @@ lin
|
||||
Small = adjCompReg "klein" ;
|
||||
Old = adjCompReg3 "alt" "älter" "ältest";
|
||||
Young = adjCompReg3 "jung" "jünger" "jüngst";
|
||||
American = adjReg "Amerikanisch" ;
|
||||
Finnish = adjReg "Finnisch" ;
|
||||
Married = adjReg "verheiratet" ** {s2 = "mit" ; c = Dat} ;
|
||||
Man = declN2u "Mann" "Männer" ;
|
||||
Woman = declN1 "Frau" ;
|
||||
Car = declNs "Auto" ;
|
||||
@@ -20,7 +23,11 @@ lin
|
||||
Prove = mkVerbSimple (regVerb "beweisen") ;
|
||||
Send = mkTransVerb (mkVerbSimple (verbLaufen "senden" "sendet" "gesandt")) [] Acc;
|
||||
Love = mkTransVerb (mkVerbSimple (regVerb "lieben")) [] Acc ;
|
||||
Wait = mkTransVerb (mkVerbSimple (verbWarten "warten")) "auf" Acc ;
|
||||
Wait = mkTransVerb (mkVerbSimple (verbWarten "warten")) "auf" Acc ;
|
||||
Give = mkDitransVerb
|
||||
(mkVerbSimple (verbLaufen "geben" "gibt" "gegeben")) [] Dat [] Acc ;
|
||||
Prefer = mkDitransVerb
|
||||
(mkVerb (verbLaufen "ziehen" "zieht" "gezogen") "vor") [] Acc "vor" Dat ;
|
||||
Mother = mkFunC (n2n (declN2uF "Mutter" "Mütter")) "von" Dat ;
|
||||
Uncle = mkFunC (n2n (declN2i "Onkel")) "von" Dat ;
|
||||
Connection = mkFunC (n2n (declN1 "Verbindung")) "von" Dat **
|
||||
|
||||
Reference in New Issue
Block a user