1
0
forked from GitHub/gf-core

Swedish relatives

This commit is contained in:
aarne
2005-12-08 09:56:15 +00:00
parent 0ca556122c
commit a8a5080693
8 changed files with 78 additions and 41 deletions

View File

@@ -64,7 +64,7 @@ incomplete concrete CatScand of Cat =
IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
IAdv = {s : Str} ;
RP = {s : RCase => Str ; a : RAgr} ;
RP = {s : GenNum => RCase => Str ; a : RAgr} ;
Numeral = {s : CardOrd => Str ; n : Number} ;

View File

@@ -36,6 +36,14 @@ interface DiffScand = open ResScand, Prelude in {
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

View File

@@ -68,12 +68,19 @@ incomplete concrete NounScand of Noun =
g = g
} ;
{-
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
RelCN cn rs = let g = cn.g in {
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 = {
s = \\n,d => noun.s ! n ! specDet d ;
g = noun.g

View File

@@ -46,7 +46,7 @@ param
--- AdjPronForm = APron GenNum Case ;
--- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ;
RCase = RNom | RAcc | RGen | RPrep ;
RCase = RNom | RGen | RPrep ;
RAgr = RNoAg | RAg {gn : GenNum ; p : Person} ;

View File

@@ -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 ;
--
-- lin
--
-- RelCl cl = {
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir
-- } ;
--
-- RelVP rp vp = {
-- s = \\t,ant,b,ag =>
-- let
-- agr = case rp.a of {
-- RNoAg => ag ;
-- RAg a => a
-- } ;
-- 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} ;
--
--}
-- The empty relative is left to $ExtScand$.
RelSlash rp slash = {
s = \\t,a,p,ag =>
rp.s ! ag.gn ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.c2
} ;
--- The case here could be genitive.
FunRP p np rp = {
s = \\gn,c => np.s ! nominative ++ p.s ++ rp.s ! gn ! RPrep ;
a = RAg np.a
} ;
IdRP = {s = relPron ; a = RNoAg} ;
}

View File

@@ -50,4 +50,14 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
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" ;
}

View File

@@ -0,0 +1,2 @@
concrete RelativeSwe of Relative = CatSwe ** RelativeScand with
(DiffScand = DiffSwe) ;

View File

@@ -8,7 +8,7 @@ concrete TestSwe of Test =
-- -- NumeralSwe,
SentenceSwe,
QuestionSwe,
-- RelativeSwe,
RelativeSwe,
ConjunctionSwe,
PhraseSwe,
UntensedSwe,