mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
fix some of the coordination again
This commit is contained in:
@@ -8,21 +8,34 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
-- ConjS : Conj -> ListS -> S ; -- he walks and she runs
|
-- ConjS : Conj -> ListS -> S ; -- he walks and she runs
|
||||||
-- TO FIX
|
-- TO FIX
|
||||||
-- ConjS conj ss = { s = \\_ => conjunctDistrX conj (ss.l ! conj.c) ; sadv = lin Adv { s = []} ; neg = ss.neg } ;
|
-- ConjS conj ss = { s = \\_ => conjunctDistrX conj (ss.l ! conj.c) ; sadv = lin Adv { s = []} ; neg = ss.neg } ;
|
||||||
|
ConjS conj ss = {
|
||||||
|
-- s = \\apos => coord conj.c { init = (ss.s ! conj.c).init ! SPreS ! apos ! CPreV ! SOV ;
|
||||||
|
-- last = (ss.s ! conj.c).last ! SPreS ! apos ! CPreV ! SOV} ;
|
||||||
|
s = \\apos => conj.s1 ++ (ss.s ! conj.c).init ! SPreS ! apos ! CPreV ! SOV ++ conj.s2 ++
|
||||||
|
(ss.s ! conj.c).last ! SPreS ! apos ! CPreV ! SOV ++ conj.s3 ;
|
||||||
|
o = \\_ => [] ;
|
||||||
|
v = \\_,_ => [] ;
|
||||||
|
neg = \\_ => [] ;
|
||||||
|
p = ss.p ;
|
||||||
|
sadv = [] ;
|
||||||
|
t = ss.t
|
||||||
|
} ;
|
||||||
|
|
||||||
-- ConjAdv : Conj -> ListAdv -> Adv ; -- here or there
|
-- ConjAdv : Conj -> ListAdv -> Adv ; -- here or there
|
||||||
ConjAdv conj ss = mkAdv (conjunctDistrSS conj (ss.l ! conj.c) ).s ;
|
-- ConjAdv conj ss = mkAdv (conjunctDistrSS conj (ss.l ! conj.c) ).s ;
|
||||||
|
|
||||||
-- ConjNP : Conj -> ListNP -> NP ; -- she or we
|
-- ConjNP : Conj -> ListNP -> NP ; -- she or we
|
||||||
ConjNP conj nps =
|
ConjNP conj nps =
|
||||||
{
|
{
|
||||||
s = case conj.c of {
|
-- s = case conj.c of {
|
||||||
And => case nps.isBase of {
|
-- Et => case nps.isBase of {
|
||||||
False => (conjunctDistrTable Case conj (nps.l ! And)).s ;
|
-- False => (conjunctDistrTable Case conj (nps.l ! Et)).s ;
|
||||||
True => \\c => conj.s1 ++ (nps.l ! And).s1 ! c ++ conj.s2 ++ (nps.l ! And).s2 ! c
|
-- True => \\c => conj.s1 ++ (nps.l ! Et).s1 ! c ++ conj.s2 ++ (nps.l ! Et).s2 ! c
|
||||||
} ;
|
-- } ;
|
||||||
c => (conjunctDistrTable Case conj (nps.l ! And)).s
|
-- c => (conjunctDistrTable Case conj (nps.l ! Et)).s
|
||||||
} ;
|
-- } ;
|
||||||
n = case conj.c of { And => Pl ; _ => nps.n } ;
|
s = \\ca => conj.s1 ++ (nps.s ! conj.c).init ! ca ++ conj.s2 ++ (nps.s ! conj.c).last ! ca++ conj.s3 ;
|
||||||
|
n = case conj.c of { Et => Pl ; _ => nps.n } ;
|
||||||
g = nps.g ;
|
g = nps.g ;
|
||||||
p = nps.p ;
|
p = nps.p ;
|
||||||
adv = nps.adv ;
|
adv = nps.adv ;
|
||||||
@@ -32,7 +45,7 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- ConjAP : Conj -> ListAP -> AP ;
|
-- ConjAP : Conj -> ListAP -> AP ;
|
||||||
ConjAP conj ss = conjunctDistrTable Agr conj (ss.l ! conj.c) ;
|
-- ConjAP conj ss = conjunctDistrTable Agr conj (ss.l ! conj.c) ;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- DConjS = conjunctDistrSS ;
|
-- DConjS = conjunctDistrSS ;
|
||||||
@@ -53,32 +66,40 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
--
|
--
|
||||||
|
|
||||||
-- BaseS : S -> S -> ListS
|
-- BaseS : S -> S -> ListS
|
||||||
-- BaseS x y = {
|
BaseS x y = {
|
||||||
-- l = \\c => { s1 = x ; s2 = y } ;
|
s = \\c => { init = combineSentence x ; last = combineSentence y } ;
|
||||||
-- } ;
|
p = y.p ;
|
||||||
|
t = y.t
|
||||||
|
} ;
|
||||||
|
|
||||||
-- ConsS : S -> ListS -> ListS
|
-- ConsS : S -> ListS -> ListS
|
||||||
-- TO FIX
|
-- TO FIX
|
||||||
-- ConsS x xs = { l = \\_ => consrSS bindComma (ss (x.s ! PreS)) (xs.l ! Comma) };
|
-- ConsS x xs = { l = \\_ => consrSS bindComma (ss (x.s ! PreS)) (xs.l ! Comma) };
|
||||||
-- ConsS s ss = {
|
ConsS s ss = {
|
||||||
-- l = \\c =>
|
s = \\co =>
|
||||||
-- { s1 = ss.s1 ++
|
{ init = \\s,a,c,o => coord co { init = (ss.s ! co).init ! s ! a ! c ! o ; last = (ss.s ! co).last ! s ! a ! c ! o } ;
|
||||||
-- table {
|
last = combineSentence s } ;
|
||||||
-- And => and_Conj
|
p = s.p ;
|
||||||
-- } ! c
|
t = s.t
|
||||||
-- ++ ss.s2 ;
|
} ;
|
||||||
-- s2 = s }
|
|
||||||
-- } ;
|
|
||||||
|
|
||||||
-- BaseAdv : Adv -> Adv -> ListAdv
|
-- BaseAdv : Adv -> Adv -> ListAdv
|
||||||
BaseAdv x y = { l = \\c => twoSS (ss (x.s ! Posit)) (ss (y.s ! Posit)) } ;
|
BaseAdv x y =
|
||||||
|
{
|
||||||
|
s = \\_ => { init = x.s ! Posit ; last = y.s ! Posit }
|
||||||
|
} ;
|
||||||
|
|
||||||
-- ConsAdv : Adv -> ListAdv -> ListAdv
|
-- ConsAdv : Adv -> ListAdv -> ListAdv
|
||||||
ConsAdv x xs = { l = \\_ => consrSS bindComma (ss (x.s ! Posit)) (xs.l ! Comma) } ;
|
ConsAdv x xs =
|
||||||
|
{
|
||||||
|
-- s = \\_ => consrSS bindComma (ss (x.s ! Posit)) (xs.l ! Comma)
|
||||||
|
s = \\c => { init = coord c (xs.s ! c) ; last = x.s ! Posit }
|
||||||
|
} ;
|
||||||
|
|
||||||
-- BaseNP : NP -> NP -> ListNP ; -- John, Mary
|
-- -- BaseNP : NP -> NP -> ListNP ; -- John, Mary
|
||||||
BaseNP x y = {
|
BaseNP x y = {
|
||||||
l = \\c => twoTable Case x y ;
|
-- s = \\c => twoTable Case x y ;
|
||||||
|
s = \\c => { init = x.s ; last = y.s } ;
|
||||||
g = Masc ; -- Just guessing (but maybe sexist bullshit)
|
g = Masc ; -- Just guessing (but maybe sexist bullshit)
|
||||||
n = matchNumber x.n y.n ;
|
n = matchNumber x.n y.n ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
@@ -87,12 +108,12 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
postap = lin AP { s = \\a => x.postap.s ! a ++ y.postap.s ! a } ;
|
postap = lin AP { s = \\a => x.postap.s ! a ++ y.postap.s ! a } ;
|
||||||
isBase = True ;
|
isBase = True ;
|
||||||
det = { s = \\g,c => x.det.s ! g ! c ++ y.det.s ! g ! c ; sp = \\g,c => x.det.sp ! g ! c ++ y.det.sp ! g ! c ; n = matchNumber x.get.n y.get.n } ;
|
det = { s = \\g,c => x.det.s ! g ! c ++ y.det.s ! g ! c ; sp = \\g,c => x.det.sp ! g ! c ++ y.det.sp ! g ! c ; n = matchNumber x.get.n y.get.n } ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- ConsNP : NP -> ListNP -> ListNP ; -- John, Mary, Bill
|
-- -- ConsNP : NP -> ListNP -> ListNP ; -- John, Mary, Bill
|
||||||
ConsNP x xs = {
|
ConsNP x xs = {
|
||||||
l = \\_ => consrTable Case bindComma x ( xs.l ! Comma );
|
-- s = \\_ => consrTable Case bindComma x ( xs.s ! Comma );
|
||||||
|
s = \\co => { init = \\ca => coord co { init = (xs.s ! co).init ! ca ; last = (xs.s ! co).last ! ca} ; last = x.s } ;
|
||||||
n = matchNumber x.n xs.n ;
|
n = matchNumber x.n xs.n ;
|
||||||
g = xs.g ;
|
g = xs.g ;
|
||||||
p = xs.p ;
|
p = xs.p ;
|
||||||
@@ -103,18 +124,18 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
-- TODO det
|
-- TODO det
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- BaseAP : AP -> AP -> ListAP
|
-- -- BaseAP : AP -> AP -> ListAP
|
||||||
BaseAP x y = { l = \\c => twoTable Agr x y };
|
-- BaseAP x y = { l = \\c => twoTable Agr x y };
|
||||||
|
|
||||||
-- ConsAP : AP -> ListAP -> ListAP
|
-- -- ConsAP : AP -> ListAP -> ListAP
|
||||||
ConsAP x xs =
|
-- ConsAP x xs =
|
||||||
{ l = \\_ => consrTable Agr and_Conj.s2 x (xs.l ! Comma ) } ;
|
-- { l = \\_ => consrTable Agr and_Conj.s2 x (xs.l ! Comma ) } ;
|
||||||
--
|
--
|
||||||
lincat
|
lincat
|
||||||
-- [S] = { l : Coordinator => {s1,s2 : S} } ; -- TO FIX
|
[S] = { s : Coordinator => {init,last : SAdvPos => AdvPos => ComplPos => Order => Str} ; p : Pol ; t : Tense } ; -- TO FIX
|
||||||
[Adv] = { l: Coordinator => {s1,s2 : Str}} ;
|
[Adv] = { s: Coordinator => {init,last : Str}} ;
|
||||||
[NP] = {l : Coordinator => {s1,s2 : Case => Str} ; g : Gender ; n : Number ; p : Person ; adv : Str ; preap : AP ; postap : AP ; isBase : Bool } ;
|
[NP] = { s : Coordinator => {init,last : Case => Str} ; g : Gender ; n : Number ; p : Person ; adv : Str ; preap : AP ; postap : AP ; isBase : Bool } ;
|
||||||
[AP] = {l : Coordinator => {s1,s2 : Agr => Str } } ;
|
[AP] = {s : Coordinator => {init,last : Agr => Str } } ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
-- Generates a new number value given two number values.
|
-- Generates a new number value given two number values.
|
||||||
@@ -126,5 +147,21 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
<_,Pl> => Pl ;
|
<_,Pl> => Pl ;
|
||||||
<_,_> => Sg
|
<_,_> => Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
coord : Coordinator -> {init : Str ; last : Str} -> Str =
|
||||||
|
\c,l ->
|
||||||
|
l.init ++
|
||||||
|
table {
|
||||||
|
Aut => "aut" ;
|
||||||
|
Et => "et" ;
|
||||||
|
Sed => "sed" ;
|
||||||
|
Si => "si" ;
|
||||||
|
Vel => "vel" ;
|
||||||
|
Comma => bindComma ;
|
||||||
|
Colon => ":" ;
|
||||||
|
Empty => "" ;
|
||||||
|
Missing => nonExist
|
||||||
|
} ! c
|
||||||
|
++ l.last ;
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ concrete ExtraLat of ExtraLatAbs =
|
|||||||
ConjNPque conj nps =
|
ConjNPque conj nps =
|
||||||
{
|
{
|
||||||
s = case conj.c of {
|
s = case conj.c of {
|
||||||
And => case nps.isBase of {
|
Et => case nps.isBase of {
|
||||||
False => (conjunctDistrTable Case conj (nps.l ! And)).s ;
|
False => \\cse => coord conj.c {init = (nps.s ! Et).init ! cse ; last = (nps.s ! Et).last ! cse } ;-- (conjunctDistrTable Case conj (nps.s ! Et)).s ;
|
||||||
True => \\c => (nps.l ! And).s1 ! c ++ (nps.l ! And).s2 ! c ++ BIND ++ "que"
|
True => \\cse => (nps.s ! Et).init ! cse ++ (nps.s ! Et).last ! cse ++ BIND ++ "que"
|
||||||
} ;
|
} ;
|
||||||
c => (conjunctDistrTable Case conj (nps.l ! And)).s
|
c => \\cse => coord conj.c {init = (nps.s ! c).init ! cse ; last = (nps.s ! c).last ! cse } -- (conjunctDistrTable Case conj (nps.l ! Et)).s
|
||||||
} ;
|
} ;
|
||||||
n = case conj.c of { And => Pl ; _ => nps.n } ;
|
n = case conj.c of { Et => Pl ; _ => nps.n } ;
|
||||||
g = nps.g ;
|
g = nps.g ;
|
||||||
p = nps.p ;
|
p = nps.p ;
|
||||||
adv = nps.adv ;
|
adv = nps.adv ;
|
||||||
|
|||||||
@@ -1159,7 +1159,7 @@ oper
|
|||||||
Preposition : Type = {s : Str ; c : Case ; isPost : Bool } ;
|
Preposition : Type = {s : Str ; c : Case ; isPost : Bool } ;
|
||||||
|
|
||||||
-- conjunctions
|
-- conjunctions
|
||||||
param Coordinator = And | Or | If | Neither | Because | Comma | Colon | Empty | Missing ; -- Missing means not implemented yet
|
param Coordinator = Aut | Et | Sed | Si | Vel | Comma | Colon | Empty | Missing ; -- Missing means not implemented yet
|
||||||
oper
|
oper
|
||||||
Conjunction : Type = { s1 : Str ; s2 : Str ; s3 : Str ; n : Number ; c : Coordinator } ; -- s1 is in the beginning of the coordination phrase, s2 in the middle and s3 is a potential enclitic, s is the prefered number of the coordination phrase and c is the parameter to define which string to put within the phrase
|
Conjunction : Type = { s1 : Str ; s2 : Str ; s3 : Str ; n : Number ; c : Coordinator } ; -- s1 is in the beginning of the coordination phrase, s2 in the middle and s3 is a potential enclitic, s is the prefered number of the coordination phrase and c is the parameter to define which string to put within the phrase
|
||||||
mkConjunction : Str -> Str -> Str -> Number -> Coordinator -> Conjunction =
|
mkConjunction : Str -> Str -> Str -> Number -> Coordinator -> Conjunction =
|
||||||
|
|||||||
@@ -11,19 +11,19 @@ concrete StructuralLat of Structural = CatLat **
|
|||||||
almost_AdA, almost_AdN = ss "quasi" ; -- L...
|
almost_AdA, almost_AdN = ss "quasi" ; -- L...
|
||||||
although_Subj = ss "quamquam" ; -- L...
|
although_Subj = ss "quamquam" ; -- L...
|
||||||
always_AdV = ss "semper" ; -- L...
|
always_AdV = ss "semper" ; -- L...
|
||||||
and_Conj = mkConj [] "et" Pl And ; -- L...
|
and_Conj = mkConj [] "et" Pl Et ; -- L...
|
||||||
-----b and_Conj = ss "and" ** {n = Pl} ;
|
-----b and_Conj = ss "and" ** {n = Pl} ;
|
||||||
because_Subj = ss "cum" ; -- L...
|
because_Subj = ss "cum" ; -- L...
|
||||||
before_Prep = mkPrep "ante" Acc ; -- acc. L...
|
before_Prep = mkPrep "ante" Acc ; -- acc. L...
|
||||||
behind_Prep = mkPrep "a tergo" Acc ; -- acc. L...
|
behind_Prep = mkPrep "a tergo" Acc ; -- acc. L...
|
||||||
between_Prep = mkPrep "inter" Acc ; -- acc. L...
|
between_Prep = mkPrep "inter" Acc ; -- acc. L...
|
||||||
both7and_DConj = mkConj "et" "et" Pl And; --L...
|
both7and_DConj = mkConj "et" "et" Pl Et ; --L...
|
||||||
but_PConj = ss "sed" ; -- L...
|
but_PConj = ss "sed" ; -- L...
|
||||||
by8agent_Prep = mkPrep "per" Abl ; -- L...
|
by8agent_Prep = mkPrep "per" Abl ; -- L...
|
||||||
by8means_Prep = mkPrep "" Abl ; -- L...
|
by8means_Prep = mkPrep "" Abl ; -- L...
|
||||||
can8know_VV, can_VV = mkVV IrregLat.can_V True ; --L...
|
can8know_VV, can_VV = mkVV IrregLat.can_V True ; --L...
|
||||||
during_Prep = mkPrep "inter" Acc ; -- L...
|
during_Prep = mkPrep "inter" Acc ; -- L...
|
||||||
either7or_DConj = mkConj "aut" "aut" Sg Or ; -- L...
|
either7or_DConj = mkConj "aut" "aut" Sg Aut ; -- L...
|
||||||
everybody_NP = regNP "quisque" "quemque" "cuiusque" "cuique" "quoque" "quisque" Masc Sg ;-- regNP "quisquae" Sg ; -- L...
|
everybody_NP = regNP "quisque" "quemque" "cuiusque" "cuique" "quoque" "quisque" Masc Sg ;-- regNP "quisquae" Sg ; -- L...
|
||||||
every_Det = mkDeterminer ( mkA "omnis" ) Pl ; -- Pons
|
every_Det = mkDeterminer ( mkA "omnis" ) Pl ; -- Pons
|
||||||
everything_NP = regNP "omnia" "omnia" "omnium" "omnis" "omnis" "omnia" Neutr Pl ; --regNP "omnia" Pl ; -- L...
|
everything_NP = regNP "omnia" "omnia" "omnium" "omnis" "omnis" "omnia" Neutr Pl ; --regNP "omnia" Pl ; -- L...
|
||||||
@@ -55,7 +55,7 @@ concrete StructuralLat of Structural = CatLat **
|
|||||||
on_Prep = mkPrep "in" Acc ; -- L...
|
on_Prep = mkPrep "in" Acc ; -- L...
|
||||||
------ one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED
|
------ one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED
|
||||||
only_Predet = ss "solum" ; -- L...
|
only_Predet = ss "solum" ; -- L...
|
||||||
or_Conj = mkConj [] "aut" Sg Or ; -- L...
|
or_Conj = mkConj [] "aut" Sg Aut ; -- L...
|
||||||
otherwise_PConj = ss "praeterea" ; -- Pons
|
otherwise_PConj = ss "praeterea" ; -- Pons
|
||||||
part_Prep = mkPrep [] Gen ; -- Bayer-Lindauer 127
|
part_Prep = mkPrep [] Gen ; -- Bayer-Lindauer 127
|
||||||
please_Voc = ss "queso" ; -- L...
|
please_Voc = ss "queso" ; -- L...
|
||||||
@@ -113,7 +113,7 @@ concrete StructuralLat of Structural = CatLat **
|
|||||||
|
|
||||||
no_Quant = { s , sp = ( mkA "nullus" ).s ! Posit } ; -- nullus L...
|
no_Quant = { s , sp = ( mkA "nullus" ).s ! Posit } ; -- nullus L...
|
||||||
not_Predet = ss "non" ; -- L...
|
not_Predet = ss "non" ; -- L...
|
||||||
if_then_Conj = mkConj "si" [] Sg If ; -- no word in s2 field L...
|
if_then_Conj = mkConj "si" [] Sg Si ; -- no word in s2 field L...
|
||||||
at_least_AdN = ss "saltem" ; -- L...
|
at_least_AdN = ss "saltem" ; -- L...
|
||||||
at_most_AdN = ss "summum" ; -- Pons
|
at_most_AdN = ss "summum" ; -- Pons
|
||||||
nobody_NP = regNP "nemo" "neminem" "neminis" "nemini" "nemine" "nemo" Masc Sg ; -- Bayer Lindauer 60.4
|
nobody_NP = regNP "nemo" "neminem" "neminis" "nemini" "nemine" "nemo" Masc Sg ; -- Bayer Lindauer 60.4
|
||||||
|
|||||||
Reference in New Issue
Block a user