mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-12 22:39:31 -06:00
more work on Finnish ClausePlus
This commit is contained in:
@@ -95,6 +95,6 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
||||
N3 = {s : NForm => Str} ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ;
|
||||
PN = {s : Case => Str} ;
|
||||
|
||||
oper Verb1 = {s : VForm => Str ; sc : NPForm ; qp : Str} ;
|
||||
oper Verb1 = {s : VForm => Str ; sc : NPForm ; qp : Bool} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
|
||||
|
||||
AdvExistNP adv np =
|
||||
mkClause (\_ -> adv.s) np.a (insertObj
|
||||
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"}))) ;
|
||||
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlla ** {sc = NPCase Nom ; qp = True}))) ;
|
||||
|
||||
RelExistNP prep rp np = {
|
||||
s = \\t,ant,bo,ag =>
|
||||
@@ -38,7 +38,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
|
||||
np.a
|
||||
(insertObj
|
||||
(\\_,b,_ => np.s ! NPCase Nom)
|
||||
(predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"}))) ;
|
||||
(predV (verbOlla ** {sc = NPCase Nom ; qp = True}))) ;
|
||||
in
|
||||
cl.s ! t ! ant ! bo ! SDecl ;
|
||||
c = NPCase Nom
|
||||
|
||||
@@ -21,15 +21,19 @@ abstract ExtraFinAbs = Extra [
|
||||
|
||||
cat
|
||||
ClPlus ; -- clause with more variation
|
||||
Part ; -- discourse particle
|
||||
|
||||
fun
|
||||
S_SVO : Temp -> Pol -> ClPlus -> S ; -- me juomme maitoa
|
||||
S_SOV : Temp -> Pol -> ClPlus -> S ; -- me maitoa juomme
|
||||
S_OSV : Temp -> Pol -> ClPlus -> S ; -- maitoa me juomme
|
||||
S_OVS : Temp -> Pol -> ClPlus -> S ; -- maitoa juomme me
|
||||
S_VSO : Temp -> Pol -> ClPlus -> S ; -- juomme me maitoa
|
||||
S_VOS : Temp -> Pol -> ClPlus -> S ; -- juomme maitoa me
|
||||
S_SVO : Temp -> Pol -> ClPlus -> S ; -- mepäs juomme maitoa
|
||||
S_SOV : Temp -> Pol -> ClPlus -> S ; -- mepäs maitoa juomme
|
||||
S_OSV : Temp -> Pol -> ClPlus -> S ; -- maitoapas me juomme
|
||||
S_OVS : Temp -> Pol -> ClPlus -> S ; -- maitoapas juomme me
|
||||
S_VSO : Temp -> Pol -> ClPlus -> S ; -- juommepas me maitoa
|
||||
S_VOS : Temp -> Pol -> ClPlus -> S ; -- juommepas maitoa me
|
||||
|
||||
PredClPlus : NP -> VP -> ClPlus ;
|
||||
|
||||
---- noPart, han_Part, pa_Part, pas_Part, ko_Part, kos_Part,
|
||||
---- kohan_Part, pahan_Part : Part ;
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ concrete IdiomFin of Idiom = CatFin **
|
||||
} ;
|
||||
|
||||
oper
|
||||
olla = verbOlla ** {sc = NPCase Nom ; qp = "ko"} ;
|
||||
olla = verbOlla ** {sc = NPCase Nom ; qp = True} ;
|
||||
|
||||
noSubj : Polarity -> Str = \_ -> [] ;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete LangFin of Lang =
|
||||
GrammarFin, --- - [SlashV2VNP,SlashVV], ---- to speed up parsing grammar
|
||||
GrammarFin - [SlashV2VNP,SlashVV], ---- to speed up compilation
|
||||
-- GrammarFin,
|
||||
LexiconFin
|
||||
** {
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ resource MorphoFin = ResFin ** open Prelude in {
|
||||
11 => lienee
|
||||
} ;
|
||||
|
||||
vforms2V : VForms -> Verb ** {qp : Str} = \vh ->
|
||||
vforms2V : VForms -> Verb ** {qp : Bool} = \vh ->
|
||||
let
|
||||
tulla = vh ! 0 ;
|
||||
tulen = vh ! 1 ;
|
||||
@@ -753,7 +753,7 @@ resource MorphoFin = ResFin ** open Prelude in {
|
||||
Inf Inf3Abess => tulema + "tt" + a
|
||||
} ;
|
||||
sc = NPCase Nom ;
|
||||
qp = Predef.dp 2 tulko ;
|
||||
qp = pbool2bool (Predef.eqStr (last tulko) "o") ;
|
||||
lock_V = <>
|
||||
} ;
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ oper
|
||||
|
||||
caseV c v = {s = v.s ; sc = NPCase c ; qp = v.qp ; lock_V = <>} ;
|
||||
|
||||
vOlla = verbOlla ** {sc = NPCase Nom ; qp = "ko" ; lock_V = <>} ; ---- lieneekö
|
||||
vOlla = verbOlla ** {sc = NPCase Nom ; qp = True ; lock_V = <>} ; ---- lieneekö
|
||||
|
||||
mk2V2 : V -> Prep -> V2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ;
|
||||
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;
|
||||
|
||||
@@ -31,7 +31,7 @@ concrete QuestionFin of Question = CatFin ** open ResFin, Prelude in {
|
||||
QuestIComp icomp np = {
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
vp = predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"}) ;
|
||||
vp = predV (verbOlla ** {sc = NPCase Nom ; qp = True}) ;
|
||||
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
||||
in
|
||||
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
|
||||
|
||||
@@ -187,10 +187,10 @@ oper
|
||||
s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa
|
||||
ext : Str ;
|
||||
sc : NPForm ;
|
||||
qp : Str
|
||||
qp : Bool -- True = back vowel
|
||||
} ;
|
||||
|
||||
predV : (Verb ** {sc : NPForm ; qp : Str}) -> VP = \verb -> {
|
||||
predV : (Verb ** {sc : NPForm ; qp : Bool}) -> VP = \verb -> {
|
||||
s = \\vi,ant,b,agr0 =>
|
||||
let
|
||||
|
||||
@@ -284,7 +284,7 @@ oper
|
||||
} ;
|
||||
|
||||
ClausePlus : Type = {
|
||||
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,ext,qp : Str}
|
||||
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,ext : Str ; qp : Bool}
|
||||
} ;
|
||||
|
||||
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause =
|
||||
@@ -292,7 +292,7 @@ oper
|
||||
s = \\t,a,b => let c = (mkClausePlus sub agr vp).s ! t ! a ! b in
|
||||
table {
|
||||
SDecl => c.subj ++ c.fin ++ c.inf ++ c.compl ++ c.ext ;
|
||||
SQuest => c.fin ++ BIND ++ c.qp ++ c.subj ++ c.inf ++ c.compl ++ c.ext
|
||||
SQuest => c.fin ++ BIND ++ questPart c.qp ++ c.subj ++ c.inf ++ c.compl ++ c.ext
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -300,15 +300,18 @@ oper
|
||||
\sub,agr,vp -> {
|
||||
s = \\t,a,b =>
|
||||
let
|
||||
subj = sub b ;
|
||||
agrfin = case vp.sc of {
|
||||
NPCase Nom => <agr,True> ;
|
||||
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
|
||||
} ;
|
||||
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
||||
compl = vp.s2 ! agrfin.p2 ! b ! agr ;
|
||||
complext = compl ++ vp.ext
|
||||
in {subj = subj ; fin = verb.fin ; inf = verb.inf ; compl = compl ; ext = vp.ext ; qp = questPart vp a b}
|
||||
in {subj = sub b ;
|
||||
fin = verb.fin ;
|
||||
inf = verb.inf ;
|
||||
compl = vp.s2 ! agrfin.p2 ! b ! agr ;
|
||||
ext = vp.ext ;
|
||||
qp = selectPart vp a b
|
||||
}
|
||||
} ;
|
||||
|
||||
-- This is used for subjects of passives: therefore isFin in False.
|
||||
@@ -316,11 +319,13 @@ oper
|
||||
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
|
||||
appCompl False b {s = [] ; c = sc ; isPre = True} np ;
|
||||
|
||||
questPart : VP -> Anteriority -> Polarity -> Str = \vp,a,p ->
|
||||
questPart : Bool -> Str = \b -> if_then_Str b "ko" "kö" ;
|
||||
|
||||
selectPart : VP -> Anteriority -> Polarity -> Bool = \vp,a,p ->
|
||||
case p of {
|
||||
Neg => "kö" ; -- eikö tule
|
||||
Neg => False ; -- eikö tule
|
||||
_ => case a of {
|
||||
Anter => "ko" ; -- onko mennyt --# notpresent
|
||||
Anter => True ; -- onko mennyt --# notpresent
|
||||
_ => vp.qp -- tuleeko, meneekö
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -53,7 +53,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
|
||||
ComplSlash vp np = insertObjPre (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
|
||||
|
||||
UseComp comp =
|
||||
insertObj (\\_,_ => comp.s) (predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"})) ;
|
||||
insertObj (\\_,_ => comp.s) (predV (verbOlla ** {sc = NPCase Nom ; qp = True})) ;
|
||||
|
||||
SlashVV v vp =
|
||||
insertObj
|
||||
|
||||
Reference in New Issue
Block a user