1
0
forked from GitHub/gf-core

ExtraFin functions for word order variations

This commit is contained in:
aarne
2011-02-08 15:49:04 +00:00
parent 55d15c9bf8
commit ff1413e801
4 changed files with 66 additions and 11 deletions

View File

@@ -103,4 +103,36 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
isPoss = True ;
isDef = True --- "minun kolme autoani ovat" ; thus "...on" is missing
} ;
lincat ClPlus = ClausePlus ;
lin
S_SVO t p clp =
let cl = clp.s ! t.t ! t.a ! p.p
in
{s = t.s ++ p.s ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.ext} ;
S_SOV t p clp =
let cl = clp.s ! t.t ! t.a ! p.p
in
{s = t.s ++ p.s ++ cl.subj ++ cl.compl ++ cl.fin ++ cl.inf ++ cl.ext} ;
S_OSV t p clp =
let cl = clp.s ! t.t ! t.a ! p.p
in
{s = t.s ++ p.s ++ cl.compl ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.ext} ;
S_OVS t p clp =
let cl = clp.s ! t.t ! t.a ! p.p
in
{s = t.s ++ p.s ++ cl.compl ++ cl.fin ++ cl.inf ++ cl.subj ++ cl.ext} ;
S_VSO t p clp =
let cl = clp.s ! t.t ! t.a ! p.p
in
{s = t.s ++ p.s ++ cl.fin ++ cl.subj ++ cl.inf ++ cl.compl ++ cl.ext} ;
S_VOS t p clp =
let cl = clp.s ! t.t ! t.a ! p.p
in
{s = t.s ++ p.s ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.subj ++ cl.ext} ;
PredClPlus np vp = mkClausePlus (subjForm np vp.sc) np.a vp ;
}

View File

@@ -19,4 +19,17 @@ abstract ExtraFinAbs = Extra [
ProDropPoss : Pron -> Quant ; -- vaimoni
cat
ClPlus ; -- clause with more variation
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
PredClPlus : NP -> VP -> ClPlus ;
}

View File

@@ -1,7 +1,7 @@
--# -path=.:../abstract:../common:../prelude
concrete LangFin of Lang =
GrammarFin,
GrammarFin, --- - [SlashV2VNP,SlashVV], ---- to speed up parsing grammar
LexiconFin
** {

View File

@@ -283,9 +283,22 @@ oper
s : Tense => Anteriority => Polarity => SType => Str
} ;
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause =
ClausePlus : Type = {
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,ext,qp : Str}
} ;
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause =
\sub,agr,vp -> {
s = \\t,a,b,o =>
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
}
} ;
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
\sub,agr,vp -> {
s = \\t,a,b =>
let
subj = sub b ;
agrfin = case vp.sc of {
@@ -293,20 +306,17 @@ oper
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
} ;
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
compl = vp.s2 ! agrfin.p2 ! b ! agr ++ vp.ext
in
case o of {
SDecl => subj ++ verb.fin ++ verb.inf ++ compl ;
SQuest => questPart vp a b verb.fin ++ subj ++ verb.inf ++ compl
}
} ;
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}
} ;
-- This is used for subjects of passives: therefore isFin in False.
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
appCompl False b {s = [] ; c = sc ; isPre = True} np ;
questPart : VP -> Anteriority -> Polarity -> Str -> Str = \vp,a,p,on -> on ++ BIND ++
questPart : VP -> Anteriority -> Polarity -> Str = \vp,a,p ->
case p of {
Neg => "kö" ; -- eikö tule
_ => case a of {