mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-18 01:09:32 -06:00
refined the check whether a complement has a preposition by adding a parameter, in Ger
This commit is contained in:
@@ -75,7 +75,7 @@ concrete CatGer of Cat =
|
||||
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = {s : Str ; c : PCase} ;
|
||||
Prep = Preposition ;
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ oper
|
||||
-- For $StructuralGer$.
|
||||
|
||||
mkPrep : Str -> PCase -> Preposition = \s,c ->
|
||||
{s = s ; c = c} ;
|
||||
{s = s ; c = c ; isPrep = True} ;
|
||||
|
||||
nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ; isPron : Bool} = \name -> heavyNP {
|
||||
s = \\c => usePrepC c (\k -> name.s ! k) ;
|
||||
|
||||
@@ -351,7 +351,7 @@ mkV2 : overload {
|
||||
|
||||
|
||||
mmkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ;
|
||||
vonN2 : N -> N2 = \n -> n ** {c2 = {s = "von" ; c = dative} ; lock_N2 = <>} ;
|
||||
vonN2 : N -> N2 = \n -> n ** {c2 = von_Prep ; lock_N2 = <>} ;
|
||||
|
||||
mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ;
|
||||
|
||||
@@ -397,10 +397,10 @@ mkV2 : overload {
|
||||
|
||||
mkAdv s = {s = s ; lock_Adv = <>} ;
|
||||
|
||||
mkPrep s c = {s = s ; c = c ; lock_Prep = <>} ;
|
||||
accPrep = mkPrep [] accusative ;
|
||||
datPrep = mkPrep [] dative ;
|
||||
genPrep = mkPrep [] genitive ;
|
||||
mkPrep s c = {s = s ; c = c ; isPrep = True ; lock_Prep = <>} ;
|
||||
accPrep = {s = [] ; c = accusative ; isPrep = False ; lock_Prep = <>} ;
|
||||
datPrep = {s = [] ; c = dative ; isPrep = False ; lock_Prep = <>} ;
|
||||
genPrep = {s = [] ; c = genitive ; isPrep = False ; lock_Prep = <>} ;
|
||||
--von_Prep = mkPrep "von" dative ;
|
||||
von_Prep = mkPrep [] vonDat_Case ;
|
||||
zu_Prep = mkPrep [] zuDat_Case ;
|
||||
@@ -472,8 +472,8 @@ mkV2 : overload {
|
||||
werden_V = MorphoGer.werden_V ** {lock_V = <>} ;
|
||||
|
||||
prepV2 v c = v ** {c2 = c ; lock_V2 = <>} ;
|
||||
dirV2 v = prepV2 v (mkPrep [] accusative) ;
|
||||
datV2 v = prepV2 v (mkPrep [] dative) ;
|
||||
dirV2 v = prepV2 v accPrep ;
|
||||
datV2 v = prepV2 v datPrep ;
|
||||
|
||||
mkV3 v c d = v ** {c2 = c ; c3 = d ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v (mkPrep [] accusative) p ;
|
||||
|
||||
@@ -344,7 +344,7 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
|
||||
-- Prepositions for complements indicate the complement case.
|
||||
|
||||
Preposition : Type = {s : Str ; c : PCase} ;
|
||||
Preposition : Type = {s : Str ; c : PCase ; isPrep : Bool} ;
|
||||
|
||||
-- To apply a preposition to a complement.
|
||||
|
||||
@@ -354,7 +354,7 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
-- To build a preposition from just a case.
|
||||
|
||||
noPreposition : Case -> Preposition = \c ->
|
||||
{s = [] ; c = NPC c} ;
|
||||
{s = [] ; c = NPC c ; isPrep = False} ;
|
||||
|
||||
-- Pronouns and articles
|
||||
-- Here we define personal and relative pronouns.
|
||||
@@ -608,9 +608,9 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
|
||||
isLightComplement : Bool -> Preposition -> Bool = \isPron,prep -> case isPron of {
|
||||
False => False ;
|
||||
_ => case prep.c of {
|
||||
NPC Acc => True ;
|
||||
_ => False
|
||||
_ => case prep.isPrep of {
|
||||
True => False ;
|
||||
_ => True
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user