1
0
forked from GitHub/gf-core

progress with scandinavian

This commit is contained in:
aarne
2005-12-07 11:32:04 +00:00
parent 141fa43eb8
commit 0dfd8c1517
20 changed files with 414 additions and 316 deletions

View File

@@ -8,7 +8,7 @@ incomplete concrete AdjectiveScand of Adjective =
isPre = True isPre = True
} ; } ;
ComparA a np = { ComparA a np = {
s = \\_ => a.s ! AF ACompar Nom ++ conjThan ++ np.s ! NPNom ; s = \\_ => a.s ! AF ACompar Nom ++ conjThan ++ np.s ! nominative ;
isPre = False isPre = False
} ; } ;

View File

@@ -5,13 +5,13 @@ incomplete concrete AdverbScand of Adverb = CatScand ** open DiffScand, ResScand
s = a.s ! adverbForm s = a.s ! adverbForm
} ; } ;
ComparAdvAdj cadv a np = { ComparAdvAdj cadv a np = {
s = cadv.s ++ a.s ! adverbForm ++ conjThan ++ np.s ! NPNom s = cadv.s ++ a.s ! adverbForm ++ conjThan ++ np.s ! nominative
} ; } ;
ComparAdvAdjS cadv a s = { ComparAdvAdjS cadv a s = {
s = cadv.s ++ a.s ! adverbForm ++ conjThan ++ s.s ! Sub s = cadv.s ++ a.s ! adverbForm ++ conjThan ++ s.s ! Sub
} ; } ;
PrepNP prep np = {s = prep.s ++ np.s ! NPAcc} ; PrepNP prep np = {s = prep.s ++ np.s ! accusative} ;
AdAdv = cc2 ; AdAdv = cc2 ;
@@ -20,7 +20,7 @@ incomplete concrete AdverbScand of Adverb = CatScand ** open DiffScand, ResScand
} ; } ;
AdvSC s = s ; AdvSC s = s ;
AdnCAdv cadv = {s = cadv.s ++ "than"} ; AdnCAdv cadv = {s = cadv.s ++ conjThan} ;
oper oper
adverbForm : AForm = AF (APosit (Strong SgNeutr)) Nom ; adverbForm : AForm = AF (APosit (Strong SgNeutr)) Nom ;

View File

