From b3e1908c782d03d93008cf4c0d587d113c766aef Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 13 Mar 2013 14:21:26 +0000 Subject: [PATCH] Poss,Part,Count NP in Scandinavian --- lib/src/danish/DiffDan.gf | 3 +++ lib/src/norwegian/DiffNor.gf | 1 + lib/src/norwegian/ExtraNor.gf | 2 +- lib/src/norwegian/ExtraNorAbs.gf | 2 +- lib/src/scandinavian/DiffScand.gf | 1 + lib/src/scandinavian/NounScand.gf | 24 ++++++++++++++++++++++++ lib/src/swedish/DiffSwe.gf | 2 ++ 7 files changed, 33 insertions(+), 2 deletions(-) diff --git a/lib/src/danish/DiffDan.gf b/lib/src/danish/DiffDan.gf index 7faaa5b86..233cc5fb5 100644 --- a/lib/src/danish/DiffDan.gf +++ b/lib/src/danish/DiffDan.gf @@ -79,4 +79,7 @@ instance DiffDan of DiffScand = open CommonScand, Prelude in { } ; hur_IAdv = {s = "hvor"} ; + + av_Prep = "af" ; + } diff --git a/lib/src/norwegian/DiffNor.gf b/lib/src/norwegian/DiffNor.gf index 3cfe4ee9b..913286176 100644 --- a/lib/src/norwegian/DiffNor.gf +++ b/lib/src/norwegian/DiffNor.gf @@ -90,4 +90,5 @@ instance DiffNor of DiffScand = open CommonScand, Prelude in { hur_IAdv = {s = "hvor"} ; + av_Prep = "av" ; } diff --git a/lib/src/norwegian/ExtraNor.gf b/lib/src/norwegian/ExtraNor.gf index db5a48cfc..bdc8361eb 100644 --- a/lib/src/norwegian/ExtraNor.gf +++ b/lib/src/norwegian/ExtraNor.gf @@ -1,7 +1,7 @@ concrete ExtraNor of ExtraNorAbs = ExtraScandNor ** open CommonScand, ResNor, Prelude in { lin - PossNP np pro = { + PossNPPron np pro = { s = \\c => np.s ! NPNom ++ pro.s ! NPPoss (gennumAgr np.a) (caseNP c) ; a = np.a } ; diff --git a/lib/src/norwegian/ExtraNorAbs.gf b/lib/src/norwegian/ExtraNorAbs.gf index 21c03ae7e..3ba0cddf8 100644 --- a/lib/src/norwegian/ExtraNorAbs.gf +++ b/lib/src/norwegian/ExtraNorAbs.gf @@ -4,6 +4,6 @@ abstract ExtraNorAbs = ExtraScandAbs ** { fun - PossNP : NP -> Pron -> NP ; -- bilen min + PossNPPron : NP -> Pron -> NP ; -- bilen min } \ No newline at end of file diff --git a/lib/src/scandinavian/DiffScand.gf b/lib/src/scandinavian/DiffScand.gf index f0c84873e..4010b7c12 100644 --- a/lib/src/scandinavian/DiffScand.gf +++ b/lib/src/scandinavian/DiffScand.gf @@ -65,5 +65,6 @@ interface DiffScand = open CommonScand, Prelude in { hur_IAdv : {s : Str} ; + av_Prep : Str ; } diff --git a/lib/src/scandinavian/NounScand.gf b/lib/src/scandinavian/NounScand.gf index 0933f9d0f..19700419f 100644 --- a/lib/src/scandinavian/NounScand.gf +++ b/lib/src/scandinavian/NounScand.gf @@ -202,4 +202,28 @@ incomplete concrete NounScand of Noun = g = g ; isMod = cn.isMod } ; + + PossNP cn np = let g = cn.g in { + s = \\n,d,c => cn.s ! n ! d ! Nom ++ av_Prep ++ np.s ! NPAcc ; --c -- "np's cn" would not work, because it can't get a determiner; use Extra.GenNP + g = g ; + isMod = cn.isMod + } ; + + PartNP cn np = let g = cn.g in { + s = \\n,d,c => cn.s ! n ! d ! Nom ++ np.s ! NPAcc ; --c -- also possible: "ett glas av vin", but can be built with part_Prep + g = g ; + isMod = cn.isMod + } ; + + CountNP det np = + let + g = np.a.g ; + ng = case g of {Utr => utrum ; _ => neutrum} ; ---- misses Nor feminine + m = True ; ---- see DetNP above + in { + s = \\c => det.sp ! m ! ng ++ av_Prep ++ np.s ! NPAcc ; + a = agrP3 g det.n + } ; + + } diff --git a/lib/src/swedish/DiffSwe.gf b/lib/src/swedish/DiffSwe.gf index 0eadbf6c6..582b683fd 100644 --- a/lib/src/swedish/DiffSwe.gf +++ b/lib/src/swedish/DiffSwe.gf @@ -81,4 +81,6 @@ instance DiffSwe of DiffScand = open CommonScand, Prelude in { } ; hur_IAdv = {s = "hur"} ; + av_Prep = "av" ; + }