documenting Numeral; completing Swedish

This commit is contained in:
aarne
2006-01-17 10:07:34 +00:00
parent 6370fbfec5
commit a31fbfc305
6 changed files with 50 additions and 22 deletions

View File

@@ -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 ** { abstract Numeral = Cat ** {
@@ -28,4 +42,5 @@ fun
pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999 pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000 pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
} }

View File

@@ -39,6 +39,7 @@ abstract Structural = Cat ** {
everybody_NP : NP ; everybody_NP : NP ;
everything_NP : NP ; everything_NP : NP ;
everywhere_Adv : Adv ; everywhere_Adv : Adv ;
first_Ord : Ord ;
from_Prep : Prep ; from_Prep : Prep ;
he_Pron : Pron ; -- NP he_Pron : Pron ; -- NP
here_Adv : Adv ; -- here_Adv : Adv ; --
@@ -60,6 +61,7 @@ abstract Structural = Cat ** {
must_VV : VV ; must_VV : VV ;
no_Phr : Phr ; no_Phr : Phr ;
on_Prep : Prep ; on_Prep : Prep ;
one_Quant : QuantSg ;
only_Predet : Predet ; -- only_Predet : Predet ; --
or_Conj : Conj ; or_Conj : Conj ;
otherwise_PConj : PConj ; -- AdC otherwise_PConj : PConj ; -- AdC

View File

@@ -27,6 +27,7 @@ concrete StructuralEng of Structural = CatEng **
every_Det = mkDeterminer Sg "every" ; every_Det = mkDeterminer Sg "every" ;
everything_NP = regNP "everything" Sg ; everything_NP = regNP "everything" Sg ;
everywhere_Adv = ss "everywhere" ; everywhere_Adv = ss "everywhere" ;
first_Ord = ss "first" ;
from_Prep = ss "from" ; from_Prep = ss "from" ;
he_Pron = mkNP "he" "him" "his" Sg P3 ; he_Pron = mkNP "he" "him" "his" Sg P3 ;
here_Adv = ss "here" ; here_Adv = ss "here" ;
@@ -47,6 +48,7 @@ concrete StructuralEng of Structural = CatEng **
must_VV = mkVerb4 "have" "has" "had" "had" ** {c2 = "to"} ; --- must_VV = mkVerb4 "have" "has" "had" "had" ** {c2 = "to"} ; ---
no_Phr = ss "no" ; no_Phr = ss "no" ;
on_Prep = ss "on" ; on_Prep = ss "on" ;
one_Quant = mkDeterminer Sg "one" ;
only_Predet = ss "only" ; only_Predet = ss "only" ;
or_Conj = ss "or" ** {n = Sg} ; or_Conj = ss "or" ** {n = Sg} ;
otherwise_PConj = ss "otherwise" ; otherwise_PConj = ss "otherwise" ;
@@ -67,10 +69,12 @@ concrete StructuralEng of Structural = CatEng **
there7to_Adv = ss "there" ; there7to_Adv = ss "there" ;
there7from_Adv = ss ["from there"] ; there7from_Adv = ss ["from there"] ;
therefore_PConj = ss "therefore" ; therefore_PConj = ss "therefore" ;
these_NP = regNP "these" Pl ;
these_Quant = mkDeterminer Pl "these" ; these_Quant = mkDeterminer Pl "these" ;
they_Pron = mkNP "they" "them" "their" Pl P3 ; they_Pron = mkNP "they" "them" "their" Pl P3 ;
this_Quant = mkDeterminer Sg "this" ; this_Quant = mkDeterminer Sg "this" ;
this_NP = regNP "this" Sg ; this_NP = regNP "this" Sg ;
those_NP = regNP "those" Pl ;
those_Quant = mkDeterminer Pl "those" ; those_Quant = mkDeterminer Pl "those" ;
thou_Pron = mkNP "you" "you" "your" Sg P2 ; thou_Pron = mkNP "you" "you" "your" Sg P2 ;
through_Prep = ss "through" ; through_Prep = ss "through" ;

View File

@@ -12,18 +12,19 @@ incomplete concrete AdjectiveScand of Adjective =
isPre = False isPre = False
} ; } ;
---- $SuperlA$ belongs to determiner syntax in $Noun$. -- $SuperlA$ belongs to determiner syntax in $Noun$.
--
-- ComplA2 a np = { ComplA2 a np = {
-- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ; s = \\ap => a.s ! AF (APosit ap) Nom ++ a.c2 ++ np.s ! accusative ;
-- isPre = False isPre = False
-- } ; } ;
--
-- ReflA2 a = { ReflA2 a = {
-- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; s = \\ap => a.s ! AF (APosit ap) Nom ++ a.c2 ++
-- isPre = False reflPron (agrP3 Utr Sg) ; ----
-- } ; isPre = False
-- } ;
SentAP ap sc = { SentAP ap sc = {
s = \\a => ap.s ! a ++ sc.s ; s = \\a => ap.s ! a ++ sc.s ;
isPre = False isPre = False

View File

@@ -6,7 +6,9 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in
UseV = predV ; UseV = predV ;
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v) ; ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v) ;
ComplV3 v np np2 = 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) ; ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
ComplVS v s = insertObj (\\_ => conjThat ++ s.s ! Sub) (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} ; CompNP np = {s = \\_ => np.s ! accusative} ;
CompAdv a = {s = \\_ => a.s} ; CompAdv a = {s = \\_ => a.s} ;
--- these give parser overflow
AdvVP vp adv = insertAdv adv.s vp ; 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} ; UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; vtype = vv.vtype} ;