@@ -1,5 +1,5 @@
incomplete concrete CatScand of Cat = incomplete concrete CatScand of Cat =
open ParamScand, Prelude, DiffScand, (R = ParamX) in { open ResScand, Prelude, DiffScand, (R = ParamX) in {
lincat lincat
Text, Phr, Utt = {s : Str} ; Text, Phr, Utt = {s : Str} ;
@@ -16,21 +16,23 @@ incomplete concrete CatScand of Cat =
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ; RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
-- Constructed in $Verb$.
VP = { VP = {
v : SForm => { s : SForm => {
v1 : Str ; -- V1 har ---s1 fin : Str ; -- V1 har ---s1
v2 : Str -- V2 sagt ---s4 inf : Str -- V2 sagt ---s4
} ; } ;
a1 : Bool => Str ; -- A1 inte ---s3 a1 : Polarity => Str ; -- A1 inte ---s3
n2 : Agr => Str ; -- N2 dig ---s5 n2 : Agr => Str ; -- N2 dig ---s5
a2 : Str ; -- A2 idag ---s6 a2 : Str ; -- A2 idag ---s6
ext : Str ; -- S extraposition ---s7 ext : Str ; -- S-Ext att hon går ---s7
ea1,ev2,en2,ea2,eext : Bool -- indicate if the field exists en2,ea2,eext : Bool -- indicate if the field exists
} ; } ;
V, VS, VQ, VA = {s : VForm => Str} ; V, VS, VQ, VA = Verb ;
V2, VV, V2A = {s : VForm => Str} ** {c2 : Str} ; V2, VV, V2A = Verb ** {c2 : Str} ;
V3 = {s : VForm => Str} ** {c2,c3 : Str} ; V3 = Verb ** {c2,c3 : Str} ;
AP = {s : AFormPos => Str ; isPre : Bool} ; AP = {s : AFormPos => Str ; isPre : Bool} ;
Comp = {s : AFormPos => Str} ; Comp = {s : AFormPos => Str} ;
@@ -43,12 +45,17 @@ incomplete concrete CatScand of Cat =
Adv, AdV, AdA, AdS, AdN = {s : Str} ; Adv, AdV, AdA, AdS, AdN = {s : Str} ;
Prep = {s : Str} ; Prep = {s : Str} ;
Det, Quant = {s : Gender => Str ; n : Number ; det : DetSpecies } ; -- Constructed in $Noun$.
Predet, Num, Ord = {s : Str} ;
CN,N = Noun ; Det, Quant = {s : Gender => Str ; n : Number ; det : DetSpecies } ;
-- {s : Number => Species => Case => Str ; g : Gender} ; Predet = {s : GenNum => Str} ;
PN = {s : Case => Str ; g : Gender} ; Num = {s : Gender => Str} ;
Ord = {s : Str} ;
N = Noun ;
-- {s : Number => Species => Case => Str ; g : Gender} ;
CN = {s : Number => DetSpecies => Case => Str ; g : Gender} ;
PN = {s : Case => Str ; g : Gender} ;
Pron, NP = {s : NPForm => Str ; a : Agr} ; Pron, NP = {s : NPForm => Str ; a : Agr} ;
N2 = Noun ** {c2 : Str} ; N2 = Noun ** {c2 : Str} ;
N3 = Noun ** {c2,c3 : Str} ; N3 = Noun ** {c2,c3 : Str} ;

View File

@@ -1,4 +1,6 @@
interface DiffScand = { interface DiffScand = open ResScand, Prelude in {
-- Parameters.
param param
Gender ; Gender ;
@@ -6,7 +8,68 @@ interface DiffScand = {
oper oper
neutrum, utrum : Gender ; neutrum, utrum : Gender ;
gennum : Gender -> Number -> GenNum ;
agrP3 : Gender -> Number -> Agr = \g,n -> {
gn = gennum g n ;
p = P3
} ;
-- This is the form of the noun in "det stora berget"/"det store berg".
detDef : Species ;
-- Strings.
conjThat : Str ; conjThat : Str ;
conjThan : Str ; conjThan : Str ;
infMark : Str ; infMark : Str ;
artIndef : Gender => Str ;
verbHave : {s : VForm => Str} ;
auxFut : Str ;
auxCond : Str ;
negation : Polarity => Str ;
-- This function is here because it depends on $verbHave, auxFut, auxCond$.
predV : Verb -> VP = \verb ->
let
vfin : Tense -> Str = \t -> verb.s ! vFin t Act ;
vsup = verb.s ! VI (VSupin Act) ;
vinf = verb.s ! VI (VInfin Act) ;
har : Tense -> Str = \t -> verbHave.s ! vFin t Act ;
ha : Str = verbHave.s ! VI (VInfin Act) ;
vf : Str -> Str -> {fin,inf : Str} = \fin,inf -> {
fin = fin ; inf = inf
} ;
in {
s = table {
VFinite t Simul => case t of {
Pres | Past => vf (vfin t) [] ;
Fut => vf auxFut vinf ;
Cond => vf auxCond vinf
} ;
VFinite t Anter => case t of {
Pres | Past => vf (har t) vsup ;
Fut => vf auxFut (ha ++ vsup) ;
Cond => vf auxCond (ha ++ vsup)
} ;
VImperat => vf (verb.s ! VF (VImper Act)) [] ;
VInfinit Simul => vf [] vinf ;
VInfinit Anter => vf [] (ha ++ vsup)
} ;
a1 : Polarity => Str = negation ;
n2 : Agr => Str = \\_ => [] ;
a2 : Str = [] ;
ext : Str = [] ;
en2,ea2,eext : Bool = False -- indicate if the field exists
} ;
} }

View File

@@ -1,26 +1,14 @@
--concrete ExtScand of ExtScandAbs = CatScand ** open ResScand in { incomplete concrete ExtScand of ExtScandAbs =
-- CatScand ** open DiffScand, ResScand in {
-- lincat
-- lin
-- Aux = {s : Polarity => Str} ; DefSgN predet noun = let g = noun.g in {
-- s = \\c => predet.s ! gennum g Sg ++ noun.s ! Sg ! Def ! caseNP c ;
-- lin a = agrP3 g Sg
-- } ;
-- PredAux np aux vp = mkS (np.s ! Nom) np.a DefPlN predet noun = let g = noun.g in {
-- (\\t,ant,b,ord,agr => s = \\c => predet.s ! Plg ++ noun.s ! Pl ! Def ! caseNP c ;
-- let a = agrP3 g Sg
-- fin = aux.s ! b ; } ;
-- vf : Str -> Str -> {fin, inf : Str} = \x,y ->
-- {fin = x ; inf = y} ; }
-- in
-- case ant of {
-- Simul => vf fin [] ;
-- Anter => vf fin "have"
-- }
-- )
-- (\\agr => infVP vp agr) ;
--
-- can_Aux = {s = \\p => posneg p "can"} ; ---- cannt
-- must_Aux = {s = \\p => posneg p "must"} ;
--
--}

View File

@@ -0,0 +1,9 @@
abstract ExtScandAbs = Cat ** {
fun
-- Definite form of simple nouns without article; neither $Num$ nor $Ord$ allowed.
DefSgN, DefPlN : Predef -> N -> NP ;
}

View File

@@ -1,50 +1,73 @@
--concrete NounScand of Noun = CatScand ** open ResScand, Prelude in { incomplete concrete NounScand of Noun =
-- CatScand ** open DiffScand, ResScand, Prelude in {
-- flags optimize=all_subs ;
-- flags optimize=all_subs ;
-- lin
-- DetCN det cn = { lin
-- s = \\c => det.s ++ cn.s ! det.n ! c ; DetCN det cn = let g = cn.g in {
-- a = agrP3 det.n s = \\c => det.s ! g ++ cn.s ! det.n ! det.det ! caseNP c ;
-- } ; a = agrP3 g det.n
-- UsePN pn = pn ** {a = agrP3 Sg} ; } ;
-- UsePron p = p ; UsePN pn = {
-- s = \\c => pn.s ! caseNP c ;
-- MkDet pred quant num ord = { a = agrP3 pn.g Sg
-- s = pred.s ++ quant.s ++ num.s ++ ord.s ; } ;
-- n = quant.n
-- } ; UsePron p = p ;
--
-- PossPronSg p = {s = p.s ! Gen ; n = Sg} ; MkDet pred quant num ord = let n = quant.n in {
-- PossPronPl p = {s = p.s ! Gen ; n = Pl} ; s = \\g => pred.s ! gennum g n ++ quant.s ! g ++ num.s ! g ++ ord.s ;
-- n = n ;
-- NoPredet, NoNum, NoOrd = {s = []} ; det = quant.det
-- NumInt n = n ; } ;
--
-- NumNumeral numeral = {s = numeral.s ! NCard} ; PossPronSg p = {
-- OrdNumeral numeral = {s = numeral.s ! NOrd} ; s = \\g => p.s ! NPPoss (gennum g Sg) ;
-- n = Sg ;
-- AdNum adn num = {s = adn.s ++ num.s} ; det = DDef Indef
-- } ;
-- OrdSuperl a = {s = a.s ! AAdj Superl} ; PossPronPl p = {
-- s = \\_ => p.s ! NPPoss Plg ;
-- DefSg = {s = artDef ; n = Sg} ; n = Pl ;
-- DefPl = {s = artDef ; n = Pl} ; det = DDef Indef
-- } ;
-- IndefSg = {s = artIndef ; n = Sg} ;
-- IndefPl = {s = [] ; n = Pl} ; NoPredet, NoNum = {s = \\_ => []} ; -- these get different types!
-- NoOrd = {s = []} ;
-- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ; NumInt n = {s = \\_ => n.s} ;
-- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
-- ---- NumNumeral numeral = {s = \\g => numeral.s ! NCard g} ;
-- AdjCN ap cn = { OrdNumeral numeral = {s = numeral.s ! NOrd} ;
-- s = \\n,c => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n ! c)
-- } ; AdNum adn num = {s = \\g => adn.s ++ num.s ! g} ;
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
-- OrdSuperl a = {s = a.s ! AF (ASuperl SupWeak) Nom} ;
-- 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} ; DefSg = {s = \\g => artDef (gennum g Sg) ; n = Sg ; det = DDef detDef} ;
-- DefPl = {s = \\_ => artDef Plg ; n = Pl ; det = DDef detDef} ;
-- UseN n = n ;
-- IndefSg = {s = artIndef ; n = Sg ; det = DIndef} ;
--} IndefPl = {s = \\_ => [] ; n = Pl ; det = DIndef} ;
---- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
---- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
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
} ;
{-
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
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

@@ -1,4 +1,4 @@
resource ParamScand = ParamX ** { resource ParamScand = ParamX ** open Prelude in {
param param
Species = Indef | Def ; Species = Indef | Def ;
@@ -18,6 +18,8 @@ param
| ACompar | ACompar
| ASuperl AFormSup ; | ASuperl AFormSup ;
-- The $Number$ in $Weak$ only matters in "lilla"/"små".
AFormPos = Strong GenNum | Weak Number ; AFormPos = Strong GenNum | Weak Number ;
AFormSup = SupStrong | SupWeak ; AFormSup = SupStrong | SupWeak ;
@@ -40,7 +42,7 @@ param
| VImperat | VImperat
| VInfinit Anteriority ; | VInfinit Anteriority ;
NPForm = NPNom | NPAcc | NPGen GenNum ; NPForm = NPNom | NPAcc | NPPoss GenNum ;
--- AdjPronForm = APron GenNum Case ; --- AdjPronForm = APron GenNum Case ;
--- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ; --- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ;
@@ -53,4 +55,33 @@ param
oper oper
Agr : PType = {gn : GenNum ; p : Person} ; Agr : PType = {gn : GenNum ; p : Person} ;
nominative : NPForm = NPNom ;
accusative : NPForm = NPAcc ;
caseNP : NPForm -> Case = \np -> case np of {
NPPoss _ => Gen ;
_ => Nom
} ;
specDet : DetSpecies -> Species = \d -> case d of {
DDef Def => Def ;
_ => Indef
} ;
-- Used in $Noun.AdjCN$.
agrAdj : GenNum -> DetSpecies -> AFormPos = \gn,d -> case <gn,d> of {
<_, DIndef> => Strong gn ;
<Plg,DDef _> => Weak Pl ;
_ => Weak Sg
} ;
-- Used in $DiffScand.predV$.
vFin : Tense -> Voice -> VForm = \t,v -> case t of {
Pres => VF (VPres v) ;
Past => VF (VPret v) ;
_ => VI (VInfin v) --- not to be used?
} ;
} }

View File

@@ -9,9 +9,9 @@ incomplete concrete PhraseScand of Phrase =
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
UttIP ip = {s = ip.s ! NPNom} ; --- Acc also UttIP ip = {s = ip.s ! nominative} ; --- Acc also
UttIAdv iadv = iadv ; UttIAdv iadv = iadv ;
UttNP np = {s = np.s ! NPAcc} ; UttNP np = {s = np.s ! accusative} ;
---- UttVP vp = {s = infMark ++ infVP vp (agrP3 Sg)} ; ---- UttVP vp = {s = infMark ++ infVP vp (agrP3 Sg)} ;
UttAdv adv = adv ; UttAdv adv = adv ;
@@ -19,6 +19,6 @@ incomplete concrete PhraseScand of Phrase =
PConjConj conj = conj ; PConjConj conj = conj ;
NoVoc = {s = []} ; NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! NPNom} ; VocNP np = {s = "," ++ np.s ! nominative} ;
} }

