more Scandinavian

This commit is contained in:
aarne
2005-12-07 18:59:35 +00:00
parent f8b9bced8b
commit 36c899e975
10 changed files with 122 additions and 43 deletions

View File

@@ -11,6 +11,22 @@
Changes in functionality since May 17, 2005, release of GF Version 2.2 Changes in functionality since May 17, 2005, release of GF Version 2.2
</center> </center>
<p>
6/12 (AR) Accept <tt>param</tt> and <tt>oper</tt> definitions in
<tt>concrete</tt> modules. The definitions are just inlined in the
current module and not inherited. The purpose is to support rapid
prototyping of grammars.
<p>
2/12 (AR) The built-in type <tt>Float</tt> added to abstract syntax (and
resource). Values are stored as Haskell's <tt>Double</tt> precision
floats. For the syntax of float literals, see BNFC document.
NB: some bug still prevents parsing float literals in object
languages.
<p> <p>
1/12 (BB,AR) The command <tt>at = apply_transfer</tt>, which applies 1/12 (BB,AR) The command <tt>at = apply_transfer</tt>, which applies

View File

@@ -47,7 +47,7 @@ incomplete concrete CatScand of Cat =
-- Constructed in $Noun$. -- Constructed in $Noun$.
Det, Quant = {s : Gender => Str ; n : Number ; det : DetSpecies } ; Det, Quant = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
Predet = {s : GenNum => Str} ; Predet = {s : GenNum => Str} ;
Num = {s : Gender => Str} ; Num = {s : Gender => Str} ;
Ord = {s : Str} ; Ord = {s : Str} ;
@@ -60,8 +60,8 @@ incomplete concrete CatScand of Cat =
N2 = Noun ** {c2 : Str} ; N2 = Noun ** {c2 : Str} ;
N3 = Noun ** {c2,c3 : Str} ; N3 = Noun ** {c2,c3 : Str} ;
IP = NP ; IP = {s : NPForm => Str ; gn : GenNum} ;
IDet = Det ; IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
IAdv = {s : Str} ; IAdv = {s : Str} ;
RP = {s : RCase => Str ; a : RAgr} ; RP = {s : RCase => Str ; a : RAgr} ;

View File

@@ -5,6 +5,8 @@ interface DiffScand = open ResScand, Prelude in {
param param
Gender ; Gender ;
CardOrd = NCard Gender | NOrd AFormSup ; -- sic! (AFormSup)
oper oper
neutrum, utrum : Gender ; neutrum, utrum : Gender ;
@@ -28,6 +30,7 @@ interface DiffScand = open ResScand, Prelude in {
artIndef : Gender => Str ; artIndef : Gender => Str ;
verbHave : {s : VForm => Str} ; verbHave : {s : VForm => Str} ;
verbBe : {s : VForm => Str} ;
auxFut : Str ; auxFut : Str ;
auxCond : Str ; auxCond : Str ;
@@ -72,4 +75,8 @@ interface DiffScand = open ResScand, Prelude in {
en2,ea2,eext : Bool = False -- indicate if the field exists en2,ea2,eext : Bool = False -- indicate if the field exists
} ; } ;
-- For determiners; mostly two-valued even in Norwegian.
genderForms : (x1,x2 : Str) -> Gender => Str ;
} }

View File

