mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
New things in english and german resources.
This commit is contained in:
@@ -58,7 +58,8 @@ cat
|
|||||||
|
|
||||||
V ; -- one-place verb, e.g. "walk"
|
V ; -- one-place verb, e.g. "walk"
|
||||||
TV ; -- two-place verb, e.g. "love", "wait (for)", "switch on"
|
TV ; -- two-place verb, e.g. "love", "wait (for)", "switch on"
|
||||||
VS ; -- sentence-compl. verb e.g. "say", "prove"
|
V3 ; -- three-place verb, e.g. "give", "prefer (stg) (to stg)"
|
||||||
|
VS ; -- sentence-compl. verb, e.g. "say", "prove"
|
||||||
VP ; -- verb phrase, e.g. "switch the light on"
|
VP ; -- verb phrase, e.g. "switch the light on"
|
||||||
|
|
||||||
--3 Adverbials
|
--3 Adverbials
|
||||||
@@ -144,6 +145,8 @@ fun
|
|||||||
PosPassV, NegPassV : V -> VP ; -- "is seen", "is not seen"
|
PosPassV, NegPassV : V -> VP ; -- "is seen", "is not seen"
|
||||||
PosNP, NegNP : NP -> VP ; -- "is John", "is not John"
|
PosNP, NegNP : NP -> VP ; -- "is John", "is not John"
|
||||||
PosVS, NegVS : VS -> S -> VP ; -- "says that I run", "doesn't say..."
|
PosVS, NegVS : VS -> S -> VP ; -- "says that I run", "doesn't say..."
|
||||||
|
PosV3, NegV3 : V3 -> NP -> NP -> VP ; -- "prefers wine to beer"
|
||||||
|
VTrans : TV -> V ; -- "loves"
|
||||||
|
|
||||||
--3 Adverbials
|
--3 Adverbials
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ abstract TestAbs = ResAbs ** {
|
|||||||
-- a random sample of lexicon to test resource grammar with
|
-- a random sample of lexicon to test resource grammar with
|
||||||
|
|
||||||
fun
|
fun
|
||||||
Big, Small, Old, Young : AdjDeg ;
|
Big, Small, Old, Young : AdjDeg ;
|
||||||
|
American, Finnish : Adj1 ;
|
||||||
|
Married : Adj2 ;
|
||||||
Man, Woman, Car, House, Light : N ;
|
Man, Woman, Car, House, Light : N ;
|
||||||
Walk, Run : V ;
|
Walk, Run : V ;
|
||||||
Send, Wait, Love, SwitchOn, SwitchOff : TV ;
|
Send, Wait, Love, SwitchOn, SwitchOff : TV ;
|
||||||
|
Give, Prefer : V3 ;
|
||||||
Say, Prove : VS ;
|
Say, Prove : VS ;
|
||||||
Mother, Uncle : Fun ;
|
Mother, Uncle : Fun ;
|
||||||
Connection : Fun2 ;
|
Connection : Fun2 ;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ oper
|
|||||||
pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 ; -- verb form still OK
|
pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 ; -- verb form still OK
|
||||||
pronHe = mkPronoun "he" "him" "his" "his" Sg P3 ;
|
pronHe = mkPronoun "he" "him" "his" "his" Sg P3 ;
|
||||||
pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 ;
|
pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 ;
|
||||||
|
pronIt = mkPronoun "it" "it" "its" "it" Sg P3 ;
|
||||||
|
|
||||||
pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 ;
|
pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 ;
|
||||||
pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 ;
|
pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 ;
|
||||||
@@ -111,29 +112,45 @@ oper
|
|||||||
|
|
||||||
--3 Verbs
|
--3 Verbs
|
||||||
--
|
--
|
||||||
-- Except for "be", the worst case needs two forms.
|
-- Except for "be", the worst case needs four forms.
|
||||||
|
|
||||||
mkVerbP3 : (_,_: Str) -> VerbP3 = \goes,go ->
|
mkVerbP3 : (_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone ->
|
||||||
{s = table {InfImp => go ; Indic P3 => goes ; Indic _ => go}} ;
|
{s = table {
|
||||||
|
InfImp => go ;
|
||||||
|
Indic P3 => goes ;
|
||||||
|
Indic _ => go ;
|
||||||
|
Past _ => went ;
|
||||||
|
PPart => gone
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkVerb : (_,_,_ : Str) -> VerbP3 = \ring,rang,rung ->
|
||||||
|
mkVerbP3 ring (ring + "s") rang rung ;
|
||||||
|
|
||||||
regVerbP3 : Str -> VerbP3 = \walk ->
|
regVerbP3 : Str -> VerbP3 = \walk ->
|
||||||
mkVerbP3 (walk + "s") walk ;
|
mkVerb walk (walk + "ed") (walk + "ed") ;
|
||||||
|
|
||||||
verbP3s : Str -> VerbP3 = \kiss ->
|
verbP3s : Str -> VerbP3 = \kiss ->
|
||||||
mkVerbP3 (kiss + "es") kiss ;
|
mkVerbP3 kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
||||||
|
|
||||||
verbP3y : Str -> VerbP3 = \fl ->
|
verbP3e : Str -> VerbP3 = \love ->
|
||||||
mkVerbP3 (fl + "ies") (fl + "y") ;
|
mkVerbP3 love (love + "s") (love + "d") (love + "d") ;
|
||||||
|
|
||||||
verbP3Have = mkVerbP3 "has" "have" ;
|
verbP3y : Str -> VerbP3 = \cr ->
|
||||||
|
mkVerbP3 (cr + "y") (cr + "ies") (cr + "ied") (cr + "ied") ;
|
||||||
|
|
||||||
verbP3Do = verbP3s "do" ;
|
verbP3Have = mkVerbP3 "have" "has" "had" "had" ;
|
||||||
|
|
||||||
|
verbP3Do = mkVerbP3 "do" "does" "did" "done" ;
|
||||||
|
|
||||||
verbBe : VerbP3 = {s = table {
|
verbBe : VerbP3 = {s = table {
|
||||||
InfImp => "be" ;
|
InfImp => "be" ;
|
||||||
Indic P1 => "am" ;
|
Indic P1 => "am" ;
|
||||||
Indic P2 => "are" ;
|
Indic P2 => "are" ;
|
||||||
Indic P3 => "is"
|
Indic P3 => "is" ;
|
||||||
|
Past Sg => "was" ;
|
||||||
|
Past Pl => "were" ;
|
||||||
|
PPart => "been"
|
||||||
}} ;
|
}} ;
|
||||||
|
|
||||||
verbPart : VerbP3 -> Particle -> Verb = \v,p ->
|
verbPart : VerbP3 -> Particle -> Verb = \v,p ->
|
||||||
|
|||||||
@@ -103,11 +103,11 @@ oper
|
|||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
--
|
--
|
||||||
-- The fragment only has present tense so far, but in all persons.
|
-- The fragment now has all verb forms, except the gerund/present participle.
|
||||||
-- Except for "be", the worst case needs two forms: the infinitive and
|
-- Except for "be", the worst case needs four forms: the infinitive and
|
||||||
-- the third person singular.
|
-- the third person singular present, the past indicative, and the past participle.
|
||||||
|
|
||||||
mkV : (go, goes : Str) -> V ;
|
mkV : (go, goes, went, gone : Str) -> V ;
|
||||||
|
|
||||||
vReg : (walk : Str) -> V ; -- walk, walks
|
vReg : (walk : Str) -> V ; -- walk, walks
|
||||||
vKiss : (kiss : Str) -> V ; -- kiss, kisses
|
vKiss : (kiss : Str) -> V ; -- kiss, kisses
|
||||||
@@ -126,7 +126,7 @@ oper
|
|||||||
|
|
||||||
-- Verbs with a particle.
|
-- Verbs with a particle.
|
||||||
|
|
||||||
vPart : (go, goes, up : Str) -> V ;
|
vPart : (go, goes, went, gone, up : Str) -> V ;
|
||||||
vPartReg : (get, up : Str) -> V ;
|
vPartReg : (get, up : Str) -> V ;
|
||||||
|
|
||||||
-- Two-place verbs, and the special case with direct object.
|
-- Two-place verbs, and the special case with direct object.
|
||||||
@@ -197,10 +197,11 @@ oper
|
|||||||
aRidiculous = adjDegrLong ;
|
aRidiculous = adjDegrLong ;
|
||||||
apReg = \s -> AdjP1 (mkAdj1 s) ;
|
apReg = \s -> AdjP1 (mkAdj1 s) ;
|
||||||
|
|
||||||
mkV = \go,goes -> verbNoPart (mkVerbP3 goes go) ;
|
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) ;
|
||||||
vReg = \run -> mkV run (run + "s") ;
|
vReg = \walk -> mkV walk (walk + "s") (walk + "ed") (walk + "ed") ;
|
||||||
vKiss = \kiss -> mkV kiss (kiss + "es") ;
|
vKiss = \kiss -> mkV kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
||||||
vFly = \fly -> mkV fly (Predef.tk 1 fly + "ies") ;
|
vFly = \cry -> let {cr = Predef.tk 1 cry} in
|
||||||
|
mkV cry (cr + "ies") (cr + "ied") (cr + "ied") ;
|
||||||
vGo = vKiss ;
|
vGo = vKiss ;
|
||||||
|
|
||||||
vGen = \fly -> let {
|
vGen = \fly -> let {
|
||||||
@@ -213,14 +214,14 @@ oper
|
|||||||
eqy "z" vKiss (
|
eqy "z" vKiss (
|
||||||
vReg))) fly ;
|
vReg))) fly ;
|
||||||
|
|
||||||
vPart = \go, goes, up -> verbPart (mkVerbP3 goes go) up ;
|
vPart = \go, goes, went, gone, up -> verbPart (mkVerbP3 go goes went gone) up ;
|
||||||
vPartReg = \get, up -> verbPart (regVerbP3 get) up ;
|
vPartReg = \get, up -> verbPart (regVerbP3 get) up ;
|
||||||
|
|
||||||
mkTV = \v,p -> v ** {s3 = p} ;
|
mkTV = \v,p -> v ** {s3 = p} ;
|
||||||
tvPartReg = \get, along, with -> mkTV (vPartReg get along) with ;
|
tvPartReg = \get, along, with -> mkTV (vPartReg get along) with ;
|
||||||
|
|
||||||
vBe = verbBe ;
|
vBe = verbBe ;
|
||||||
vHave = mkV "have" "has" ;
|
vHave = verbP3Have ;
|
||||||
|
|
||||||
tvGen = \s,p -> mkTV (vGen s) p ;
|
tvGen = \s,p -> mkTV (vGen s) p ;
|
||||||
tvDir = \v -> mkTV v [] ;
|
tvDir = \v -> mkTV v [] ;
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ lincat
|
|||||||
NP = {s : NPForm => Str ; n : Number ; p : Person} ;
|
NP = {s : NPForm => Str ; n : Number ; p : Person} ;
|
||||||
PN = {s : Case => Str} ;
|
PN = {s : Case => Str} ;
|
||||||
Det = {s : Str ; n : Number} ;
|
Det = {s : Str ; n : Number} ;
|
||||||
Fun = CommNounPhrase ** {s2 : Preposition} ;
|
Fun = Function ;
|
||||||
|
-- = CommNounPhrase ** {s2 : Preposition} ;
|
||||||
|
Fun2 = Function ** {s3 : Preposition} ;
|
||||||
|
|
||||||
Adj1 = Adjective ;
|
Adj1 = Adjective ;
|
||||||
-- = {s : Str}
|
-- = {s : Str}
|
||||||
@@ -42,7 +44,9 @@ lincat
|
|||||||
V = Verb ;
|
V = Verb ;
|
||||||
-- = {s : VForm => Str ; s1 : Particle}
|
-- = {s : VForm => Str ; s1 : Particle}
|
||||||
VP = {s : VForm => Str ; s2 : Number => Str ; isAux : Bool} ;
|
VP = {s : VForm => Str ; s2 : Number => Str ; isAux : Bool} ;
|
||||||
TV = Verb ** {s3 : Preposition} ;
|
TV = TransVerb ;
|
||||||
|
-- = Verb ** {s3 : Preposition} ;
|
||||||
|
V3 = TransVerb ** {s4 : Preposition} ;
|
||||||
VS = Verb ;
|
VS = Verb ;
|
||||||
|
|
||||||
AdV = {s : Str ; isPost : Bool} ;
|
AdV = {s : Str ; isPost : Bool} ;
|
||||||
@@ -56,6 +60,7 @@ lincat
|
|||||||
Qu = {s : QuestForm => Str} ;
|
Qu = {s : QuestForm => Str} ;
|
||||||
Imp = {s : Number => Str} ;
|
Imp = {s : Number => Str} ;
|
||||||
Phr = {s : Str} ;
|
Phr = {s : Str} ;
|
||||||
|
Text = {s : Str} ;
|
||||||
|
|
||||||
Conj = {s : Str ; n : Number} ;
|
Conj = {s : Str ; n : Number} ;
|
||||||
ConjD = {s1 : Str ; s2 : Str ; n : Number} ;
|
ConjD = {s1 : Str ; s2 : Str ; n : Number} ;
|
||||||
@@ -74,6 +79,7 @@ lin
|
|||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
UseFun = funAsCommNounPhrase ;
|
UseFun = funAsCommNounPhrase ;
|
||||||
AppFun = appFunComm ;
|
AppFun = appFunComm ;
|
||||||
|
AppFun2 = appFun2 ;
|
||||||
AdjP1 = adj2adjPhrase ;
|
AdjP1 = adj2adjPhrase ;
|
||||||
ComplAdj = complAdj ;
|
ComplAdj = complAdj ;
|
||||||
PositAdjP = positAdjPhrase ;
|
PositAdjP = positAdjPhrase ;
|
||||||
@@ -86,6 +92,8 @@ lin
|
|||||||
DefOneNP = defNounPhrase singular ;
|
DefOneNP = defNounPhrase singular ;
|
||||||
DefManyNP = defNounPhrase plural ;
|
DefManyNP = defNounPhrase plural ;
|
||||||
|
|
||||||
|
CNthatS = nounThatSentence ;
|
||||||
|
|
||||||
PredVP = predVerbPhrase ;
|
PredVP = predVerbPhrase ;
|
||||||
PosV = predVerb True ;
|
PosV = predVerb True ;
|
||||||
NegV = predVerb False ;
|
NegV = predVerb False ;
|
||||||
@@ -95,18 +103,24 @@ lin
|
|||||||
NegCN = predCommNoun False ;
|
NegCN = predCommNoun False ;
|
||||||
PosTV = complTransVerb True ;
|
PosTV = complTransVerb True ;
|
||||||
NegTV = complTransVerb False ;
|
NegTV = complTransVerb False ;
|
||||||
|
PosV3 = complDitransVerb True ;
|
||||||
|
NegV3 = complDitransVerb False ;
|
||||||
|
PosPassV = passVerb True ;
|
||||||
|
NegPassV = passVerb False ;
|
||||||
PosNP = predNounPhrase True ;
|
PosNP = predNounPhrase True ;
|
||||||
NegNP = predNounPhrase False ;
|
NegNP = predNounPhrase False ;
|
||||||
PosVS = complSentVerb True ;
|
PosVS = complSentVerb True ;
|
||||||
NegVS = complSentVerb False ;
|
NegVS = complSentVerb False ;
|
||||||
|
VTrans = transAsVerb ;
|
||||||
|
|
||||||
AdvVP = adVerbPhrase ;
|
AdvVP = adVerbPhrase ;
|
||||||
LocNP = locativeNounPhrase ;
|
LocNP = locativeNounPhrase ;
|
||||||
AdvCN = advCommNounPhrase ;
|
AdvCN = advCommNounPhrase ;
|
||||||
|
AdvAP = advAdjPhrase ;
|
||||||
|
|
||||||
PosSlashTV = slashTransVerb True ;
|
PosSlashTV = slashTransVerb True ;
|
||||||
NegSlashTV = slashTransVerb False ;
|
NegSlashTV = slashTransVerb False ;
|
||||||
|
OneVP = predVerbPhrase (nameNounPhrase (nameReg "one")) ;
|
||||||
|
|
||||||
IdRP = identRelPron ;
|
IdRP = identRelPron ;
|
||||||
FunRP = funRelPron ;
|
FunRP = funRelPron ;
|
||||||
@@ -135,6 +149,8 @@ lin
|
|||||||
ImperOne = imperUtterance singular ;
|
ImperOne = imperUtterance singular ;
|
||||||
ImperMany = imperUtterance plural ;
|
ImperMany = imperUtterance plural ;
|
||||||
|
|
||||||
|
AdvS = advSentence ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
TwoS = twoSentence ;
|
TwoS = twoSentence ;
|
||||||
ConsS = consSentence ;
|
ConsS = consSentence ;
|
||||||
@@ -161,12 +177,14 @@ lin
|
|||||||
PhrIP ip = ip ;
|
PhrIP ip = ip ;
|
||||||
PhrIAdv ia = ia ;
|
PhrIAdv ia = ia ;
|
||||||
|
|
||||||
|
OnePhr p = p ;
|
||||||
|
ConsPhr = cc2 ;
|
||||||
|
|
||||||
lin
|
|
||||||
INP = pronI ;
|
INP = pronI ;
|
||||||
ThouNP = pronYouSg ;
|
ThouNP = pronYouSg ;
|
||||||
HeNP = pronHe ;
|
HeNP = pronHe ;
|
||||||
SheNP = pronShe ;
|
SheNP = pronShe ;
|
||||||
|
ItNP = pronIt ;
|
||||||
WeNP = pronWe ;
|
WeNP = pronWe ;
|
||||||
YeNP = pronYouPl ;
|
YeNP = pronYouPl ;
|
||||||
YouNP = pronYouSg ;
|
YouNP = pronYouSg ;
|
||||||
@@ -192,4 +210,10 @@ lin
|
|||||||
|
|
||||||
PhrYes = ss "Yes." ;
|
PhrYes = ss "Yes." ;
|
||||||
PhrNo = ss "No." ;
|
PhrNo = ss "No." ;
|
||||||
|
|
||||||
|
VeryAdv = ss "very" ;
|
||||||
|
TooAdv = ss "too" ;
|
||||||
|
OtherwiseAdv = ss "otherwise" ;
|
||||||
|
ThereforeAdv = ss "therefore" ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -115,6 +115,14 @@ oper
|
|||||||
n = Pl
|
n = Pl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- Constructions like "the idea that two is even" are formed at the
|
||||||
|
-- first place as common nouns, so that one can also have "a suggestion that...".
|
||||||
|
|
||||||
|
nounThatSentence : CommNounPhrase -> Sentence -> CommNounPhrase = \idea,x ->
|
||||||
|
{s = \\n,c => idea.s ! n ! c ++ "that" ++ x.s ;
|
||||||
|
g = idea.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
--
|
--
|
||||||
@@ -128,6 +136,7 @@ oper
|
|||||||
simpleAdjPhrase : Str -> AdjPhrase = \French ->
|
simpleAdjPhrase : Str -> AdjPhrase = \French ->
|
||||||
adj2adjPhrase (simpleAdj French) ;
|
adj2adjPhrase (simpleAdj French) ;
|
||||||
|
|
||||||
|
|
||||||
--3 Comparison adjectives
|
--3 Comparison adjectives
|
||||||
--
|
--
|
||||||
-- Each of the comparison forms has a characteristic use:
|
-- Each of the comparison forms has a characteristic use:
|
||||||
@@ -205,7 +214,7 @@ oper
|
|||||||
|
|
||||||
appFunComm : Function -> NounPhrase -> CommNounPhrase = \mother,john ->
|
appFunComm : Function -> NounPhrase -> CommNounPhrase = \mother,john ->
|
||||||
{s = \\n => table {
|
{s = \\n => table {
|
||||||
Gen => nonExist ;
|
Gen => nonExist ; --- ?
|
||||||
_ => mother.s ! n ! Nom ++ mother.s2 ++ john.s ! GenSP
|
_ => mother.s ! n ! Nom ++ mother.s2 ++ john.s ! GenSP
|
||||||
} ;
|
} ;
|
||||||
g = mother.g
|
g = mother.g
|
||||||
@@ -226,7 +235,7 @@ oper
|
|||||||
variants {
|
variants {
|
||||||
defNounPhrase nf (appFunComm mother john) ;
|
defNounPhrase nf (appFunComm mother john) ;
|
||||||
npGenDet nf john mother
|
npGenDet nf john mother
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- The commonest case is functions with the preposition "of".
|
-- The commonest case is functions with the preposition "of".
|
||||||
|
|
||||||
@@ -236,6 +245,17 @@ oper
|
|||||||
funOfReg : Str -> Gender -> Function = \mother,g ->
|
funOfReg : Str -> Gender -> Function = \mother,g ->
|
||||||
funOf (nounReg mother ** {g = g}) ;
|
funOf (nounReg mother ** {g = g}) ;
|
||||||
|
|
||||||
|
-- Two-place functions add one argument place.
|
||||||
|
|
||||||
|
Function2 = Function ** {s3 : Preposition} ;
|
||||||
|
|
||||||
|
-- There application starts by filling the first place.
|
||||||
|
|
||||||
|
appFun2 : Function2 -> NounPhrase -> Function = \train, paris ->
|
||||||
|
{s = \\n,c => train.s ! n ! c ++ train.s2 ++ paris.s ! AccP ;
|
||||||
|
g = train.g ;
|
||||||
|
s2 = train.s3
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
@@ -350,6 +370,46 @@ oper
|
|||||||
mkTransVerbDir : VerbP3 -> TransVerb = \love ->
|
mkTransVerbDir : VerbP3 -> TransVerb = \love ->
|
||||||
mkTransVerbPart love [] ;
|
mkTransVerbPart love [] ;
|
||||||
|
|
||||||
|
-- Transitive verbs with accusative objects can be used passively.
|
||||||
|
-- The function does not check that the verb is transitive.
|
||||||
|
-- Therefore, the function can also be used for "he is swum", etc.
|
||||||
|
-- The syntax is the same as for adjectival predication.
|
||||||
|
|
||||||
|
passVerb : Bool -> Verb -> VerbPhrase = \b,love ->
|
||||||
|
predAdjective b (adj2adjPhrase (ss (love.s ! PPart))) ;
|
||||||
|
|
||||||
|
-- Transitive verbs can be used elliptically as verbs. The semantics
|
||||||
|
-- is left to applications. The definition is trivial, due to record
|
||||||
|
-- subtyping.
|
||||||
|
|
||||||
|
transAsVerb : TransVerb -> Verb = \love ->
|
||||||
|
love ;
|
||||||
|
|
||||||
|
-- *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} ;
|
||||||
|
|
||||||
|
mkDitransVerb : Verb -> Preposition -> Preposition -> DitransVerb = \v,p1,p2 ->
|
||||||
|
v ** {s3 = p1 ; s4 = p2} ;
|
||||||
|
|
||||||
|
complDitransVerb :
|
||||||
|
Bool -> DitransVerb -> NounPhrase -> NounPhrase -> VerbPhrase =
|
||||||
|
\b,give,you,beer ->
|
||||||
|
let {
|
||||||
|
youbeer = give.s1 ++ give.s3 ++ you.s ! AccP ++ give.s4 ++ beer.s ! AccP
|
||||||
|
} in
|
||||||
|
if_then_else VerbPhrase b
|
||||||
|
{s = give.s ;
|
||||||
|
s2 = \\_ => youbeer ;
|
||||||
|
isAux = False
|
||||||
|
}
|
||||||
|
{s = \\v => contractNot (verbP3Do.s ! v) ;
|
||||||
|
s2 = \\_ => give.s ! InfImp ++ youbeer ;
|
||||||
|
isAux = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Adverbials
|
--2 Adverbials
|
||||||
--
|
--
|
||||||
@@ -373,6 +433,11 @@ oper
|
|||||||
isAux = sings.isAux
|
isAux = sings.isAux
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
advAdjPhrase : Adverb -> AdjPhrase -> AdjPhrase = \very, good ->
|
||||||
|
{s = very.s ++ good.s ;
|
||||||
|
p = good.p
|
||||||
|
} ;
|
||||||
|
|
||||||
-- Adverbials are typically generated by prefixing prepositions.
|
-- Adverbials are typically generated by prefixing prepositions.
|
||||||
-- The rule for creating locative noun phrases by the preposition "in"
|
-- The rule for creating locative noun phrases by the preposition "in"
|
||||||
-- is a little shaky, since other prepositions may be preferred ("on", "at").
|
-- is a little shaky, since other prepositions may be preferred ("on", "at").
|
||||||
@@ -680,6 +745,14 @@ oper
|
|||||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||||
ss (I.s ! n ++ "!") ;
|
ss (I.s ! n ++ "!") ;
|
||||||
|
|
||||||
|
--2 Sentence adverbials
|
||||||
|
--
|
||||||
|
-- This class covers adverbials such as "otherwise", "therefore", which are prefixed
|
||||||
|
-- to a sentence to form a phrase.
|
||||||
|
|
||||||
|
advSentence : Adverb -> Sentence -> Utterance = \hence,itiseven ->
|
||||||
|
ss (hence.s ++ itiseven.s ++ ".") ;
|
||||||
|
|
||||||
|
|
||||||
--2 Coordination
|
--2 Coordination
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -9,20 +9,27 @@ lin
|
|||||||
Small = adjDegrReg "small" ;
|
Small = adjDegrReg "small" ;
|
||||||
Old = adjDegrReg "old" ;
|
Old = adjDegrReg "old" ;
|
||||||
Young = adjDegrReg "young" ;
|
Young = adjDegrReg "young" ;
|
||||||
|
American = simpleAdj "American" ;
|
||||||
|
Finnish = simpleAdj "Finnish" ;
|
||||||
|
Married = simpleAdj "married" ** {s2 = "to"} ;
|
||||||
Man = cnHum (mkNoun "man" "men" "man's" "men's") ;
|
Man = cnHum (mkNoun "man" "men" "man's" "men's") ;
|
||||||
Woman = cnHum (mkNoun "woman" "women" "woman's" "women's") ;
|
Woman = cnHum (mkNoun "woman" "women" "woman's" "women's") ;
|
||||||
Car = cnNoHum (nounReg "car") ;
|
Car = cnNoHum (nounReg "car") ;
|
||||||
House = cnNoHum (nounReg "house") ;
|
House = cnNoHum (nounReg "house") ;
|
||||||
Light = cnNoHum (nounReg "light") ;
|
Light = cnNoHum (nounReg "light") ;
|
||||||
Walk = verbNoPart (regVerbP3 "walk") ;
|
Walk = verbNoPart (regVerbP3 "walk") ;
|
||||||
Run = verbNoPart (regVerbP3 "run") ;
|
Run = verbNoPart (mkVerb "run" "ran" "run") ;
|
||||||
Say = verbNoPart (regVerbP3 "say") ;
|
Say = verbNoPart (mkVerb "say" "said" "said") ;
|
||||||
Prove = verbNoPart (regVerbP3 "prove") ;
|
Prove = verbNoPart (regVerbP3 "prove") ;
|
||||||
Send = mkTransVerbDir (regVerbP3 "send") ;
|
Send = mkTransVerbDir (verbNoPart (mkVerb "send" "sent" "sent")) ;
|
||||||
Love = mkTransVerbDir (regVerbP3 "love") ;
|
Love = mkTransVerbDir (verbNoPart (verbP3e "love")) ;
|
||||||
Wait = mkTransVerb (regVerbP3 "wait") "for" ;
|
Wait = mkTransVerb (verbNoPart (regVerbP3 "wait")) "for" ;
|
||||||
|
Give = mkDitransVerb (verbNoPart (mkVerb "give" "gave" "given")) [] [] ;
|
||||||
|
Prefer = mkDitransVerb
|
||||||
|
(verbNoPart (mkVerb "prefer" "preferred" "preferred")) [] "to" ;
|
||||||
Mother = funOfReg "mother" Hum ;
|
Mother = funOfReg "mother" Hum ;
|
||||||
Uncle = funOfReg "uncle" Hum ;
|
Uncle = funOfReg "uncle" Hum ;
|
||||||
|
Connection = cnNoHum (nounReg "connection") ** {s2 = "from" ; s3 = "to"} ;
|
||||||
|
|
||||||
Always = advPre "always" ;
|
Always = advPre "always" ;
|
||||||
Well = advPost "well" ;
|
Well = advPost "well" ;
|
||||||
|
|||||||
@@ -55,12 +55,12 @@ oper
|
|||||||
|
|
||||||
--3 Verbs
|
--3 Verbs
|
||||||
--
|
--
|
||||||
-- We limit the grammar so far to verbs in infinitive-imperative or present tense.
|
-- We treat the full conjugation now.
|
||||||
-- The present tense is made to depend on person, which correspond to forms
|
-- The present tense is made to depend on person, which correspond to forms
|
||||||
-- in the singular; plural forms are uniformly equal to the 2nd person singular.
|
-- in the singular; plural forms are uniformly equal to the 2nd person singular.
|
||||||
|
|
||||||
param
|
param
|
||||||
VForm = InfImp | Indic Person ;
|
VForm = InfImp | Indic Person | Past Number | PPart ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
VerbP3 : Type = SS1 VForm ;
|
VerbP3 : Type = SS1 VForm ;
|
||||||
|
|||||||
@@ -396,4 +396,3 @@ oper
|
|||||||
-}
|
-}
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -190,6 +190,11 @@ oper
|
|||||||
tvDir : V -> TV ; -- umbringen
|
tvDir : V -> TV ; -- umbringen
|
||||||
tvDirReg : Str -> TV ; -- lieben
|
tvDirReg : Str -> TV ; -- lieben
|
||||||
|
|
||||||
|
-- Three-place verbs require two prepositions and cases.
|
||||||
|
|
||||||
|
mkV3 : V -> Str -> Case -> Str -> Case -> TV ; -- geben,[],dative,[],accusative
|
||||||
|
|
||||||
|
|
||||||
--2 Adverbials
|
--2 Adverbials
|
||||||
--
|
--
|
||||||
-- Adverbials for modifying verbs, adjectives, and sentences can be formed
|
-- 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 ;
|
tvReg = \hören, zu, dat -> mkTV (vReg hören) zu dat ;
|
||||||
tvDir = \v -> mkTV v [] accusative ;
|
tvDir = \v -> mkTV v [] accusative ;
|
||||||
tvDirReg = \v -> tvReg v [] accusative ;
|
tvDirReg = \v -> tvReg v [] accusative ;
|
||||||
|
mkV3 = mkDitransVerb ;
|
||||||
|
|
||||||
mkAdV = ss ;
|
mkAdV = ss ;
|
||||||
mkPP = prepPhrase ;
|
mkPP = prepPhrase ;
|
||||||
|
|||||||
@@ -13,16 +13,17 @@ resource Predication = open Deutsch in {
|
|||||||
-- We first define a set of predication patterns.
|
-- We first define a set of predication patterns.
|
||||||
|
|
||||||
oper
|
oper
|
||||||
predV1 : V -> NP -> S ; -- one-place verb: "John walks"
|
predV1 : V -> NP -> S ; -- one-place verb: "John walks"
|
||||||
predV2 : TV -> NP -> NP -> S ; -- two-place verb: "John loves Mary"
|
predV2 : TV -> NP -> NP -> S ; -- two-place verb: "John loves Mary"
|
||||||
predVColl : V -> NP -> NP -> S ; -- collective verb: "John and Mary fight"
|
predV3 : TV -> NP -> NP -> NP -> S ; -- three-place verb: "John gives Mary beer"
|
||||||
predA1 : Adj1 -> NP -> S ; -- one-place adjective: "John is old"
|
predVColl : V -> NP -> NP -> S ; -- collective verb: "John and Mary fight"
|
||||||
predA2 : Adj2 -> NP -> NP -> S ; -- two-place adj: "John is married to Mary"
|
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"
|
predAComp : AdjDeg -> NP -> NP -> S ; -- compar adj: "John is older than Mary"
|
||||||
predAColl : Adj1 -> NP -> NP -> S ; -- collective adj: "John and Mary are married"
|
predAColl : Adj1 -> NP -> NP -> S ; -- collect adj: "John and Mary are married"
|
||||||
predN1 : N -> NP -> S ; -- one-place noun: "John is a man"
|
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"
|
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"
|
predNColl : N -> NP -> NP -> S ; -- collect noun: "John and Mary are lovers"
|
||||||
|
|
||||||
-- Individual-valued function applications.
|
-- Individual-valued function applications.
|
||||||
|
|
||||||
@@ -42,9 +43,13 @@ oper
|
|||||||
|
|
||||||
-- Logical connectives on two sentences.
|
-- Logical connectives on two sentences.
|
||||||
|
|
||||||
conjS : S -> S -> S ;
|
conjS : S -> S -> S ; -- A and B
|
||||||
disjS : S -> S -> S ;
|
disjS : S -> S -> S ; -- A or B
|
||||||
implS : S -> S -> S ;
|
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"),
|
-- As an auxiliary, we need two-place conjunction of names ("John and Mary"),
|
||||||
-- used in collective predication.
|
-- used in collective predication.
|
||||||
@@ -80,6 +85,8 @@ oper
|
|||||||
disjS = \A, B -> ConjS OrConj (TwoS A B) ;
|
disjS = \A, B -> ConjS OrConj (TwoS A B) ;
|
||||||
implS = \A, B -> SubjS IfSubj 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) ;
|
constrTyp1 = \F, A -> AppFun F (IndefManyNP A) ;
|
||||||
|
|
||||||
conjNP = \x, y -> ConjNP AndConj (TwoNP x y) ;
|
conjNP = \x, y -> ConjNP AndConj (TwoNP x y) ;
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ lincat
|
|||||||
V = Verb ;
|
V = Verb ;
|
||||||
-- = {s : VForm => Str ; s2 : Particle} ;
|
-- = {s : VForm => Str ; s2 : Particle} ;
|
||||||
VP = Verb ** {s3 : Number => Str} ;
|
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 ;
|
VS = Verb ;
|
||||||
AdV = {s : Str} ;
|
AdV = {s : Str} ;
|
||||||
|
|
||||||
@@ -110,6 +112,9 @@ lin
|
|||||||
NegNP = predNounPhrase False ;
|
NegNP = predNounPhrase False ;
|
||||||
PosVS = complSentVerb True ;
|
PosVS = complSentVerb True ;
|
||||||
NegVS = complSentVerb False ;
|
NegVS = complSentVerb False ;
|
||||||
|
PosV3 = complDitransVerb True ;
|
||||||
|
NegV3 = complDitransVerb False ;
|
||||||
|
VTrans = transAsVerb ;
|
||||||
|
|
||||||
AdvVP = adVerbPhrase ;
|
AdvVP = adVerbPhrase ;
|
||||||
LocNP = locativeNounPhrase ;
|
LocNP = locativeNounPhrase ;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ oper
|
|||||||
n2n = noun2CommNounPhrase ;
|
n2n = noun2CommNounPhrase ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--2 Noun phrases
|
--2 Noun phrases
|
||||||
--
|
--
|
||||||
-- The worst case is pronouns, which have inflection in the possessive
|
-- The worst case is pronouns, which have inflection in the possessive
|
||||||
@@ -70,6 +69,26 @@ oper
|
|||||||
mkProperName : Str -> ProperName = \horst ->
|
mkProperName : Str -> ProperName = \horst ->
|
||||||
{s = table {Gen => horst + "s" ; _ => 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
|
--2 Determiners
|
||||||
--
|
--
|
||||||
-- Determiners are inflected according to the nouns they determine.
|
-- Determiners are inflected according to the nouns they determine.
|
||||||
@@ -77,14 +96,15 @@ oper
|
|||||||
|
|
||||||
Determiner : Type = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
Determiner : Type = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
||||||
|
|
||||||
detNounPhrase : Determiner -> CommNounPhrase -> NounPhrase = \ein, mann ->
|
detNounPhrase : Determiner -> CommNounPhrase -> NounPhrase = \ein, mann -> {
|
||||||
{s = \\c => let {nc = caseNP c} in
|
s = \\c => let {nc = caseNP c} in
|
||||||
ein.s ! mann.g ! nc ++ mann.s ! adjfCas ein.a nc ! ein.n ! nc ;
|
ein.s ! mann.g ! nc ++ mann.s ! adjfCas ein.a nc ! ein.n ! nc ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
n = ein.n ;
|
n = ein.n ;
|
||||||
pro = False
|
pro = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- The adjectival form after a determiner depends both on the inferent form
|
-- The adjectival form after a determiner depends both on the inferent form
|
||||||
-- and on the case ("ein alter Mann" but "einem alten Mann").
|
-- and on the case ("ein alter Mann" but "einem alten Mann").
|
||||||
|
|
||||||
@@ -400,6 +420,40 @@ oper
|
|||||||
s3 = \\_ => negation b ++ lieben.s ! VPart APred
|
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
|
--2 Adverbials
|
||||||
--
|
--
|
||||||
@@ -699,7 +753,7 @@ oper
|
|||||||
|
|
||||||
--2 Sentence adverbials
|
--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.
|
-- to a sentence to form a phrase; the sentence gets inverted word order.
|
||||||
|
|
||||||
advSentence : Adverb -> Sentence -> Utterance = \sonst,ist1gerade ->
|
advSentence : Adverb -> Sentence -> Utterance = \sonst,ist1gerade ->
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ lin
|
|||||||
Small = adjCompReg "klein" ;
|
Small = adjCompReg "klein" ;
|
||||||
Old = adjCompReg3 "alt" "älter" "ältest";
|
Old = adjCompReg3 "alt" "älter" "ältest";
|
||||||
Young = adjCompReg3 "jung" "jünger" "jüngst";
|
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" ;
|
Man = declN2u "Mann" "Männer" ;
|
||||||
Woman = declN1 "Frau" ;
|
Woman = declN1 "Frau" ;
|
||||||
Car = declNs "Auto" ;
|
Car = declNs "Auto" ;
|
||||||
@@ -20,7 +23,11 @@ lin
|
|||||||
Prove = mkVerbSimple (regVerb "beweisen") ;
|
Prove = mkVerbSimple (regVerb "beweisen") ;
|
||||||
Send = mkTransVerb (mkVerbSimple (verbLaufen "senden" "sendet" "gesandt")) [] Acc;
|
Send = mkTransVerb (mkVerbSimple (verbLaufen "senden" "sendet" "gesandt")) [] Acc;
|
||||||
Love = mkTransVerb (mkVerbSimple (regVerb "lieben")) [] 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 ;
|
Mother = mkFunC (n2n (declN2uF "Mutter" "Mütter")) "von" Dat ;
|
||||||
Uncle = mkFunC (n2n (declN2i "Onkel")) "von" Dat ;
|
Uncle = mkFunC (n2n (declN2i "Onkel")) "von" Dat ;
|
||||||
Connection = mkFunC (n2n (declN1 "Verbindung")) "von" Dat **
|
Connection = mkFunC (n2n (declN1 "Verbindung")) "von" Dat **
|
||||||
|
|||||||
Reference in New Issue
Block a user