mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
completing Idiom implementations
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
--1 The category system
|
--1 The category system
|
||||||
|
|
||||||
|
-- Some categories are inherited from [Common Common.html].
|
||||||
|
|
||||||
abstract Cat = Common ** {
|
abstract Cat = Common ** {
|
||||||
|
|
||||||
cat
|
cat
|
||||||
@@ -105,7 +107,6 @@ abstract Cat = Common ** {
|
|||||||
--2 Words of open classes
|
--2 Words of open classes
|
||||||
|
|
||||||
-- These are constructed in [Lexicon Lexicon.html] and in additional lexicon modules.
|
-- These are constructed in [Lexicon Lexicon.html] and in additional lexicon modules.
|
||||||
|
|
||||||
V ; -- one-place verb e.g. "sleep"
|
V ; -- one-place verb e.g. "sleep"
|
||||||
V2 ; -- two-place verb e.g. "love"
|
V2 ; -- two-place verb e.g. "love"
|
||||||
V3 ; -- three-place verb e.g. "show"
|
V3 ; -- three-place verb e.g. "show"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ abstract Noun = Cat ** {
|
|||||||
|
|
||||||
-- A noun phrase already formed can be modified by a Predeterminer.
|
-- A noun phrase already formed can be modified by a Predeterminer.
|
||||||
|
|
||||||
PredetNP : Predet -> NP -> NP; -- only the man
|
PredetNP : Predet -> NP -> NP; -- only the man
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,40 @@ concrete IdiomFin of Idiom = CatFin **
|
|||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ExistNP np =
|
||||||
|
let
|
||||||
|
cas : Polarity -> NPForm = \p -> case p of {
|
||||||
|
Pos => NPCase Nom ; -- on olemassa luku
|
||||||
|
Neg => NPCase Part -- ei ole olemassa lukua
|
||||||
|
}
|
||||||
|
in
|
||||||
|
mkClause [] (agrP3 Sg) (insertObj
|
||||||
|
(\\_,b,_ => "olemassa" ++ np.s ! cas b) (predV olla)) ;
|
||||||
|
|
||||||
|
ImpersCl vp = mkClause [] (agrP3 Sg) vp ;
|
||||||
|
|
||||||
|
GenericCl vp = mkClause [] (agrP3 Sg) {
|
||||||
|
s = \\_ => vp.s ! VIPass ;
|
||||||
|
s2 = vp.s2 ;
|
||||||
|
ext = vp.ext ;
|
||||||
|
sc = vp.sc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
ProgrVP vp =
|
||||||
|
let
|
||||||
|
inf = (vp.s ! VIInf Inf3Iness ! Simul ! Pos ! agrP3 Sg).fin ;
|
||||||
|
on = predV olla
|
||||||
|
in {
|
||||||
|
s = on.s ;
|
||||||
|
s2 = \\b,p,a => inf ++ vp.s2 ! b ! p ! a ;
|
||||||
|
ext = vp.ext ;
|
||||||
|
sc = vp.sc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
olla = verbOlla ** {sc = NPCase Nom} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../romance:../common:../abstract:../common:prelude
|
--# -path=.:../romance:../common:../abstract:../common:prelude
|
||||||
|
|
||||||
concrete CatFre of Cat = TenseX ** CatRomance with
|
concrete CatFre of Cat = CommonX ** CatRomance with
|
||||||
(ResRomance = ResFre) ;
|
(ResRomance = ResFre) ;
|
||||||
|
|||||||
@@ -3,5 +3,17 @@ concrete IdiomGer of Idiom = CatGer **
|
|||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ExistNP np =
|
||||||
|
let geben = dirV2 (mkV "geben" "gibt" "gib" "gab" "gäbe" "gegeben")
|
||||||
|
in
|
||||||
|
mkClause "es" (agrP3 Sg)
|
||||||
|
(insertObj (\\_ => appPrep geben.c2 np.s)
|
||||||
|
(predV geben)) ;
|
||||||
|
ImpersCl vp = mkClause "es" (agrP3 Sg) vp ;
|
||||||
|
GenericCl vp = mkClause "man" (agrP3 Sg) vp ;
|
||||||
|
|
||||||
|
ProgrVP = insertAdv "eben" ; ----
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:prelude
|
--# -path=.:../romance:../abstract:../common:prelude
|
||||||
|
|
||||||
concrete CatIta of Cat = TenseX ** CatRomance with
|
concrete CatIta of Cat = CommonX ** CatRomance with
|
||||||
(ResRomance = ResIta) ;
|
(ResRomance = ResIta) ;
|
||||||
|
|||||||
@@ -1,7 +1,27 @@
|
|||||||
concrete IdiomIta of Idiom = CatIta **
|
concrete IdiomIta of Idiom = CatIta **
|
||||||
open MorphoIta, ParadigmsIta, Prelude in {
|
open PhonoIta, MorphoIta, ParadigmsIta, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ExistNP np =
|
||||||
|
mkClause [] (agrP3 np.a.g np.a.n)
|
||||||
|
(insertClit2 (elision "ci" "c'" "ci")
|
||||||
|
(insertComplement (\\_ => np.s ! Ton Nom)
|
||||||
|
(predV copula))) ;
|
||||||
|
ImpersCl vp = mkClause [] (agrP3 Masc Sg) vp ;
|
||||||
|
GenericCl vp = mkClause "si" (agrP3 Masc Sg) vp ; ---- se ci fanno cose
|
||||||
|
|
||||||
|
ProgrVP vp =
|
||||||
|
insertComplement
|
||||||
|
(\\agr =>
|
||||||
|
let
|
||||||
|
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||||
|
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
|
||||||
|
in
|
||||||
|
(vp.s ! VPGerund).inf ! (aagr agr.g agr.n) ++ clpr.p1 ++ obj
|
||||||
|
)
|
||||||
|
(predV (essereV (regV "stare"))) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
concrete CatNor of Cat = TenseX ** CatScand with
|
concrete CatNor of Cat = CommonX ** CatScand with
|
||||||
(ResScand = ResNor) ;
|
(ResScand = ResNor) ;
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
concrete IdiomNor of Idiom = CatNor **
|
concrete IdiomNor of Idiom = CatNor **
|
||||||
open MorphoNor, ParadigmsNor, Prelude in {
|
open MorphoNor, ParadigmsNor, IrregNor, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ExistNP np =
|
||||||
|
mkClause "det" (agrP3 neutrum Sg) (insertObj
|
||||||
|
(\\_ => np.s ! accusative) (predV (depV finne_V))) ;
|
||||||
|
ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ;
|
||||||
|
GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ;
|
||||||
|
|
||||||
|
ProgrVP vp =
|
||||||
|
insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ param
|
|||||||
VPForm =
|
VPForm =
|
||||||
VPFinite TMood Anteriority
|
VPFinite TMood Anteriority
|
||||||
| VPImperat
|
| VPImperat
|
||||||
|
| VPGerund
|
||||||
| VPInfinit Anteriority ;
|
| VPInfinit Anteriority ;
|
||||||
|
|
||||||
-- Agreement of adjectives, verb phrases, and relative pronouns.
|
-- Agreement of adjectives, verb phrases, and relative pronouns.
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ oper
|
|||||||
vfin : TMood -> Agr -> Str = \tm,a -> verb.s ! VFin tm a.n a.p ;
|
vfin : TMood -> Agr -> Str = \tm,a -> verb.s ! VFin tm a.n a.p ;
|
||||||
vpart : AAgr -> Str = \a -> verb.s ! VPart a.g a.n ;
|
vpart : AAgr -> Str = \a -> verb.s ! VPart a.g a.n ;
|
||||||
vinf = verb.s ! VInfin ;
|
vinf = verb.s ! VInfin ;
|
||||||
|
vger = verb.s ! VGer ;
|
||||||
|
|
||||||
typ = verb.vtyp ;
|
typ = verb.vtyp ;
|
||||||
aux = auxVerb typ ;
|
aux = auxVerb typ ;
|
||||||
@@ -80,6 +81,7 @@ oper
|
|||||||
VPFinite t Simul => vf (vfin t) (\_ -> []) ;
|
VPFinite t Simul => vf (vfin t) (\_ -> []) ;
|
||||||
VPFinite t Anter => vf (habet t) vpart ;
|
VPFinite t Anter => vf (habet t) vpart ;
|
||||||
VPImperat => vf vimp (\_ -> []) ;
|
VPImperat => vf vimp (\_ -> []) ;
|
||||||
|
VPGerund => vf (\_ -> []) (\_ -> vger) ;
|
||||||
VPInfinit Simul => vf (\_ -> []) (\_ -> vinf) ;
|
VPInfinit Simul => vf (\_ -> []) (\_ -> vinf) ;
|
||||||
VPInfinit Anter => vf (\_ -> []) (\a -> habere ++ vpart a)
|
VPInfinit Anter => vf (\_ -> []) (\a -> habere ++ vpart a)
|
||||||
} ;
|
} ;
|
||||||
@@ -192,7 +194,7 @@ oper
|
|||||||
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
|
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
|
||||||
neg = vp.neg ! Pos ; --- Neg not in API
|
neg = vp.neg ! Pos ; --- Neg not in API
|
||||||
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||||
obj = clpr.p2 ++ vp.comp ! agr
|
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
|
||||||
in
|
in
|
||||||
clitInf (clpr.p1 ++ vp.clit2) inf ++ obj ;
|
clitInf (clpr.p1 ++ vp.clit2) inf ++ obj ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:prelude
|
--# -path=.:../romance:../abstract:../common:prelude
|
||||||
|
|
||||||
concrete CatSpa of Cat = TenseX ** CatRomance with
|
concrete CatSpa of Cat = CommonX ** CatRomance with
|
||||||
(ResRomance = ResSpa) ;
|
(ResRomance = ResSpa) ;
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
concrete IdiomSwe of Idiom = CatSwe **
|
concrete IdiomSwe of Idiom = CatSwe **
|
||||||
open MorphoSwe, ParadigmsSwe, Prelude in {
|
open MorphoSwe, ParadigmsSwe, IrregSwe, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ExistNP np =
|
||||||
|
mkClause "det" (agrP3 neutrum Sg) (insertObj
|
||||||
|
(\\_ => np.s ! accusative) (predV (depV finna_V))) ;
|
||||||
|
ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ;
|
||||||
|
GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ;
|
||||||
|
|
||||||
|
ProgrVP vp =
|
||||||
|
insertObj (\\a => "att" ++ infVP vp a) (predV (partV hålla_V "på")) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user