forked from GitHub/gf-core
Swedish relatives
This commit is contained in:
@@ -64,7 +64,7 @@ incomplete concrete CatScand of Cat =
|
|||||||
IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
|
IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
|
||||||
IAdv = {s : Str} ;
|
IAdv = {s : Str} ;
|
||||||
|
|
||||||
RP = {s : RCase => Str ; a : RAgr} ;
|
RP = {s : GenNum => RCase => Str ; a : RAgr} ;
|
||||||
|
|
||||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ interface DiffScand = open ResScand, Prelude in {
|
|||||||
|
|
||||||
genderForms : (x1,x2 : Str) -> Gender => Str ;
|
genderForms : (x1,x2 : Str) -> Gender => Str ;
|
||||||
|
|
||||||
|
-- The forms of a relative pronoun ("som", "vars", "i vilken").
|
||||||
|
|
||||||
|
relPron : GenNum => RCase => Str ;
|
||||||
|
|
||||||
|
-- Pronoun "sådan" used in $Relative.RelCl$.
|
||||||
|
|
||||||
|
pronSuch : GenNum => Str ;
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- The functions and parameters below are here because they depend on
|
-- The functions and parameters below are here because they depend on
|
||||||
|
|||||||
@@ -68,12 +68,19 @@ incomplete concrete NounScand of Noun =
|
|||||||
g = g
|
g = g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
RelCN cn rs = let g = cn.g in {
|
||||||
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
s = \\n,d,c => cn.s ! n ! d ! c ++ rs.s ! agrP3 g n ;
|
||||||
|
g = g
|
||||||
|
} ;
|
||||||
|
SentCN cn s = let g = cn.g in {
|
||||||
|
s = \\n,d,c => cn.s ! n ! d ! c ++ conjThat ++ s.s ! Sub ;
|
||||||
|
g = g
|
||||||
|
} ;
|
||||||
|
QuestCN cn qs = let g = cn.g in {
|
||||||
|
s = \\n,d,c => cn.s ! n ! d ! c ++ qs.s ! QIndir ;
|
||||||
|
g = g
|
||||||
|
} ;
|
||||||
|
|
||||||
SentCN cn s = {s = \\n,c => cn.s ! n ! c ++ conjThat ++ s.s} ;
|
|
||||||
QuestCN cn qs = {s = \\n,c => cn.s ! n ! c ++ qs.s ! QIndir} ;
|
|
||||||
-}
|
|
||||||
UseN noun = {
|
UseN noun = {
|
||||||
s = \\n,d => noun.s ! n ! specDet d ;
|
s = \\n,d => noun.s ! n ! specDet d ;
|
||||||
g = noun.g
|
g = noun.g
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ param
|
|||||||
--- AdjPronForm = APron GenNum Case ;
|
--- AdjPronForm = APron GenNum Case ;
|
||||||
--- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ;
|
--- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ;
|
||||||
|
|
||||||
RCase = RNom | RAcc | RGen | RPrep ;
|
RCase = RNom | RGen | RPrep ;
|
||||||
|
|
||||||
RAgr = RNoAg | RAg {gn : GenNum ; p : Person} ;
|
RAgr = RNoAg | RAg {gn : GenNum ; p : Person} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,44 @@
|
|||||||
--concrete RelativeScand of Relative = CatScand ** open ResScand in {
|
incomplete concrete RelativeScand of Relative =
|
||||||
|
CatScand ** open DiffScand, ResScand in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
RelCl cl = {
|
||||||
|
s = \\t,a,p,ag => pronSuch ! ag.gn ++ conjThat ++ cl.s ! t ! a ! p ! Sub
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelVP rp vp = {
|
||||||
|
s = \\t,ant,b,ag =>
|
||||||
|
let
|
||||||
|
agr = case rp.a of {
|
||||||
|
RNoAg => ag ;
|
||||||
|
RAg a => a
|
||||||
|
} ;
|
||||||
|
cl = mkClause (rp.s ! ag.gn ! RNom) agr vp
|
||||||
|
in
|
||||||
|
cl.s ! t ! ant ! b ! Sub
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--- We make this easy by using "som" and preposition stranding. It would be
|
||||||
|
--- a proble to determine whether $slash$ takes a direct object, since
|
||||||
|
--- $slash.c2$ is defined to be just a string.
|
||||||
--
|
--
|
||||||
-- flags optimize=all_subs ;
|
-- The empty relative is left to $ExtScand$.
|
||||||
--
|
|
||||||
-- lin
|
RelSlash rp slash = {
|
||||||
--
|
s = \\t,a,p,ag =>
|
||||||
-- RelCl cl = {
|
rp.s ! ag.gn ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.c2
|
||||||
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir
|
} ;
|
||||||
-- } ;
|
|
||||||
--
|
--- The case here could be genitive.
|
||||||
-- RelVP rp vp = {
|
|
||||||
-- s = \\t,ant,b,ag =>
|
FunRP p np rp = {
|
||||||
-- let
|
s = \\gn,c => np.s ! nominative ++ p.s ++ rp.s ! gn ! RPrep ;
|
||||||
-- agr = case rp.a of {
|
a = RAg np.a
|
||||||
-- RNoAg => ag ;
|
} ;
|
||||||
-- RAg a => a
|
|
||||||
-- } ;
|
IdRP = {s = relPron ; a = RNoAg} ;
|
||||||
-- cl = mkS (rp.s ! Nom) agr vp.s vp.s2
|
|
||||||
-- in
|
}
|
||||||
-- cl.s ! t ! ant ! b ! ODir
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- RelSlash rp slash = {
|
|
||||||
-- s = \\t,a,p,_ => slash.c2 ++ rp.s ! Acc ++ slash.s ! t ! a ! p ! ODir
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- FunRP p np rp = {
|
|
||||||
-- s = \\c => np.s ! c ++ p.s ++ rp.s ! Acc ;
|
|
||||||
-- a = RAg np.a
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- IdRP = mkIP "which" "which" "whose" Sg ** {a = RNoAg} ;
|
|
||||||
--
|
|
||||||
--}
|
|
||||||
|
|||||||
@@ -50,4 +50,14 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
|
|||||||
Neutr => allt
|
Neutr => allt
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
relPron : GenNum => RCase => Str = \\gn,c => case c of {
|
||||||
|
RNom => "som" ;
|
||||||
|
RGen => "vars" ;
|
||||||
|
RPrep => gennumForms "vilken" "vilket" "vilka" ! gn
|
||||||
|
} ;
|
||||||
|
|
||||||
|
pronSuch = gennumForms "sådan" "sådant" "sådana" ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
lib/resource-1.0/swedish/RelativeSwe.gf
Normal file
2
lib/resource-1.0/swedish/RelativeSwe.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete RelativeSwe of Relative = CatSwe ** RelativeScand with
|
||||||
|
(DiffScand = DiffSwe) ;
|
||||||
@@ -8,7 +8,7 @@ concrete TestSwe of Test =
|
|||||||
-- -- NumeralSwe,
|
-- -- NumeralSwe,
|
||||||
SentenceSwe,
|
SentenceSwe,
|
||||||
QuestionSwe,
|
QuestionSwe,
|
||||||
-- RelativeSwe,
|
RelativeSwe,
|
||||||
ConjunctionSwe,
|
ConjunctionSwe,
|
||||||
PhraseSwe,
|
PhraseSwe,
|
||||||
UntensedSwe,
|
UntensedSwe,
|
||||||
|
|||||||
Reference in New Issue
Block a user