mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-21 18:59:32 -06:00
modified Det structure; integrated scand definites.
This commit is contained in:
@@ -16,20 +16,22 @@ abstract Noun = Cat ** {
|
||||
UsePN : PN -> NP ; -- John
|
||||
UsePron : Pron -> NP ; -- he
|
||||
|
||||
-- Pronouns are given in the module [Structural Structural.html].
|
||||
-- Pronouns are defined in the module [Structural Structural.html].
|
||||
|
||||
-- A noun phrase already formed can be modified by a Predeterminer.
|
||||
|
||||
PredetNP : Predet -> NP -> NP; -- only the man
|
||||
|
||||
--2 Determiners
|
||||
|
||||
-- The determiner has a fine-grained structure, in which four
|
||||
-- different optional parts can be discerned. The noun phrase
|
||||
-- "all my first forty books" shows each of these parts.
|
||||
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
||||
-- quantifier and two optional parts can be discerned.
|
||||
-- The cardinal numeral is only available for plural determiners.
|
||||
-- (This is modified from CLE by further dividing their $Num$ into
|
||||
-- cardinal and ordinal.)
|
||||
|
||||
DetSg : Predet -> QuantSg -> Ord -> Det ;
|
||||
DetPl : Predet -> QuantPl -> Num -> Ord -> Det ;
|
||||
DetSg : QuantSg -> Ord -> Det ; -- this best man
|
||||
DetPl : QuantPl -> Num -> Ord -> Det ; -- these five best men
|
||||
|
||||
-- Pronouns have possessive forms. Genitives of other kinds
|
||||
-- of noun phrases are not given here, since they are not possible
|
||||
@@ -41,9 +43,8 @@ abstract Noun = Cat ** {
|
||||
-- All parts of the determiner can be empty, except $Quant$, which is
|
||||
-- the "kernel" of a determiner.
|
||||
|
||||
NoPredet : Predet ;
|
||||
NoNum : Num ;
|
||||
NoOrd : Ord ;
|
||||
NoNum : Num ;
|
||||
NoOrd : Ord ;
|
||||
|
||||
-- $Num$ consists of either digits or numeral words.
|
||||
|
||||
|
||||
@@ -10,20 +10,25 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
||||
UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||
UsePron p = p ;
|
||||
|
||||
DetSg pred quant ord = {
|
||||
s = pred.s ++ quant.s ++ ord.s ;
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s = quant.s ++ ord.s ;
|
||||
n = Sg
|
||||
} ;
|
||||
|
||||
DetPl pred quant num ord = {
|
||||
s = pred.s ++ quant.s ++ num.s ++ ord.s ;
|
||||
DetPl quant num ord = {
|
||||
s = quant.s ++ num.s ++ ord.s ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
PossSg p = {s = p.s ! Gen} ;
|
||||
PossPl p = {s = p.s ! Gen} ;
|
||||
|
||||
NoPredet, NoNum, NoOrd = {s = []} ;
|
||||
NoNum, NoOrd = {s = []} ;
|
||||
|
||||
NumInt n = n ;
|
||||
OrdInt n = {s = n.s ++ "th"} ; ---
|
||||
|
||||
@@ -10,27 +10,33 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
} ;
|
||||
|
||||
UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||
|
||||
UsePron pron = {
|
||||
s = \\c => pron.s ! NPCase c ;
|
||||
a = pron.a
|
||||
} ;
|
||||
|
||||
DetSg pred quant ord =
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ! np.a.n ! Masc ! c ++ np.s ! c ; ---- g
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetSg quant ord =
|
||||
let
|
||||
n = Sg ;
|
||||
a = quant.a
|
||||
in {
|
||||
s = \\g,c => pred.s ! n ! g ! c ++ quant.s ! g ! c ++
|
||||
s = \\g,c => quant.s ! g ! c ++
|
||||
ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||
n = n ;
|
||||
a = a
|
||||
} ;
|
||||
DetPl pred quant num ord =
|
||||
DetPl quant num ord =
|
||||
let
|
||||
n = Pl ;
|
||||
a = quant.a
|
||||
in {
|
||||
s = \\g,c => pred.s ! n ! g ! c ++ quant.s ! g ! c ++
|
||||
s = \\g,c => quant.s ! g ! c ++
|
||||
num.s ! g ! c ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||
n = n ;
|
||||
a = a
|
||||
@@ -48,7 +54,6 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
a = Weak
|
||||
} ;
|
||||
|
||||
NoPredet = {s = \\_,_,_ => []} ;
|
||||
NoNum = {s = \\_,_ => []} ;
|
||||
NoOrd = {s = \\_ => []} ;
|
||||
|
||||
|
||||
@@ -56,14 +56,19 @@ incomplete concrete CatScand of Cat =
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = {s : Number => DetSpecies => Case => Str ; g : Gender} ;
|
||||
-- The fields $isMod$ and $isDet$, and the boolean parameter of
|
||||
-- determiners, are a hack (the simples possible we found) that
|
||||
-- permits treating definite articles "huset - de fem husen - det gamla huset"
|
||||
-- as $Quant$.
|
||||
|
||||
CN = {s : Number => DetSpecies => Case => Str ; g : Gender ; isMod : Bool} ;
|
||||
NP,Pron = {s : NPForm => Str ; a : Agr} ;
|
||||
Det = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
|
||||
QuantSg = {s : Gender => Str ; det : DetSpecies} ;
|
||||
QuantPl = {s : Gender => Str ; det : DetSpecies} ;
|
||||
Det = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ;
|
||||
QuantSg = {s : Bool => Gender => Str ; det : DetSpecies} ;
|
||||
QuantPl = {s : Bool => Gender => Str ; det : DetSpecies} ;
|
||||
Predet = {s : GenNum => Str} ;
|
||||
Num = {s : Gender => Str} ;
|
||||
Ord = {s : Str} ;
|
||||
Num = {s : Gender => Str ; isDet : Bool} ;
|
||||
Ord = {s : Str ; isDet : Bool} ;
|
||||
|
||||
-- Adverb
|
||||
|
||||
|
||||
@@ -3,11 +3,18 @@ incomplete concrete NounScand of Noun =
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
-- The rule defines $Det Quant Num Ord CN$ where $Det$ is empty if
|
||||
-- it is the definite article ($DefSg$ or $DefPl$) and both $Num$ and
|
||||
-- $Ord$ are empty and $CN$ is not adjectivally modified
|
||||
-- ($AdjCN$). Thus we get $huset$ but $de fem husen$, $det gamla huset$.
|
||||
|
||||
lin
|
||||
DetCN det cn = let g = cn.g in {
|
||||
s = \\c => det.s ! g ++ cn.s ! det.n ! det.det ! caseNP c ;
|
||||
s = \\c => det.s ! cn.isMod ! g ++
|
||||
cn.s ! det.n ! det.det ! caseNP c ;
|
||||
a = agrP3 g det.n
|
||||
} ;
|
||||
|
||||
UsePN pn = {
|
||||
s = \\c => pn.s ! caseNP c ;
|
||||
a = agrP3 pn.g Sg
|
||||
@@ -15,80 +22,99 @@ incomplete concrete NounScand of Noun =
|
||||
|
||||
UsePron p = p ;
|
||||
|
||||
DetSg pred quant ord = {
|
||||
s = \\g => pred.s ! gennum g Sg ++ quant.s ! g ++ ord.s ;
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ! np.a.gn ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s = \\b,g => quant.s ! (orB b ord.isDet) ! g ++ ord.s ;
|
||||
n = Sg ;
|
||||
det = quant.det
|
||||
} ;
|
||||
DetPl pred quant num ord = {
|
||||
s = \\g => pred.s ! gennum g Pl ++ quant.s ! g ++ num.s ! g ++ ord.s ;
|
||||
DetPl quant num ord = {
|
||||
s = \\b,g => quant.s ! (orB b (orB num.isDet ord.isDet)) ! g ++ ord.s ;
|
||||
n = Pl ;
|
||||
det = quant.det
|
||||
} ;
|
||||
|
||||
PossSg p = {
|
||||
s = \\g => p.s ! NPPoss (gennum g Sg) ;
|
||||
s = \\_,g => p.s ! NPPoss (gennum g Sg) ;
|
||||
n = Sg ;
|
||||
det = DDef Indef
|
||||
} ;
|
||||
PossPl p = {
|
||||
s = \\_ => p.s ! NPPoss Plg ;
|
||||
s = \\_,_ => p.s ! NPPoss Plg ;
|
||||
n = Pl ;
|
||||
det = DDef Indef
|
||||
} ;
|
||||
|
||||
NoPredet, NoNum = {s = \\_ => []} ; -- these get different types!
|
||||
NoOrd = {s = []} ;
|
||||
NoNum = {s = \\_ => [] ; isDet = False} ;
|
||||
NoOrd = {s = [] ; isDet = False} ;
|
||||
|
||||
NumInt n = {s = \\_ => n.s} ;
|
||||
OrdInt n = {s = n.s ++ ":e"} ; ---
|
||||
NumInt n = {s = \\_ => n.s ; isDet = True} ;
|
||||
OrdInt n = {s = n.s ++ ":e" ; isDet = True} ; ---
|
||||
|
||||
NumNumeral numeral = {s = \\g => numeral.s ! NCard g} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd SupWeak} ;
|
||||
NumNumeral numeral = {s = \\g => numeral.s ! NCard g ; isDet = True} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd SupWeak ; isDet = True} ;
|
||||
|
||||
AdNum adn num = {s = \\g => adn.s ++ num.s ! g} ;
|
||||
AdNum adn num = {s = \\g => adn.s ++ num.s ! g ; isDet = True} ;
|
||||
|
||||
OrdSuperl a = {s = a.s ! AF (ASuperl SupWeak) Nom} ;
|
||||
OrdSuperl a = {s = a.s ! AF (ASuperl SupWeak) Nom ; isDet = True} ;
|
||||
|
||||
DefSg = {s = \\g => artDef (gennum g Sg) ; n = Sg ; det = DDef detDef} ;
|
||||
DefPl = {s = \\_ => artDef Plg ; n = Pl ; det = DDef detDef} ;
|
||||
DefSg = {
|
||||
s = \\b,g => if_then_Str b (artDef (gennum g Sg)) [] ;
|
||||
n = Sg ;
|
||||
det = DDef detDef
|
||||
} ;
|
||||
DefPl = {
|
||||
s = \\b,_ => if_then_Str b (artDef Plg) [] ;
|
||||
n = Pl ;
|
||||
det = DDef detDef
|
||||
} ;
|
||||
|
||||
IndefSg = {s = artIndef ; n = Sg ; det = DIndef} ;
|
||||
IndefPl = {s = \\_ => [] ; n = Pl ; det = DIndef} ;
|
||||
IndefSg = {s = \\_ => artIndef ; n = Sg ; det = DIndef} ;
|
||||
IndefPl = {s = \\_,_ => [] ; n = Pl ; det = DIndef} ;
|
||||
|
||||
MassDet = {s = \\_ => [] ; n = Sg ; det = DIndef} ;
|
||||
MassDet = {s = \\_,_ => [] ; n = Sg ; det = DIndef} ;
|
||||
|
||||
UseN, UseN2, UseN3 = \noun -> {
|
||||
s = \\n,d => noun.s ! n ! specDet d ;
|
||||
g = noun.g
|
||||
g = noun.g ;
|
||||
isMod = False
|
||||
} ;
|
||||
|
||||
-- The genitive of this $NP$ is not correct: "sonen till mig" (not "migs").
|
||||
|
||||
ComplN2 f x = {
|
||||
s = \\n,d,c => f.s ! n ! specDet d ! Nom ++ f.c2 ++ x.s ! accusative ;
|
||||
g = f.g
|
||||
g = f.g ;
|
||||
isMod = False
|
||||
} ;
|
||||
ComplN3 f x = {
|
||||
s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2 ++ x.s ! accusative ;
|
||||
g = f.g ;
|
||||
c2 = f.c3
|
||||
c2 = f.c3 ;
|
||||
isMod = False
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = let g = cn.g in {
|
||||
s = \\n,d,c => preOrPost ap.isPre
|
||||
(ap.s ! agrAdj (gennum g n) d)
|
||||
(cn.s ! n ! d ! c) ;
|
||||
g = g
|
||||
g = g ;
|
||||
isMod = True
|
||||
} ;
|
||||
|
||||
RelCN cn rs = let g = cn.g in {
|
||||
s = \\n,d,c => cn.s ! n ! d ! c ++ rs.s ! agrP3 g n ;
|
||||
g = g
|
||||
g = g ;
|
||||
isMod = cn.isMod
|
||||
} ;
|
||||
SentCN cn sc = let g = cn.g in {
|
||||
s = \\n,d,c => cn.s ! n ! d ! c ++ sc.s ;
|
||||
g = g
|
||||
g = g ;
|
||||
isMod = cn.isMod
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ concrete StructuralSwe of Structural = CatSwe **
|
||||
during_Prep = ss "under" ;
|
||||
either7or_DConj = sd2 "antingen" "eller" ** {n = Sg} ;
|
||||
everybody_NP = regNP "alla" "allas" Plg ;
|
||||
every_Det = {s = \\_ => "varje" ; n = Sg ; det = DDef Indef} ;
|
||||
every_Det = {s = \\_,_ => "varje" ; n = Sg ; det = DDef Indef} ;
|
||||
everything_NP = regNP "allting" "alltings" SgNeutr ;
|
||||
everywhere_Adv = ss "överallt" ;
|
||||
from_Prep = ss "från" ;
|
||||
@@ -41,10 +41,10 @@ concrete StructuralSwe of Structural = CatSwe **
|
||||
in_Prep = ss "i" ;
|
||||
it_Pron = regNP "det" "dess" SgNeutr ;
|
||||
less_CAdv = ss "mindre" ;
|
||||
many_Det = {s = \\_ => "många" ; n = Pl ; det = DDef Indef} ;
|
||||
many_Det = {s = \\_,_ => "många" ; n = Pl ; det = DDef Indef} ;
|
||||
more_CAdv = ss "mer" ;
|
||||
most_Predet = {s = gennumForms ["den mesta"] ["det mesta"] ["de flesta"]} ;
|
||||
much_Det = {s = \\_ => "mycket" ; n = Pl ; det = DDef Indef} ;
|
||||
much_Det = {s = \\_,_ => "mycket" ; n = Pl ; det = DDef Indef} ;
|
||||
must_VV =
|
||||
mkVerb6 "få" "måste" "få" "fick" "måst" "måst" ** {c2 = [] ; lock_VV = <>} ;
|
||||
no_Phr = ss ["Nej"] ;
|
||||
@@ -58,24 +58,26 @@ 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 = DDef Indef} ;
|
||||
somePl_Det = {s = \\_,_ => "några" ; n = Pl ; det = DDef Indef} ;
|
||||
somebody_NP = regNP "någon" "någons" SgUtr ;
|
||||
something_NP = regNP "något" "någots" SgNeutr ;
|
||||
somewhere_Adv = ss "någonstans" ;
|
||||
that_Quant = {s = genderForms ["den där"] ["det där"] ; n = Sg ; det = DDef Def} ;
|
||||
that_Quant =
|
||||
{s = \\_ => genderForms ["den där"] ["det där"] ; n = Sg ; det = DDef Def} ;
|
||||
that_NP = regNP ["det där"] ["det därs"] SgNeutr ;
|
||||
there_Adv = ss "där" ;
|
||||
there7to_Adv = ss "dit" ;
|
||||
there7from_Adv = ss "därifrån" ;
|
||||
therefore_PConj = ss "därför" ;
|
||||
these_NP = regNP ["de här"] ["det härs"] Plg ;
|
||||
these_Quant = {s = \\_ => ["de här"] ; n = Pl ; det = DDef Def} ;
|
||||
these_Quant = {s = \\_,_ => ["de här"] ; n = Pl ; det = DDef Def} ;
|
||||
they_Pron = mkNP "de" "dem" "deras" "deras" "deras" Plg P1 ;
|
||||
this_Quant = {s = genderForms ["den här"] ["det här"] ; n = Sg ; det = DDef Def} ;
|
||||
this_Quant =
|
||||
{s = \\_ => genderForms ["den här"] ["det här"] ; n = Sg ; det = DDef Def} ;
|
||||
this_NP = regNP ["det här"] ["det härs"] SgNeutr ;
|
||||
those_NP = regNP ["de där"] ["det därs"] Plg ;
|
||||
those_Quant = {s = \\_ => ["de där"] ; n = Pl ; det = DDef Def} ;
|
||||
those_Quant = {s = \\_,_ => ["de där"] ; n = Pl ; det = DDef Def} ;
|
||||
thou_Pron = mkNP "du" "dig" "din" "ditt" "dina" SgUtr P2 ;
|
||||
through_Prep = ss "genom" ;
|
||||
too_AdA = ss "för" ;
|
||||
|
||||
Reference in New Issue
Block a user