diff --git a/next-lib/src/Makefile b/next-lib/src/Makefile index c32f1bbbb..89a9d4a3e 100644 --- a/next-lib/src/Makefile +++ b/next-lib/src/Makefile @@ -32,6 +32,11 @@ constructX: gfc common/ConstructX.gf cp -p common/ConstructX.gfo ../prelude +MakeStructural: + gfc */MakeStructural*.gf + cp -p */MakeStructural*.gfo ../present + cp -p */MakeStructural*.gfo ../alltenses + test: $(RUNMAKE) test diff --git a/next-lib/src/abstract/Noun.gf b/next-lib/src/abstract/Noun.gf index 0a149ba82..2daf141d6 100644 --- a/next-lib/src/abstract/Noun.gf +++ b/next-lib/src/abstract/Noun.gf @@ -132,4 +132,5 @@ abstract Noun = Cat ** { ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y) + } ; diff --git a/next-lib/src/abstract/Relative.gf b/next-lib/src/abstract/Relative.gf index 6db45d085..00289bdf5 100644 --- a/next-lib/src/abstract/Relative.gf +++ b/next-lib/src/abstract/Relative.gf @@ -17,7 +17,7 @@ abstract Relative = Cat ** { 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 suffixing (depending on language) prepositional phrases or genitives. IdRP : RP ; -- which FunRP : Prep -> NP -> RP -> RP ; -- the mother of whom diff --git a/next-lib/src/abstract/Structural.gf b/next-lib/src/abstract/Structural.gf index 8ba4486d1..1c952a4b7 100644 --- a/next-lib/src/abstract/Structural.gf +++ b/next-lib/src/abstract/Structural.gf @@ -109,13 +109,12 @@ abstract Structural = Cat ** { youPol_Pron : Pron ; -- you (polite) no_Quant : Quant ; - nobody_but_Predet : Predet ; - nothing_but_Predet : Predet ; not_Predet : Predet ; if_then_Conj : Conj ; at_least_AdN : AdN ; at_most_AdN : AdN ; nobody_NP : NP ; nothing_NP : NP ; + except_Prep : Prep ; } diff --git a/next-lib/src/api/Constructors.gf b/next-lib/src/api/Constructors.gf index a6804b56c..4c3e91c38 100644 --- a/next-lib/src/api/Constructors.gf +++ b/next-lib/src/api/Constructors.gf @@ -749,7 +749,9 @@ incomplete resource Constructors = open Grammar in { mkRS : overload { mkRS : RCl -> RS ; -- 1. that walk - mkRS : (Tense) -> (Ant) -> (Pol) -> RCl -> RS -- 2. that wouldn't have walked + mkRS : (Tense) -> (Ant) -> (Pol) -> RCl -> RS ; -- 2. that wouldn't have walked + mkRS : Conj -> RS -> RS -> RS ; -- 3. who walks and whom I know + mkRS : Conj -> ListRS -> RS ; -- 4. who walks, whose son runs, and whom I know } ; --3 RCl, relative clauses @@ -857,6 +859,12 @@ incomplete resource Constructors = open Grammar in { mkListNP : NP -> ListNP -> ListNP -- 2. John, I, that } ; +--3 ListRS, relative clause lists + + mkListRS : overload { + mkListRS : RS -> RS -> ListRS ; -- 1. who walks, who runs + mkListRS : RS -> ListRS -> ListRS -- 2. who walks, who runs, who sleeps + } ; --. -- Definitions @@ -1473,7 +1481,12 @@ incomplete resource Constructors = open Grammar in { mkRS : Ant -> Pol -> RCl -> RS = \a,p -> TUseRCl TPres a p ; mkRS : Tense -> Ant -> Pol -> RCl -> RS - = TUseRCl + = TUseRCl ; + mkRS : Conj -> RS -> RS -> RS + = \c,x,y -> ConjRS c (BaseRS x y) ; + mkRS : Conj -> ListRS -> RS + = \c,xy -> ConjRS c xy ; + } ; param Punct = PFullStop | PExclMark | PQuestMark ; @@ -1618,6 +1631,11 @@ incomplete resource Constructors = open Grammar in { mkListNP : NP -> ListNP -> ListNP = ConsNP } ; + mkListRS = overload { + mkListRS : RS -> RS -> ListRS = BaseRS ; + mkListRS : RS -> ListRS -> ListRS = ConsRS + } ; + ------------ for backward compatibility diff --git a/next-lib/src/english/MakeStructuralEng.gf b/next-lib/src/english/MakeStructuralEng.gf new file mode 100644 index 000000000..31f3c0960 --- /dev/null +++ b/next-lib/src/english/MakeStructuralEng.gf @@ -0,0 +1,11 @@ +--# -path=.:../common:../abstract + +resource MakeStructuralEng = open CatEng, ParadigmsEng, MorphoEng, Prelude in { + +oper + mkConj : Str -> Str -> Number -> Conj = \x,y,n -> + {s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ; + mkSubj : Str -> Subj = \x -> + {s = x ; lock_Subj = <>} ; + +} diff --git a/next-lib/src/english/StructuralEng.gf b/next-lib/src/english/StructuralEng.gf index 995844771..bbad3efdd 100644 --- a/next-lib/src/english/StructuralEng.gf +++ b/next-lib/src/english/StructuralEng.gf @@ -123,8 +123,6 @@ concrete StructuralEng of Structural = CatEng ** youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; not_Predet = {s = "not" ; lock_Predet = <>} ; - nothing_but_Predet = {s = "nothing but" ; lock_Predet = <>} ; - nobody_but_Predet = {s = "nobody but" ; lock_Predet = <>} ; no_Quant = mkQuant "no" "no" ; if_then_Conj = {s1 = "if" ; s2 = "then" ; n = singular ; lock_Conj = <>} ; nobody_NP = regNP "nobody" singular ; @@ -132,5 +130,7 @@ concrete StructuralEng of Structural = CatEng ** at_least_AdN = mkAdN "at least" ; at_most_AdN = mkAdN "at most" ; + + except_Prep = mkPrep "except" ; } diff --git a/next-lib/src/french/MakeStructuralFre.gf b/next-lib/src/french/MakeStructuralFre.gf new file mode 100644 index 000000000..282e1c3e7 --- /dev/null +++ b/next-lib/src/french/MakeStructuralFre.gf @@ -0,0 +1,13 @@ +--# -path=.:../romance:../common:../abstract + +resource MakeStructuralFre = open CatFre, ParadigmsFre, MorphoFre, Prelude in { + +oper + mkConj : Str -> Str -> Number -> Conj = \x,y,n -> + {s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ; + mkSubj : Str -> Subj = \x -> + {s = x ; m = Indic ; lock_Subj = <>} ; + mkSubjSubj : Str -> Subj = \x -> + {s = x ; m = Conjunct ; lock_Subj = <>} ; + +} diff --git a/next-lib/src/french/StructuralFre.gf b/next-lib/src/french/StructuralFre.gf index 4a0fa4981..133455612 100644 --- a/next-lib/src/french/StructuralFre.gf +++ b/next-lib/src/french/StructuralFre.gf @@ -163,9 +163,6 @@ lin Masc Pl P2 ; not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom} ; - nothing_but_Predet = {s = \\a,c => prepCase c ++ "rien excepté" ; c = Nom} ; - nobody_but_Predet = {s = \\a,c => prepCase c ++ "personne excepté" ; c = Nom} ; - no_Quant = let aucun : ParadigmsFre.Number => ParadigmsFre.Gender => Case => Str = table { @@ -184,5 +181,7 @@ lin at_least_AdN = ss "au moins" ; at_most_AdN = ss "au plus" ; + except_Prep = mkPreposition "excepté" ; + } diff --git a/next-lib/src/german/MakeStructuralGer.gf b/next-lib/src/german/MakeStructuralGer.gf new file mode 100644 index 000000000..8f5006df9 --- /dev/null +++ b/next-lib/src/german/MakeStructuralGer.gf @@ -0,0 +1,11 @@ +--# -path=.:../common:../abstract + +resource MakeStructuralGer = open CatGer, ParadigmsGer, MorphoGer, Prelude in { + +oper + mkConj : Str -> Str -> Number -> Conj = \x,y,n -> + {s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ; + mkSubj : Str -> Subj = \x -> + {s = x ; lock_Subj = <>} ; + +} diff --git a/next-lib/src/german/StructuralGer.gf b/next-lib/src/german/StructuralGer.gf index 0f87fcee7..beda7514a 100644 --- a/next-lib/src/german/StructuralGer.gf +++ b/next-lib/src/german/StructuralGer.gf @@ -128,12 +128,6 @@ concrete StructuralGer of Structural = CatGer ** yes_Utt = ss "ja" ; not_Predet = {s = \\_,_,_ => "nicht" ; c = NoCase} ; - nothing_but_Predet = {s = \\_,_,_ => "nichts ausser" ; c = PredCase Dat} ; - nobody_but_Predet = { - s = \\_,_,c => - caselist "niemand" "niemanden" "niemandem" "niemands" ! c ++ "ausser" ; - c = PredCase Dat - } ; no_Quant = let keiner : Number => Gender => Case => Str = table { Sg => \\g,c => "kein" + pronEnding ! GSg g ! c ; @@ -148,5 +142,5 @@ concrete StructuralGer of Structural = CatGer ** nameNounPhrase {s = \\_ => "nichts"} ; at_least_AdN = ss "wenigstens" ; at_most_AdN = ss "höchstens" ; - + except_Prep = mkPrep "außer" Dat ; } diff --git a/next-lib/src/scandinavian/NounScand.gf b/next-lib/src/scandinavian/NounScand.gf index dd6c39742..06a34be57 100644 --- a/next-lib/src/scandinavian/NounScand.gf +++ b/next-lib/src/scandinavian/NounScand.gf @@ -189,5 +189,4 @@ incomplete concrete NounScand of Noun = g = g ; isMod = cn.isMod } ; - } diff --git a/next-lib/src/swedish/MakeStructuralSwe.gf b/next-lib/src/swedish/MakeStructuralSwe.gf new file mode 100644 index 000000000..48d0a1225 --- /dev/null +++ b/next-lib/src/swedish/MakeStructuralSwe.gf @@ -0,0 +1,11 @@ +--# -path=.:../scandinavian:../common:../abstract + +resource MakeStructuralSwe = open CatSwe, ParadigmsSwe, MorphoSwe, Prelude in { + +oper + mkConj : Str -> Str -> Number -> Conj = \x,y,n -> + {s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ; + mkSubj : Str -> Subj = \x -> + {s = x ; lock_Subj = <>} ; + +} diff --git a/next-lib/src/swedish/StructuralSwe.gf b/next-lib/src/swedish/StructuralSwe.gf index b257b850a..a6a3a00b2 100644 --- a/next-lib/src/swedish/StructuralSwe.gf +++ b/next-lib/src/swedish/StructuralSwe.gf @@ -125,8 +125,6 @@ concrete StructuralSwe of Structural = CatSwe ** lin not_Predet = {s = \\_ => "inte"} ; - nothing_but_Predet = {s = \\_ => "inget förutom"} ; - nobody_but_Predet = {s = \\_ => "ingen förutom"} ; no_Quant = {s = table { Sg => \\_,_ => genderForms "ingen" "inget" ; @@ -141,5 +139,7 @@ lin at_least_AdN = ss "minst" ; at_most_AdN = ss "högst" ; + + except_Prep = ss "utom" ; }