mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-07-01 03:28:34 -06:00
(Ger) Shrink Agr = Ag Gender Number Person from 3*2*3 = 18 values to 2+3+1+3+1 = 10 by
Agr = AgSgP1 | AgSgP2 | AgSgP3 Gender | AgSgP3Gen | AgPl Person | AgPlPol ;
with AgSgP3Gen resp. AgPlPol used for reflexive,possessive forms of "man", "Sie".
Compiles AllGer from src in 162sec with 15M VerbGer.gfo vs. 380sec with 17M VerbGer.gfo
This commit is contained in:
+45
-76
@@ -2,7 +2,7 @@
|
||||
|
||||
--1 German Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta, Harald Hammarström and Björn Bringert2003--2007
|
||||
-- Aarne Ranta, Harald Hammarström and Björn Bringert 2003--2007
|
||||
--
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
@@ -141,7 +141,6 @@ mkN : overload {
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
mkGN : overload {
|
||||
mkGN : Str -> Sex -> GN ; -- regular name with genitive in "s"
|
||||
mkGN : (nom,gen : Str) -> Sex -> GN ; -- name with other genitive
|
||||
@@ -160,36 +159,10 @@ mkN : overload {
|
||||
mkSN : (nom,acc,dat,gen : Str) -> GN ; -- name with all case forms
|
||||
} ;
|
||||
|
||||
mkLN = overload {
|
||||
mkLN : Str -> LN = \s -> regLN s Masc ; -- regular name with genitive in "s", masculine
|
||||
mkLN : Str -> Number -> LN = \s,n -> regLN s Masc ** {n=n} ; -- regular name with genitive in "s", masculine
|
||||
mkLN : Str -> Gender -> LN = regLN ; -- regular name with genitive in "s"
|
||||
|
||||
-- If only the genitive differs, two strings are needed.
|
||||
|
||||
mkLN : (nom,gen : Str) -> Gender -> LN = mk2LN ; -- name with other genitive
|
||||
|
||||
-- In the worst case, all four forms are needed.
|
||||
|
||||
mkLN : (nom,acc,dat,gen : Str) -> Gender -> LN = \nom,acc,dat,gen,g ->
|
||||
lin LN {s = \\a => table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ;
|
||||
g = g ; n = Sg ;
|
||||
hasArt = False}
|
||||
|
||||
} ;
|
||||
|
||||
defLN : LN -> LN = \n -> n ** {hasArt = True} ;
|
||||
|
||||
mk2LN : (karolus, karoli : Str) -> Gender -> LN = \karolus, karoli, g ->
|
||||
lin LN {s = \\a => table {Gen => karoli ; _ => karolus} ; g = g ; n = Sg ;
|
||||
hasArt = False} ;
|
||||
regLN : (horst : Str) -> Gender -> LN = \horst, g ->
|
||||
mk2LN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) g ;
|
||||
|
||||
-- To extract the number of a noun phrase
|
||||
|
||||
-- ifPluralNP : NP -> Bool
|
||||
-- = \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
|
||||
ifPluralNP : CatGer.NP -> Bool
|
||||
= \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
|
||||
|
||||
|
||||
--2 Adjectives
|
||||
@@ -234,9 +207,9 @@ mkN : overload {
|
||||
mkPrep : Str -> Case -> Prep ; -- e.g. "durch" + accusative
|
||||
mkPrep : Case -> Str -> Prep ; -- postposition
|
||||
mkPrep : Str -> Case -> Str -> Prep ; -- both sides
|
||||
-- for preposition glued with DefArt in singular:
|
||||
-- for prepositions glued with DefArt in singular
|
||||
-- e.g. "auf" "auf den" "auf die" "aufs" + accusative
|
||||
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep ;
|
||||
mkPrep : Str -> Str -> Str -> Str -> Case -> Prep ;
|
||||
mkPrep : Case -> Prep ; -- convert case to preposition
|
||||
} ;
|
||||
|
||||
@@ -246,15 +219,14 @@ mkN : overload {
|
||||
datPrep : Prep ; -- no string, just dative case
|
||||
genPrep : Prep ; -- no string, just genitive case
|
||||
|
||||
-- A couple of common prepositions (the first three always with the dative).
|
||||
-- A couple of common prepositions (the first two always with the dative).
|
||||
|
||||
von_Prep : Prep ; -- von + dative, with contraction vom
|
||||
zu_Prep : Prep ; -- zu + dative, with contractions zum, zur
|
||||
bei_Prep : Prep ; -- bei + dative, with contraction beim
|
||||
anDat_Prep : Prep ; -- an + dative, with contraction am
|
||||
inDat_Prep : Prep ; -- in + dative, with contraction im
|
||||
inAcc_Prep : Prep ; -- in + accusative, with contraction ins
|
||||
aufAcc_Prep : Prep ; -- auf + accusative, with contraction aufs
|
||||
von_Prep : Prep ; -- von + dative, with contraction vom
|
||||
zu_Prep : Prep ; -- zu + dative, with contractions zum, zur
|
||||
anDat_Prep : Prep ; -- an + dative, with contraction am
|
||||
inDat_Prep : Prep ; -- in + dative, with contraction im
|
||||
anAcc_Prep : Prep ; -- an + accusative, with contraction ans
|
||||
inAcc_Prep : Prep ; -- in + accusative, with contraction ins
|
||||
|
||||
--2 Verbs
|
||||
|
||||
@@ -337,12 +309,12 @@ mkV2 : overload {
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
accdatV3 : V -> V3 ; -- geben + dat(c2) + acc(c3) (Eng: no prepositions)
|
||||
dirV3 : V -> Prep -> V3 ; -- senden + acc + nach (preposition on second arg)
|
||||
accdatV3 : V -> V3 ; -- geben + dat(c2) + acc(c3) (Eng: give sb sth)
|
||||
dirV3 : V -> Prep -> V3 ; -- senden + acc(c2) + nach(c3)
|
||||
|
||||
mkV3 : overload {
|
||||
mkV3 : V -> V3 ; -- geben + dat(c3) + acc(c2) (Eng: give sth to-sb)
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen + mit + über
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen + mit(c2) + über(c3)
|
||||
} ;
|
||||
|
||||
--3 Other complement patterns
|
||||
@@ -353,39 +325,39 @@ mkV2 : overload {
|
||||
mkV0 : V -> V0 ; --%
|
||||
mkVS : V -> VS ;
|
||||
|
||||
mkV2V : overload { -- with zu; object-control
|
||||
mkV2V : V -> V2V ;
|
||||
mkV2V : V -> Prep -> V2V ;
|
||||
mkV2V : overload { -- with zu
|
||||
mkV2V : V -> V2V ; -- object-control verb (zu-inf), e.g. bitte jmdn, sich auszuruhen
|
||||
mkV2V : V -> Prep -> V2V ; -- object-control verb with prep, e.g. appelliere an jmdn, zu schweigen
|
||||
} ;
|
||||
auxV2V : overload { -- without zu
|
||||
auxV2V : V -> V2V ;
|
||||
auxV2V : V -> V2V ; -- object-control auxiliary, e.g. lasse jmdn sich ausruhen
|
||||
auxV2V : V -> Prep -> V2V ;
|
||||
} ;
|
||||
subjV2V : V2V -> V2V ; -- force subject-control
|
||||
subjV2V : V2V -> V2V ; -- force subject-control, e.g. verspreche jmdm, mich auszuruhen
|
||||
|
||||
mkV2A : overload {
|
||||
mkV2A : V -> V2A ;
|
||||
mkV2A : V -> V2A ; -- e.g. male etwas blau
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
} ;
|
||||
mkV2S : overload {
|
||||
mkV2S : V -> V2S ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkV2S : V -> V2S ; -- e.g. antworte jmdm, dass S
|
||||
mkV2S : V -> Prep -> V2S ; -- e.g. berichte an jmdn, dass S
|
||||
} ;
|
||||
mkV2Q : overload {
|
||||
mkV2Q : V -> V2Q ;
|
||||
mkV2Q : V -> V2Q ; -- e.g. frage jmdn, ob S
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
} ;
|
||||
|
||||
|
||||
mkVV : V -> VV ; -- with zu
|
||||
auxVV : V -> VV ; -- without zu
|
||||
mkVV : V -> VV ; -- with zu, e.g. versuche, zu schlafen
|
||||
auxVV : V -> VV ; -- without zu, e.g. will schlafen
|
||||
|
||||
mkVA : overload {
|
||||
mkVA : V -> VA ;
|
||||
mkVA : V -> VA ; -- e.g. bleibe gesund
|
||||
mkVA : V -> Prep -> VA ;
|
||||
} ;
|
||||
|
||||
mkVQ : V -> VQ ;
|
||||
mkVQ : V -> VQ ; -- e.g. frage mich, ob S
|
||||
|
||||
|
||||
mkAS : A -> AS ; --%
|
||||
@@ -411,9 +383,8 @@ mkV2 : overload {
|
||||
-- hidden from the document.
|
||||
|
||||
Gender = MorphoGer.Gender ;
|
||||
Case = MorphoGer.Case ;
|
||||
Case = MorphoGer.Case ;
|
||||
Number = MorphoGer.Number ;
|
||||
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
neuter = Neutr ;
|
||||
@@ -566,7 +537,7 @@ mkV2 : overload {
|
||||
dunk + "el" => mk3A a (dunk + "ler") (dunk + "leste") ;
|
||||
te + "uer" => mk3A a (te + "urer") (te + "ureste") ;
|
||||
_ + "e" => mk3A a (a + "r") (a + "ste") ;
|
||||
_ + ("t" | "d" | "s" | "ß" | "sch" | "z" | "au" | "eu") => mk3A a (a + "er") (a + "este") ;
|
||||
_ + ("t" | "d" | "s" | "ß" | "sch" | "z" | "au" | "eu") => mk3A a (a + "er") (a + "este") ;
|
||||
_ => mk3A a (a + "er") (a + "ste")
|
||||
} ;
|
||||
|
||||
@@ -582,27 +553,24 @@ mkV2 : overload {
|
||||
mkPrep : Case -> Str -> Prep = \c,s ->
|
||||
{s = \\_ => [] ; s2 = s ; c = c ; isPrep = isPrep ; lock_Prep = <>} ;
|
||||
mkPrep : Str -> Case -> Str -> Prep = \s,c,t ->
|
||||
{s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep = <>} ;
|
||||
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep = \s,masc,fem,neutr, c ->
|
||||
{s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep = <>} ;
|
||||
mkPrep : Str -> Str -> Str -> Str -> Case -> Prep = \s,masc,fem,neutr,c ->
|
||||
{s = table{GPl => s ; GSg Masc => masc ; GSg Fem => fem ; GSg Neutr => neutr} ;
|
||||
s2 = [] ; c = c ; isPrep = isPrepDefArt ; lock_Prep = <>} ;
|
||||
mkPrep : Case -> Prep = \c ->
|
||||
{s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>} ;
|
||||
{s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>}
|
||||
} ;
|
||||
|
||||
|
||||
accPrep = mkPrep accusative ;
|
||||
datPrep = mkPrep dative ;
|
||||
genPrep = mkPrep genitive ;
|
||||
|
||||
--von_Prep = mkPrep "von" dative ;
|
||||
von_Prep = mkPrep "von" "vom" "von der" "vom" dative ;
|
||||
zu_Prep = mkPrep "zu" "zum" "zur" "zum" dative ;
|
||||
bei_Prep = mkPrep "bei" "beim" "bei der" "beim" dative ;
|
||||
inDat_Prep = mkPrep "in" "im" "in der" "im" dative ;
|
||||
inAcc_Prep = mkPrep "in" "in den" "in die" "ins" accusative ;
|
||||
anDat_Prep = mkPrep "an" "am" "an der" "am" dative ;
|
||||
anAcc_Prep = mkPrep "an" "an den" "an die" "ans" accusative ;
|
||||
aufAcc_Prep = mkPrep "auf" "auf den" "auf die" "aufs" accusative ;
|
||||
|
||||
mk6V geben gibt gib gab gaebe gegeben =
|
||||
let
|
||||
@@ -672,7 +640,7 @@ mkV2 : overload {
|
||||
= \v,c,d -> lin V3 (v ** {c2 = c ; c3 = d}) ;
|
||||
} ;
|
||||
|
||||
dirV3 v p = mkV3 v accPrep p ;
|
||||
dirV3 v p = mkV3 v accPrep p ; -- accPrep sets isPrep=False
|
||||
accdatV3 v = mkV3 v datPrep accPrep ; -- to fit to Eng ditransitives (no preposition):
|
||||
-- give sb(indir) sth(dir) = geben jmdm(dat) etwas(acc)
|
||||
mkVS v = v ** {lock_VS = <>} ;
|
||||
@@ -687,34 +655,35 @@ mkV2 : overload {
|
||||
mkV0 v = v ** {lock_V = <>} ;
|
||||
|
||||
mkV2V = overload { -- default: object-control
|
||||
mkV2V : V -> V2V
|
||||
mkV2V : V -> V2V
|
||||
= \v -> dirV2 v ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ; -- ermahne jmdn, sich zu waschen
|
||||
mkV2V : V -> Prep -> V2V
|
||||
mkV2V : V -> Prep -> V2V
|
||||
= \v,p -> prepV2 v p ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ;
|
||||
} ;
|
||||
auxV2V = overload {
|
||||
auxV2V : V -> V2V
|
||||
auxV2V : V -> V2V
|
||||
= \v -> dirV2 v ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ; -- lasse jmdn sich waschen
|
||||
auxV2V : V -> Prep -> V2V
|
||||
auxV2V : V -> Prep -> V2V
|
||||
= \v,p -> prepV2 v p ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ;
|
||||
} ;
|
||||
subjV2V v = v ** {objCtrl = False} ;
|
||||
|
||||
mkV2A = overload {
|
||||
mkV2A : V -> V2A = \v -> dirV2 v ** {isAux = False ; lock_V2A = <>} ;
|
||||
mkV2A : V -> Prep -> V2A
|
||||
mkV2A : V -> V2A
|
||||
= \v -> dirV2 v ** {isAux = False ; lock_V2A = <>} ;
|
||||
mkV2A : V -> Prep -> V2A
|
||||
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2A = <>} ;
|
||||
} ;
|
||||
mkV2S = overload {
|
||||
mkV2S : V -> V2S
|
||||
= \v -> dirV2 v ** {isAux = False ; lock_V2S = <>} ;
|
||||
mkV2S : V -> Prep -> V2S
|
||||
mkV2S : V -> Prep -> V2S
|
||||
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2S = <>} ;
|
||||
} ;
|
||||
mkV2Q = overload {
|
||||
mkV2Q : V -> V2Q
|
||||
mkV2Q : V -> V2Q
|
||||
= \v -> dirV2 v ** {isAux = False ; lock_V2Q = <>} ;
|
||||
mkV2Q : V -> Prep -> V2Q
|
||||
mkV2Q : V -> Prep -> V2Q
|
||||
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2Q = <>} ;
|
||||
} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user