From 935a30db90a7806641957f49edebb57f8231db78 Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 15 Dec 2013 20:11:19 +0000 Subject: [PATCH] added noun compound form to Swe; commented out Constructions and Documentation in Lang concretes, because their presence makes it impossible to bootstrap the compilation of the library, causing new makes of the library to fail (to be fixed) --- src/abstract/Lang.gf | 6 ++-- src/chinese/LangChi.gf | 4 +-- src/danish/ParadigmsDan.gf | 2 +- src/english/LangEng.gf | 6 ++-- src/finnish/LangFin.gf | 6 ++-- src/french/LangFre.gf | 6 ++-- src/german/LangGer.gf | 6 ++-- src/norwegian/ParadigmsNor.gf | 2 +- src/scandinavian/NounScand.gf | 3 ++ src/scandinavian/ResScand.gf | 2 +- src/swedish/ExtraSwe.gf | 9 ++++-- src/swedish/LangSwe.gf | 6 ++-- src/swedish/ParadigmsSwe.gf | 60 +++++++++++++++++++++++++++-------- 13 files changed, 78 insertions(+), 40 deletions(-) diff --git a/src/abstract/Lang.gf b/src/abstract/Lang.gf index 08cd3a88..c0601f15 100644 --- a/src/abstract/Lang.gf +++ b/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/src/chinese/LangChi.gf b/src/chinese/LangChi.gf index 84469b3e..e5ea42eb 100644 --- a/src/chinese/LangChi.gf +++ b/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/src/danish/ParadigmsDan.gf b/src/danish/ParadigmsDan.gf index dd6a89df..8ec10868 100644 --- a/src/danish/ParadigmsDan.gf +++ b/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/src/english/LangEng.gf b/src/english/LangEng.gf index 0805937a..ac7695f9 100644 --- a/src/english/LangEng.gf +++ b/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/src/finnish/LangFin.gf b/src/finnish/LangFin.gf index 57036168..94ded5bd 100644 --- a/src/finnish/LangFin.gf +++ b/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/src/french/LangFre.gf b/src/french/LangFre.gf index 683118b5..96cc21d8 100644 --- a/src/french/LangFre.gf +++ b/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/src/german/LangGer.gf b/src/german/LangGer.gf index 6dc7384f..30f255f5 100644 --- a/src/german/LangGer.gf +++ b/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/src/norwegian/ParadigmsNor.gf b/src/norwegian/ParadigmsNor.gf index aed3bf83..236a00f8 100644 --- a/src/norwegian/ParadigmsNor.gf +++ b/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/src/scandinavian/NounScand.gf b/src/scandinavian/NounScand.gf index d6d1c923..b03b81d9 100644 --- a/src/scandinavian/NounScand.gf +++ b/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/src/scandinavian/ResScand.gf b/src/scandinavian/ResScand.gf index 1e7001b0..54775742 100644 --- a/src/scandinavian/ResScand.gf +++ b/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/src/swedish/ExtraSwe.gf b/src/swedish/ExtraSwe.gf index 36c68a56..a112f38a 100644 --- a/src/swedish/ExtraSwe.gf +++ b/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/src/swedish/LangSwe.gf b/src/swedish/LangSwe.gf index 61ee1453..d2b30ac1 100644 --- a/src/swedish/LangSwe.gf +++ b/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/src/swedish/ParadigmsSwe.gf b/src/swedish/ParadigmsSwe.gf index e000db3f..17c49824 100644 --- a/src/swedish/ParadigmsSwe.gf +++ b/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 {