forked from GitHub/gf-core
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} ;
|
N3 = {s : NForm => Str} ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ;
|
||||||
PN = {s : Case => Str} ;
|
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 =
|
AdvExistNP adv np =
|
||||||
mkClause (\_ -> adv.s) np.a (insertObj
|
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 = {
|
RelExistNP prep rp np = {
|
||||||
s = \\t,ant,bo,ag =>
|
s = \\t,ant,bo,ag =>
|
||||||
@@ -38,7 +38,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
|
|||||||
np.a
|
np.a
|
||||||
(insertObj
|
(insertObj
|
||||||
(\\_,b,_ => np.s ! NPCase Nom)
|
(\\_,b,_ => np.s ! NPCase Nom)
|
||||||
(predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"}))) ;
|
(predV (verbOlla ** {sc = NPCase Nom ; qp = True}))) ;
|
||||||
in
|
in
|
||||||
cl.s ! t ! ant ! bo ! SDecl ;
|
cl.s ! t ! ant ! bo ! SDecl ;
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
|
|||||||
@@ -21,15 +21,19 @@ abstract ExtraFinAbs = Extra [
|
|||||||
|
|
||||||
cat
|
cat
|
||||||
ClPlus ; -- clause with more variation
|
ClPlus ; -- clause with more variation
|
||||||
|
Part ; -- discourse particle
|
||||||
|
|
||||||
fun
|
fun
|
||||||
S_SVO : Temp -> Pol -> ClPlus -> S ; -- me juomme maitoa
|
S_SVO : Temp -> Pol -> ClPlus -> S ; -- mepäs juomme maitoa
|
||||||
S_SOV : Temp -> Pol -> ClPlus -> S ; -- me maitoa juomme
|
S_SOV : Temp -> Pol -> ClPlus -> S ; -- mepäs maitoa juomme
|
||||||
S_OSV : Temp -> Pol -> ClPlus -> S ; -- maitoa me juomme
|
S_OSV : Temp -> Pol -> ClPlus -> S ; -- maitoapas me juomme
|
||||||
S_OVS : Temp -> Pol -> ClPlus -> S ; -- maitoa juomme me
|
S_OVS : Temp -> Pol -> ClPlus -> S ; -- maitoapas juomme me
|
||||||
S_VSO : Temp -> Pol -> ClPlus -> S ; -- juomme me maitoa
|
S_VSO : Temp -> Pol -> ClPlus -> S ; -- juommepas me maitoa
|
||||||
S_VOS : Temp -> Pol -> ClPlus -> S ; -- juomme maitoa me
|
S_VOS : Temp -> Pol -> ClPlus -> S ; -- juommepas maitoa me
|
||||||
|
|
||||||
PredClPlus : NP -> VP -> ClPlus ;
|
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
|
oper
|
||||||
olla = verbOlla ** {sc = NPCase Nom ; qp = "ko"} ;
|
olla = verbOlla ** {sc = NPCase Nom ; qp = True} ;
|
||||||
|
|
||||||
noSubj : Polarity -> Str = \_ -> [] ;
|
noSubj : Polarity -> Str = \_ -> [] ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
--# -path=.:../abstract:../common:../prelude
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
concrete LangFin of Lang =
|
concrete LangFin of Lang =
|
||||||
GrammarFin, --- - [SlashV2VNP,SlashVV], ---- to speed up parsing grammar
|
GrammarFin - [SlashV2VNP,SlashVV], ---- to speed up compilation
|
||||||
|
-- GrammarFin,
|
||||||
LexiconFin
|
LexiconFin
|
||||||
** {
|
** {
|
||||||
|
|
||||||
|
|||||||
@@ -688,7 +688,7 @@ resource MorphoFin = ResFin ** open Prelude in {
|
|||||||
11 => lienee
|
11 => lienee
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
vforms2V : VForms -> Verb ** {qp : Str} = \vh ->
|
vforms2V : VForms -> Verb ** {qp : Bool} = \vh ->
|
||||||
let
|
let
|
||||||
tulla = vh ! 0 ;
|
tulla = vh ! 0 ;
|
||||||
tulen = vh ! 1 ;
|
tulen = vh ! 1 ;
|
||||||
@@ -753,7 +753,7 @@ resource MorphoFin = ResFin ** open Prelude in {
|
|||||||
Inf Inf3Abess => tulema + "tt" + a
|
Inf Inf3Abess => tulema + "tt" + a
|
||||||
} ;
|
} ;
|
||||||
sc = NPCase Nom ;
|
sc = NPCase Nom ;
|
||||||
qp = Predef.dp 2 tulko ;
|
qp = pbool2bool (Predef.eqStr (last tulko) "o") ;
|
||||||
lock_V = <>
|
lock_V = <>
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ oper
|
|||||||
|
|
||||||
caseV c v = {s = v.s ; sc = NPCase c ; qp = v.qp ; lock_V = <>} ;
|
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 = <>} ;
|
mk2V2 : V -> Prep -> V2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ;
|
||||||
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;
|
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 = {
|
QuestIComp icomp np = {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
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 ;
|
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
||||||
in
|
in
|
||||||
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
|
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
|
||||||
|
|||||||
@@ -187,10 +187,10 @@ oper
|
|||||||
s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa
|
s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa
|
||||||
ext : Str ;
|
ext : Str ;
|
||||||
sc : NPForm ;
|
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 =>
|
s = \\vi,ant,b,agr0 =>
|
||||||
let
|
let
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
ClausePlus : Type = {
|
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 =
|
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
|
s = \\t,a,b => let c = (mkClausePlus sub agr vp).s ! t ! a ! b in
|
||||||
table {
|
table {
|
||||||
SDecl => c.subj ++ c.fin ++ c.inf ++ c.compl ++ c.ext ;
|
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 -> {
|
\sub,agr,vp -> {
|
||||||
s = \\t,a,b =>
|
s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
subj = sub b ;
|
|
||||||
agrfin = case vp.sc of {
|
agrfin = case vp.sc of {
|
||||||
NPCase Nom => <agr,True> ;
|
NPCase Nom => <agr,True> ;
|
||||||
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
|
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
|
||||||
} ;
|
} ;
|
||||||
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
||||||
compl = vp.s2 ! agrfin.p2 ! b ! agr ;
|
in {subj = sub b ;
|
||||||
complext = compl ++ vp.ext
|
fin = verb.fin ;
|
||||||
in {subj = subj ; fin = verb.fin ; inf = verb.inf ; compl = compl ; ext = vp.ext ; qp = questPart vp a b}
|
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.
|
-- This is used for subjects of passives: therefore isFin in False.
|
||||||
@@ -316,11 +319,13 @@ oper
|
|||||||
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
|
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
|
||||||
appCompl False b {s = [] ; c = sc ; isPre = True} np ;
|
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 {
|
case p of {
|
||||||
Neg => "kö" ; -- eikö tule
|
Neg => False ; -- eikö tule
|
||||||
_ => case a of {
|
_ => case a of {
|
||||||
Anter => "ko" ; -- onko mennyt --# notpresent
|
Anter => True ; -- onko mennyt --# notpresent
|
||||||
_ => vp.qp -- tuleeko, meneekö
|
_ => 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 ;
|
ComplSlash vp np = insertObjPre (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
|
||||||
|
|
||||||
UseComp comp =
|
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 =
|
SlashVV v vp =
|
||||||
insertObj
|
insertObj
|
||||||
|
|||||||
Reference in New Issue
Block a user