diff --git a/lib/resource-1.0/abstract/Numeral.gf b/lib/resource-1.0/abstract/Numeral.gf index ea9260aa0..0ad34d13c 100644 --- a/lib/resource-1.0/abstract/Numeral.gf +++ b/lib/resource-1.0/abstract/Numeral.gf @@ -1,4 +1,18 @@ --- numerals from 1 to 999999 in decimal notation +--1 Numerals + +-- This grammar defines numerals from 1 to 999999. +-- The implementations are adapted from the +-- [numerals library http://www.cs.chalmers.se/~aarne/GF/examples/numerals/] +-- which defines numerals for 88 languages. +-- The resource grammar implementations add to this inflection (if needed) +-- and ordinal numbers. + +-- *Note*. Number 1 as defined +-- in the category $Numeral$ here should not be used in the formation of +-- noun phrases, and should therefore be removed. Instead, one should use +-- [Structural Structural.html]$.one_Quant$. This makes the grammar simpler +-- because we can assume that numbers form plural noun phrases. + abstract Numeral = Cat ** { @@ -28,4 +42,5 @@ fun pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999 pot3 : Sub1000 -> Sub1000000 ; -- m * 1000 pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + } diff --git a/lib/resource-1.0/abstract/Structural.gf b/lib/resource-1.0/abstract/Structural.gf index b8bdeff65..d5d3984c4 100644 --- a/lib/resource-1.0/abstract/Structural.gf +++ b/lib/resource-1.0/abstract/Structural.gf @@ -39,6 +39,7 @@ abstract Structural = Cat ** { everybody_NP : NP ; everything_NP : NP ; everywhere_Adv : Adv ; + first_Ord : Ord ; from_Prep : Prep ; he_Pron : Pron ; -- NP here_Adv : Adv ; -- @@ -60,6 +61,7 @@ abstract Structural = Cat ** { must_VV : VV ; no_Phr : Phr ; on_Prep : Prep ; + one_Quant : QuantSg ; only_Predet : Predet ; -- or_Conj : Conj ; otherwise_PConj : PConj ; -- AdC diff --git a/lib/resource-1.0/english/StructuralEng.gf b/lib/resource-1.0/english/StructuralEng.gf index e29bfb0d2..a1fa6cce2 100644 --- a/lib/resource-1.0/english/StructuralEng.gf +++ b/lib/resource-1.0/english/StructuralEng.gf @@ -27,6 +27,7 @@ concrete StructuralEng of Structural = CatEng ** every_Det = mkDeterminer Sg "every" ; everything_NP = regNP "everything" Sg ; everywhere_Adv = ss "everywhere" ; + first_Ord = ss "first" ; from_Prep = ss "from" ; he_Pron = mkNP "he" "him" "his" Sg P3 ; here_Adv = ss "here" ; @@ -47,6 +48,7 @@ concrete StructuralEng of Structural = CatEng ** must_VV = mkVerb4 "have" "has" "had" "had" ** {c2 = "to"} ; --- no_Phr = ss "no" ; on_Prep = ss "on" ; + one_Quant = mkDeterminer Sg "one" ; only_Predet = ss "only" ; or_Conj = ss "or" ** {n = Sg} ; otherwise_PConj = ss "otherwise" ; @@ -67,10 +69,12 @@ concrete StructuralEng of Structural = CatEng ** there7to_Adv = ss "there" ; there7from_Adv = ss ["from there"] ; therefore_PConj = ss "therefore" ; + these_NP = regNP "these" Pl ; these_Quant = mkDeterminer Pl "these" ; they_Pron = mkNP "they" "them" "their" Pl P3 ; this_Quant = mkDeterminer Sg "this" ; this_NP = regNP "this" Sg ; + those_NP = regNP "those" Pl ; those_Quant = mkDeterminer Pl "those" ; thou_Pron = mkNP "you" "you" "your" Sg P2 ; through_Prep = ss "through" ; diff --git a/lib/resource-1.0/scandinavian/AdjectiveScand.gf b/lib/resource-1.0/scandinavian/AdjectiveScand.gf index df5567385..5ae5bbe42 100644 --- a/lib/resource-1.0/scandinavian/AdjectiveScand.gf +++ b/lib/resource-1.0/scandinavian/AdjectiveScand.gf @@ -12,18 +12,19 @@ incomplete concrete AdjectiveScand of Adjective = isPre = False } ; ----- $SuperlA$ belongs to determiner syntax in $Noun$. --- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ; --- isPre = False --- } ; --- --- ReflA2 a = { --- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; --- isPre = False --- } ; --- +-- $SuperlA$ belongs to determiner syntax in $Noun$. + + ComplA2 a np = { + s = \\ap => a.s ! AF (APosit ap) Nom ++ a.c2 ++ np.s ! accusative ; + isPre = False + } ; + + ReflA2 a = { + s = \\ap => a.s ! AF (APosit ap) Nom ++ a.c2 ++ + reflPron (agrP3 Utr Sg) ; ---- + isPre = False + } ; + SentAP ap sc = { s = \\a => ap.s ! a ++ sc.s ; isPre = False diff --git a/lib/resource-1.0/scandinavian/VerbScand.gf b/lib/resource-1.0/scandinavian/VerbScand.gf index c1e48c531..d40f7e867 100644 --- a/lib/resource-1.0/scandinavian/VerbScand.gf +++ b/lib/resource-1.0/scandinavian/VerbScand.gf @@ -6,7 +6,9 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in UseV = predV ; ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v) ; ComplV3 v np np2 = - insertObj (\\_ => v.c2 ++ np.s ! accusative ++ v.c3 ++ np2.s ! accusative) (predV v) ; + insertObj + (\\_ => v.c2 ++ np.s ! accusative ++ v.c3 ++ np2.s ! accusative) + (predV v) ; ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ; ComplVS v s = insertObj (\\_ => conjThat ++ s.s ! Sub) (predV v) ; @@ -25,15 +27,15 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in CompNP np = {s = \\_ => np.s ! accusative} ; CompAdv a = {s = \\_ => a.s} ; ---- these give parser overflow AdvVP vp adv = insertAdv adv.s vp ; ---- AdVVP adv vp = insertAdV adv.s vp ; + AdVVP adv vp = insertAdV adv.s vp ; -{- - ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; - PassV2 v = {s = \\_ => v.s ! VPPart} ; --} + ReflV2 v = insertObj (\\a => v.c2 ++ reflPron a) (predV v) ; + +-- PassV2 v = {s = \\_ => v.s ! VPPart} ; +-- UseComp comp = insertObj (\\a => comp.s ! agrAdj a.gn DIndef) (predV verbBe) ; + UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; vtype = vv.vtype} ; diff --git a/lib/resource-1.0/swedish/StructuralSwe.gf b/lib/resource-1.0/swedish/StructuralSwe.gf index 9a05ab6cd..95db1ceda 100644 --- a/lib/resource-1.0/swedish/StructuralSwe.gf +++ b/lib/resource-1.0/swedish/StructuralSwe.gf @@ -28,6 +28,7 @@ concrete StructuralSwe of Structural = CatSwe ** every_Det = {s = \\_,_ => "varje" ; n = Sg ; det = DDef Indef} ; everything_NP = regNP "allting" "alltings" SgNeutr ; everywhere_Adv = ss "överallt" ; + first_Ord = {s = "första" ; isDet = True} ; from_Prep = ss "från" ; he_Pron = mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ; here_Adv = ss "här" ; @@ -49,6 +50,7 @@ concrete StructuralSwe of Structural = CatSwe ** mkVerb6 "få" "måste" "få" "fick" "måst" "måst" ** {c2 = [] ; lock_VV = <>} ; no_Phr = ss ["Nej"] ; on_Prep = ss "på" ; + one_Quant = {s = \\_ => genderForms ["en"] ["ett"] ; n = Sg ; det = DIndef} ; only_Predet = {s = \\_ => "bara"} ; or_Conj = ss "eller" ** {n = Sg} ; otherwise_PConj = ss "annars" ; @@ -58,8 +60,8 @@ concrete StructuralSwe of Structural = CatSwe ** quite_Adv = ss "ganska" ; she_Pron = mkNP "hon" "henne" "hennes" "hennes" "hennes" SgUtr P3 ; so_AdA = ss "så" ; - someSg_Det = {s = \\_ => genderForms "någon" "något" ; n = Sg ; det = DDef Indef} ; - somePl_Det = {s = \\_,_ => "några" ; n = Pl ; det = DDef Indef} ; + someSg_Det = {s = \\_ => genderForms "någon" "något" ; n = Sg ; det = DIndef} ; + somePl_Det = {s = \\_,_ => "några" ; n = Pl ; det = DIndef} ; somebody_NP = regNP "någon" "någons" SgUtr ; something_NP = regNP "något" "någots" SgNeutr ; somewhere_Adv = ss "någonstans" ; @@ -93,6 +95,8 @@ concrete StructuralSwe of Structural = CatSwe ** when_IAdv = ss "när" ; when_Subj = ss "när" ; where_IAdv = ss "var" ; + whichPl_IDet = {s = \\_ => "vilka" ; n = Pl ; det = DIndef} ; + whichSg_IDet = {s = genderForms "vilken" "vilket" ; n = Sg ; det = DIndef} ; ---- whichPl_IDet = vilkenDet ; ---- whichSg_IDet = mkDeterminerPl "vilka" IndefP ; whoSg_IP = {s = vem.s ; gn = SgUtr} ;