diff --git a/lib/src/abstract/Lang.gf b/lib/src/abstract/Lang.gf index 08cd3a88f..c0601f159 100644 --- a/lib/src/abstract/Lang.gf +++ b/lib/src/abstract/Lang.gf @@ -7,9 +7,9 @@ abstract Lang = Grammar, - Lexicon, - Construction, - Documentation + Lexicon + ,Construction --- can be compiled here, but not in concretes, as they call Syntax and Grammar + ,Documentation ** { flags startcat=Phr ; } ; diff --git a/lib/src/chinese/LangChi.gf b/lib/src/chinese/LangChi.gf index 84469b3ea..e5ea42eba 100644 --- a/lib/src/chinese/LangChi.gf +++ b/lib/src/chinese/LangChi.gf @@ -3,8 +3,8 @@ concrete LangChi of Lang = GrammarChi, - LexiconChi, - ConstructionChi + LexiconChi +-- ,ConstructionChi ** { flags startcat = Phr ; unlexer = concat ; lexer = text ; diff --git a/lib/src/danish/ParadigmsDan.gf b/lib/src/danish/ParadigmsDan.gf index dd6a89dfd..8ec108687 100644 --- a/lib/src/danish/ParadigmsDan.gf +++ b/lib/src/danish/ParadigmsDan.gf @@ -305,7 +305,7 @@ oper mkPrep p = {s = p ; lock_Prep = <>} ; noPrep = mkPrep [] ; - mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ; + mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <> ; co = x} ; ---- TODO co regN x = regGenN x Utr ; diff --git a/lib/src/english/LangEng.gf b/lib/src/english/LangEng.gf index 0805937a9..ac7695f9a 100644 --- a/lib/src/english/LangEng.gf +++ b/lib/src/english/LangEng.gf @@ -2,9 +2,9 @@ concrete LangEng of Lang = GrammarEng, - LexiconEng, - ConstructionEng, - DocumentationEng + LexiconEng +-- ,ConstructionEng, +-- ,DocumentationEng ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/finnish/LangFin.gf b/lib/src/finnish/LangFin.gf index 570361680..94ded5bdd 100644 --- a/lib/src/finnish/LangFin.gf +++ b/lib/src/finnish/LangFin.gf @@ -2,9 +2,9 @@ concrete LangFin of Lang = GrammarFin, - LexiconFin, - ConstructionFin, - DocumentationFin + LexiconFin +-- , ConstructionFin, +-- , DocumentationFin ** { flags startcat = Phr ; unlexer = text ; lexer = finnish ; diff --git a/lib/src/french/LangFre.gf b/lib/src/french/LangFre.gf index 683118b53..96cc21d89 100644 --- a/lib/src/french/LangFre.gf +++ b/lib/src/french/LangFre.gf @@ -2,9 +2,9 @@ concrete LangFre of Lang = GrammarFre, - LexiconFre, - DocumentationFre, - ConstructionFre + LexiconFre +-- ,DocumentationFre +-- ,ConstructionFre ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/german/LangGer.gf b/lib/src/german/LangGer.gf index 6dc7384f6..30f255f5a 100644 --- a/lib/src/german/LangGer.gf +++ b/lib/src/german/LangGer.gf @@ -2,9 +2,9 @@ concrete LangGer of Lang = GrammarGer, - LexiconGer, - ConstructionGer, - DocumentationGer + LexiconGer +-- ,ConstructionGer +-- ,DocumentationGer ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/norwegian/ParadigmsNor.gf b/lib/src/norwegian/ParadigmsNor.gf index aed3bf83b..236a00f8f 100644 --- a/lib/src/norwegian/ParadigmsNor.gf +++ b/lib/src/norwegian/ParadigmsNor.gf @@ -284,7 +284,7 @@ oper nominative = Nom ; genitive = Gen ; - mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ; + mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <> ; co = x} ; ---- TODO co regN x = regGenN x g where { g = case of { diff --git a/lib/src/scandinavian/NounScand.gf b/lib/src/scandinavian/NounScand.gf index d6d1c9237..b03b81d9a 100644 --- a/lib/src/scandinavian/NounScand.gf +++ b/lib/src/scandinavian/NounScand.gf @@ -142,6 +142,7 @@ incomplete concrete NounScand of Noun = s = f.s ; g = f.g ; c2 = f.c2 ; + co = f.co ; isMod = False } ; @@ -149,6 +150,7 @@ incomplete concrete NounScand of Noun = s = f.s ; g = f.g ; c2 = f.c3 ; + co = f.co ; isMod = False } ; @@ -163,6 +165,7 @@ incomplete concrete NounScand of Noun = s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2.s ++ x.s ! accusative ; g = f.g ; c2 = f.c3 ; + co = f.co ; isMod = False } ; diff --git a/lib/src/scandinavian/ResScand.gf b/lib/src/scandinavian/ResScand.gf index 1e7001b06..547757426 100644 --- a/lib/src/scandinavian/ResScand.gf +++ b/lib/src/scandinavian/ResScand.gf @@ -14,7 +14,7 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in { p = P3 } ; - Noun = {s : Number => Species => Case => Str ; g : NGender} ; + Noun = {s : Number => Species => Case => Str ; g : NGender ; co : Str} ; -- co = compounding form -- needed for VP conjunction param diff --git a/lib/src/swedish/ExtraSwe.gf b/lib/src/swedish/ExtraSwe.gf index 36c68a569..a112f38a5 100644 --- a/lib/src/swedish/ExtraSwe.gf +++ b/lib/src/swedish/ExtraSwe.gf @@ -125,17 +125,20 @@ lin CompoundNomN a b = { s = \\n,d,c => a.s ! Sg ! Indef ! Nom ++ BIND ++ b.s ! n ! d ! c ; - g = b.g + g = b.g ; + co = b.co } ; CompoundGenN a b = { s = \\n,d,c => a.s ! Sg ! Indef ! Gen ++ BIND ++ b.s ! n ! d ! c ; - g = b.g + g = b.g ; + co = b.co } ; CompoundAdjN a b = { s = \\n,d,c => a.s ! AF (APosit (Strong (GSg Utr))) Nom ++ BIND ++ b.s ! n ! d ! c ; - g = b.g + g = b.g ; + co = b.co } ; diff --git a/lib/src/swedish/LangSwe.gf b/lib/src/swedish/LangSwe.gf index 61ee14536..d2b30ac17 100644 --- a/lib/src/swedish/LangSwe.gf +++ b/lib/src/swedish/LangSwe.gf @@ -2,9 +2,9 @@ concrete LangSwe of Lang = GrammarSwe, - LexiconSwe, - ConstructionSwe, - DocumentationSwe + LexiconSwe +-- ,ConstructionSwe +-- ,DocumentationSwe ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/swedish/ParadigmsSwe.gf b/lib/src/swedish/ParadigmsSwe.gf index e000db3f7..17c498249 100644 --- a/lib/src/swedish/ParadigmsSwe.gf +++ b/lib/src/swedish/ParadigmsSwe.gf @@ -95,12 +95,17 @@ oper -- and perhaps a gender. - mkN : (museum,museet,museer,museerna : Str) -> Gender -> N -- even worse case for nouns - } ; + mkN : (museum,museet,museer,museerna : Str) -> Gender -> N ; -- even worse case for nouns -- All the functions above work quite as well to form *compound nouns*, --- such as "fotboll". +-- such as "fotboll", just given as one argument. But compound nouns can be formed from their parts as well, + mkN : (regering, makt : N) -> N ; -- regeringsmakt, using the co form of regering + } ; + +-- The default compound form can be changed: + + changeCompoundN : Str -> N -> N ; -- kyrko + kyrka_N --3 Relational nouns @@ -350,21 +355,48 @@ oper mkN : Str -> Gender -> N = regGenN ; mkN : (nyckel, nycklar : Str) -> N = mk2N ; mkN : (museum,museet,museer,museerna : Str) -> N = mk4N ; - mkN : (museum,museet,museer,museerna : Str) -> Gender -> N = mk5N - } ; + mkN : (museum,museet,museer,museerna : Str) -> Gender -> N = mk5N ; + mkN : (regering, makt : N) -> N = \a,b -> lin N { + s = \\n,d,c => a.co + b.s ! n ! d ! c ; + g = b.g ; + co = case b.co of { + _ + "s" => a.co + b.co ; + co => a.co + co + "s" + } + } ; + } ; - mk4N : (museum,museet,museer,museerna : Str) -> N = \apa,apan,apor,aporna -> { - s = nounForms apa apan apor aporna ; - g = case last apan of { - "n" => Utr ; - _ => Neutr +-- The default compound form can be changed: + + changeCompoundN : Str -> N -> N = \co,n -> lin N { + s = n.s ; + g = n.g ; + co = co + } ; + + + mk4N : (museum,museet,museer,museerna : Str) -> N = \apa,apan,apor,aporna -> + mk5N apa apan apor aporna g + where { + g = case last apan of { + "n" => Utr ; + _ => Neutr } - } ** {lock_N = <>} ; + } ; - mk5N : (museum,museet,museer,museerna : Str) -> Gender -> N = \apa,apan,apor,aporna,g -> { + mk5N : (museum,museet,museer,museerna : Str) -> Gender -> N = \apa,apan,apor,aporna,g -> lin N { s = nounForms apa apan apor aporna ; - g = g - } ** {lock_N = <>} ; + g = g ; + co = case apa of { + ap + "e" => case g of { + Neutr => apa + "s" ; -- rikes + _ => ap -- pojk + } ; + ap + "a" => ap ; -- flick + ? + ? + ? + _ + ("ing" | "ion" | "het") => apa + "s" ; -- regerings, stations, frihets + _ => apa + } + } ; regN : Str -> N = \bil -> regGenN bil g where { g = case of {