@@ -36,8 +36,8 @@ incomplete concrete NounScand of Noun =
NoOrd = {s = []} ; NoOrd = {s = []} ;
NumInt n = {s = \\_ => n.s} ; NumInt n = {s = \\_ => n.s} ;
---- NumNumeral numeral = {s = \\g => numeral.s ! NCard g} ; NumNumeral numeral = {s = \\g => numeral.s ! NCard g} ;
OrdNumeral numeral = {s = numeral.s ! NOrd} ; OrdNumeral numeral = {s = numeral.s ! NOrd SupWeak} ;
AdNum adn num = {s = \\g => adn.s ++ num.s ! g} ; AdNum adn num = {s = \\g => adn.s ++ num.s ! g} ;
@@ -49,8 +49,17 @@ incomplete concrete NounScand of Noun =
IndefSg = {s = artIndef ; n = Sg ; det = DIndef} ; IndefSg = {s = artIndef ; n = Sg ; det = DIndef} ;
IndefPl = {s = \\_ => [] ; n = Pl ; det = DIndef} ; IndefPl = {s = \\_ => [] ; n = Pl ; det = DIndef} ;
---- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ; -- The genitive of this $NP$ is not correct: "sonen till mig" (not "migs").
---- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
ComplN2 f x = {
s = \\n,d,c => f.s ! n ! specDet d ! Nom ++ f.c2 ++ x.s ! accusative ;
g = f.g
} ;
ComplN3 f x = {
s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2 ++ x.s ! accusative ;
g = f.g ;
c2 = f.c3
} ;
AdjCN ap cn = let g = cn.g in { AdjCN ap cn = let g = cn.g in {
s = \\n,d,c => preOrPost ap.isPre s = \\n,d,c => preOrPost ap.isPre

View File

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

View File

@@ -162,13 +162,28 @@ resource ResScand = ParamScand ** open Prelude in {
eext = vp.eext eext = vp.eext
} ; } ;
----- This is not functional. insertAdv : Str -> VP -> VP = \adv,vp -> {
-- s = vp.s ;
-- insertAdV : Str -> VP -> VP = \adv,vp -> { a1 = vp.a1 ;
-- s = vp.s ; n2 = vp.n2 ;
-- s2 = vp.s2 a2 = vp.a2 ++ adv ;
-- } ; ext = vp.ext ;
-- en2 = vp.en2 ;
ea2 = True ;
eext = vp.eext
} ;
insertAdV : Str -> VP -> VP = \adv,vp -> {
s = vp.s ;
a1 = \\b => vp.a1 ! b ++ adv ;
n2 = vp.n2 ;
a2 = vp.a2 ;
ext = vp.ext ;
en2 = vp.en2 ;
ea2 = vp.ea2 ;
eext = vp.eext
} ;
-- 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) ;

View File

@@ -11,29 +11,34 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in
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 ! Sub) (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 (\\a => ap.s ! agrAdj a.gn DIndef) (predV v) ;
ComplV2A v np ap = ComplV2A v np ap =
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; insertAdv
(ap.s ! agrAdj np.a.gn DIndef)
(insertObj (\\_ => v.c2 ++ np.s ! accusative) (predV v)) ;
UseComp comp = insertObj comp.s (predAux auxBe) ; UseComp comp = insertObj (\\a => comp.s ! agrAdj a.gn DIndef) (predV verbBe) ;
AdvVP vp adv = insertObj (\\_ => adv.s) vp ; CompAP ap = ap ;
AdVVP adv vp = insertAdV adv.s vp ; CompNP np = {s = \\_ => np.s ! accusative} ;
CompAdv a = {s = \\_ => a.s} ;
--- these give parser overflow
--- AdvVP vp adv = 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 = []} ; UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ;
CompAP ap = ap ; EmbedS s = {s = conjThat ++ s.s ! Sub} ;
CompNP np = {s = \\_ => np.s ! Acc} ;
CompAdv a = {s = \\_ => a.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 utrum Sg)} ; --- agr
-}
} }

View File

@@ -31,6 +31,8 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
verbHave = verbHave =
mkVerb "ha" "har" "ha" "hade" "haft" "havd" "havt" "havda" ; mkVerb "ha" "har" "ha" "hade" "haft" "havd" "havt" "havda" ;
verbBe =
mkVerb "vara" "är" "var" "var" "varit" "varen" "varet" "varna" ;
auxFut = "ska" ; -- "skall" in ExtSwe auxFut = "ska" ; -- "skall" in ExtSwe
auxCond = "skulle" ; auxCond = "skulle" ;
@@ -39,4 +41,11 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
Pos => [] ; Pos => [] ;
Neg => "inte" Neg => "inte"
} ; } ;
genderForms : (x1,x2 : Str) -> Gender => Str = \all,allt ->
table {
Utr => all ;
Neutr => allt
} ;
} }

View File

