From 1cad178ec8707d8f51945078cb42402c37bf5f2d Mon Sep 17 00:00:00 2001 From: Hans Leiss Date: Tue, 23 Aug 2022 15:32:17 +0200 Subject: [PATCH] The glueing of preposition with definite article is now implemented using NP.s : Bool => Case => Str and NP.w = WDefArt np.s ! False : Case => Str is the ordinary paradigm; if the np has a definite article, np.w = WDefArt, and np.s ! True : Case => Str is the paradigm with definite article omitted, if np.a = Ag g Sg p. Prepositions now have type Prep = {s : GenNum => Str ; s2 :Str ; c : Case ; isPrep : PrepType}, and |Prep| = |Case|*|isPrep| = 4 * 3 = 12, independent of |PCase| >= 18. A preposition p with p.isPrep = isPrepDefArt has in p.s ! (GSg g) : Str the preposition glued with definite article of a following np in singular. The modified linearization categories for Prep, NP, Det, DAP, Quant, Predet are no longer Prep', NP' etc., but Prep, NP etc. in CatGer. They are now also used in gf-rgl/tests/german/TestLangGer.gf. The previous auxiliary files abstract/Adjective'.gf etc. are removed. BUT: for complexitiy reasons, - the glueing is omitted in SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash, - SlashVP : NP -> SlashVP -> ClSlash (in SentenceGer and TestLanGer) are commented out. SlashVP causes grammar compilation to crash due to memory limits, probably because mkClause and its modification mkClSlash are too detailed. --- src/abstract/Adjective'.gf | 39 -------- src/abstract/Adverb'.gf | 35 ------- src/abstract/Cat'.gf | 1 - src/abstract/Conjunction'.gf | 82 ---------------- src/abstract/Grammar'.gf | 23 ----- src/abstract/Idiom'.gf | 35 ------- src/abstract/Lang'.gf | 16 ---- src/abstract/Noun'.gf | 158 ------------------------------- src/abstract/NumeralTransfer'.gf | 97 ------------------- src/abstract/Phrase'.gf | 48 ---------- src/abstract/Question'.gf | 55 ----------- src/abstract/Relative'.gf | 26 ----- src/abstract/Sentence'.gf | 107 --------------------- src/abstract/Structural'.gf | 128 ------------------------- src/abstract/Transfer'.gf | 29 ------ src/abstract/Verb'.gf | 84 ---------------- src/api/CombinatorsGer.gf | 6 +- src/api/ConstructorsGer.gf | 2 +- src/api/SyntaxGer.gf | 2 +- src/german/AdjectiveGer.gf | 12 +-- src/german/AdverbGer.gf | 6 +- src/german/AllGer.gf | 2 +- src/german/CatGer.gf | 66 +++++-------- src/german/ConjunctionGer.gf | 23 +++-- src/german/ConstructionGer.gf | 6 +- src/german/ExtraGer.gf | 22 ++--- src/german/GrammarGer.gf | 2 +- src/german/IdiomGer.gf | 13 ++- src/german/LangGer.gf | 2 +- src/german/MakeStructuralGer.gf | 12 +-- src/german/MorphoGer.gf | 2 +- src/german/NounGer.gf | 20 ++-- src/german/ParadigmsGer.gf | 90 +++++++++--------- src/german/PhraseGer.gf | 6 +- src/german/QuestionGer.gf | 9 +- src/german/RelativeGer.gf | 10 +- src/german/ResGer.gf | 83 +++++++++------- src/german/SentenceGer.gf | 12 +-- src/german/StructuralGer.gf | 2 +- src/german/SymbolGer.gf | 15 +-- src/german/VerbGer.gf | 26 ++--- tests/german/TestLangGer.gf | 26 ++--- 42 files changed, 238 insertions(+), 1202 deletions(-) delete mode 100644 src/abstract/Adjective'.gf delete mode 100644 src/abstract/Adverb'.gf delete mode 100644 src/abstract/Cat'.gf delete mode 100644 src/abstract/Conjunction'.gf delete mode 100644 src/abstract/Grammar'.gf delete mode 100644 src/abstract/Idiom'.gf delete mode 100644 src/abstract/Lang'.gf delete mode 100644 src/abstract/Noun'.gf delete mode 100644 src/abstract/NumeralTransfer'.gf delete mode 100644 src/abstract/Phrase'.gf delete mode 100644 src/abstract/Question'.gf delete mode 100644 src/abstract/Relative'.gf delete mode 100644 src/abstract/Sentence'.gf delete mode 100644 src/abstract/Structural'.gf delete mode 100644 src/abstract/Transfer'.gf delete mode 100644 src/abstract/Verb'.gf diff --git a/src/abstract/Adjective'.gf b/src/abstract/Adjective'.gf deleted file mode 100644 index 38eedba00..000000000 --- a/src/abstract/Adjective'.gf +++ /dev/null @@ -1,39 +0,0 @@ ---1 Adjective: Adjectives and Adjectival Phrases - -abstract Adjective' = Cat' ** { - - fun - --- The principal ways of forming an adjectival phrase are --- positive, comparative, relational, reflexive-relational, and --- elliptic-relational. - - PositA : A -> AP ; -- warm - ComparA : A -> NP' -> AP ; -- warmer than I - ComplA2 : A2 -> NP' -> AP ; -- married to her - ReflA2 : A2 -> AP ; -- married to itself - UseA2 : A2 -> AP ; -- married - UseComparA : A -> AP ; -- warmer - CAdvAP : CAdv -> AP -> NP' -> AP ; -- as cool as John - --- The superlative use is covered in $Ord$. - - AdjOrd : Ord -> AP ; -- warmest - --- Sentence and question complements defined for all adjectival --- phrases, although the semantics is only clear for some adjectives. - - SentAP : AP -> SC -> AP ; -- good that she is here - --- An adjectival phrase can be modified by an *adadjective*, such as "very". - - AdAP : AdA -> AP -> AP ; -- very warm - --- It can also be postmodified by an adverb, typically a prepositional phrase. - - AdvAP : AP -> Adv -> AP ; -- warm by nature - --- The formation of adverbs from adjectives (e.g. "quickly") is covered --- in [Adverb Adverb.html]; the same concerns adadjectives (e.g. "extremely"). - -} diff --git a/src/abstract/Adverb'.gf b/src/abstract/Adverb'.gf deleted file mode 100644 index 99d9c5991..000000000 --- a/src/abstract/Adverb'.gf +++ /dev/null @@ -1,35 +0,0 @@ ---1 Adverb: Adverbs and Adverbial Phrases - -abstract Adverb' = Cat' ** { - - fun - --- The two main ways of forming adverbs are from adjectives and by --- prepositions from noun phrases. - - PositAdvAdj : A -> Adv ; -- warmly - PrepNP : Prep' -> NP' -> Adv ; -- in the house - --- Comparative adverbs have a noun phrase or a sentence as object of --- comparison. - - ComparAdvAdj : CAdv -> A -> NP' -> Adv ; -- more warmly than John - ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs - --- Adverbs can be modified by 'adadjectives', just like adjectives. - - AdAdv : AdA -> Adv -> Adv ; -- very quickly - --- Like adverbs, adadjectives can be produced by adjectives. - - PositAdAAdj : A -> AdA ; -- extremely - --- Subordinate clauses can function as adverbs. - - SubjS : Subj -> S -> Adv ; -- when she sleeps - --- Comparison adverbs also work as numeral adverbs. - - AdnCAdv : CAdv -> AdN ; -- less (than five) - -} diff --git a/src/abstract/Cat'.gf b/src/abstract/Cat'.gf deleted file mode 100644 index 18f9f46b1..000000000 --- a/src/abstract/Cat'.gf +++ /dev/null @@ -1 +0,0 @@ -abstract Cat' = Cat ** {cat NP'; Det'; Quant'; Predet'; Prep'; DAP' ;} diff --git a/src/abstract/Conjunction'.gf b/src/abstract/Conjunction'.gf deleted file mode 100644 index b15d5d9d1..000000000 --- a/src/abstract/Conjunction'.gf +++ /dev/null @@ -1,82 +0,0 @@ ---1 Conjunction: Coordination - --- Coordination is defined for many different categories; here is --- a sample. The rules apply to *lists* of two or more elements, --- and define two general patterns: --- - ordinary conjunction: X,...X and X --- - distributed conjunction: both X,...,X and X --- --- --- $VP$ conjunctions are not covered here, because their applicability --- depends on language. Some special cases are defined in --- [``Extra`` ../abstract/Extra.gf]. - - -abstract Conjunction' = Cat' ** { - ---2 Rules - - fun - ConjS : Conj -> ListS -> S ; -- he walks and she runs - ConjRS : Conj -> ListRS -> RS ; -- who walks and whose mother runs - ConjAP : Conj -> ListAP -> AP ; -- cold and warm - ConjNP : Conj -> ListNP' -> NP' ; -- she or we - ConjAdv : Conj -> ListAdv -> Adv ; -- here or there - ConjAdV : Conj -> ListAdV -> AdV ; -- always or sometimes - ConjIAdv : Conj -> ListIAdv -> IAdv ; -- where and with whom - ConjCN : Conj -> ListCN -> CN ; -- man and woman - ConjDet : Conj -> ListDAP -> Det' ; -- his or her - ---2 Categories - --- These categories are only used in this module. - - cat - [S]{2} ; - [RS]{2} ; - [Adv]{2} ; - [AdV]{2} ; - [NP']{2} ; - [AP]{2} ; - [IAdv]{2} ; - [CN] {2} ; - [DAP] {2} ; - ---2 List constructors - --- The list constructors are derived from the list notation and therefore --- not given explicitly. But here are their type signatures: -{- --- overview - BaseC : C -> C -> [C] ; --- for C = AdV, Adv, AP, CN, Det, IAdv, NP, RS, S - ConsC : C -> [C] -> [C] ; --- for C = AdV, Adv, AP, CN, Det, IAdv, NP, RS, S - --- complete list - - BaseAP : AP -> AP -> ListAP ; -- red, white - ConsAP : AP -> ListAP -> ListAP ; -- red, white, blue - - BaseAdV : AdV -> AdV -> ListAdV ; -- always, sometimes - ConsAdV : AdV -> ListAdV -> ListAdV ; -- always, sometimes, never - - BaseAdv : Adv -> Adv -> ListAdv ; -- here, there - ConsAdv : Adv -> ListAdv -> ListAdv ; -- here, there, everywhere - - BaseCN : CN -> CN -> ListCN ; -- man, woman - ConsCN : CN -> ListCN -> ListCN ; -- man, woman, child - - BaseIAdv : IAdv -> IAdv -> ListIAdv ; -- where, when - ConsIAdv : IAdv -> ListIAdv -> ListIAdv ; -- where, when, why - - BaseNP : NP -> NP -> ListNP ; -- John, Mary - ConsNP : NP -> ListNP -> ListNP ; -- John, Mary, Bill - - BaseRS : RS -> RS -> ListRS ; -- who walks, whom I know - ConsRS : RS -> ListRS -> ListRS ; -- who wals, whom I know, who is here - - BaseS : S -> S -> ListS ; -- John walks, Mary runs - ConsS : S -> ListS -> ListS ; -- John walks, Mary runs, Bill swims - --} -} - diff --git a/src/abstract/Grammar'.gf b/src/abstract/Grammar'.gf deleted file mode 100644 index b90e2e9d4..000000000 --- a/src/abstract/Grammar'.gf +++ /dev/null @@ -1,23 +0,0 @@ ---1 Grammar: the Main Module of the Resource Grammar - --- This grammar is a collection of the different grammar modules, --- To test the resource, import [``Lang`` Lang.html], which also contains --- a lexicon. - -abstract Grammar' = - Noun', - Verb', - Adjective', - Adverb', - Numeral, - Sentence', - Question', - Relative', - Conjunction', - Phrase', - Text, - Structural', - Idiom', - Tense, - Transfer' - ; diff --git a/src/abstract/Idiom'.gf b/src/abstract/Idiom'.gf deleted file mode 100644 index 5fa876ce6..000000000 --- a/src/abstract/Idiom'.gf +++ /dev/null @@ -1,35 +0,0 @@ ---1 Idiom: Idiomatic Expressions - -abstract Idiom' = Cat' ** { - --- This module defines constructions that are formed in fixed ways, --- often different even in closely related languages. - - fun - ImpersCl : VP -> Cl ; -- it is hot - GenericCl : VP -> Cl ; -- one sleeps - - CleftNP : NP' -> RS -> Cl ; -- it is I who did it - CleftAdv : Adv -> S -> Cl ; -- it is here she slept - - ExistNP : NP' -> Cl ; -- there is a house - ExistIP : IP -> QCl ; -- which houses are there - --- 7/12/2012 generalizations of these - - ExistNPAdv : NP' -> Adv -> Cl ; -- there is a house in Paris - ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris - - ProgrVP : VP -> VP ; -- be sleeping - - ImpPl1 : VP -> Utt ; -- let's go - - ImpP3 : NP' -> VP -> Utt ; -- let John walk - --- 3/12/2013 non-reflexive uses of "self" - - SelfAdvVP : VP -> VP ; -- is at home himself - SelfAdVVP : VP -> VP ; -- is himself at home - SelfNP : NP' -> NP' ; -- the president himself (is at home) - -} diff --git a/src/abstract/Lang'.gf b/src/abstract/Lang'.gf deleted file mode 100644 index ad859414d..000000000 --- a/src/abstract/Lang'.gf +++ /dev/null @@ -1,16 +0,0 @@ ---1 Lang: a Test Module for the Resource Grammar - --- This grammar is for testing the resource as included in the --- language-independent API, consisting of a grammar and a lexicon. --- The grammar without a lexicon is [``Grammar`` Grammar.html], --- which may be more suitable to open in applications. - -abstract Lang' = - Grammar', - Lexicon --- ,Construction --- could be compiled here, but not in concretes, as they call Syntax and Grammar --- ,Documentation --# notpresent --- ,Markup' - [stringMark] - ** { - flags startcat=Phr ; - } ; diff --git a/src/abstract/Noun'.gf b/src/abstract/Noun'.gf deleted file mode 100644 index b56b92ddb..000000000 --- a/src/abstract/Noun'.gf +++ /dev/null @@ -1,158 +0,0 @@ ---1 Noun: Nouns, noun phrases, and determiners - -abstract Noun' = Cat' ** { - - ---2 Noun phrases - --- The three main types of noun phrases are --- - common nouns with determiners --- - proper names --- - pronouns --- --- - fun - DetCN : Det' -> CN -> NP' ; -- the man - UsePN : PN -> NP' ; -- John - UsePron : Pron -> NP' ; -- he - --- Pronouns are defined in the module [``Structural`` Structural.html]. - --- A noun phrase already formed can be modified by a $Predet$erminer. - - PredetNP : Predet' -> NP' -> NP' ; -- only the man - --- A noun phrase can also be postmodified by the past participle of a --- verb, by an adverb, or by a relative clause - - PPartNP : NP' -> V2 -> NP' ; -- the man seen - AdvNP : NP' -> Adv -> NP' ; -- Paris today - ExtAdvNP: NP' -> Adv -> NP' ; -- boys, such as .. - RelNP : NP' -> RS -> NP' ; -- Paris, which is here - --- Determiners can form noun phrases directly. - - DetNP : Det' -> NP' ; -- these five - - ---2 Determiners - --- The determiner has a fine-grained structure, in which a 'nucleus' --- quantifier and an optional numeral can be discerned. - - DetQuant : Quant' -> Num -> Det' ; -- these five - DetQuantOrd : Quant' -> Num -> Ord -> Det' ; -- these five best - --- Whether the resulting determiner is singular or plural depends on the --- cardinal. - --- All parts of the determiner can be empty, except $Quant$, which is --- the "kernel" of a determiner. It is, however, the $Num$ that determines --- the inherent number. - - NumSg : Num ; -- [no numeral, but marked as singular] - NumPl : Num ; -- [no numeral, but marked as plural] - NumCard : Card -> Num ; -- one/five [explicit numeral] - --- $Card$ consists of either digits or numeral words. - - data - NumDigits : Digits -> Card ; -- 51 - NumNumeral : Numeral -> Card ; -- fifty-one - --- The construction of numerals is defined in [Numeral Numeral.html]. - --- A $Card$ can be modified by certain adverbs. - - fun - AdNum : AdN -> Card -> Card ; -- almost 51 - --- An $Ord$ consists of either digits or numeral words. --- Also superlative forms of adjectives behave syntactically like ordinals. - - OrdDigits : Digits -> Ord ; -- 51st - OrdNumeral : Numeral -> Ord ; -- fifty-first - OrdSuperl : A -> Ord ; -- warmest - --- One can combine a numeral and a superlative. - - OrdNumeralSuperl : Numeral -> A -> Ord ; -- third largest - --- Definite and indefinite noun phrases are sometimes realized as --- neatly distinct words (Spanish "un, unos ; el, los") but also without --- any particular word (Finnish; Swedish definites). - - DefArt : Quant'; -- the - IndefArt : Quant' ; -- a/an - --- Nouns can be used without an article as mass nouns. The resource does --- not distinguish mass nouns from other common nouns, which can result --- in semantically odd expressions. - - MassNP : CN -> NP' ; -- (beer) - --- Pronouns have possessive forms. Genitives of other kinds --- of noun phrases are not given here, since they are not possible --- in e.g. Romance languages. They can be found in $Extra$ modules. - - PossPron : Pron -> Quant' ; -- my (house) - --- Other determiners are defined in [Structural Structural.html]. - - - ---2 Common nouns - --- Simple nouns can be used as nouns outright. - - UseN : N -> CN ; -- house - --- Relational nouns take one or two arguments. - - ComplN2 : N2 -> NP' -> CN ; -- mother of the king - ComplN3 : N3 -> NP' -> N2 ; -- distance from this city (to Paris) - --- Relational nouns can also be used without their arguments. --- The semantics is typically derivative of the relational meaning. - - UseN2 : N2 -> CN ; -- mother - Use2N3 : N3 -> N2 ; -- distance (from this city) - Use3N3 : N3 -> N2 ; -- distance (to Paris) - --- Nouns can be modified by adjectives, relative clauses, and adverbs --- (the last rule will give rise to many 'PP attachment' ambiguities --- when used in connection with verb phrases). - - AdjCN : AP -> CN -> CN ; -- big house - RelCN : CN -> RS -> CN ; -- house that John bought - AdvCN : CN -> Adv -> CN ; -- house on the hill - --- Nouns can also be modified by embedded sentences and questions. --- For some nouns this makes little sense, but we leave this for applications --- to decide. Sentential complements are defined in [Verb Verb.html]. - - SentCN : CN -> SC -> CN ; -- question where she sleeps - ---2 Apposition - --- This is certainly overgenerating. - - ApposCN : CN -> NP' -> CN ; -- city Paris (, numbers x and y) - ---2 Possessive and partitive constructs - --- (New 13/3/2013 AR; Structural.possess_Prep and part_Prep should be deprecated in favour of these.) - - PossNP : CN -> NP' -> CN ; -- house of Paris, house of mine - PartNP : CN -> NP' -> CN ; -- glass of wine - --- This is different from the partitive, as shown by many languages. - - CountNP : Det' -> NP' -> NP' ; -- three of them, some of the boys - ---3 Conjoinable determiners and ones with adjectives - - AdjDAP : DAP' -> AP -> DAP' ; -- the large (one) - DetDAP : Det' -> DAP' ; -- this (or that) - -} diff --git a/src/abstract/NumeralTransfer'.gf b/src/abstract/NumeralTransfer'.gf deleted file mode 100644 index 639524e58..000000000 --- a/src/abstract/NumeralTransfer'.gf +++ /dev/null @@ -1,97 +0,0 @@ -abstract NumeralTransfer' = Numeral, Noun' ** { - -fun digits2numeral : Card -> Card ; -def - digits2numeral (NumDigits d) = NumNumeral (digits2num d) ; - digits2numeral n = n ; - -fun digits2num : Digits -> Numeral ; -def digits2num (IDig d1) = num (pot2as3 (pot1as2 (pot0as1 (dn10 d1)))) ; - digits2num (IIDig d2 (IDig d1)) = num (pot2as3 (pot1as2 (dn100 d2 d1))) ; - digits2num (IIDig d3 (IIDig d2 (IDig d1))) = num (pot2as3 (dn1000 d3 d2 d1)) ; - digits2num (IIDig d4 (IIDig d3 (IIDig d2 (IDig d1)))) = num (dn1000000a d4 d3 d2 d1) ; - digits2num (IIDig d5 (IIDig d4 (IIDig d3 (IIDig d2 (IDig d1))))) = num (dn1000000b d5 d4 d3 d2 d1) ; - digits2num (IIDig d6 ((IIDig d5 (IIDig d4 (IIDig d3 (IIDig d2 (IDig d1))))))) = num (dn1000000c d6 d5 d4 d3 d2 d1) ; - -fun num2digits : Numeral -> Digits ; -def num2digits (num x) = nd1000000 x ; - -fun dn10 : Dig -> Sub10 ; -def dn10 D_1 = pot01 ; - dn10 d1 = pot0 (dn d1) ; - -fun dn100 : Dig -> Dig -> Sub100 ; -def dn100 D_0 d1 = pot0as1 (dn10 d1) ; - dn100 D_1 D_0 = pot110 ; - dn100 D_1 D_1 = pot111 ; - dn100 D_1 d1 = pot1to19 (dn d1) ; - dn100 d2 D_0 = pot1 (dn d2) ; - dn100 d2 d1 = pot1plus (dn d2) (dn10 d1) ; - -fun dn1000 : Dig -> Dig -> Dig -> Sub1000 ; -def dn1000 D_0 d2 d1 = pot1as2 (dn100 d2 d1) ; - dn1000 d3 D_0 D_0 = pot2 (dn10 d3) ; - dn1000 d3 d2 d1 = pot2plus (dn10 d3) (dn100 d2 d1) ; - -fun dn1000000a : Dig -> Dig -> Dig -> Dig -> Sub1000000 ; -def dn1000000a D_0 d3 d2 d1 = pot2as3 (dn1000 d3 d2 d1) ; - dn1000000a d4 D_0 D_0 D_0 = pot3 (pot1as2 (pot0as1 (dn10 d4))) ; - dn1000000a d4 d3 d2 d1 = pot3plus (pot1as2 (pot0as1 (dn10 d4))) (dn1000 d3 d2 d1) ; - -fun dn1000000b : Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 ; -def dn1000000b D_0 d4 d3 d2 d1 = dn1000000a d4 d3 d2 d1 ; - dn1000000b d5 d4 D_0 D_0 D_0 = pot3 (pot1as2 (dn100 d5 d4)) ; - dn1000000b d5 d4 d3 d2 d1 = pot3plus (pot1as2 (dn100 d5 d4)) (dn1000 d3 d2 d1) ; - -fun dn1000000c : Dig -> Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 ; -def dn1000000c D_0 d5 d4 d3 d2 d1 = dn1000000b d5 d4 d3 d2 d1 ; - dn1000000c d6 d5 d4 D_0 D_0 D_0 = pot3 (dn1000 d6 d5 d4) ; - dn1000000c d6 d5 d4 d3 d2 d1 = pot3plus (dn1000 d6 d5 d4) (dn1000 d3 d2 d1) ; - -fun dn : Dig -> Digit ; -def dn D_2 = n2 ; - dn D_3 = n3 ; - dn D_4 = n4 ; - dn D_5 = n5 ; - dn D_6 = n6 ; - dn D_7 = n7 ; - dn D_8 = n8 ; - dn D_9 = n9 ; - -fun nd10 : Sub10 -> Digits ; -def nd10 pot01 = IDig D_1 ; - nd10 (pot0 d1) = IDig (nd d1) ; - -fun nd100 : Sub100 -> Digits ; -def nd100 (pot0as1 d) = nd10 d ; - nd100 pot110 = IIDig D_1 (IDig D_0) ; - nd100 pot111 = IIDig D_1 (IDig D_1) ; - nd100 (pot1to19 d) = IIDig D_1 (IDig (nd d)) ; - nd100 (pot1 d) = IIDig (nd d) (IDig D_0) ; - nd100 (pot1plus d x) = IIDig (nd d) (nd10 x) ; - -fun nd1000 : Sub1000 -> Digits ; -def nd1000 (pot1as2 x) = nd100 x ; - nd1000 (pot2 x) = dconcat (nd10 x) (IIDig D_0 (IDig D_0)) ; - nd1000 (pot2plus x y) = dconcat (nd10 x) (nd100 y) ; - -fun nd1000000 : Sub1000000 -> Digits ; -def nd1000000 (pot2as3 x) = nd1000 x ; - nd1000000 (pot3 x) = dconcat (nd1000 x) (IIDig D_0 (IIDig D_0 (IDig D_0))) ; - nd1000000 (pot3plus x y) = dconcat (nd1000 x) (nd1000 y) ; - -fun dconcat : Digits -> Digits -> Digits ; -def dconcat (IDig d) ys = IIDig d ys ; - dconcat (IIDig d xs) ys = IIDig d (dconcat xs ys) ; - -fun nd : Digit -> Dig ; -def nd n2 = D_2 ; - nd n3 = D_3 ; - nd n4 = D_4 ; - nd n5 = D_5 ; - nd n6 = D_6 ; - nd n7 = D_7 ; - nd n8 = D_8 ; - nd n9 = D_9 ; - -} diff --git a/src/abstract/Phrase'.gf b/src/abstract/Phrase'.gf deleted file mode 100644 index 35ae77dab..000000000 --- a/src/abstract/Phrase'.gf +++ /dev/null @@ -1,48 +0,0 @@ ---1 Phrase: Phrases and Utterances - -abstract Phrase' = Cat' ** { - --- When a phrase is built from an utterance it can be prefixed --- with a phrasal conjunction (such as "but", "therefore") --- and suffixing with a vocative (typically a noun phrase). - - fun - PhrUtt : PConj -> Utt -> Voc -> Phr ; -- but come here, my friend - --- Utterances are formed from sentences, questions, and imperatives. - - UttS : S -> Utt ; -- John walks - UttQS : QS -> Utt ; -- is it good - UttImpSg : Pol -> Imp -> Utt ; -- (don't) love yourself - UttImpPl : Pol -> Imp -> Utt ; -- (don't) love yourselves - UttImpPol : Pol -> Imp -> Utt ; -- (don't) sleep (polite) - --- There are also 'one-word utterances'. A typical use of them is --- as answers to questions. --- *Note*. This list is incomplete. More categories could be covered. --- Moreover, in many languages e.g. noun phrases in different cases --- can be used. - - UttIP : IP -> Utt ; -- who - UttIAdv : IAdv -> Utt ; -- why - UttNP : NP' -> Utt ; -- this man - UttAdv : Adv -> Utt ; -- here - UttVP : VP -> Utt ; -- to sleep - UttCN : CN -> Utt ; -- house - UttCard : Card -> Utt ; -- five - UttAP : AP -> Utt ; -- fine - UttInterj : Interj -> Utt ; -- alas - --- The phrasal conjunction is optional. A sentence conjunction --- can also be used to prefix an utterance. - - NoPConj : PConj ; -- [plain phrase without conjunction in front] - PConjConj : Conj -> PConj ; -- and - --- The vocative is optional. Any noun phrase can be made into vocative, --- which may be overgenerating (e.g. "I"). - - NoVoc : Voc ; -- [plain phrase without vocative] - VocNP : NP' -> Voc ; -- my friend - -} diff --git a/src/abstract/Question'.gf b/src/abstract/Question'.gf deleted file mode 100644 index 139ce4e37..000000000 --- a/src/abstract/Question'.gf +++ /dev/null @@ -1,55 +0,0 @@ ---1 Question: Questions and Interrogative Pronouns - -abstract Question' = Cat' ** { - --- A question can be formed from a clause ('yes-no question') or --- with an interrogative. - - fun - QuestCl : Cl -> QCl ; -- does John walk - QuestVP : IP -> VP -> QCl ; -- who walks - QuestSlash : IP -> ClSlash -> QCl ; -- whom does John love - QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk - QuestIComp : IComp -> NP' -> QCl ; -- where is John - --- Interrogative pronouns can be formed with interrogative --- determiners, with or without a noun. - - IdetCN : IDet -> CN -> IP ; -- which five songs - IdetIP : IDet -> IP ; -- which five - --- They can be modified with adverbs. - - AdvIP : IP -> Adv -> IP ; -- who in Paris - --- Interrogative quantifiers have number forms and can take number modifiers. - - IdetQuant : IQuant -> Num -> IDet ; -- which (five) - --- Interrogative adverbs can be formed prepositionally. - - PrepIP : Prep' -> IP -> IAdv ; -- with whom - --- They can be modified with other adverbs. - - AdvIAdv : IAdv -> Adv -> IAdv ; -- where in Paris - --- Interrogative complements to copulas can be both adverbs and --- pronouns. - - CompIAdv : IAdv -> IComp ; -- where (is it) - CompIP : IP -> IComp ; -- who (is it) - --- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$. - --- Wh questions with two or more question words require a new, special category. - - cat - QVP ; -- buy what where - fun - ComplSlashIP : VPSlash -> IP -> QVP ; -- buys what - AdvQVP : VP -> IAdv -> QVP ; -- lives where - AddAdvQVP : QVP -> IAdv -> QVP ; -- buys what where - - QuestQVP : IP -> QVP -> QCl ; -- who buys what where -} diff --git a/src/abstract/Relative'.gf b/src/abstract/Relative'.gf deleted file mode 100644 index 3c936a368..000000000 --- a/src/abstract/Relative'.gf +++ /dev/null @@ -1,26 +0,0 @@ ---1 Relative clauses and pronouns - -abstract Relative' = Cat' ** { - - fun - --- The simplest way to form a relative clause is from a clause by --- a pronoun similar to "such that". - - RelCl : Cl -> RCl ; -- such that John loves her - --- The more proper ways are from a verb phrase --- (formed in [``Verb`` Verb.html]) or a sentence --- with a missing noun phrase (formed in [``Sentence`` Sentence.html]). - - RelVP : RP -> VP -> RCl ; -- who loves John - RelSlash : RP -> ClSlash -> RCl ; -- whom John loves - --- Relative pronouns are formed from an 'identity element' by prefixing --- or suffixing (depending on language) prepositional phrases or genitives. - - IdRP : RP ; -- which - FunRP : Prep' -> NP' -> RP -> RP ; -- the mother of whom - -} - diff --git a/src/abstract/Sentence'.gf b/src/abstract/Sentence'.gf deleted file mode 100644 index 821970ed0..000000000 --- a/src/abstract/Sentence'.gf +++ /dev/null @@ -1,107 +0,0 @@ ---1 Sentence: Sentences, Clauses, and Imperatives - -abstract Sentence' = Cat' ** { - ---2 Clauses - --- The $NP VP$ predication rule form a clause whose linearization --- gives a table of all tense variants, positive and negative. --- Clauses are converted to $S$ (with fixed tense) with the --- $UseCl$ function below. - - data - PredVP : NP' -> VP -> Cl ; -- John walks - --- Using an embedded sentence as a subject is treated separately. --- This can be overgenerating. E.g. "whether you go" as subject --- is only meaningful for some verb phrases. - - PredSCVP : SC -> VP -> Cl ; -- that she goes is good - ---2 Clauses missing object noun phrases - --- This category is a variant of the 'slash category' $S/NP$ of --- GPSG and categorial grammars, which in turn replaces --- movement transformations in the formation of questions --- and relative clauses. Except $SlashV2$, the construction --- rules can be seen as special cases of function composition, in --- the style of CCG. --- *Note* the set is not complete and lacks e.g. verbs with more than 2 places. - - SlashVP : NP' -> VPSlash -> ClSlash ; -- (whom) he sees - AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today - SlashPrep : Cl -> Prep' -> ClSlash ; -- (with whom) he walks - SlashVS : NP' -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves - ---2 Imperatives - --- An imperative is straightforwardly formed from a verb phrase. --- It has variation over positive and negative, singular and plural. --- To fix these parameters, see [Phrase Phrase.html]. - - ImpVP : VP -> Imp ; -- love yourselves - AdvImp : Adv -> Imp -> Imp ; -- please love yourselves - ---2 Embedded sentences - --- Sentences, questions, and infinitival phrases can be used as --- subjects and (adverbial) complements. - - EmbedS : S -> SC ; -- that she goes - EmbedQS : QS -> SC ; -- who goes - EmbedVP : VP -> SC ; -- to go - ---2 Sentences - --- These are the 2 x 4 x 4 = 16 forms generated by different --- combinations of tense, polarity, and --- anteriority, which are defined in [``Common`` Common.html]. - - fun - UseCl : Temp -> Pol -> Cl -> S ; -- she had not slept - UseQCl : Temp -> Pol -> QCl -> QS ; -- who had not slept - UseRCl : Temp -> Pol -> RCl -> RS ; -- that had not slept - UseSlash : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen - --- An adverb can be added to the beginning of a sentence, either with comma ("externally") --- or without: - - AdvS : Adv -> S -> S ; -- then I will go home - ExtAdvS : Adv -> S -> S ; -- next week, I will go home - --- This covers subjunctive clauses, but they can also be added to the end. - - SSubjS : S -> Subj -> S -> S ; -- I go home, if she comes - --- A sentence can be modified by a relative clause referring to its contents. - - RelS : S -> RS -> S ; -- she sleeps, which is good - ----- A sentence can also be post-modified by a subjunct sentence. - ----- ModSubjS : S -> Subj -> S -> S ; -- she sleeps, because she is old ----- cf. Adverb.SubjS - -} - ---. - --- Examples for English $S$/$Cl$: -{- - Pres Simul Pos ODir : he sleeps - Pres Simul Neg ODir : he doesn't sleep - Pres Anter Pos ODir : he has slept - Pres Anter Neg ODir : he hasn't slept - Past Simul Pos ODir : he slept - Past Simul Neg ODir : he didn't sleep - Past Anter Pos ODir : he had slept - Past Anter Neg ODir : he hadn't slept - Fut Simul Pos ODir : he will sleep - Fut Simul Neg ODir : he won't sleep - Fut Anter Pos ODir : he will have slept - Fut Anter Neg ODir : he won't have slept - Cond Simul Pos ODir : he would sleep - Cond Simul Neg ODir : he wouldn't sleep - Cond Anter Pos ODir : he would have slept - Cond Anter Neg ODir : he wouldn't have slept --} diff --git a/src/abstract/Structural'.gf b/src/abstract/Structural'.gf deleted file mode 100644 index 1db750a27..000000000 --- a/src/abstract/Structural'.gf +++ /dev/null @@ -1,128 +0,0 @@ ---1 Structural: Structural Words --- --- Here we have some words belonging to closed classes and appearing --- in all languages we have considered. --- Sometimes more distinctions are needed, e.g. $we_Pron$ in Spanish --- should be replaced by masculine and feminine variants, found in --- [``ExtendSpa`` ../spanish/ExtendSpa.gf]. - -abstract Structural' = Cat' ** { - - fun - --- This is an alphabetical list of structural words - - above_Prep : Prep' ; - after_Prep : Prep' ; - all_Predet : Predet' ; - almost_AdA : AdA ; - almost_AdN : AdN ; - although_Subj : Subj ; - always_AdV : AdV ; - and_Conj : Conj ; - because_Subj : Subj ; - before_Prep : Prep' ; - behind_Prep : Prep' ; - between_Prep : Prep' ; - both7and_DConj : Conj ; -- both...and ----b both7and_DConj : DConj ; - but_PConj : PConj ; - by8agent_Prep : Prep' ; -- by (agent) - by8means_Prep : Prep' ; -- by (means of) - can8know_VV : VV ; -- can (capacity) - can_VV : VV ; -- can (possibility) - during_Prep : Prep' ; - either7or_DConj : Conj ; -- either...or ----b either7or_DConj : DConj ; - every_Det : Det' ; - everybody_NP : NP' ; -- everybody - everything_NP : NP' ; - everywhere_Adv : Adv ; ---- first_Ord : Ord ; DEPRECATED - few_Det : Det' ; - for_Prep : Prep' ; - from_Prep : Prep' ; - he_Pron : Pron ; - here_Adv : Adv ; - here7to_Adv : Adv ; -- to here - here7from_Adv : Adv ; -- from here - how_IAdv : IAdv ; - how8many_IDet : IDet ; - how8much_IAdv : IAdv ; - i_Pron : Pron ; - if_Subj : Subj ; - in8front_Prep : Prep' ; -- in front of - in_Prep : Prep' ; - it_Pron : Pron ; - less_CAdv : CAdv ; - many_Det : Det' ; - more_CAdv : CAdv ; - most_Predet : Predet' ; - much_Det : Det' ; - must_VV : VV ; ----b no_Phr : Phr ; - no_Utt : Utt ; - on_Prep : Prep' ; ---- one_Quant : QuantSg ; DEPRECATED - only_Predet : Predet' ; - or_Conj : Conj ; - otherwise_PConj : PConj ; - part_Prep : Prep' ; - please_Voc : Voc ; - possess_Prep : Prep' ; -- of (possessive) - quite_Adv : AdA ; - she_Pron : Pron ; - so_AdA : AdA ; - someSg_Det : Det' ; - somePl_Det : Det' ; - somebody_NP : NP' ; - something_NP : NP' ; - somewhere_Adv : Adv ; - that_Quant : Quant' ; - that_Subj : Subj ; - there_Adv : Adv ; - there7to_Adv : Adv ; -- to there - there7from_Adv : Adv ; -- from there - therefore_PConj : PConj ; - they_Pron : Pron ; - this_Quant : Quant' ; - through_Prep : Prep' ; - to_Prep : Prep' ; - too_AdA : AdA ; - under_Prep : Prep' ; - very_AdA : AdA ; - want_VV : VV ; - we_Pron : Pron ; - whatPl_IP : IP ; -- what (plural) - whatSg_IP : IP ; -- what (singular) - when_IAdv : IAdv ; - when_Subj : Subj ; - where_IAdv : IAdv ; - which_IQuant : IQuant ; - whoPl_IP : IP ; -- who (plural) - whoSg_IP : IP ; -- who (singular) - why_IAdv : IAdv ; - with_Prep : Prep' ; - without_Prep : Prep' ; ----b yes_Phr : Phr ; - yes_Utt : Utt ; - youSg_Pron : Pron ; -- you (singular) - youPl_Pron : Pron ; -- you (plural) - youPol_Pron : Pron ; -- you (polite) - - no_Quant : Quant' ; - not_Predet : Predet' ; - if_then_Conj : Conj ; - at_least_AdN : AdN ; - at_most_AdN : AdN ; - nobody_NP : NP' ; - nothing_NP : NP' ; - except_Prep : Prep' ; - - as_CAdv : CAdv ; - - have_V2 : V2 ; - - fun language_title_Utt : Utt ; - -} diff --git a/src/abstract/Transfer'.gf b/src/abstract/Transfer'.gf deleted file mode 100644 index 0c41fa525..000000000 --- a/src/abstract/Transfer'.gf +++ /dev/null @@ -1,29 +0,0 @@ -abstract Transfer' = Sentence', Verb', Adverb', Structural', NumeralTransfer' ** { - -{- --- examples of transfer: to test, - - > i LangEng.gf - - > p "she sees him" | pt -transfer=active2passive | l - he is seen by her - - > p "wouldn't she see him" | pt -transfer=active2passive | l - wouldn't he be seen by her - - > p -cat=NP "3 cats with 4 dogs" | pt -transfer=digits2numeral | l - three cats with four dogs --} - -fun - active2passive : Cl -> Cl ; -def - active2passive (PredVP subj (ComplSlash (SlashV2a v) obj)) = - PredVP obj (AdvVP (PassV2 v) (PrepNP by8agent_Prep subj)) ; - active2passive (PredVP subj (AdvVP (ComplSlash (SlashV2a v) obj) adv)) = - PredVP obj (AdvVP (AdvVP (PassV2 v) (PrepNP by8agent_Prep subj)) adv) ; - active2passive (PredVP subj (AdVVP adv (ComplSlash (SlashV2a v) obj))) = - PredVP obj (AdVVP adv (AdvVP (PassV2 v) (PrepNP by8agent_Prep subj))) ; - active2passive cl = cl ; - -} diff --git a/src/abstract/Verb'.gf b/src/abstract/Verb'.gf deleted file mode 100644 index b3e4c1f57..000000000 --- a/src/abstract/Verb'.gf +++ /dev/null @@ -1,84 +0,0 @@ ---1 The construction of verb phrases - -abstract Verb' = Cat' ** { - - flags coding = utf8 ; - ---2 Complementization rules - --- Verb phrases are constructed from verbs by providing their --- complements. There is one rule for each verb category. - - data - UseV : V -> VP ; -- sleep - - ComplVV : VV -> VP -> VP ; -- want to run - ComplVS : VS -> S -> VP ; -- say that she runs - ComplVQ : VQ -> QS -> VP ; -- wonder who runs - ComplVA : VA -> AP -> VP ; -- they become red - - SlashV2a : V2 -> VPSlash ; -- love (it) - Slash2V3 : V3 -> NP' -> VPSlash ; -- give it (to her) - Slash3V3 : V3 -> NP' -> VPSlash ; -- give (it) to her - - SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go - SlashV2S : V2S -> S -> VPSlash ; -- answer (to him) that it is good - SlashV2Q : V2Q -> QS -> VPSlash ; -- ask (him) who came - SlashV2A : V2A -> AP -> VPSlash ; -- paint (it) red - - ComplSlash : VPSlash -> NP' -> VP ; -- love it - - SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy - SlashV2VNP : V2V -> NP' -> VPSlash -> VPSlash ; -- beg me to buy - ---2 Other ways of forming verb phrases - --- Verb phrases can also be constructed reflexively and from --- copula-preceded complements. - - ReflVP : VPSlash -> VP ; -- love himself - UseComp : Comp -> VP ; -- be warm - --- Passivization of two-place verbs is another way to use --- them. In many languages, the result is a participle that --- is used as complement to a copula ("is used"), but other --- auxiliary verbs are possible (Ger. "wird angewendet", It. --- "viene usato"), as well as special verb forms (Fin. "käytetään", --- Swe. "används"). --- --- *Note*. the rule can be overgenerating, since the $V2$ need not --- take a direct object. - - PassV2 : V2 -> VP ; -- be loved - --- Adverbs can be added to verb phrases. Many languages make --- a distinction between adverbs that are attached in the end --- vs. next to (or before) the verb. - - AdvVP : VP -> Adv -> VP ; -- sleep here - ExtAdvVP : VP -> Adv -> VP ; -- sleep , even though ... - AdVVP : AdV -> VP -> VP ; -- always sleep - - AdvVPSlash : VPSlash -> Adv -> VPSlash ; -- use (it) here - AdVVPSlash : AdV -> VPSlash -> VPSlash ; -- always use (it) - - VPSlashPrep : VP -> Prep' -> VPSlash ; -- live in (it) - - --- *Agents of passives* are constructed as adverbs with the --- preposition [Structural Structural.html]$.8agent_Prep$. - - ---2 Complements to copula - --- Adjectival phrases, noun phrases, and adverbs can be used. - - CompAP : AP -> Comp ; -- (be) small - CompNP : NP' -> Comp ; -- (be) the man - CompAdv : Adv -> Comp ; -- (be) here - CompCN : CN -> Comp ; -- (be) a man/men - --- Copula alone - - UseCopula : VP ; -- be -} diff --git a/src/api/CombinatorsGer.gf b/src/api/CombinatorsGer.gf index 6847da626..2fbed5a41 100644 --- a/src/api/CombinatorsGer.gf +++ b/src/api/CombinatorsGer.gf @@ -7,9 +7,9 @@ resource CombinatorsGer = Combinators - [appCN, appCNc] with (Constructors = ConstructorsGer) ** { oper -appCN : CN -> NP' -> NP' +appCN : CN -> NP -> NP = \cn,x -> mkNP the_Art (PossNP cn x) ; -appCNc : CN -> [NP'] -> NP' - = \cn,xs -> let np : NP' = mkNP and_Conj xs +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs in mkNP the_Art (PossNP cn np) ; } diff --git a/src/api/ConstructorsGer.gf b/src/api/ConstructorsGer.gf index d70f05be5..907bf90a0 100644 --- a/src/api/ConstructorsGer.gf +++ b/src/api/ConstructorsGer.gf @@ -1,3 +1,3 @@ --# -path=.:alltenses:prelude -resource ConstructorsGer = Constructors' with (Grammar = GrammarGer) ; +resource ConstructorsGer = Constructors with (Grammar = GrammarGer) ; diff --git a/src/api/SyntaxGer.gf b/src/api/SyntaxGer.gf index 206061f9c..441702885 100644 --- a/src/api/SyntaxGer.gf +++ b/src/api/SyntaxGer.gf @@ -1,4 +1,4 @@ --# -path=../abstract:.:alltenses:prelude: -instance SyntaxGer of Syntax' = ConstructorsGer, CatGer, StructuralGer, CombinatorsGer ; +instance SyntaxGer of Syntax = ConstructorsGer, CatGer, StructuralGer, CombinatorsGer ; diff --git a/src/german/AdjectiveGer.gf b/src/german/AdjectiveGer.gf index 540edb3cf..3504a8f07 100644 --- a/src/german/AdjectiveGer.gf +++ b/src/german/AdjectiveGer.gf @@ -1,4 +1,4 @@ -concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in { +concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { flags optimize=all_subs ; @@ -11,7 +11,7 @@ concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in { ext = [] } ; ComparA a np = - let nps = np.s ! False ! Nom ++ bigNP' np + let nps = np.s ! False ! Nom ++ bigNP np in { s = \\af => a.s ! Compar ! af ++ conjThan ++ nps ; isPre = True ; @@ -19,7 +19,7 @@ concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in { ext = [] } ; CAdvAP ad ap np = - let nps = np.s ! False ! Nom ++ bigNP' np in + let nps = np.s ! False ! Nom ++ bigNP np in ap ** { s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ nps ; isPre = False @@ -42,8 +42,8 @@ concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in { ComplA2 a np = let CExt = case a.c2.isPrep of { - isCase => ; - _ => <[], appPrepNP' a.c2 np> } -- HL: check 7/22 + isCase => ; + _ => <[], appPrepNP a.c2 np> } -- HL: check 7/22 in { s = a.s ! Posit ; isPre = True ; @@ -53,7 +53,7 @@ concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in { ReflA2 a = let - compl = appPrep' a.c2 (reflPron ! agrP3 Sg) ; + compl = appPrep a.c2 (reflPron ! agrP3 Sg) ; CExt = case a.c2.isPrep of {isCase => ; _ => <[], compl> } in { diff --git a/src/german/AdverbGer.gf b/src/german/AdverbGer.gf index 7f6310b99..29bf0d2bc 100644 --- a/src/german/AdverbGer.gf +++ b/src/german/AdverbGer.gf @@ -1,10 +1,10 @@ -concrete AdverbGer of Adverb' = CatGer ** open ResGer, Prelude in { +concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in { lin PositAdvAdj a = {s = a.s ! Posit ! APred} ; ComparAdvAdj cadv a np = - let nps = np.s ! False ! Nom ++ bigNP' np in + let nps = np.s ! False ! Nom ++ bigNP np in { s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ nps } ; @@ -12,7 +12,7 @@ concrete AdverbGer of Adverb' = CatGer ** open ResGer, Prelude in { s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub } ; - PrepNP prep np = {s = appPrepNP' prep np} ; + PrepNP prep np = {s = appPrepNP prep np} ; AdAdv = cc2 ; diff --git a/src/german/AllGer.gf b/src/german/AllGer.gf index 3788cab2e..ad643b202 100644 --- a/src/german/AllGer.gf +++ b/src/german/AllGer.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:../api:../prelude -concrete AllGer of AllGerAbs' = +concrete AllGer of AllGerAbs = LangGer, IrregGer, ---- ExtendGer, ---- to replace ExtraGer diff --git a/src/german/CatGer.gf b/src/german/CatGer.gf index 76feb4584..b0a5f5338 100644 --- a/src/german/CatGer.gf +++ b/src/german/CatGer.gf @@ -1,5 +1,5 @@ --# -path=.:../abstract:../common:../prelude -concrete CatGer of Cat' = +concrete CatGer of Cat = CommonX - [Tense,Temp] ** open ResGer, Prelude in { @@ -12,14 +12,14 @@ concrete CatGer of Cat' = S = {s : Order => Str} ; QS = {s : QForm => Str} ; RS = {s : RelGenNum => Str ; c : Case} ; - SSlash = {s : Order => Str} ** {c2 : Preposition'} ; + SSlash = {s : Order => Str} ** {c2 : Preposition} ; -- Sentence Cl = {s : Mood => ResGer.Tense => Anteriority => Polarity => Order => Str} ; ClSlash = { s : Mood => ResGer.Tense => Anteriority => Polarity => Order => Str ; - c2 : Preposition' + c2 : Preposition } ; Imp = {s : Polarity => ImpForm => Str} ; @@ -58,35 +58,23 @@ concrete CatGer of Cat' = adv : Str ; -- Haus [adv auf dem Hügel] g : Gender } ; --- NP = ResGer.NP ; Pron = {s : NPForm => Str ; a : Agr} ; -{- - Det, DAP = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ; - Quant = { - s : Bool => Number => Gender => PCase => Str ; -- Bool is True if a cardinal number is present - sp : Bool => Number => Gender => PCase => Str ; - a : Adjf ; - aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde" - } ; - Predet = { - s : Number => Gender => PCase => Str ; - c : {p : Str ; k : PredetCase} ; - a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ... - } ; --} - -- HL: To reduce PCase to Case: - NP' = ResGer.NP' ; - Det' = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped - n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ; - DAP' = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ; - Quant' = { -- HL 7/2022: first Bool = True if used to glue in Sg with preposition - s : Bool => Bool => Number => Gender => Case => Str ; -- second Bool is True if a cardinal number is present - sp : Bool => Bool => Number => Gender => Case => Str ; + + -- simplified PCase to Case in NP, Det, DAP, Quant, Predet HL 8/22 + NP = ResGer.NP ; + Det = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped HL 8/22 + n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ; + DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ; + + -- HL 7/2022: first Bool = True if used to glue in Sg with preposition + -- second Bool is True if a cardinal number is present + Quant = { + s, sp : Bool => Bool => Number => Gender => Case => Str ; a : Adjf ; aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde" hasDefArt : Bool } ; - Predet' = { + Predet = { s : Number => Gender => Case => Str ; c : {p : Str ; k : PredetCase'} ; a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ... @@ -105,23 +93,22 @@ concrete CatGer of Cat' = Conj = {s1,s2 : Str ; n : Number} ; Subj = {s : Str} ; --- Prep = Preposition ; - Prep' = Preposition' ; + Prep = Preposition ; -- Open lexical classes, e.g. Lexicon V, VA, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ; VV = Verb ** {isAux : Bool} ; - V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition'} ; - V2V = Verb ** {c2 : Preposition' ; isAux : Bool ; objCtrl : Bool} ; - V3 = Verb ** {c2, c3 : Preposition'} ; + V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ; + V2V = Verb ** {c2 : Preposition ; isAux : Bool ; objCtrl : Bool} ; + V3 = Verb ** {c2, c3 : Preposition} ; A = {s : Degree => AForm => Str} ; - A2 = {s : Degree => AForm => Str ; c2 : Preposition'} ; + A2 = {s : Degree => AForm => Str ; c2 : Preposition} ; N = ResGer.Noun ; - N2 = ResGer.Noun ** {c2 : Preposition'} ; - N3 = ResGer.Noun ** {c2,c3 : Preposition'} ; + N2 = ResGer.Noun ** {c2 : Preposition} ; + N3 = ResGer.Noun ** {c2,c3 : Preposition} ; PN = {s : Case => Str; g : Gender} ; -- tense with possibility to choose conjunctive forms @@ -130,8 +117,7 @@ concrete CatGer of Cat' = Tense = {s : Str ; t : ResGer.Tense ; m : Mood} ; linref --- NP = \np -> np.s!(NPC Nom) ++ np.ext ++ np.rc ; -- HL 6/2019 - NP' = \np -> np.s ! False ! Nom ++ np.ext ++ np.rc ; -- HL 7/2022 Bool added + NP = \np -> np.s ! False ! Nom ++ np.ext ++ np.rc ; -- HL 7/2022 Bool added CN = \cn -> cn.s ! Strong ! Pl ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Pl ; SSlash = \ss -> ss.s ! Main ++ ss.c2.s ! GPl ; @@ -152,7 +138,7 @@ concrete CatGer of Cat' = Conj = \c -> c.s1 ++ c.s2 ; - Det' = \det -> det.s ! False ! Masc ! Nom ; - Prep' = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ; - _ => prep.s ! GPl } ; + Det = \det -> det.s ! False ! Masc ! Nom ; + Prep = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ; + _ => prep.s ! GPl } ; } diff --git a/src/german/ConjunctionGer.gf b/src/german/ConjunctionGer.gf index 826337188..aaf5fb234 100644 --- a/src/german/ConjunctionGer.gf +++ b/src/german/ConjunctionGer.gf @@ -1,4 +1,4 @@ -concrete ConjunctionGer of Conjunction' = +concrete ConjunctionGer of Conjunction = CatGer ** open ResGer, Coordination, Prelude in { flags optimize=all_subs ; @@ -40,21 +40,21 @@ concrete ConjunctionGer of Conjunction' = BaseAdv = twoSS ; ConsAdv = consrSS comma ; - BaseNP' x y = { - s1 = \\c => x.s ! False ! c ++ bigNP' x ; - s2 = \\c => y.s ! False ! c ++ bigNP' y ; + BaseNP x y = { + s1 = \\c => x.s ! False ! c ++ bigNP x ; + s2 = \\c => y.s ! False ! c ++ bigNP y ; a = conjAgr x.a y.a } ; - ConsNP' xs x = { - s1 = \\c => xs.s ! False ! c ++ bigNP' xs ++ comma ++ x.s1 ! c ; + ConsNP xs x = { + s1 = \\c => xs.s ! False ! c ++ bigNP xs ++ comma ++ x.s1 ! c ; s2 = x.s2 ; a = conjAgr xs.a x.a } ; - BaseAP x y = { + BaseAP x y = lin AP { s1 = bigAP x ; s2 = bigAP y ; isPre = andB x.isPre y.isPre ; c = <[],[]> ; ext = []} ; - ConsAP xs x = { + ConsAP xs x = lin AP { s1 = \\a => (bigAP xs) ! a ++ comma ++ x.s1 ! a ; s2 = x.s2 ; isPre = andB x.isPre xs.isPre ; @@ -62,12 +62,12 @@ concrete ConjunctionGer of Conjunction' = ext = []} ; BaseRS x y = twoTable RelGenNum x y ** {c = y.c} ; ConsRS xs x = consrTable RelGenNum comma xs x ** {c = xs.c} ; - BaseCN x y = { + BaseCN x y = lin CN { s1 = bigCN x ; s2 = bigCN y ; g = x.g ; --- gender of first CN, used e.g. in articles } ; - ConsCN x xs = { + ConsCN x xs = lin CN { s1 = \\a,n,c => bigCN x ! a ! n ! c ++ comma ++ xs.s1 ! a ! n ! c ; s2 = xs.s2 ; g = x.g ; --- gender of first CN, used e.g. in articles @@ -77,8 +77,7 @@ concrete ConjunctionGer of Conjunction' = lincat [S] = {s1,s2 : Order => Str} ; [Adv] = {s1,s2 : Str} ; --- [NP] = {s1,s2 : PCase => Str ; a : Agr} ; - [NP'] = {s1,s2 : Case => Str ; a : Agr} ; + [NP] = {s1,s2 : Case => Str ; a : Agr} ; [AP] = {s1,s2 : AForm => Str ; isPre : Bool; c : Str * Str ; ext : Str} ; [RS] = {s1,s2 : RelGenNum => Str ; c : Case} ; [CN] = {s1,s2 : Adjf => Number => Case => Str ; g : Gender} ; diff --git a/src/german/ConstructionGer.gf b/src/german/ConstructionGer.gf index 72bdf6065..9c71d7793 100644 --- a/src/german/ConstructionGer.gf +++ b/src/german/ConstructionGer.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract -concrete ConstructionGer of Construction' = CatGer ** +concrete ConstructionGer of Construction = CatGer ** open SyntaxGer, SymbolicGer, ParadigmsGer, (L = LexiconGer), (E = ExtraGer), (G = GrammarGer), (I = IrregGer), (R = ResGer), (N = NounGer), Prelude in { flags coding=utf8 ; @@ -63,9 +63,9 @@ lin monthAdv m = SyntaxGer.mkAdv inDat_Prep (mkNP the_Det m) ; yearAdv y = SyntaxGer.mkAdv (mkPrep "im Jahr" dative) y ; ---- - dayMonthAdv d m = ParadigmsGer.mkAdv ("am" ++ d.s ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom) ; -- am 17 Mai + dayMonthAdv d m = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom) ; -- am 17 Mai monthYearAdv m y = SyntaxGer.mkAdv inDat_Prep (mkNP the_Det (mkCN m y)) ; -- im Mai 2012 - dayMonthYearAdv d m y = ParadigmsGer.mkAdv ("am" ++ d.s ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom ++ y.s ! accusative) ; -- am 17 Mai 2013 + dayMonthYearAdv d m y = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom ++ y.s ! False ! accusative) ; -- am 17 Mai 2013 intYear = symb ; intMonthday = symb ; diff --git a/src/german/ExtraGer.gf b/src/german/ExtraGer.gf index 7bdfe46d9..58e83151d 100644 --- a/src/german/ExtraGer.gf +++ b/src/german/ExtraGer.gf @@ -1,4 +1,4 @@ -concrete ExtraGer of ExtraGerAbs' = CatGer ** +concrete ExtraGer of ExtraGerAbs = CatGer ** open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer) in { flags coding=utf8 ; @@ -49,7 +49,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** EmptyRelSlash slash = { s = \\m,t,a,p,gn => - appPrep' slash.c2 (relPron ! gn) ++ slash.s ! m ! t ! a ! p ! Sub ; + appPrep slash.c2 (relPron ! gn) ++ slash.s ! m ! t ! a ! p ! Sub ; c = slash.c2.c } ; @@ -67,7 +67,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** Pass3V3 v = -- HL 7/19 let bekommenPass : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen") in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) ** - { c1 = PrepNom' ; c2 = v.c2 ; objCtrl = False } ; + { c1 = PrepNom ; c2 = v.c2 ; objCtrl = False } ; PastPartAP vp = let a = agrP3 Sg in { @@ -80,7 +80,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** PastPartAgentAP vp np = let a = agrP3 Sg ; - agent = appPrepNP' P.von_Prep np + agent = appPrepNP P.von_Prep np in { s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ agent ++ vp.inf.inpl.p2 @@ -101,7 +101,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** PredVPS np vpi = let - subj = np.s ! False ! Nom ++ bigNP' np ; + subj = np.s ! False ! Nom ++ bigNP np ; agr = np.a ; in { s = \\o => @@ -175,7 +175,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** RNP = {s : Agr => Case => Str} ; lin ReflRNP vps rnp = - insertObj (\\a => appPrep' vps.c2 (rnp.s ! a)) vps ; + insertObj (\\a => appPrep vps.c2 (rnp.s ! a)) vps ; ReflPoss num cn = {s = \\a,c => num.s ! cn.g ! c ++ possPron a num.n cn.g c ++ cn.s ! adjfCase Strong c ! num.n ! c} ; @@ -202,7 +202,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** lin FocObj np cl = - let n = appPrepNP' cl.c2 np in mkFoc n cl ; + let n = appPrepNP cl.c2 np in mkFoc n cl ; FocAdv adv cl = mkFoc adv.s cl ; @@ -214,7 +214,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** -- "treu ist sie ihm" -- "froh ist sie dass er da ist" -- "stolz ist sie auf ihn" - subj = mkSubj' np vp.c1 ; + subj = mkSubj np vp.c1 ; cl = mkClause subj.p1 subj.p2 vp in mkFoc adj cl ; @@ -239,7 +239,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** -- "es wird gelacht"; generating formal sentences lincat - FClause = ResGer.VP ** {subj : ResGer.NP'} ; + FClause = ResGer.VP ** {subj : ResGer.NP} ; lin VPass v = @@ -250,7 +250,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** AdvFor adv fcl = fcl ** {a2 = adv.s} ; FtoCl cl = - let subj = mkSubj' cl.subj cl.c1 + let subj = mkSubj cl.subj cl.c1 in DisToCl subj.p1 subj.p2 cl ; @@ -259,7 +259,7 @@ concrete ExtraGer of ExtraGerAbs' = CatGer ** mkFoc : Str -> Cl -> Foc = \focus, cl -> lin Foc {s = \\m,t,a,p => focus ++ cl.s ! m ! t ! a ! p ! Inv} ; - esSubj : CatGer.NP' = lin NP' { + esSubj : CatGer.NP = lin NP { s = \\_,_ => "es" ; rc, ext = [] ; a = Ag Neutr Sg P3 ; diff --git a/src/german/GrammarGer.gf b/src/german/GrammarGer.gf index 1c0ed02a1..c4651534d 100644 --- a/src/german/GrammarGer.gf +++ b/src/german/GrammarGer.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:prelude -concrete GrammarGer of Grammar' = +concrete GrammarGer of Grammar = NounGer, VerbGer, AdjectiveGer, diff --git a/src/german/IdiomGer.gf b/src/german/IdiomGer.gf index 4f69772f6..9a5318215 100644 --- a/src/german/IdiomGer.gf +++ b/src/german/IdiomGer.gf @@ -1,4 +1,4 @@ -concrete IdiomGer of Idiom' = CatGer ** +concrete IdiomGer of Idiom = CatGer ** open MorphoGer, ParadigmsGer, Prelude in { flags optimize=all_subs ; @@ -10,7 +10,7 @@ concrete IdiomGer of Idiom' = CatGer ** CleftNP np rs = mkClause "es" (agrP3 Sg) (insertExtrapos (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ---- - (insertObj (\\_ => (np.s ! False ! rs.c ++ bigNP' np)) (predV MorphoGer.sein_V))) ; --HL + (insertObj (\\_ => (np.s ! False ! rs.c ++ bigNP np)) (predV MorphoGer.sein_V))) ; --HL CleftAdv ad s = mkClause "es" (agrP3 Sg) (insertExtrapos (conjThat ++ s.s ! Sub) @@ -19,7 +19,7 @@ concrete IdiomGer of Idiom' = CatGer ** ExistNP np = mkClause "es" (agrP3 Sg) - (insertObj (\\_ => appPrep' geben.c2 (np.s ! False) ++ bigNP' np) + (insertObj (\\_ => appPrep geben.c2 (np.s ! False) ++ bigNP np) (predV geben)) ; ExistIP ip = { @@ -35,8 +35,7 @@ concrete IdiomGer of Idiom' = CatGer ** ExistNPAdv np adv= mkClause "es" (agrP3 Sg) --- (insertAdv adv.s (insertObj (\\_ => appPrep geben.c2 np.s ++ bigNP np) - (insertAdv adv.s (insertObj (\\_ => appPrep' geben.c2 (np.s ! False) ++ bigNP' np) + (insertAdv adv.s (insertObj (\\_ => appPrep geben.c2 (np.s ! False) ++ bigNP np) (predV geben))) ; ExistIPAdv ip adv = { @@ -59,14 +58,14 @@ concrete IdiomGer of Idiom' = CatGer ** } ; ImpP3 np vp = { - s = (mkClause ((mkSubj' np vp.c1).p1) np.a vp).s ! + s = (mkClause ((mkSubj np vp.c1).p1) np.a vp).s ! MConjunct ! Pres ! Simul ! Pos ! Inv } ; SelfAdvVP vp = insertAdv "selbst" vp ; SelfAdVVP vp = insertAdv "selbst" vp ; SelfNP np = np ** { - s = \\_,c => np.s ! False ! c ++ "selbst" ++ bigNP' np ; + s = \\_,c => np.s ! False ! c ++ "selbst" ++ bigNP np ; isPron = False ; } ; diff --git a/src/german/LangGer.gf b/src/german/LangGer.gf index 2fc7921c2..f6358abc0 100644 --- a/src/german/LangGer.gf +++ b/src/german/LangGer.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:../api:../prelude -concrete LangGer of Lang' = +concrete LangGer of Lang = GrammarGer, LexiconGer -- ,ConstructionGer diff --git a/src/german/MakeStructuralGer.gf b/src/german/MakeStructuralGer.gf index 474601023..caacdb0f3 100644 --- a/src/german/MakeStructuralGer.gf +++ b/src/german/MakeStructuralGer.gf @@ -11,14 +11,14 @@ oper {s = \\_,_,_ => s ; lock_IQuant = <>} ; mkPredet = overload { - mkPredet : A -> Predet' = \a -> - lin Predet' { + mkPredet : A -> Predet = \a -> + lin Predet { s = appAdj' a ; c = noCase' ; a = PAgNone } ; - mkPredet : A -> Str -> Case -> Bool -> Number -> Predet' = \a,p,c,b,n -> - lin Predet' { + mkPredet : A -> Str -> Case -> Bool -> Number -> Predet = \a,p,c,b,n -> + lin Predet { s = appAdj' a ; c = {p = p ; k = PredCase' c} ; a = case b of {True => PAg n ; _ => PAgNone} @@ -26,11 +26,11 @@ oper } ; -- e.g. das selbe - mmkQuant : Quant' -> A -> Quant' = \q,a -> q ** { + mmkQuant : Quant -> A -> Quant = \q,a -> q ** { s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c ++ a.s ! Posit ! agrAdj g q.a n c } ; -- e.g. derjenige - mmbQuant : Quant' -> A -> Quant' = \q,a -> q ** { + mmbQuant : Quant -> A -> Quant = \q,a -> q ** { s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c + a.s ! Posit ! agrAdj g q.a n c } ; diff --git a/src/german/MorphoGer.gf b/src/german/MorphoGer.gf index c685de061..251e9e920 100644 --- a/src/german/MorphoGer.gf +++ b/src/german/MorphoGer.gf @@ -17,7 +17,7 @@ oper -- For $StructuralGer$. - mkPrep : Str -> Case -> Preposition' = \s,c -> + mkPrep : Str -> Case -> Preposition = \s,c -> {s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep} ; nameNounPhrase' : Gender -> {s : Case => Str} -> {s : Bool => Case => Str ; diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index d4190da52..470204179 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -1,5 +1,5 @@ --# -path=.:../abstract:../common: -concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in { +concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { flags optimize=all_subs ; @@ -183,18 +183,18 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in { } ; ComplN2 f x = { - s = \\_,n,c => f.s ! n ! c ++ appPrepNP' f.c2 x ; + s = \\_,n,c => f.s ! n ! c ++ appPrepNP f.c2 x ; g = f.g ; rc = \\_ => [] ; ext,adv = [] } ; ComplN3 f x = { - s = \\n,c => f.s ! n ! c ++ appPrepNP' f.c2 x ; - co = f.co ++ appPrepNP' f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2 + s = \\n,c => f.s ! n ! c ++ appPrepNP f.c2 x ; + co = f.co ++ appPrepNP f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2 uncap = { - s = \\n,c => f.uncap.s ! n ! c ++ appPrepNP' f.c2 x ; - co = f.uncap.co ++ appPrepNP' f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2 + s = \\n,c => f.uncap.s ! n ! c ++ appPrepNP f.c2 x ; + co = f.uncap.co ++ appPrepNP f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2 } ; g = f.g ; c2 = f.c3 ; @@ -231,15 +231,15 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in { AdvCN cn a = cn ** {adv = cn.adv ++ a.s} ; ApposCN cn np = let g = cn.g in cn ** { - s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! c ++ bigNP' np } ; + s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! c ++ bigNP np } ; -- PossNP cn np = cn ** { -- s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat ++ bigNP np } ; PossNP cn np = cn ** { - s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep' vonDat' (np.s ! False) ++ bigNP' np } ; -- HL, ad hoc + s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ bigNP np } ; -- HL, ad hoc PartNP cn np = case np.w of { - WPron' => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep' vonDat' (np.s ! False) ++ np.rc} ; + WPron' => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ np.rc} ; _ => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! Gen} -- HL 7/2022, ad hoc }; -- glass of wine @@ -247,7 +247,7 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in { -- det or numeral? np or rather (DefArt +) cn? drei (einiger Kinder) ? let g = genderAgr np.a in { - s = \\b,c => det.s ! b ! g ! c ++ appPrepNP' vonDat' np ++ bigNP' np ; + s = \\b,c => det.s ! b ! g ! c ++ appPrepNP vonDat np ++ bigNP np ; a = agrgP3 g det.n ; w = case det.isDef of { True => WLight' ; _ => WHeavy' } ; rc = np.rc ; diff --git a/src/german/ParadigmsGer.gf b/src/german/ParadigmsGer.gf index 70b920ce8..b7b773459 100644 --- a/src/german/ParadigmsGer.gf +++ b/src/german/ParadigmsGer.gf @@ -102,7 +102,7 @@ mkN : overload { mkN2 : overload { mkN2 : Str -> N2 ; --% mkN2 : N -> N2 ; -- noun + von - mkN2 : N -> Prep' -> N2 -- noun + other preposition + mkN2 : N -> Prep -> N2 -- noun + other preposition } ; -- Use the function $mkPrep$ or see the section on prepositions below to @@ -111,7 +111,7 @@ mkN : overload { -- -- Three-place relational nouns ("die Verbindung von x nach y") need two prepositions. - mkN3 : N -> Prep' -> Prep' -> N3 ; -- noun + two prepositions + mkN3 : N -> Prep -> Prep -> N3 ; -- noun + two prepositions --3 Proper names and noun phrases -- @@ -168,7 +168,7 @@ mkN : overload { -- Two-place adjectives are formed by adding a preposition to an adjective. - mkA2 : A -> Prep' -> A2 ; -- e.g. teilbar + durch + mkA2 : A -> Prep -> A2 ; -- e.g. teilbar + durch --2 Adverbs @@ -182,28 +182,28 @@ mkN : overload { -- A preposition is formed from a string and a case. mkPrep : overload { - mkPrep : Str -> Case -> Prep' ; -- e.g. "durch" + accusative - mkPrep : Case -> Str -> Prep' ; -- postposition - mkPrep : Str -> Case -> Str -> Prep' ; -- both sides + 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: -- e.g. "auf" "auf den" "auf die" "aufs" + accusative - mkPrep : Str -> Str -> Str -> Str-> Case -> Prep' ; - mkPrep : Case -> Prep' ; -- convert case to preposition + mkPrep : Str -> Str -> Str -> Str-> Case -> Prep ; + mkPrep : Case -> Prep ; -- convert case to preposition } ; -- Often just a case with the empty string is enough. - accPrep : Prep' ; -- no string, just accusative case - datPrep : Prep' ; -- no string, just dative case - genPrep : Prep' ; -- no string, just genitive case + accPrep : Prep ; -- no string, just accusative case + datPrep : Prep ; -- no string, just dative case + genPrep : Prep ; -- no string, just genitive case -- 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 - anDat_Prep : Prep' ; -- an + dative, with contraction am - inDat_Prep : Prep' ; -- in + dative, with contraction im - inAcc_Prep : Prep' ; -- in + accusative, with contraction ins + 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 + inAcc_Prep : Prep ; -- in + accusative, with contraction ins --2 Verbs @@ -273,7 +273,7 @@ mkV2 : overload { -- Two-place verbs with a preposition. - mkV2 : V -> Prep' -> V2 ; -- preposition for complement + mkV2 : V -> Prep -> V2 ; -- preposition for complement -- Two-place verbs with object in the given case. @@ -287,11 +287,11 @@ mkV2 : overload { -- 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) + dirV3 : V -> Prep -> V3 ; -- senden + acc + nach (preposition on second arg) 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 + über } ; --3 Other complement patterns @@ -314,15 +314,15 @@ mkV2 : overload { mkV2A : overload { mkV2A : V -> V2A ; - mkV2A : V -> Prep' -> V2A ; + mkV2A : V -> Prep -> V2A ; } ; mkV2S : overload { mkV2S : V -> V2S ; - mkV2S : V -> Prep' -> V2S ; + mkV2S : V -> Prep -> V2S ; } ; mkV2Q : overload { mkV2Q : V -> V2Q ; - mkV2Q : V -> Prep' -> V2Q ; + mkV2Q : V -> Prep -> V2Q ; } ; @@ -338,9 +338,9 @@ mkV2 : overload { mkAS : A -> AS ; --% - mkA2S : A -> Prep' -> A2S ; --% + mkA2S : A -> Prep -> A2S ; --% mkAV : A -> AV ; --% - mkA2V : A -> Prep' -> A2V ; --% + mkA2V : A -> Prep -> A2V ; --% -- Notice: categories $AS, A2S, AV, A2V$ are just $A$, -- and the second argument is given as an adverb. Likewise @@ -447,11 +447,11 @@ mkV2 : overload { mkN2 = overload { mkN2 : Str -> N2 = \s -> vonN2 (regN s) ; mkN2 : N -> N2 = vonN2 ; - mkN2 : N -> Prep' -> N2 = mmkN2 + mkN2 : N -> Prep -> N2 = mmkN2 } ; - mmkN2 : N -> Prep' -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ; + mmkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ; vonN2 : N -> N2 = \n -> n ** {c2 = von_Prep ; lock_N2 = <>} ; mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ; @@ -502,17 +502,17 @@ mkV2 : overload { mkAdv s = {s = s ; lock_Adv = <>} ; mkPrep = overload { - mkPrep : Str -> Case -> Prep' = \s,c -> - {s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep ; lock_Prep' = <>} ; - 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 -> + mkPrep : Str -> Case -> Prep = \s,c -> + {s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; + 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 = 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' = <>} ; + s2 = [] ; c = c ; isPrep = isPrepDefArt ; lock_Prep = <>} ; + mkPrep : Case -> Prep = \c -> + {s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>} ; } ; accPrep = mkPrep accusative ; @@ -590,7 +590,7 @@ mkV2 : overload { mkV3 = overload { mkV3 : V -> V3 = \v -> lin V3 (v ** {c2 = accPrep ; c3 = datPrep}) ; - mkV3 : V -> Prep' -> Prep' -> V3 + mkV3 : V -> Prep -> Prep -> V3 = \v,c,d -> lin V3 (v ** {c2 = c ; c3 = d}) ; } ; @@ -611,38 +611,38 @@ mkV2 : overload { mkV2V = overload { -- default: object-control 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 = \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 -> 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 = \v -> dirV2 v ** {isAux = False ; lock_V2Q = <>} ; - mkV2Q : V -> Prep' -> V2Q + mkV2Q : V -> Prep -> V2Q = \v,p -> prepV2 v p ** {isAux = False ; lock_V2Q = <>} ; } ; mkVA = overload { mkVA : V -> VA = \v -> lin VA (dirV2 v) ; - mkVA : V -> Prep' -> VA = \v,p -> lin VA (v ** {c2 = p}) ; + mkVA : V -> Prep -> VA = \v,p -> lin VA (v ** {c2 = p}) ; } ; mkAS v = v ** {lock_A = <>} ; @@ -713,7 +713,7 @@ mkV2 : overload { }; - prepV2 : V -> Prep' -> V2 ; + prepV2 : V -> Prep -> V2 ; dirV2 : V -> V2 ; @@ -722,7 +722,7 @@ mkV2 : overload { mkV2 = overload { mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; mkV2 : V -> V2 = dirV2 ; - mkV2 : V -> Prep' -> V2 = prepV2; + mkV2 : V -> Prep -> V2 = prepV2; mkV2 : V -> Case -> V2 = \v,c -> prepV2 v (mkPrep c) ; } ; diff --git a/src/german/PhraseGer.gf b/src/german/PhraseGer.gf index 8a0512c38..36c1d4e32 100644 --- a/src/german/PhraseGer.gf +++ b/src/german/PhraseGer.gf @@ -1,5 +1,5 @@ --# -path=.:../abstract:../common:prelude -- HL -concrete PhraseGer of Phrase' = CatGer ** open Prelude, ResGer in { +concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in { flags optimize=all_subs ; @@ -14,7 +14,7 @@ concrete PhraseGer of Phrase' = CatGer ** open Prelude, ResGer in { UttIP ip = {s = ip.s ! Nom} ; --- Acc also UttIAdv iadv = iadv ; - UttNP np = {s = np.s ! False ! Nom ++ bigNP' np} ; + UttNP np = {s = np.s ! False ! Nom ++ bigNP np} ; UttVP vp = {s = useInfVP True vp} ; -- without zu UttAdv adv = adv ; UttCN n = {s = n.s ! Strong ! Sg ! Nom ++ n.adv ++ n.ext ++ n.rc ! Sg} ; @@ -26,6 +26,6 @@ concrete PhraseGer of Phrase' = CatGer ** open Prelude, ResGer in { PConjConj conj = ss (conj.s2) ; NoVoc = {s = []} ; - VocNP np = {s = "," ++ np.s ! False ! Nom ++ bigNP' np} ; + VocNP np = {s = "," ++ np.s ! False ! Nom ++ bigNP np} ; } diff --git a/src/german/QuestionGer.gf b/src/german/QuestionGer.gf index 86b7bf7cd..50890db2f 100644 --- a/src/german/QuestionGer.gf +++ b/src/german/QuestionGer.gf @@ -1,4 +1,4 @@ -concrete QuestionGer of Question' = CatGer ** open ResGer in { +concrete QuestionGer of Question = CatGer ** open ResGer in { flags optimize=all_subs ; @@ -28,8 +28,7 @@ concrete QuestionGer of Question' = CatGer ** open ResGer in { s = \\m,t,a,p => let cls = slash.s ! m ! t ! a ! p ; --- who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ; - who = appPrep' slash.c2 ip.s ; + who = appPrep slash.c2 ip.s ; in table { QDir => who ++ cls ! Inv ; QIndir => who ++ cls ! Sub @@ -51,7 +50,7 @@ concrete QuestionGer of Question' = CatGer ** open ResGer in { s = \\m,t,a,p => let vp = predV sein_V ** {ext = icomp.ext}; - subj = mkSubj' np vp.c1 ; + subj = mkSubj np vp.c1 ; cls = (mkClause subj.p1 subj.p2 vp).s ! m ! t ! a ! p ; why = icomp.s ! np.a in table { @@ -61,7 +60,7 @@ concrete QuestionGer of Question' = CatGer ** open ResGer in { } ; PrepIP p ip = { - s = appPrep' p ip.s ; + s = appPrep p ip.s ; } ; AdvIP ip adv = { diff --git a/src/german/RelativeGer.gf b/src/german/RelativeGer.gf index a992e769a..f961cb121 100644 --- a/src/german/RelativeGer.gf +++ b/src/german/RelativeGer.gf @@ -1,4 +1,4 @@ -concrete RelativeGer of Relative' = CatGer ** open Prelude, ResGer in { +concrete RelativeGer of Relative = CatGer ** open Prelude, ResGer in { flags optimize=all_subs ; @@ -28,16 +28,12 @@ concrete RelativeGer of Relative' = CatGer ** open Prelude, ResGer in { RelSlash rp slash = { s = \\m,t,a,p,gn => --- appPrep slash.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++ - appPrep' slash.c2 (rp.s ! gn) ++ - slash.s ! m ! t ! a ! p ! Sub ; --- c = (prepC slash.c2.c).c + appPrep slash.c2 (rp.s ! gn) ++ slash.s ! m ! t ! a ! p ! Sub ; c = slash.c2.c } ; FunRP p np rp = { --- s = \\gn,c => np.s ! NPC c ++ appPrep p (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ; - s = \\gn,c => np.s ! False ! c ++ appPrep' p (rp.s ! gn) ; + s = \\gn,c => np.s ! False ! c ++ appPrep p (rp.s ! gn) ; a = RAg (numberAgr np.a) (personAgr np.a) } ; diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index d9ac934cb..e474a6892 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -228,7 +228,7 @@ resource ResGer = ParamX ** open Prelude in { g : Gender } ; - NP' : Type = { -- HL 7/22: Bool = True if DefArt is dropped to combine with prep of type isPrepDefArt + NP : Type = { -- HL 7/22: Bool = True if DefArt is dropped to combine with prep of type isPrepDefArt s : Bool => Case => Str ; rc : Str ; -- die Frage , [rc die ich gestellt habe] ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...] @@ -405,18 +405,18 @@ resource ResGer = ParamX ** open Prelude in { PrepType = isCase | isPrep | isPrepDefArt ; oper - Preposition' : Type = {s : GenNum => Str ; s2:Str ; c : Case ; isPrep : PrepType} ; + Preposition : Type = {s : GenNum => Str ; s2:Str ; c : Case ; isPrep : PrepType} ; - isaCase : Preposition' -> Bool = \p -> case p.isPrep of {isCase => True ; _ => False} ; - isaPrep : Preposition' -> Bool = \p -> case p.isPrep of {isPrep => True ; _ => False} ; - isaPrepDefArt : Preposition' -> Bool = \p -> case p.isPrep of {isPrepDefArt => True ; _ => False} ; + isaCase : Preposition -> Bool = \p -> case p.isPrep of {isCase => True ; _ => False} ; + isaPrep : Preposition -> Bool = \p -> case p.isPrep of {isPrep => True ; _ => False} ; + isaPrepDefArt : Preposition -> Bool = \p -> case p.isPrep of {isPrepDefArt => True ; _ => False} ; -- To apply a preposition to a complement. - appPrep' : Preposition' -> (Case => Str) -> Str = \prep,arg -> + appPrep : Preposition -> (Case => Str) -> Str = \prep,arg -> prep.s ! GPl ++ arg ! prep.c ++ prep.s2 ; - appPrepNP' : Preposition' -> NP' -> Str = \prep,np -> + appPrepNP : Preposition -> NP -> Str = \prep,np -> let g = (genderAgr np.a) ; n = (numberAgr np.a) ; @@ -428,27 +428,36 @@ resource ResGer = ParamX ** open Prelude in { prep.s ! (GSg g) ++ nps ++ np.ext ++ prep.s2 ++ np.rc ; _ => prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc } ; - - bigNP' : NP' -> Str = \np -> np.ext ++ np.rc ; +{- + -- Simplify to test the effect on grammar compilation complexity (without SlashV2VNP): + -- with glues = False: 27096 msec, 3,2M VerbGer.gfo, 854K SentenceGer.gfo + -- and SlashV2VNP:102597 msec, 16 M VerbGer.gfo, 854K SentenceGer.gfo (good!) + appPrepNP : Preposition -> NP -> Str = \prep,np -> + let + glues = False ; + nps = np.s ! glues ! prep.c + in prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc ; +-} + bigNP : NP -> Str = \np -> np.ext ++ np.rc ; -- To build a preposition from just a case. -- HL 9/19: moved to mkPrep in ParadigmsGer - PrepNom' : Preposition' = {s = \\_ => []; isPrep = isCase ; c = Nom ; s2 = []} ; + PrepNom : Preposition = {s = \\_ => []; isPrep = isCase ; c = Nom ; s2 = []} ; - vonDat' : Preposition' = {s=table{GPl => "von" ; GSg Fem => "von der"; _ => "vom"}; - s2=[]; c=Dat; isPrep=isPrepDefArt} ; + vonDat : Preposition = {s=table{GPl => "von" ; GSg Fem => "von der"; _ => "vom"}; + s2=[]; c=Dat; isPrep=isPrepDefArt} ; -- for testing: - Dat' : Preposition' = {s = \\_ => []; s2 = []; c=Dat; isPrep=isCase} ; - mit' : Preposition' = {s = \\_ => "zusammen mit"; s2 = []; c=Dat; isPrep=isPrep} ; + Dat' : Preposition = {s = \\_ => []; s2 = []; c=Dat; isPrep=isCase} ; + mit' : Preposition = {s = \\_ => "zusammen mit"; s2 = []; c=Dat; isPrep=isPrep} ; - zuDat' : Preposition' = {s=\\_ => "zu"; s2="herein"; c=Dat; isPrep=isPrep} ; - zum' : Preposition' = {s= table{GPl => "zu"; GSg Fem =>"zur"; _ => "zum"}; + zuDat' : Preposition = {s=\\_ => "zu"; s2="herein"; c=Dat; isPrep=isPrep} ; + zum' : Preposition = {s= table{GPl => "zu"; GSg Fem =>"zur"; _ => "zum"}; s2="herein"; c=Dat; isPrep=isPrepDefArt} ; - inDat' : Preposition' = {s= \\_ => "in" ; s2="drin"; c=Dat; isPrep=isPrep} ; - im' : Preposition' = {s= table{GPl => "in"; GSg Fem=>"in der"; _ =>"im"}; + inDat' : Preposition = {s= \\_ => "in" ; s2="drin"; c=Dat; isPrep=isPrep} ; + im' : Preposition = {s= table{GPl => "in"; GSg Fem=>"in der"; _ =>"im"}; s2="drin"; c=Dat; isPrep=isPrepDefArt} ; - inAcc' : Preposition' = {s=\\_ => "in"; s2="hinein"; c=Acc; isPrep=isPrep} ; - ins' : Preposition' = {s=table{GPl => "in"; GSg Masc=>"in den"; GSg Fem=>"in die"; GSg Neutr=>"ins"}; + inAcc' : Preposition = {s=\\_ => "in"; s2="hinein"; c=Acc; isPrep=isPrep} ; + ins' : Preposition = {s=table{GPl => "in"; GSg Masc=>"in den"; GSg Fem=>"in die"; GSg Neutr=>"ins"}; s2="hinein"; c=Acc; isPrep=isPrepDefArt} ; -- Pronouns and articles @@ -558,9 +567,9 @@ resource ResGer = ParamX ** open Prelude in { ext : Str ; -- sentential complement of V(2)S, V(2)Q, e.g. dass|ob sie kommt inf : {inpl: (Agr => Str)*Str ; -- infinitival complement of V(2)V HL 3/2022 extr: (Agr => Str)} ; -- e.g. ihn [] versuchen (lasse) [, ihr zu helfen] - c1 : Preposition' -- case of subject + c1 : Preposition -- case of subject } ; - VPSlash = VP ** {c2 : Preposition' ; objCtrl : Bool} ; -- HL 3/2019 objCtr added + VPSlash = VP ** {c2 : Preposition ; objCtrl : Bool} ; -- HL 3/2019 objCtr added -- objCtrl distinguishes object-control from subject-control verb v:V2V in VP.s: -- if True, reflexives in vp.inf and vp.nn have to agree with c2-object (added @@ -622,7 +631,7 @@ resource ResGer = ParamX ** open Prelude in { predV : Verb -> VP = predVGen False ; - predVc : Verb ** {c2 : Preposition'} -> VPSlash = \v -> + predVc : Verb ** {c2 : Preposition} -> VPSlash = \v -> predV v ** {c2 = v.c2 ; objCtrl = False} ; predVGen : Bool -> Verb -> VP = \isAux, verb -> { @@ -636,7 +645,7 @@ resource ResGer = ParamX ** open Prelude in { -- default infinitival complement: inf = {inpl = <\\_ => [], []>; extr = \\_ => []} ; ext,adj : Str = [] ; - c1 = PrepNom' + c1 = PrepNom } ; auxPerfect : Verb -> VForm => Str = \verb -> @@ -711,16 +720,20 @@ resource ResGer = ParamX ** open Prelude in { insertObjc : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp -> insertObj obj vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl } ; - insertObjNP' : NP' -> Preposition' -> VPSlash -> VPSlash = \np,prep,vp -> - let c = prep.c ; - obj = appPrepNP' prep np ; - isPrep : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ; - in vp ** { + insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp -> + let obj = appPrepNP prep np ; + b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ; + w = np.w ; + c = prep.c + in insertObj' obj b w c vp ; + + insertObj' : Str -> Bool -> Weight' -> Case -> VPSlash -> VPSlash = \obj,isPrep,w,c,vp -> + vp ** { nn = \\a => let vpnn = vp.nn ! a in -- HL 11/6/19: rough object NP order (expensive): -- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp - case of { -- 2 * 3 * 4 = 24 cases + case of { -- 2 * 3 * 4 = 24 cases => -- ; => -- @@ -732,8 +745,8 @@ resource ResGer = ParamX ** open Prelude in { ; => -- ; - -- => -- - -- ; + => -- + ; => -- } } ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4) @@ -983,7 +996,7 @@ resource ResGer = ParamX ** open Prelude in { infPart : Bool -> Str = \b -> if_then_Str b [] "zu" ; - heavyNP' : + heavyNP : {s : Bool => Case => Str ; a : Agr} -> {s : Bool => Case => Str ; a : Agr ; w : Weight' ; ext,rc : Str} = \np -> np ** {w = WHeavy' ; ext,rc = []} ; -- this could be wrong @@ -1002,10 +1015,10 @@ resource ResGer = ParamX ** open Prelude in { -- Function that allows the construction of non-nominative subjects. - mkSubj' : NP' -> Preposition' -> Str * Agr = \np, prep -> + mkSubj : NP -> Preposition -> Str * Agr = \np, prep -> let agr = case prep.c of { Nom => np.a ; _ => Ag Masc Sg P3 } ; - subj = appPrepNP' prep np + subj = appPrepNP prep np in ; } diff --git a/src/german/SentenceGer.gf b/src/german/SentenceGer.gf index 9c0aef6ad..dad963797 100644 --- a/src/german/SentenceGer.gf +++ b/src/german/SentenceGer.gf @@ -1,11 +1,11 @@ -concrete SentenceGer of Sentence' = CatGer ** open ResGer, Prelude in { +concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { flags optimize=all_subs ; lin PredVP np vp = - let subj = mkSubj' np vp.c1 + let subj = mkSubj np vp.c1 in mkClause subj.p1 subj.p2 vp ; {- applies verb's subject case to subject ; @@ -33,10 +33,10 @@ concrete SentenceGer of Sentence' = CatGer ** open ResGer, Prelude in { verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext } ; -- to save (67299 - 27432 = 39863 msec) compile time: HL 7/22, comment out: - SlashVP np vp = - let subj = mkSubj' np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent +{- SlashVP np vp = + let subj = mkSubj np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent in mkClause subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a - +-} -- cf. tests/german/TestLangGer.gf AdvSlash slash adv = { s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ; c2 = slash.c2 @@ -45,7 +45,7 @@ concrete SentenceGer of Sentence' = CatGer ** open ResGer, Prelude in { SlashPrep cl prep = cl ** {c2 = prep} ; SlashVS np vs slash = - let subj = mkSubj' np PrepNom' ; + let subj = mkSubj np PrepNom ; vp = (insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) in mkClause subj.p1 subj.p2 vp ** {c2 = slash.c2} ; diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index e86fda77f..9acc82519 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -1,4 +1,4 @@ -concrete StructuralGer of Structural' = CatGer ** +concrete StructuralGer of Structural = CatGer ** open MorphoGer, MakeStructuralGer, (X = ConstructX), (P = ParadigmsGer), IrregGer, Prelude in { diff --git a/src/german/SymbolGer.gf b/src/german/SymbolGer.gf index 2838f911e..a8126d05e 100644 --- a/src/german/SymbolGer.gf +++ b/src/german/SymbolGer.gf @@ -9,27 +9,28 @@ lin NumPN i = {s = i.s ! Neutr ; g = Neutr} ; --- c CNIntNP cn i = { - s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ; + s = \\b,c => cn.s ! Weak ! Sg ! Nom ++ i.s ; a = agrP3 Sg ; -- isPron = False ; -- isLight = True ; - w = WLight ; + w = WLight' ; ext,rc = [] -- added } ; CNSymbNP det cn xs = let g = cn.g in { - s = \\c => det.s ! g ! c ++ - (let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k) ++ xs.s ; + s = \\b,c => det.s ! b ! g ! c ++ +-- (let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k) ++ xs.s ; + (let k = c in cn.s ! adjfCase det.a k ! det.n ! k) ++ xs.s ; a = agrP3 det.n ; -- isPron = False ; -- isLight = True ; - w = WLight ; + w = WLight' ; ext,rc = [] -- added } ; CNNumNP cn i = { -- s = \\c => artDefContr (GSg cn.g) c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; - s = \\c => artDef (GSg cn.g) c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; + s = \\_,c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; -- HL 8/22 ad hoc a = agrP3 Sg ; - w = WLight ; + w = WLight' ; ext,rc = [] } ; diff --git a/src/german/VerbGer.gf b/src/german/VerbGer.gf index ae789227b..4f418e556 100644 --- a/src/german/VerbGer.gf +++ b/src/german/VerbGer.gf @@ -1,4 +1,4 @@ -concrete VerbGer of Verb' = CatGer ** open Prelude, ResGer, Coordination in { +concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { flags optimize=all_subs ; @@ -21,8 +21,8 @@ concrete VerbGer of Verb' = CatGer ** open Prelude, ResGer, Coordination in { SlashV2a v = (predVc v) ; - Slash2V3 v np = insertObjNP' np v.c2 (predVc v) ** {c2 = v.c3} ; - Slash3V3 v np = insertObjNP' np v.c3 (predVc v) ; + Slash2V3 v np = insertObjNP np v.c2 (predVc v) ** {c2 = v.c3} ; + Slash3V3 v np = insertObjNP np v.c3 (predVc v) ; SlashV2S v s = insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2; objCtrl = False} ; @@ -46,7 +46,7 @@ concrete VerbGer of Verb' = CatGer ** open Prelude, ResGer, Coordination in { -- HL 3/22 better before inserting np, using objCtrl let vp = case vps.objCtrl of { True => objAgr np vps ; _ => vps } ** { c2 = vps.c2 ; objCtrl = vps.objCtrl } ; - in insertObjNP' np vps.c2 vp ; + in insertObjNP np vps.c2 vp ; -- compiler: + ComplSlash' 414720 (199680,352) -- SlashVV v vps is like ComplVV v vp, but infinite vps should not be extracted @@ -92,13 +92,17 @@ concrete VerbGer of Verb' = CatGer ** open Prelude, ResGer, Coordination in { -- expensive: + SlashV2VNP 503.884.800 (2880,540), reaches memory limit with SlashVV -- does not work for nested uses: the nn-levels are confused HL 3/22 - -- SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22 - -- insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ; - - -- without: 205539 msec --- to save (571098 = 83669 = 487429 msec) compile time (in 58% memory), comment out: - -- SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22 - -- insertObjNP' np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ; + -- to save a lot compile time and memory, avoid insertObjNP with glueing of prep+DefArt: + SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22 + -- insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ; + let prep = v.c2 ; + obj = appPrep prep (np.s!False) ; -- simplify: no glueing of prep+DefArt, HL 8/22 + b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ; + c = prep.c ; + w = np.w ; + vps = (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) + in + insertObj' obj b w c vps ; UseComp comp = insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used diff --git a/tests/german/TestLangGer.gf b/tests/german/TestLangGer.gf index 4fe2bf143..835977b10 100644 --- a/tests/german/TestLangGer.gf +++ b/tests/german/TestLangGer.gf @@ -4,7 +4,7 @@ concrete TestLangGer of TestLang = GrammarGer - [SlashVP, RelSlash] , TestLexiconGer - , ConstructionGer +-- , ConstructionGer ** open ResGer,Prelude,(P=ParadigmsGer) in { flags startcat = Phr ; unlexer = text ; lexer = text ; @@ -28,15 +28,15 @@ concrete TestLangGer of TestLang = (insertObjRefl (predVc v3) ** {c2 = v3.c3}); PassV2Q v q = - let c = case of { - => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject + let c = case of { + => Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } in insertExtrapos (bindComma ++ q.s ! QIndir) vp ; PassV2S v s = - let c = case of { - => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject + let c = case of { + => Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } in insertExtrapos (bindComma ++ conjThat ++ s.s ! Sub) vp ; @@ -44,15 +44,15 @@ concrete TestLangGer of TestLang = PassV2V v vp = let inf = mkInf v.isAux Simul Pos vp ; -- ok for v.isAux=False, v.c2.c=Acc - c = case of { -- v.objCtrl=True HL 3/22 - => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject + c = case of { -- v.objCtrl=True HL 3/22 + => Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject vp2 = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } ; in insertInf inf vp2 ; -- v=lassen needs in-place inf instead PassVPSlash vp = - let c = case of { - => NPC Nom ; _ => vp.c2.c} ; + let c = case of { + => Nom ; _ => vp.c2.c} ; ctrl = case vp.objCtrl of { True => False ; _ => True } -- always False? in -- insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass ** {c1 = vp.c2 ** {c = c}}) insertObj (\\_ => vp.s.s ! (VPastPart APred)) @@ -164,15 +164,17 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa } ; lin +{- too expensive 60% memory, then killed: SlashVP np vp = let subj = mkSubj np vp.c1 in mkClSlash subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; - +-} RelSlash rp cls = lin RCl { s = \\m,t,a,p,gn => - appPrep cls.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++ +-- appPrep cls.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++ + appPrep cls.c2 (rp.s ! gn) ++ cls.s ! m ! t ! a ! p ! Sub ! gn ; - c = (prepC cls.c2.c).c + c = cls.c2.c } ; {- QuestSlash ip slash = {