Swedish 1.4 complete

This commit is contained in:
aarne
2008-06-02 15:22:44 +00:00
parent 1a14b51f51
commit 41e0ba7f64
8 changed files with 169 additions and 63 deletions

View File

@@ -65,11 +65,3 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
}
{-
--- todo: tense of embedded Slash
SlashVSS np vs s =
mkClause (np.s ! Nom) np.a
(insertObj (\\_ => conjThat ++ s.s) (predV vs)) **
{c2 = s.c2} ;
-}

View File

@@ -44,6 +44,7 @@ incomplete concrete CatScand of Cat =
ext : Str ; -- S-Ext att hon går ---s7
en2,ea2,eext : Bool -- indicate if the field exists
} ;
VPSlash = CommonScand.VP ** {c2 : Str} ;
Comp = {s : AFormPos => Str} ;
@@ -61,14 +62,12 @@ incomplete concrete CatScand of Cat =
CN = {s : Number => DetSpecies => Case => Str ; g : Gender ; isMod : Bool} ;
NP,Pron = {s : NPForm => Str ; a : Agr} ;
Det = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ;
--- QuantSg = {s : Bool => Gender => Str ; det : DetSpecies} ;
--- QuantPl = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ;
Quant = {s : Number => Bool => Gender => Str ; det : DetSpecies} ;
Art = {s : Number => Bool => Gender => Str ; det : DetSpecies} ;
Predet = {s : GenNum => Str} ;
Num = {s : Gender => Str ; isDet : Bool ; n : Number} ;
Card = {s : Gender => Str ; n : Number} ;
Ord = {s : Str ; isDet : Bool} ;
Ord = {s : Str} ;
-- Numeral

View File

