diff --git a/src/catalan/LexiconCat.gf b/src/catalan/LexiconCat.gf index bbdc4a3c..d681c231 100644 --- a/src/catalan/LexiconCat.gf +++ b/src/catalan/LexiconCat.gf @@ -10,7 +10,7 @@ flags oper regFN : Str -> N = \s -> femN (regN s) ; regMN : Str -> N = \s -> regN s ; - irregMN : Str -> Str -> N = \pa,pans -> M.mkNounIrreg pa pans masculine ** {lock_N=<>} ; + irregMN : Str -> Str -> N = \pa,pans -> M.mkNounIrreg pa pans masculine ** {relType=D.NRelPrep D.P_de; lock_N=<>} ; saberV : V = verbV (saber_99 "saber") ; lin diff --git a/src/catalan/ParadigmsCat.gf b/src/catalan/ParadigmsCat.gf index c60a4f27..62713fd7 100644 --- a/src/catalan/ParadigmsCat.gf +++ b/src/catalan/ParadigmsCat.gf @@ -348,11 +348,11 @@ oper mkPrep p = {s = p ; c = Acc ; isDir = False ; lock_Prep = <>} ; - mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ; - regN x = mkNomReg x ** {lock_N = <>} ; - compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ; - femN x = {s = x.s ; g = feminine ; lock_N = <>} ; - mascN x = {s = x.s ; g = masculine ; lock_N = <>} ; + mk2N x y g = mkNounIrreg x y g ** {relType = NRelPrep P_de; lock_N = <>} ; + regN x = mkNomReg x ** {relType = NRelPrep P_de; lock_N = <>} ; + compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; relType = x.relType ; lock_N = <>} ; + femN x = x ** {g = feminine} ; + mascN x = x ** {g = masculine} ; mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; deN2 n = mkN2 n genitive ; @@ -525,7 +525,7 @@ oper mkN = overload { mkN : (llum : Str) -> N = regN ; - mkN : Str -> Gender -> N = \s,g -> {s = (regN s).s ; g = g ; lock_N = <>}; + mkN : Str -> Gender -> N = \s,g -> (regN s) ** {g = g}; mkN : (disc,discos : Str) -> Gender -> N = mk2N } ; regN : Str -> N ; diff --git a/src/french/ExtendFre.gf b/src/french/ExtendFre.gf index 61ea2f9d..a77fead5 100644 --- a/src/french/ExtendFre.gf +++ b/src/french/ExtendFre.gf @@ -59,7 +59,16 @@ lin ApposNP np1 np2 = np1 ** { -- guessed by KA } ; } ; -lin CompoundN a b = lin N {s = \\n => b.s ! n ++ a.s ! Sg ; g = b.g} ; -- connessione internet = internet connection +lin CompoundN a b = lin N { + s = \\n => b.s ! n ++ + case b.relType of { + NRelPrep p => prepCase (CPrep p) ; -- tasa de suicidio + NRelNoPrep => [] -- connessione internet = internet connection + } ++ + a.s ! Sg ; + g = b.g ; + relType = b.relType + } ; lin UseDAP = \dap -> let diff --git a/src/french/ParadigmsFre.gf b/src/french/ParadigmsFre.gf index 6aceb83d..8310ac1d 100644 --- a/src/french/ParadigmsFre.gf +++ b/src/french/ParadigmsFre.gf @@ -393,16 +393,16 @@ oper regGenN : Str -> Gender -> N ; regN : Str -> N ; mk2N : (oeil,yeux : Str) -> Gender -> N ; - mk2N x y g = mkCNomIrreg x y g ** {lock_N = <>} ; + mk2N x y g = mkCNomIrreg x y g ** {relType = NRelPrep P_de; lock_N = <>} ; regN x = regGenN x g where { g = case of { _ + ("e" | "ion") => Fem ; _ => Masc } } ; - regGenN x g = mkNomReg x g ** {lock_N = <>} ; + regGenN x g = mkNomReg x g ** {relType = NRelPrep P_de; lock_N = <>} ; compN : N -> Str -> N ; - compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ; + compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; relType = NRelPrep P_de ; lock_N = <>} ; mkN = overload { mkN : Str -> N = regN ; diff --git a/src/italian/ParadigmsIta.gf b/src/italian/ParadigmsIta.gf index 22647496..36165db9 100644 --- a/src/italian/ParadigmsIta.gf +++ b/src/italian/ParadigmsIta.gf @@ -378,11 +378,11 @@ oper in_Prep = {s = [] ; c = CPrep P_in ; isDir = False ; lock_Prep = <>} ; su_Prep = {s = [] ; c = CPrep P_su ; isDir = False ; lock_Prep = <>} ; - mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ; - regN x = mkNomReg x ** {lock_N = <>} ; - compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ; - femN x = {s = x.s ; g = feminine ; lock_N = <>} ; - mascN x = {s = x.s ; g = masculine ; lock_N = <>} ; + mk2N x y g = mkNounIrreg x y g ** {relType=NRelPrep P_da; lock_N = <>} ; + regN x = mkNomReg x ** {relType=NRelPrep P_da; lock_N = <>} ; + compN x y = x ** {s = \\n => x.s ! n ++ y} ; + femN x = {s = x.s ; g = feminine ; relType=NRelPrep P_da; lock_N = <>} ; + mascN x = {s = x.s ; g = masculine ; relType=NRelPrep P_da; lock_N = <>} ; mk2N2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; @@ -518,7 +518,7 @@ oper mkN = overload { mkN : (cane : Str) -> N = regN ; - mkN : (carne : Str) -> Gender -> N = \n,g -> {s = (regN n).s ; g = g ; lock_N = <>} ; + mkN : (carne : Str) -> Gender -> N = \n,g -> (regN n) ** {g = g} ; mkN : (uomo,uomini : Str) -> Gender -> N = mk2N ; mkN : N -> Str -> N = compN } ; diff --git a/src/portuguese/ExtendPor.gf b/src/portuguese/ExtendPor.gf index c91b169a..50a696e6 100644 --- a/src/portuguese/ExtendPor.gf +++ b/src/portuguese/ExtendPor.gf @@ -67,10 +67,14 @@ concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor - lin CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english - s = \\n => noun2.s ! n - ++ variants {"de" ; genForms "do" "da" ! noun.g} - ++ noun.s ! Sg ; - g = noun2.g + s = \\n => noun2.s ! n ++ + case noun2.relType of { + NRelPrep p => artDef True noun.g Sg (CPrep p) ; -- tasa de suicidio + NRelNoPrep => [] -- connessione internet = internet connection + } ++ + noun.s ! Sg ; + g = noun2.g ; + relType = noun2.relType } ; CompoundAP noun adj = { diff --git a/src/portuguese/ParadigmsPor.gf b/src/portuguese/ParadigmsPor.gf index d62697fd..fe1fbd93 100644 --- a/src/portuguese/ParadigmsPor.gf +++ b/src/portuguese/ParadigmsPor.gf @@ -102,7 +102,7 @@ oper --2 Nouns regN : Str -> N ; --% - regN x = lin N (mkNomReg x) ; + regN x = lin N (mkNomReg x ** {relType=NRelPrep P_de}) ; femN : N -> N ; --% femN n = n ** {g = feminine} ; @@ -111,7 +111,7 @@ oper mascN n = n ** {g = masculine} ; mk2N : (bastão, bastões : Str) -> Gender -> N ; --% - mk2N x y g = lin N (mkNounIrreg x y g) ; + mk2N x y g = lin N (mkNounIrreg x y g ** {relType=NRelPrep P_de}) ; -- The regular function takes the singular form and the gender, and -- computes the plural and the gender by a heuristic (see MorphoPor diff --git a/src/romance/CatRomance.gf b/src/romance/CatRomance.gf index 4fe38778..4426fca5 100644 --- a/src/romance/CatRomance.gf +++ b/src/romance/CatRomance.gf @@ -110,9 +110,9 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol,MU] A = {s : AForm => Str ; compar : ComparAgr => Str ; isPre : Bool ; copTyp : CopulaType ; isDeg : Bool} ; A2 = {s : AForm => Str ; compar : ComparAgr => Str ; c2 : Compl ; copTyp : CopulaType ; isDeg : Bool} ; - N = Noun ; - N2 = Noun ** {c2 : Compl} ; - N3 = Noun ** {c2,c3 : Compl} ; + N = Noun ** {relType : NRelType}; + N2 = Noun ** {relType : NRelType; c2 : Compl} ; + N3 = Noun ** {relType : NRelType; c2,c3 : Compl} ; GN, PN = {s : Str ; g : Gender} ; SN = {s : Gender => Str ; pl : Str} ; LN = {s : Str; diff --git a/src/romance/DiffRomance.gf b/src/romance/DiffRomance.gf index acb5237d..105fe90b 100644 --- a/src/romance/DiffRomance.gf +++ b/src/romance/DiffRomance.gf @@ -140,6 +140,8 @@ interface DiffRomance = open CommonRomance, Prelude in { param Case = Nom | Acc | CPrep Prepos ; + NRelType = NRelPrep Prepos | NRelNoPrep ; -- How do build a compound noun + oper Verb = {s : VF => Str ; vtyp : VType ; p : Str} ; diff --git a/src/romance/ExtendRomanceFunctor.gf b/src/romance/ExtendRomanceFunctor.gf index 8e752710..cc68dbbc 100644 --- a/src/romance/ExtendRomanceFunctor.gf +++ b/src/romance/ExtendRomanceFunctor.gf @@ -127,7 +127,7 @@ incomplete concrete ExtendRomanceFunctor of Extend = ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ; AdvIsNP adv np = mkClause adv.s False False np.a (UseComp_estar (CompNP np)) ; AdvIsNPAP adv np ap = -- está - let emptyN : N = lin N {s = \\_ => [] ; g = np.a.g} ; -- To match the gender of the N + let emptyN : N = lin N {s = \\_ => [] ; relType = NRelNoPrep ; g = np.a.g} ; -- To match the gender of the N indef : Quant = IndefArt ** {s = \\b,n,g,c => []} ; det : Det = case np.a.n of {Sg => DetQuant indef NumSg ; Pl => DetQuant indef NumPl} ; apAsNP : NP = DetCN det (AdjCN ap (UseN emptyN)) ; -- NP where the string comes only from AP @@ -166,7 +166,16 @@ incomplete concrete ExtendRomanceFunctor of Extend = ComplGenVV = variants {} ; -- VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept ComplSlashPartLast = ComplSlash ; - CompoundN a b = lin N {s = \\n => b.s ! n ++ a.s ! Sg ; g = b.g} ; -- connessione internet = internet connection + CompoundN a b = lin N { + s = \\n => b.s ! n ++ + case b.relType of { + NRelPrep p => prepCase (CPrep p) ; -- tasa de suicidio + NRelNoPrep => [] -- connessione internet = internet connection + } ++ + a.s ! Sg ; + g = b.g ; + relType = b.relType + } ; CompoundAP = variants {} ; -- N -> A -> AP ; -- language independent / language-independent lin diff --git a/src/romance/NounRomance.gf b/src/romance/NounRomance.gf index 0fe65659..c9586cbf 100644 --- a/src/romance/NounRomance.gf +++ b/src/romance/NounRomance.gf @@ -158,11 +158,13 @@ incomplete concrete NounRomance of Noun = ComplN2 f x = { s = \\n => f.s ! n ++ appCompl f.c2 x ; g = f.g ; + relType = f.relType } ; ComplN3 f x = { s = \\n => f.s ! n ++ appCompl f.c2 x ; g = f.g ; + relType = f.relType ; c2 = f.c3 } ; diff --git a/src/spanish/ExtendSpa.gf b/src/spanish/ExtendSpa.gf index c853586b..dd8bdd95 100644 --- a/src/spanish/ExtendSpa.gf +++ b/src/spanish/ExtendSpa.gf @@ -73,10 +73,14 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor - (predV (mkV "existir"))) ; CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english - s = \\n => noun2.s ! n - ++ variants {"de" ; genForms "del" "de la" ! noun.g} - ++ noun.s ! Sg ; - g = noun2.g + s = \\n => noun2.s ! n ++ + case noun2.relType of { + NRelPrep p => prepCase (CPrep p) ; -- tasa de suicidio + NRelNoPrep => [] -- connessione internet = internet connection + } ++ + noun.s ! Sg ; + g = noun2.g ; + relType = noun2.relType } ; CompoundAP noun adj = { diff --git a/src/spanish/ParadigmsSpa.gf b/src/spanish/ParadigmsSpa.gf index 89c7f0f6..d2ac452d 100644 --- a/src/spanish/ParadigmsSpa.gf +++ b/src/spanish/ParadigmsSpa.gf @@ -380,11 +380,11 @@ oper } ; - mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ; - regN x = mkNomReg x ** {lock_N = <>} ; - compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ; - femN x = {s = x.s ; g = feminine ; lock_N = <>} ; - mascN x = {s = x.s ; g = masculine ; lock_N = <>} ; + mk2N x y g = mkNounIrreg x y g ** {relType=NRelPrep P_de; lock_N = <>} ; + regN x = mkNomReg x ** {relType=NRelPrep P_de; lock_N = <>} ; + compN x y = x ** {s = \\n => x.s ! n ++ y} ; + femN x = {s = x.s ; g = feminine ; relType=NRelPrep P_de; lock_N = <>} ; + mascN x = {s = x.s ; g = masculine ; relType=NRelPrep P_de; lock_N = <>} ; mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; deN2 n = mkN2 n genitive ; @@ -550,7 +550,7 @@ oper mkN = overload { mkN : (luz : Str) -> N = regN ; - mkN : Str -> Gender -> N = \s,g -> {s = (regN s).s ; g = g ; lock_N = <>}; + mkN : Str -> Gender -> N = \s,g -> (regN s) ** {g = g}; mkN : (baston,bastones : Str) -> Gender -> N = mk2N ; mkN : N -> Str -> N = compN ; } ;