View File

@@ -102,127 +102,66 @@ resource ResScand = ParamScand ** open Prelude in {
-- --
-- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} = -- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
-- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ; -- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
--
-- mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} = -- For $Noun$.
-- \i,me,my,n,p -> {
-- s = table { artDef : GenNum -> Str = \gn -> gennumForms "den" "det" "de" ! gn ;
-- Nom => i ;
-- Acc => me ; mkNP : (x1,_,_,_,x5 : Str) -> GenNum -> Person ->
-- Gen => my {s : NPForm => Str ; a : Agr} = \du,dig,din,ditt,dina,gn,p -> {
-- } ; s = table {
-- a = { NPNom => du ;
-- n = n ; NPAcc => dig ;
-- p = p NPPoss g => gennumForms din ditt dina ! g
-- } } ;
-- } ; a = {
-- gn = gn ;
---- These functions cover many cases; full coverage inflectional patterns are p = p
---- in $MorphoScand$. }
-- } ;
-- regN : Str -> {s : Number => Case => Str} = \car ->
-- mkNoun car (car + "'s") (car + "s") (car + "s'") ; gennumForms : (x1,x2,x3 : Str) -> GenNum => Str = \den,det,de ->
-- table {
-- regA : Str -> {s : AForm => Str} = \warm -> SgUtr => den ;
-- mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ; SgNeutr => det ;
-- _ => de
-- regV : Str -> {s : VForm => Str} = \walk -> } ;
-- mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ;
--
-- regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n -> -- regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n ->
-- mkNP that that (that + "'s") n P3 ; -- mkNP that that (that + "'s") n P3 ;
-- --
---- We have just a heuristic definition of the indefinite article.
---- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic -- For $Verb$.
---- "o" ("one-sided"), vocalic "u" ("umbrella").
-- Verb : Type = {
-- artIndef = pre { s : VForm => Str
-- "a" ; } ;
-- "an" / strs {"a" ; "e" ; "i" ; "o" ; "A" ; "E" ; "I" ; "O" }
-- } ; VP = {
-- s : SForm => {
-- artDef = "the" ; fin : Str ; -- V1 har ---s1
-- inf : Str -- V2 sagt ---s4
---- For $Verb$. } ;
-- a1 : Polarity => Str ; -- A1 inte ---s3
-- Verb : Type = { n2 : Agr => Str ; -- N2 dig ---s5
-- s : VForm => Str a2 : Str ; -- A2 idag ---s6
-- } ; ext : Str ; -- S-Ext att hon går ---s7
-- --- ea1,ev2, --- these depend on params of v and a1
-- VerbForms : Type = en2,ea2,eext : Bool -- indicate if the field exists
-- Tense => Anteriority => Polarity => Ord => Agr => {fin, inf : Str} ; } ;
--
-- VP : Type = {
-- s : VerbForms ; insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
-- s2 : Agr => Str s = vp.s ;
-- } ; a1 = vp.a1 ;
-- n2 = \\a => vp.n2 ! a ++ obj ! a ;
-- predV : Verb -> VP = \verb -> { a2 = vp.a2 ;
-- s = \\t,ant,b,ord,agr => ext = vp.ext ;
-- let en2 = True ;
-- inf = verb.s ! VInf ; ea2 = vp.ea2 ;
-- fin = presVerb verb agr ; eext = vp.eext
-- past = verb.s ! VPast ; } ;
-- part = verb.s ! VPPart ;
-- vf : Str -> Str -> {fin, inf : Str} = \x,y ->
-- {fin = x ; inf = y} ;
-- in
-- case <t,ant,b,ord> of {
-- <Pres,Simul,Pos,ODir> => vf fin [] ;
-- <Pres,Simul,Pos,OQuest> => vf (does agr) inf ;
-- <Pres,Simul,Neg,_> => vf (doesnt agr) inf ;
-- <Pres,Anter,Pos,_> => vf (have agr) part ;
-- <Pres,Anter,Neg,_> => vf (havent agr) part ;
-- <Past,Simul,Pos,ODir> => vf past [] ;
-- <Past,Simul,Pos,OQuest> => vf "did" inf ;
-- <Past,Simul,Neg,_> => vf "didn't" inf ;
-- <Past,Anter,Pos,_> => vf "had" part ;
-- <Past,Anter,Neg,_> => vf "hadn't" part ;
-- <Fut, Simul,Pos,_> => vf "will" inf ;
-- <Fut, Simul,Neg,_> => vf "won't" inf ;
-- <Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ;
-- <Fut, Anter,Neg,_> => vf "won't" ("have" ++ part) ;
-- <Cond,Simul,Pos,_> => vf "would" inf ;
-- <Cond,Simul,Neg,_> => vf "wouldn't" inf ;
-- <Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
-- <Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
-- } ;
-- s2 = \\_ => []
-- } ;
--
-- predAux : Aux -> VP = \verb -> {
-- s = \\t,ant,b,ord,agr =>
-- let
-- inf = verb.inf ;
-- fin = verb.pres ! b ! agr ;
-- past = verb.past ! b ! agr ;
-- part = verb.ppart ;
-- vf : Str -> Str -> {fin, inf : Str} = \x,y ->
-- {fin = x ; inf = y} ;
-- in
-- case <t,ant,b,ord> of {
-- <Pres,Simul,_, _> => vf fin [] ;
-- <Pres,Anter,Pos,_> => vf (have agr) part ;
-- <Pres,Anter,Neg,_> => vf (havent agr) part ;
-- <Past,Simul,_, _> => vf past [] ;
-- <Past,Anter,Pos,_> => vf "had" part ;
-- <Past,Anter,Neg,_> => vf "hadn't" part ;
-- <Fut, Simul,Pos,_> => vf "will" inf ;
-- <Fut, Simul,Neg,_> => vf "won't" inf ;
-- <Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ;
-- <Fut, Anter,Neg,_> => vf "won't" ("have" ++ part) ;
-- <Cond,Simul,Pos,_> => vf "would" inf ;
-- <Cond,Simul,Neg,_> => vf "wouldn't" inf ;
-- <Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
-- <Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
-- } ;
-- s2 = \\_ => []
-- } ;
--
-- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
-- s = vp.s ;
-- s2 = \\a => vp.s2 ! a ++ obj ! a
-- } ;
--
----- This is not functional. ----- This is not functional.
-- --
-- insertAdV : Str -> VP -> VP = \adv,vp -> { -- insertAdV : Str -> VP -> VP = \adv,vp -> {
@@ -232,10 +171,10 @@ resource ResScand = ParamScand ** open Prelude in {
-- --
-- presVerb : {s : VForm => Str} -> Agr -> Str = \verb -> -- presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
-- agrVerb (verb.s ! VPres) (verb.s ! VInf) ; -- agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
--
-- infVP : VP -> Agr -> Str = \vp,a -> infVP : VP -> Agr -> Str = \vp,a ->
-- (vp.s ! Fut ! Simul ! Neg ! ODir ! a).inf ++ vp.s2 ! a ; (vp.s ! VInfinit Simul).inf ++ vp.n2 ! a ++ vp.a2 ++ vp.ext ; --- a1
--
-- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> -- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
-- case agr of { -- case agr of {
-- {n = Sg ; p = P3} => has ; -- {n = Sg ; p = P3} => has ;
@@ -275,26 +214,29 @@ resource ResScand = ParamScand ** open Prelude in {
-- {n = Pl ; p = P2} => "yourselves" ; -- {n = Pl ; p = P2} => "yourselves" ;
-- {n = Pl ; p = P3} => "themselves" -- {n = Pl ; p = P3} => "themselves"
-- } ; -- } ;
--
---- For $Sentence$. -- For $Sentence$.
--
-- Clause : Type = { Clause : Type = {
-- s : Tense => Anteriority => Polarity => Ord => Str s : Tense => Anteriority => Polarity => Order => Str
-- } ; } ;
--
-- mkS : Str -> Agr -> VerbForms -> (Agr => Str) -> Clause = mkS : Str -> Agr ->
-- \subj,agr,verb,compl0 -> { (SForm => {fin,inf : Str}) -> (Polarity => Str) -> (Agr => Str) -> Clause =
-- s = \\t,a,b,o => \subj,agr,verb,adv,compl0 -> {
-- let s = \\t,a,b,o =>
-- verb = verb ! t ! a ! b ! o ! agr ; let
-- compl = compl0 ! agr verb = verb ! VFinite t a ;
-- in neg = adv ! b ;
-- case o of { compl = compl0 ! agr
-- ODir => subj ++ verb.fin ++ verb.inf ++ compl ; in
-- OQuest => verb.fin ++ subj ++ verb.inf ++ compl case o of {
-- } Main => subj ++ verb.fin ++ neg ++ verb.inf ++ compl ;
-- } ; Inv => verb.fin ++ subj ++ neg ++ verb.inf ++ compl ;
-- Sub => subj ++ neg ++ verb.fin ++ verb.inf ++ compl
}
} ;
-- --
---- For $Numeral$. ---- For $Numeral$.
-- --

View File

@@ -1,10 +1,11 @@
--concrete SentenceScand of Sentence = CatScand ** open ResScand in { incomplete concrete SentenceScand of Sentence =
-- CatScand ** open DiffScand, ResScand in {
-- flags optimize=all_subs ;
-- flags optimize=all_subs ;
-- lin
-- PredVP np vp = mkS (np.s ! Nom) np.a vp.s vp.s2 ; lin
-- PredVP np vp = mkS (np.s ! nominative) np.a vp.s vp.a1 vp.n2 ;
-- PredSCVP sc vp = mkS sc.s (agrP3 Sg) vp.s vp.s2 ; -- PredSCVP sc vp = mkS sc.s (agrP3 Sg) vp.s vp.s2 ;
-- --
-- ImpVP vp = { -- ImpVP vp = {
@@ -34,4 +35,4 @@
-- --
-- SlashPrep cl prep = cl ** {c2 = prep.s} ; -- SlashPrep cl prep = cl ** {c2 = prep.s} ;
-- --
--} }

View File

@@ -1,15 +1,15 @@
--concrete UntensedScand of Untensed = CatScand ** open ResScand in { incomplete concrete UntensedScand of Untensed = CatScand ** open ResScand in {
--
-- flags optimize=all_subs ; flags optimize=all_subs ;
--
-- lin lin
-- PosCl cl = {s = cl.s ! Pres ! Simul ! Pos ! ODir} ; PosCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
-- NegCl cl = {s = cl.s ! Pres ! Simul ! Neg ! ODir} ; NegCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
--
-- PosQCl cl = {s = cl.s ! Pres ! Simul ! Pos} ; PosQCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
-- NegQCl cl = {s = cl.s ! Pres ! Simul ! Neg} ; NegQCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
--
-- PosRCl cl = {s = cl.s ! Pres ! Simul ! Pos} ; PosRCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
-- NegRCl cl = {s = cl.s ! Pres ! Simul ! Neg} ; NegRCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
--
--} }

View File

@@ -1,38 +1,39 @@
--concrete VerbScand of Verb = CatScand ** open ResScand in { incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in {
--
-- flags optimize=all_subs ; flags optimize=all_subs ;
--
-- lin lin
-- UseV = predV ; UseV = predV ;
-- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (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 ! Acc ++ v.c3 ++ np2.s ! Acc) (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) (predV v) ; ComplVS v s = insertObj (\\_ => conjThat ++ s.s ! Sub) (predV v) ;
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
-- {-
-- ComplVA v ap = insertObj (ap.s) (predV v) ; ComplVA v ap = insertObj (ap.s) (predV v) ;
-- ComplV2A v np ap = ComplV2A v np ap =
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
--
-- UseComp comp = insertObj comp.s (predAux auxBe) ; UseComp comp = insertObj comp.s (predAux auxBe) ;
--
-- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; AdvVP vp adv = insertObj (\\_ => 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) ; ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
--
-- PassV2 v = {s = \\_ => v.s ! VPPart} ; PassV2 v = {s = \\_ => v.s ! VPPart} ;
--
-- UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to" UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ;
--
-- CompAP ap = ap ; CompAP ap = ap ;
-- CompNP np = {s = \\_ => np.s ! Acc} ; CompNP np = {s = \\_ => np.s ! Acc} ;
-- CompAdv a = {s = \\_ => a.s} ; CompAdv a = {s = \\_ => a.s} ;
--
-- EmbedS s = {s = conjThat ++ s.s} ; EmbedS s = {s = conjThat ++ s.s} ;
-- EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
-- EmbedVP vp = {s = infVP vp (agrP3 Sg)} ; --- agr EmbedVP vp = {s = infVP vp (agrP3 Sg)} ; --- agr
-- -}
--}
}

View File

@@ -1,4 +1,4 @@
instance DiffSwe of DiffScand = { instance DiffSwe of DiffScand = open ResScand, Prelude in {
-- Parameters. -- Parameters.
@@ -6,7 +6,17 @@ instance DiffSwe of DiffScand = {
Gender = Utr | Neutr ; Gender = Utr | Neutr ;
oper oper
utrum = Utr ; neutrum = Neutr ; utrum = Utr ;
neutrum = Neutr ;
gennum : Gender -> Number -> GenNum = \g,n ->
case <g,n> of {
<Utr,Sg> => SgUtr ;
<Neutr,Sg> => SgNeutr ;
_ => Plg
} ;
detDef : Species = Def ;
-- Strings. -- Strings.
@@ -14,4 +24,19 @@ instance DiffSwe of DiffScand = {
conjThan = "än" ; conjThan = "än" ;
infMark = "att" ; infMark = "att" ;
artIndef : Gender => Str = table {
Utr => "en" ;
Neutr => "ett"
} ;
verbHave =
mkVerb "ha" "har" "ha" "hade" "haft" "havd" "havt" "havda" ;
auxFut = "ska" ; -- "skall" in ExtSwe
auxCond = "skulle" ;
negation : Polarity => Str = table {
Pos => [] ;
Neg => "inte"
} ;
} }

View File

@@ -30,15 +30,15 @@ concrete LexSwe of Lex = CatSwe ** open ResSwe, Prelude in {
here_Adv = {s = "här"} ; here_Adv = {s = "här"} ;
very_AdA = {s = "mycket"} ; very_AdA = {s = "mycket"} ;
always_AdV = {s = "alltid"} ; always_AdV = {s = "alltid"} ;
--
-- only_Predet = {s = "bara"} ; only_Predet = {s = \\_ => "bara"} ;
-- all_Predet = {s = "alla"} ; all_Predet = {s = gennumForms "all" "allt" "alla"} ;
-- this_Quant = {s = "this" ; n = Sg} ; -- this_Quant = {s = "this" ; n = Sg} ;
-- these_Quant = {s = "these" ; n = Pl} ; -- these_Quant = {s = "these" ; n = Pl} ;
-- --
-- i_Pron = mkNP "I" "me" "my" Sg P1 ; i_Pron = mkNP "jag" "mig" "min" "mitt" "mina" SgUtr P1 ;
-- he_Pron = mkNP "he" "him" "his" Sg P3 ; he_Pron = mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ;
-- we_Pron = mkNP "we" "us" "our" Pl P1 ; we_Pron = mkNP "vi" "oss" "r" "vårt" "våra" SgUtr P1 ;
-- --
-- whoSg_IP = mkIP "who" "whom" "whose" Sg ; -- whoSg_IP = mkIP "who" "whom" "whose" Sg ;
-- whoPl_IP = mkIP "who" "whom" "whose" Pl ; -- whoPl_IP = mkIP "who" "whom" "whose" Pl ;

View File

@@ -0,0 +1,2 @@
concrete NounSwe of Noun = CatSwe ** NounScand with
(DiffScand = DiffSwe) ;

View File

@@ -0,0 +1,2 @@
concrete SentenceSwe of Sentence = CatSwe ** SentenceScand with
(DiffScand = DiffSwe) ;

View File

@@ -1,17 +1,17 @@
--# -path=.:../scandinavian:../abstract:../common:prelude --# -path=.:../scandinavian:../abstract:../common:prelude
concrete TestSwe of Test = concrete TestSwe of Test =
-- NounSwe, NounSwe,
-- VerbSwe, VerbSwe,
AdjectiveSwe, AdjectiveSwe,
AdverbSwe, AdverbSwe,
-- -- NumeralSwe, -- -- NumeralSwe,
-- SentenceSwe, SentenceSwe,
-- QuestionSwe, -- QuestionSwe,
-- RelativeSwe, -- RelativeSwe,
-- ConjunctionSwe, -- ConjunctionSwe,
PhraseSwe, PhraseSwe,
-- UntensedSwe, UntensedSwe,
-- -- TensedSwe, -- -- TensedSwe,
LexSwe LexSwe
** { ** {

View File

@@ -0,0 +1,2 @@
concrete UntensedSwe of Untensed = CatSwe ** UntensedScand with
(DiffScand = DiffSwe) ;

View File

@@ -0,0 +1,2 @@
concrete VerbSwe of Verb = CatSwe ** VerbScand with
(DiffScand = DiffSwe) ;