@@ -25,7 +25,7 @@ concrete LexSwe of Lex = CatSwe ** open ResSwe, Prelude in {
mkAdjective "varm" "varmt" "varma" "varma" "varmare" "varmast" "varmaste" ; mkAdjective "varm" "varmt" "varma" "varma" "varmare" "varmast" "varmaste" ;
close_A2 = close_A2 =
mkAdjective "nära" "nära" "nära" "nära" "närmare" "närmast" "närmaste" mkAdjective "nära" "nära" "nära" "nära" "närmare" "närmast" "närmaste"
** {c2 = "to"} ; ** {c2 = "till"} ;
here_Adv = {s = "här"} ; here_Adv = {s = "här"} ;
very_AdA = {s = "mycket"} ; very_AdA = {s = "mycket"} ;
@@ -33,25 +33,39 @@ concrete LexSwe of Lex = CatSwe ** open ResSwe, Prelude in {
only_Predet = {s = \\_ => "bara"} ; only_Predet = {s = \\_ => "bara"} ;
all_Predet = {s = gennumForms "all" "allt" "alla"} ; all_Predet = {s = gennumForms "all" "allt" "alla"} ;
-- this_Quant = {s = "this" ; n = Sg} ; this_Quant = {s = genderForms "denna" "detta" ; n = Sg ; det = DDef Indef} ;
-- these_Quant = {s = "these" ; n = Pl} ; these_Quant = {s = \\_ => "dessa" ; n = Pl ; det = DDef Indef} ;
--
i_Pron = mkNP "jag" "mig" "min" "mitt" "mina" SgUtr P1 ; i_Pron = mkNP "jag" "mig" "min" "mitt" "mina" SgUtr P1 ;
he_Pron = mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ; he_Pron = mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ;
we_Pron = mkNP "vi" "oss" "vår" "vårt" "våra" SgUtr P1 ; we_Pron = mkNP "vi" "oss" "vår" "vårt" "våra" SgUtr P1 ;
--
-- whoSg_IP = mkIP "who" "whom" "whose" Sg ; whoSg_IP = {s = vem.s ; gn = SgUtr} ;
-- whoPl_IP = mkIP "who" "whom" "whose" Pl ; whoPl_IP = {s = vem.s ; gn = Plg} ;
--
when_IAdv = {s = "när"} ; when_IAdv = {s = "när"} ;
where_IAdv = {s = "var"} ; where_IAdv = {s = "var"} ;
why_IAdv = {s = "varför"} ; why_IAdv = {s = "varför"} ;
--
-- whichSg_IDet = {s = "which" ; n = Sg} ; whichSg_IDet = {s = genderForms "vilken" "vilket" ; n = Sg ; det = DDef Indef} ;
-- whichPl_IDet = {s = "which" ; n = Pl} ; whichPl_IDet = {s = \\_ => "vilka" ; n = Pl ; det = DDef Indef} ;
--
-- one_Numeral = {s = table {NCard => "one" ; NOrd => "first"} ; n = Sg} ; one_Numeral = {
-- forty_Numeral = {s = table {NCard => "forty" ; NOrd => "fortieth"} ; n = Pl} ; s = table {
NCard Utr => "en" ;
NCard Neutr => "ett" ;
NOrd SupStrong => "först" ;
NOrd SupWeak => "första"
} ;
n = Sg
} ;
forty_Numeral = {
s = table {
NCard _ => "fyrtio" ;
NOrd _ => "fyrtionde"
} ;
n = Sg
} ;
in_Prep = {s = "i"} ; in_Prep = {s = "i"} ;
of_Prep = {s = "av"} ; of_Prep = {s = "av"} ;
@@ -69,4 +83,9 @@ concrete LexSwe of Lex = CatSwe ** open ResSwe, Prelude in {
more_CAdv = ss "mera" ; more_CAdv = ss "mera" ;
less_CAdv = ss "mindre" ; less_CAdv = ss "mindre" ;
-- Auxiliaries that are used repeatedly.
oper
vem = mkNP "vem" "vem" "vems" "vems" "vems" SgUtr P3 ;
} }

View File

@@ -0,0 +1 @@
--# noparse AdvVP AdVVP