@@ -231,6 +231,17 @@ oper
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ;
a1 = vp.a1 ;
n2 = \\a => obj ! a ++ vp.n2 ! a ;
a2 = vp.a2 ;
ext = vp.ext ;
en2 = True ;
ea2 = vp.ea2 ;
eext = vp.eext
} ;
insertObjPost : (Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ;
a1 = vp.a1 ;
n2 = \\a => vp.n2 ! a ++ obj ! a ;

View File

@@ -46,25 +46,87 @@ incomplete concrete NounScand of Noun =
} ;
DetQuantOrd quant num ord = {
s = \\b,g => quant.s ! num.n ! (orB b (orB num.isDet ord.isDet)) ! g ++
s = \\b,g => quant.s ! num.n ! (orB b num.isDet) ! g ++
num.s ! g ++ ord.s ;
n = num.n ;
det = quant.det
} ;
DetQuant quant num = {
s = \\b,g => quant.s ! num.n ! (orB b num.isDet) ! g ++
num.s ! g ;
n = num.n ;
det = quant.det
} ;
DetNP det =
let
g = Neutr ; ----
m = True ; ---- is this needed for other than Art?
in {
s = \\c => det.s ! m ! g ;
a = agrP3 g det.n
} ;
DetArtOrd quant num ord = {
s = \\b,g => quant.s ! num.n ! (orB b num.isDet) ! g ++
num.s ! g ++ ord.s ;
n = num.n ;
det = quant.det
} ;
DetArtCard quant num = {
s = \\b,g => quant.s ! num.n ! b ! g ++ num.s ! g ;
n = num.n ;
det = quant.det
} ;
DetArtSg det cn =
let
g = cn.g ;
n = Sg ;
m = cn.isMod ;
dd = case <det.det,detDef,m> of {
<DDef Def, Indef, True> => DDef Indef ;
<d,_,_> => d
}
in {
s = \\c => det.s ! n ! cn.isMod ! cn.g ++
cn.s ! n ! dd ! caseNP c ;
a = agrP3 g n
} ;
DetArtPl det cn =
let
g = cn.g ;
n = Pl ;
m = cn.isMod ;
dd = case <det.det,detDef,m> of {
<DDef Def, Indef, True> => DDef Indef ;
<d,_,_> => d
}
in {
s = \\c => det.s ! n ! cn.isMod ! cn.g ++
cn.s ! n ! dd ! caseNP c ;
a = agrP3 g n
} ;
PossPron p = {
s = \\n,_,g => p.s ! NPPoss (gennum g n) ;
det = DDef Indef
} ;
NumCard c = c ** {isDet = True} ;
NumSg = {s = \\_ => [] ; isDet = False ; n = Sg} ;
NumPl = {s = \\_ => [] ; isDet = False ; n = Pl} ;
NumDigits nu = {s = \\g => nu.s ! NCard g ; isDet = True ; n = nu.n} ;
OrdDigits nu = {s = nu.s ! NOrd SupWeak ; isDet = True} ;
NumDigits nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdDigits nu = {s = nu.s ! NOrd SupWeak} ;
NumNumeral nu = {s = \\g => nu.s ! NCard g ; isDet = True ; n = nu.n} ;
OrdNumeral nu = {s = nu.s ! NOrd SupWeak ; isDet = True} ;
NumNumeral nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdNumeral nu = {s = nu.s ! NOrd SupWeak} ;
AdNum adn num = {s = \\g => adn.s ++ num.s ! g ; isDet = True ; n = num.n} ;
@@ -88,9 +150,12 @@ incomplete concrete NounScand of Noun =
} ;
det = DIndef
} ;
{-
MassDet = {s = \\_,_,_ => [] ; n = Sg ; det = DIndef} ;
-}
MassNP cn = {
s = \\c => cn.s ! Sg ! DIndef ! caseNP c ;
a = agrP3 cn.g Sg
} ;
UseN, UseN2 = \noun -> {
s = \\n,d,c => noun.s ! n ! specDet d ! c ;
---- part app wo c shows editor bug. AR 8/7/2007
@@ -98,6 +163,20 @@ incomplete concrete NounScand of Noun =
isMod = False
} ;
Use2N3 f = {
s = \\n,d,c => f.s ! n ! d ! Nom ;
g = f.g ;
c2 = f.c2 ;
isMod = False
} ;
Use3N3 f = {
s = \\n,d,c => f.s ! n ! d ! Nom ;
g = f.g ;
c2 = f.c3 ;
isMod = False
} ;
-- The genitive of this $NP$ is not correct: "sonen till mig" (not "migs").
ComplN2 f x = {
@@ -126,6 +205,13 @@ incomplete concrete NounScand of Noun =
g = g ;
isMod = cn.isMod
} ;
RelNP np rs = {
s = \\c => np.s ! c ++ rs.s ! np.a ;
a = np.a ;
isMod = np.isMod
} ;
AdvCN cn sc = let g = cn.g in {
s = \\n,d,c => cn.s ! n ! d ! c ++ sc.s ;
g = g ;

View File

@@ -69,13 +69,27 @@ incomplete concrete QuestionScand of Question =
gn = ip.gn
} ;
{-
IDetCN idet num ord cn = let g = cn.g in {
IdetCN idet cn = let g = cn.g in {
s = \\c =>
idet.s ! g ++ num.s ! g ++ ord.s ++ cn.s !idet.n ! idet.det ! caseNP c ;
idet.s ! g ++ cn.s ! idet.n ! idet.det ! caseNP c ;
gn = gennum g idet.n
} ;
-}
IdetIP idet =
let
g = Neutr ;
in {
s = \\c => idet.s ! g ;
gn = (agrP3 g idet.n).gn
} ;
IdetQuant idet num = {
s = \\g => idet.s ! num.n ! g ++ num.s ! g ;
n = num.n ;
det = idet.det
} ;
CompIAdv a = {s = \\_ => a.s} ;
CompIP ip = {s = \\_ => ip.s ! nominative} ;
}

View File

