mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-26 11:18:55 -06:00
swedish complete
This commit is contained in:
@@ -28,6 +28,8 @@ interface DiffScand = open ResScand, Prelude in {
|
|||||||
verbHave : {s : VForm => Str ; vtype : VType} ;
|
verbHave : {s : VForm => Str ; vtype : VType} ;
|
||||||
verbBe : {s : VForm => Str ; vtype : VType} ;
|
verbBe : {s : VForm => Str ; vtype : VType} ;
|
||||||
|
|
||||||
|
verbBecome : {s : VForm => Str ; vtype : VType} ;
|
||||||
|
|
||||||
auxFut : Str ;
|
auxFut : Str ;
|
||||||
auxCond : Str ;
|
auxCond : Str ;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ incomplete concrete PhraseScand of Phrase =
|
|||||||
UttIP ip = {s = ip.s ! nominative} ; --- Acc also
|
UttIP ip = {s = ip.s ! nominative} ; --- Acc also
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = {s = np.s ! accusative} ;
|
UttNP np = {s = np.s ! accusative} ;
|
||||||
---- UttVP vp = {s = infMark ++ infVP vp (agrP3 Sg)} ;
|
UttVP vp = {s = infMark ++ infVP vp (agrP3 Utr Sg)} ;
|
||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
|
|
||||||
NoPConj = {s = []} ;
|
NoPConj = {s = []} ;
|
||||||
|
|||||||
@@ -190,30 +190,4 @@ resource ResScand = ParamScand ** open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- For $Numeral$.
|
|
||||||
--
|
|
||||||
-- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
|
||||||
-- \two, twelve, twenty, second ->
|
|
||||||
-- {s = table {
|
|
||||||
-- unit => table {NCard => two ; NOrd => second} ;
|
|
||||||
-- teen => \\c => mkCard c twelve ;
|
|
||||||
-- ten => \\c => mkCard c twenty
|
|
||||||
-- }
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- regNum : Str -> {s : DForm => CardOrd => Str} =
|
|
||||||
-- \six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ;
|
|
||||||
--
|
|
||||||
-- regCardOrd : Str -> {s : CardOrd => Str} = \ten ->
|
|
||||||
-- {s = table {NCard => ten ; NOrd => regOrd ten}} ;
|
|
||||||
--
|
|
||||||
-- mkCard : CardOrd -> Str -> Str = \c,ten ->
|
|
||||||
-- (regCardOrd ten).s ! c ;
|
|
||||||
--
|
|
||||||
-- regOrd : Str -> Str = \ten ->
|
|
||||||
-- case last ten of {
|
|
||||||
-- "y" => init ten + "ieth" ;
|
|
||||||
-- _ => ten + "th"
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,10 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in
|
|||||||
|
|
||||||
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 =
|
||||||
-- UseComp comp = insertObj (\\a => comp.s ! agrAdj a.gn DIndef) (predV verbBe) ;
|
insertObj
|
||||||
|
(\\a => v.s ! VI (VPtPret (agrAdj a.gn DIndef) Nom))
|
||||||
|
(predV verbBecome) ;
|
||||||
|
|
||||||
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; vtype = vv.vtype} ;
|
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; vtype = vv.vtype} ;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
|
|||||||
mkVerb "ha" "har" "ha" "hade" "haft" "havd" "havt" "havda" ;
|
mkVerb "ha" "har" "ha" "hade" "haft" "havd" "havt" "havda" ;
|
||||||
verbBe =
|
verbBe =
|
||||||
mkVerb "vara" "är" "var" "var" "varit" "varen" "varet" "varna" ;
|
mkVerb "vara" "är" "var" "var" "varit" "varen" "varet" "varna" ;
|
||||||
|
verbBecome =
|
||||||
|
mkVerb "bli" "blir" "bli" "blev" "blivit" "bliven" "blivet" "blivna" ;
|
||||||
|
|
||||||
auxFut = "ska" ; -- "skall" in ExtSwe
|
auxFut = "ska" ; -- "skall" in ExtSwe
|
||||||
auxCond = "skulle" ;
|
auxCond = "skulle" ;
|
||||||
|
|||||||
@@ -256,21 +256,36 @@ conj3 : Str -> Verb = \bo ->
|
|||||||
|
|
||||||
-- for $Structural$
|
-- for $Structural$
|
||||||
|
|
||||||
-- for Numerals
|
-- For $Numeral$.
|
||||||
|
|
||||||
param DForm = ental | ton | tiotal ;
|
param DForm = ental | ton | tiotal ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
LinDigit = {s : DForm => Str} ;
|
LinDigit = {s : DForm => CardOrd => Str} ;
|
||||||
|
|
||||||
mkTal : Str -> Str -> Str -> LinDigit = \två, tolv, tjugo ->
|
cardOrd : Str -> Str -> CardOrd => Str = \tre,tredje ->
|
||||||
{s = table {ental => två ; ton => tolv ; tiotal => tjugo}} ;
|
table {
|
||||||
|
NCard _ => tre ;
|
||||||
|
NOrd a => tredje ---- a
|
||||||
|
} ;
|
||||||
|
|
||||||
regTal : Str -> LinDigit = \fem ->
|
cardReg : Str -> CardOrd => Str = \tio ->
|
||||||
mkTal fem (fem + "ton") (fem + "tio") ;
|
cardOrd tio (tio + "nde") ;
|
||||||
|
|
||||||
|
mkTal : (x1,_,_,_,x5 : Str) -> LinDigit =
|
||||||
|
\två, tolv, tjugo, andra, tolfte ->
|
||||||
|
{s = table {
|
||||||
|
ental => cardOrd två andra ;
|
||||||
|
ton => cardOrd tolv tolfte ;
|
||||||
|
tiotal => cardReg tjugo
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
numPl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \n ->
|
||||||
|
{s = n ; n = Pl} ;
|
||||||
|
|
||||||
|
invNum : CardOrd = NCard Neutr ;
|
||||||
|
|
||||||
numPl : Str -> {s : Gender => Str ; n : Number} = \n ->
|
|
||||||
{s = \\_ => n ; n = Pl} ;
|
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
concrete NumeralSwe of Numeral = CatSwe ** open ResScand, MorphoSwe in {
|
concrete NumeralSwe of Numeral = CatSwe ** open ResScand, MorphoSwe in {
|
||||||
|
|
||||||
{-
|
|
||||||
lincat
|
lincat
|
||||||
Digit = {s : DForm => CardOrd => Str} ;
|
Digit = {s : DForm => CardOrd => Str} ;
|
||||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
||||||
Sub100 = {s : CardOrd => Str ; n : Number} ;
|
Sub100, Sub1000, Sub1000000 =
|
||||||
Sub1000 = {s : CardOrd => Str ; n : Number} ;
|
{s : CardOrd => Str ; n : Number} ;
|
||||||
Sub1000000 = {s : CardOrd => Str ; n : Number} ;
|
|
||||||
|
|
||||||
lin num x = x ;
|
lin
|
||||||
lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in
|
num x = x ;
|
||||||
{s = \\f,c => case <f,c> of {
|
|
||||||
<teen,NOrd> => "twelfth" ;
|
|
||||||
_ => two.s ! f ! c
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin n3 = mkNum "three" "thirteen" "thirty" "third" ;
|
n2 = mkTal "två" "tolv" "tjugo" "andra" "tolfte" ;
|
||||||
lin n4 = mkNum "four" "fourteen" "forty" "fourth" ;
|
n3 = mkTal "tre" "tretton" "trettio" "tredje" "trettonde" ;
|
||||||
lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ;
|
n4 = mkTal "fyra" "fjorton" "fyrtio" "fjärde" "fjortonde" ;
|
||||||
lin n6 = regNum "six" ;
|
n5 = mkTal "fem" "femton" "femtio" "femte" "femtonde" ;
|
||||||
lin n7 = regNum "seven" ;
|
n6 = mkTal "sex" "sexton" "sextion" "sjätte" "sextonde" ;
|
||||||
lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ;
|
n7 = mkTal "sju" "sjutton" "sjuttio" "sjunde" "sjuttonde" ;
|
||||||
lin n9 = regNum "nine" ;
|
n8 = mkTal "åtta" "arton" "åttio" "åttonde" "artonde" ;
|
||||||
|
n9 = mkTal "nio" "nitton" "nittio" "nionde" "nittonde" ;
|
||||||
|
|
||||||
lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ;
|
pot01 = {
|
||||||
lin pot0 d = d ** {n = Pl} ;
|
s = \\f => table {
|
||||||
lin pot110 = regCardOrd "ten" ** {n = Pl} ;
|
NCard g => case g of {Neutr => "ett" ; _ => "en"} ;
|
||||||
lin pot111 = regCardOrd "eleven" ** {n = Pl} ;
|
_ => "första"
|
||||||
lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
} ;
|
||||||
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
n = Sg
|
||||||
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
} ;
|
||||||
lin pot1plus d e = {
|
pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ;
|
||||||
s = \\c => d.s ! ten ! NCard ++ "-" ++ e.s ! unit ! c ; n = Pl} ;
|
pot110 = numPl (cardReg "tio") ;
|
||||||
lin pot1as2 n = n ;
|
pot111 = numPl (cardOrd "elva" "elfte") ;
|
||||||
lin pot2 d = {s = \\c => d.s ! unit ! NCard ++ mkCard c "hundred"} ** {n = Pl} ;
|
pot1to19 d = numPl (d.s ! ton) ;
|
||||||
lin pot2plus d e = {
|
pot0as1 n = {s = n.s ! ental ; n = n.n} ;
|
||||||
s = \\c => d.s ! unit ! NCard ++ "hundred" ++ "and" ++ e.s ! c ; n = Pl} ;
|
pot1 d = numPl (d.s ! tiotal) ;
|
||||||
lin pot2as3 n = n ;
|
pot1plus d e = {s = \\g => d.s ! tiotal ! invNum ++ e.s ! ental ! g ; n = Pl} ;
|
||||||
lin pot3 n = {
|
pot1as2 n = n ;
|
||||||
s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ;
|
pot2 d =
|
||||||
lin pot3plus n m = {
|
numPl (\\g => d.s ! ental ! invNum ++ cardOrd "hundra" "hundrade" ! g) ;
|
||||||
s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ;
|
pot2plus d e =
|
||||||
-}
|
{s = \\g => d.s ! ental ! invNum ++ "hundra" ++ e.s ! g ; n = Pl} ;
|
||||||
|
pot2as3 n = n ;
|
||||||
|
pot3 n =
|
||||||
|
numPl (\\g => n.s ! invNum ++ "tusen" ++ cardOrd "tusen" "tusende" ! g) ;
|
||||||
|
pot3plus n m =
|
||||||
|
{s = \\g => n.s ! invNum ++ "tusen" ++ m.s ! g ; n = Pl} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,15 +167,6 @@ oper
|
|||||||
mk3ADeg : (galen,galet,galna : Str) -> ADeg ;
|
mk3ADeg : (galen,galet,galna : Str) -> ADeg ;
|
||||||
mk2ADeg : (bred,brett : Str) -> ADeg ;
|
mk2ADeg : (bred,brett : Str) -> ADeg ;
|
||||||
|
|
||||||
-- If comparison is formed by "more, "most", as in general for
|
|
||||||
-- long adjective, the following pattern is used:
|
|
||||||
|
|
||||||
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
|
||||||
|
|
||||||
-- From a given $ADeg$, it is possible to get back to $A$.
|
|
||||||
|
|
||||||
adegA : ADeg -> A ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Adverbs
|
--2 Adverbs
|
||||||
|
|
||||||
|
|||||||
@@ -90,15 +90,13 @@ concrete StructuralSwe of Structural = CatSwe **
|
|||||||
mkVerb6 "vilja" "vill" "vilj" "ville" "velat" "velad" **
|
mkVerb6 "vilja" "vill" "vilj" "ville" "velat" "velad" **
|
||||||
{c2 = [] ; lock_VV = <>} ;
|
{c2 = [] ; lock_VV = <>} ;
|
||||||
we_Pron = mkNP "vi" "oss" "vår" "vårt" "våra" Plg P1 ;
|
we_Pron = mkNP "vi" "oss" "vår" "vårt" "våra" Plg P1 ;
|
||||||
---- whatPl_IP = intPronWhat plural ;
|
whatSg_IP = {s = \\_ => "vad" ; gn = SgUtr} ; ---- infl
|
||||||
---- whatSg_IP = intPronWhat singular ;
|
whatPl_IP = {s = \\_ => "vad" ; gn = Plg} ; ---- infl
|
||||||
when_IAdv = ss "när" ;
|
when_IAdv = ss "när" ;
|
||||||
when_Subj = ss "när" ;
|
when_Subj = ss "när" ;
|
||||||
where_IAdv = ss "var" ;
|
where_IAdv = ss "var" ;
|
||||||
whichPl_IDet = {s = \\_ => "vilka" ; n = Pl ; det = DIndef} ;
|
whichPl_IDet = {s = \\_ => "vilka" ; n = Pl ; det = DIndef} ;
|
||||||
whichSg_IDet = {s = genderForms "vilken" "vilket" ; n = Sg ; det = DIndef} ;
|
whichSg_IDet = {s = genderForms "vilken" "vilket" ; n = Sg ; det = DIndef} ;
|
||||||
---- whichPl_IDet = vilkenDet ;
|
|
||||||
---- whichSg_IDet = mkDeterminerPl "vilka" IndefP ;
|
|
||||||
whoSg_IP = {s = vem.s ; gn = SgUtr} ;
|
whoSg_IP = {s = vem.s ; gn = SgUtr} ;
|
||||||
whoPl_IP = {s = vem.s ; gn = Plg} ;
|
whoPl_IP = {s = vem.s ; gn = Plg} ;
|
||||||
why_IAdv = ss "varför" ;
|
why_IAdv = ss "varför" ;
|
||||||
|
|||||||
Reference in New Issue
Block a user