View File

@@ -28,6 +28,7 @@ concrete StructuralSwe of Structural = CatSwe **
every_Det = {s = \\_,_ => "varje" ; n = Sg ; det = DDef Indef} ; every_Det = {s = \\_,_ => "varje" ; n = Sg ; det = DDef Indef} ;
everything_NP = regNP "allting" "alltings" SgNeutr ; everything_NP = regNP "allting" "alltings" SgNeutr ;
everywhere_Adv = ss "överallt" ; everywhere_Adv = ss "överallt" ;
first_Ord = {s = "första" ; isDet = True} ;
from_Prep = ss "från" ; from_Prep = ss "från" ;
he_Pron = mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ; he_Pron = mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ;
here_Adv = ss "här" ; 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 = <>} ; mkVerb6 "få" "måste" "få" "fick" "måst" "måst" ** {c2 = [] ; lock_VV = <>} ;
no_Phr = ss ["Nej"] ; no_Phr = ss ["Nej"] ;
on_Prep = ss "på" ; on_Prep = ss "på" ;
one_Quant = {s = \\_ => genderForms ["en"] ["ett"] ; n = Sg ; det = DIndef} ;
only_Predet = {s = \\_ => "bara"} ; only_Predet = {s = \\_ => "bara"} ;
or_Conj = ss "eller" ** {n = Sg} ; or_Conj = ss "eller" ** {n = Sg} ;
otherwise_PConj = ss "annars" ; otherwise_PConj = ss "annars" ;
@@ -58,8 +60,8 @@ concrete StructuralSwe of Structural = CatSwe **
quite_Adv = ss "ganska" ; quite_Adv = ss "ganska" ;
she_Pron = mkNP "hon" "henne" "hennes" "hennes" "hennes" SgUtr P3 ; she_Pron = mkNP "hon" "henne" "hennes" "hennes" "hennes" SgUtr P3 ;
so_AdA = ss "så" ; so_AdA = ss "så" ;
someSg_Det = {s = \\_ => genderForms "någon" "något" ; n = Sg ; det = DDef Indef} ; someSg_Det = {s = \\_ => genderForms "någon" "något" ; n = Sg ; det = DIndef} ;
somePl_Det = {s = \\_,_ => "några" ; n = Pl ; det = DDef Indef} ; somePl_Det = {s = \\_,_ => "några" ; n = Pl ; det = DIndef} ;
somebody_NP = regNP "någon" "någons" SgUtr ; somebody_NP = regNP "någon" "någons" SgUtr ;
something_NP = regNP "något" "någots" SgNeutr ; something_NP = regNP "något" "någots" SgNeutr ;
somewhere_Adv = ss "någonstans" ; somewhere_Adv = ss "någonstans" ;
@@ -93,6 +95,8 @@ concrete StructuralSwe of Structural = CatSwe **
when_IAdv = ss "när" ; when_IAdv = ss "när" ;
when_Subj = ss "när" ; when_Subj = ss "när" ;
where_IAdv = ss "var" ; 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 ; ---- whichPl_IDet = vilkenDet ;
---- whichSg_IDet = mkDeterminerPl "vilka" IndefP ; ---- whichSg_IDet = mkDeterminerPl "vilka" IndefP ;
whoSg_IP = {s = vem.s ; gn = SgUtr} ; whoSg_IP = {s = vem.s ; gn = SgUtr} ;