mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-21 02:39:31 -06:00
Scandinavian conjunction
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
resource Coordination = {
|
||||
resource Coordination = open Prelude in {
|
||||
|
||||
param
|
||||
ListSize = TwoElem | ManyElem ;
|
||||
@@ -27,6 +27,12 @@ oper
|
||||
conjunctDistrX : ConjunctionDistr -> ListX -> Str = \or,xs ->
|
||||
or.s1 ++ xs.s1 ++ or.s2 ++ xs.s2 ;
|
||||
|
||||
conjunctSS : Conjunction -> ListX -> SS = \or,xs ->
|
||||
ss (xs.s1 ++ or.s ++ xs.s2) ;
|
||||
|
||||
conjunctDistrSS : ConjunctionDistr -> ListX -> SS = \or,xs ->
|
||||
ss (or.s1 ++ xs.s1 ++ or.s2 ++ xs.s2) ;
|
||||
|
||||
-- all this lifted to tables
|
||||
|
||||
ListTable : Type -> Type = \P -> {s1,s2 : P => Str} ;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
concrete ConjunctionEng of Conjunction =
|
||||
CatEng ** open ResEng, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
ConjS conj ss = {s = conjunctX conj ss} ;
|
||||
DConjS conj ss = {s = conjunctDistrX conj ss} ;
|
||||
ConjS = conjunctSS ;
|
||||
DConjS = conjunctDistrSS ;
|
||||
|
||||
ConjAdv conj ss = {s = conjunctX conj ss} ;
|
||||
DConjAdv conj ss = {s = conjunctDistrX conj ss} ;
|
||||
ConjAdv = conjunctSS ;
|
||||
DConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
|
||||
@@ -23,4 +23,4 @@ concrete ExtEng of ExtEngAbs = CatEng ** open ResEng in {
|
||||
can_Aux = {s = \\p => posneg p "can"} ; ---- cannt
|
||||
must_Aux = {s = \\p => posneg p "must"} ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,45 @@
|
||||
--concrete ConjunctionScand of Conjunction =
|
||||
-- CatScand ** open ResScand, Coordination, Prelude in {
|
||||
--
|
||||
-- lin
|
||||
--
|
||||
-- ConjS conj ss = {s = conjunctX conj ss} ;
|
||||
-- DConjS conj ss = {s = conjunctDistrX conj ss} ;
|
||||
--
|
||||
-- ConjAdv conj ss = {s = conjunctX conj ss} ;
|
||||
-- DConjAdv conj ss = {s = conjunctDistrX conj ss} ;
|
||||
--
|
||||
-- ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
-- } ;
|
||||
-- DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
-- } ;
|
||||
--
|
||||
-- ConjAP conj ss = conjunctTable Agr conj ss ** {
|
||||
-- isPre = ss.isPre
|
||||
-- } ;
|
||||
-- DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
||||
-- isPre = ss.isPre
|
||||
-- } ;
|
||||
--
|
||||
---- These fun's are generated from the list cat's.
|
||||
--
|
||||
-- BaseS = twoSS ;
|
||||
-- ConsS = consrSS comma ;
|
||||
-- BaseAdv = twoSS ;
|
||||
-- ConsAdv = consrSS comma ;
|
||||
-- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||
-- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
-- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
||||
-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||
--
|
||||
-- lincat
|
||||
-- [S] = {s1,s2 : Str} ;
|
||||
-- [Adv] = {s1,s2 : Str} ;
|
||||
-- [NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||
-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
||||
--
|
||||
--}
|
||||
incomplete concrete ConjunctionScand of Conjunction =
|
||||
CatScand ** open ResScand, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
ConjS conj ss = conjunctTable Order conj ss ;
|
||||
DConjS conj ss = conjunctDistrTable Order conj ss ;
|
||||
|
||||
ConjAdv conj ss = conjunctSS conj ss ;
|
||||
DConjAdv conj ss = conjunctDistrSS conj ss ;
|
||||
|
||||
ConjNP conj ss = conjunctTable NPForm conj ss ** {
|
||||
a = {gn = conjGenNum (gennum utrum conj.n) ss.a.gn ; p = ss.a.p}
|
||||
} ;
|
||||
DConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
|
||||
a = {gn = conjGenNum (gennum utrum conj.n) ss.a.gn ; p = ss.a.p}
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctTable AFormPos conj ss ** {
|
||||
isPre = ss.isPre
|
||||
} ;
|
||||
DConjAP conj ss = conjunctDistrTable AFormPos conj ss ** {
|
||||
isPre = ss.isPre
|
||||
} ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
BaseS = twoTable Order ;
|
||||
ConsS = consrTable Order comma ;
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ;
|
||||
ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
BaseAP x y = twoTable AFormPos x y ** {isPre = andB x.isPre y.isPre} ;
|
||||
ConsAP xs x = consrTable AFormPos comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Order => Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||
[AP] = {s1,s2 : AFormPos => Str ; isPre : Bool} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,20 @@ oper
|
||||
Pres => VF (VPres v) ;
|
||||
Past => VF (VPret v) ;
|
||||
_ => VI (VInfin v) --- not to be used?
|
||||
} ;
|
||||
} ;
|
||||
|
||||
-- Used in $ConjunctionScand$.
|
||||
|
||||
conjGenNum : (_,_ : GenNum) -> GenNum = \g,h -> case <g,h> of {
|
||||
<SgUtr,SgUtr> => SgUtr ;
|
||||
<Plg, _> => Plg ;
|
||||
<_, Plg> => Plg ;
|
||||
_ => SgNeutr
|
||||
} ;
|
||||
|
||||
conjAgr : (_,_ : Agr) -> Agr = \a,b -> {
|
||||
gn = conjGenNum a.gn b.gn ;
|
||||
p = conjPerson a.p b.p
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
2
lib/resource-1.0/swedish/ConjunctionSwe.gf
Normal file
2
lib/resource-1.0/swedish/ConjunctionSwe.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ConjunctionSwe of Conjunction = CatSwe ** ConjunctionScand with
|
||||
(DiffScand = DiffSwe) ;
|
||||
@@ -9,7 +9,7 @@ concrete TestSwe of Test =
|
||||
SentenceSwe,
|
||||
QuestionSwe,
|
||||
-- RelativeSwe,
|
||||
-- ConjunctionSwe,
|
||||
ConjunctionSwe,
|
||||
PhraseSwe,
|
||||
UntensedSwe,
|
||||
-- -- TensedSwe,
|
||||
|
||||
Reference in New Issue
Block a user