@@ -16,19 +16,13 @@ incomplete concrete SentenceScand of Sentence =
in
verb.fin ++ vp.a1 ! pol ++ verb.inf ++ vp.n2 ! agr ++ vp.a2 ++ vp.ext
} ;
{-
SlashV2 np v2 =
SlashVP np vp =
mkClause
(np.s ! nominative) np.a
(predV v2) **
{c2 = v2.c2} ;
vp **
{c2 = vp.c2} ;
SlashVVV2 np vv v2 =
mkClause
(np.s ! nominative) np.a
(insertObj (\\_ => vv.c2 ++ infVP (predV v2) np.a) (predV vv)) **
{c2 = v2.c2} ;
-}
AdvSlash slash adv = {
s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
c2 = slash.c2
@@ -62,4 +56,7 @@ incomplete concrete SentenceScand of Sentence =
} ;
AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ;
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! agrP3 Neutr Sg} ; --- vilket
}

View File

@@ -4,36 +4,38 @@ incomplete concrete VerbScand of Verb = CatScand ** open CommonScand, ResScand i
lin
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) ;
-}
SlashV2a v = predV v ** {c2 = v.c2} ;
Slash2V3 v np =
insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v) ** {c2 = v.c3} ;
Slash3V3 v np =
insertObj (\\_ => v.c3 ++ np.s ! accusative) (predV v) ** {c2 = v.c2} ;
ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
ComplVS v s = insertObj (\\_ => conjThat ++ s.s ! Sub) (predV v) ;
ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
ComplVA v ap =
insertObj (\\a => ap.s ! agrAdj a.gn DIndef) (predV v) ;
{-
ComplV2V v np vp =
insertObj
(\\a => v.c3 ++ infVP vp a)
(insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v)) ;
ComplV2S v np s =
insertObj
(\\_ => conjThat ++ s.s ! Sub)
(insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v)) ;
ComplV2Q v np q =
insertObj
(\\_ => q.s ! QIndir)
(insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v)) ;
ComplV2A v np ap =
insertObj
(\\_ => ap.s ! agrAdj np.a.gn DIndef)
(insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v)) ;
-}
ComplVA v ap = insertObj (\\a => ap.s ! agrAdj a.gn DIndef) (predV v) ;
SlashV2V v vp =
insertObj (\\a => v.c3 ++ infVP vp a) (predV v) ** {c2 = v.c2} ;
SlashV2S v s =
insertObj (\\_ => conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2} ;
SlashV2Q v q =
insertObj (\\_ => q.s ! QIndir) (predV v) ** {c2 = v.c2} ;
SlashV2A v ap =
insertObj
(\\a => ap.s ! agrAdj a.gn DIndef) (predV v) ** {c2 = v.c2} ; ---- agr to obj
ComplSlash vp np = insertObj (\\_ => vp.c2 ++ np.s ! accusative) vp ;
SlashVV v vp =
insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ** {c2 = vp.c2} ;
SlashV2VNP v np vp =
insertObj
(\\a => vp.c2 ++ np.s ! accusative ++ v.c3 ++ infVP vp a) (predV v)
** {c2 = v.c2} ;
UseComp comp = insertObj (\\a => comp.s ! agrAdj a.gn DIndef) (predV verbBe) ;
CompAP ap = ap ;
@@ -44,7 +46,7 @@ incomplete concrete VerbScand of Verb = CatScand ** open CommonScand, ResScand i
AdVVP adv vp = insertAdV adv.s vp ;
---- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron a) (predV v) ;
ReflVP vp = insertObj (\\a => vp.c2 ++ reflPron a) vp ;
PassV2 v =
insertObj

View File

@@ -100,8 +100,13 @@ 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} ;
which_IQuant = {
s = table {
Sg => genderForms "vilken" "vilket" ;
Pl => \\_ => "vilka"
} ;
det = DIndef
} ;
whoSg_IP = {s = vem.s ; gn = SgUtr} ;
whoPl_IP = {s = \\_ => "vilka" ; gn = Plg} ;
why_IAdv = ss "varför" ;