diff --git a/doc/DocExtend.hs b/doc/DocExtend.hs
index bbaecf340..cd5434775 100644
--- a/doc/DocExtend.hs
+++ b/doc/DocExtend.hs
@@ -1,3 +1,8 @@
+module Main where
+
+import Data.List
+import Data.Ord (comparing)
+
main = docExtend
docExtend = do
@@ -22,13 +27,15 @@ docExtend = do
--- mapM print fundefs
-- read the functor exclusion lists for each language
- let langs = [("Eng","english"),("Dut","dutch"),("Spa","spanish")] --,("Swe","swedish")]
+ let langs = [("Eng","english"),("Dut","dutch"),("Spa","spanish"),("Swe","swedish")]
funss <- mapM getExclusions langs
- mapM_ print funss
+ --- mapM_ print funss
let langfuns = zip (map fst langs) funss
let funlangs = [(fu,[lang | (lang,fs) <- langfuns, elem fu fs]) | fu:_ <- funs]
let fundeflangs = [[fu,ty,co,de,unwords ls] | fu:ty:co:de:_ <- fundefs, (f,ls) <- funlangs, f==fu]
- mapM print fundeflangs
+ --- mapM print fundeflangs
+ writeFile "GF-RGL-Extend.html" $ printHTML $ sortBy (comparing (\z -> (last (words (z !! 1)), z!!0))) fundeflangs
+ putStrLn "wrote file GF-RGL-Extend.html"
-- exclusion format:
-- concrete ExtendEng of Extend =
@@ -42,4 +49,17 @@ getExclusions (lan,language) = do
let excls = case dropWhile (/=["["]) rs of
[] -> []
_:es -> map (filter (/=',')) $ concat $ takeWhile (/= ["]"]) es
- return excls
\ No newline at end of file
+ return excls
+
+printHTML fs = unlines $
+ "" :
+ "
" :
+ "" :
+ map prRow fs ++ [
+ "
",
+ "",
+ ""
+ ]
+ where
+ prRow ss = concat $ "" : ["| " ++ s ++ " | " | s <- ss] ++ ["
"]
+
diff --git a/src/abstract/Extend.gf b/src/abstract/Extend.gf
index 00d60b094..26da22e7a 100644
--- a/src/abstract/Extend.gf
+++ b/src/abstract/Extend.gf
@@ -25,7 +25,7 @@ abstract Extend = Cat ** {
GenModNP : Num -> NP -> CN -> NP ; -- this man's car(s)
GenModIP : Num -> IP -> CN -> IP ; -- whose car(s)
- CompBareCN : CN -> Comp ; -- (est) professeur
+ CompBareCN : CN -> Comp ; -- (is) teacher
StrandQuestSlash : IP -> ClSlash -> QCl ; -- whom does John live with
StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives in
@@ -68,7 +68,7 @@ abstract Extend = Cat ** {
ComplVPI2 : VPI2 -> NP -> VPI ; -- to love and hate that person
fun
- ProDrop : Pron -> Pron ; -- unstressed subject pronoun becomes []: "(io) sono stanco"
+ ProDrop : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired"
ICompAP : AP -> IComp ; -- "how old"
IAdvAdv : Adv -> IAdv ; -- "how often"
@@ -192,18 +192,20 @@ abstract Extend = Cat ** {
-- Romance
DetNPFem : Det -> NP ;
- iFem_Pron : Pron ; -- je (suis vieille)
- youFem_Pron : Pron ; -- tu (es vieille)
- weFem_Pron : Pron ; -- nous (sommes vieilles)
- youPlFem_Pron : Pron ; -- vous (êtes vieilles)
- theyFem_Pron : Pron ; -- elles (sont vieilles)
- youPolFem_Pron : Pron ; -- vous (êtes vieille)
+ iFem_Pron : Pron ; -- I (Fem)
+ youFem_Pron : Pron ; -- you (Fem)
+ weFem_Pron : Pron ; -- we (Fem)
+ youPlFem_Pron : Pron ; -- you plural (Fem)
+ theyFem_Pron : Pron ; -- they (Fem)
+ youPolFem_Pron : Pron ; -- you polite (Fem)
+ youPolPl_Pron : Pron ; -- you polite plural (Masc)
+ youPolPlFem_Pron : Pron ; -- you polite plural (Fem)
-- German
UttAccNP : NP -> Utt ; -- him (accusative)
UttDatNP : NP -> Utt ; -- him (dative)
- UttAccIP : NP -> Utt ; -- whom (accusative)
- UttDatIP : NP -> Utt ; -- whom (dative)
+ UttAccIP : IP -> Utt ; -- whom (accusative)
+ UttDatIP : IP -> Utt ; -- whom (dative)
}
diff --git a/src/common/ExtendFunctor.gf b/src/common/ExtendFunctor.gf
index 5145acd79..a758cc7ff 100644
--- a/src/common/ExtendFunctor.gf
+++ b/src/common/ExtendFunctor.gf
@@ -19,7 +19,7 @@ lin
GenRP = variants {} ; -- Num -> CN -> RP ; -- whose car
GenModNP num np cn = DetCN (DetQuant DefArt num) (AdvCN cn (PrepNP possess_Prep np)) ; -- this man's car(s) ; DEFAULT the car of this man
GenModIP = variants {} ; -- Num -> IP -> CN -> IP ; -- whose car(s)
- CompBareCN cn = CompCN cn ; -- (est) professeur ; DEFAULT is a teacher
+ CompBareCN cn = CompCN cn ; -- (is) teacher ; DEFAULT is a teacher
StrandQuestSlash = QuestSlash ; -- whom does John live with ; DEFAULT with whom does John live
StrandRelSlash = RelSlash ; -- that he lives in ; DEFAULT in which he lives
EmptyRelSlash = RelSlash IdRP ; -- he lives in ; DEFAULT in which he lives
@@ -35,7 +35,7 @@ lin
MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved
ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated
ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person
- ProDrop pro = pro ; -- am tired ; DEFAULT I am tired
+ ProDrop pro = pro ; -- am tired ; DEFAULT I am tired (no pro drop)
ICompAP = variants {} ; -- AP -> IComp ; -- "how old"
IAdvAdv = variants {} ; -- Adv -> IAdv ; -- "how often"
CompIQuant iquant = CompIP (IdetIP (IdetQuant iquant NumSg)) ; -- which (is it) [agreement to NP] ; DEFAULT which [no agreement]
@@ -90,12 +90,14 @@ lin
DetNPFem = DetNP ;
- iFem_Pron = i_Pron ;
- youFem_Pron = youSg_Pron ;
- weFem_Pron = we_Pron ;
- youPlFem_Pron = youPl_Pron ;
- theyFem_Pron = they_Pron ;
- youPolFem_Pron = youPol_Pron ;
+ iFem_Pron = i_Pron ; -- DEFAULT I (masc)
+ youFem_Pron = youSg_Pron ; -- DEFAULT you (masc)
+ weFem_Pron = we_Pron ; -- DEFAULT we (masc)
+ youPlFem_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
+ theyFem_Pron = they_Pron ; -- DEFAULT they (masc)
+ youPolFem_Pron = youPol_Pron ; -- DEFAULT you polite (masc)
+ youPolPl_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
+ youPolPlFem_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
UttAccNP = UttNP ; -- him (accusative) ; DEFAULT he
UttDatNP np = UttAccNP (lin NP np) ; -- him(dative) ; DEFAULT he
UttAccIP = UttIP ; -- whom (accusative) ; DEFAULT who
diff --git a/src/spanish/AllSpa.gf b/src/spanish/AllSpa.gf
index 7bef719f3..8ac77b39b 100644
--- a/src/spanish/AllSpa.gf
+++ b/src/spanish/AllSpa.gf
@@ -3,5 +3,6 @@
concrete AllSpa of AllSpaAbs =
LangSpa,
IrregSpa,
- ExtraSpa
+ ExtendSpa
+---- ExtraSpa
** {} ;
diff --git a/src/spanish/AllSpaAbs.gf b/src/spanish/AllSpaAbs.gf
index f1e21176e..97642e3c8 100644
--- a/src/spanish/AllSpaAbs.gf
+++ b/src/spanish/AllSpaAbs.gf
@@ -1,5 +1,6 @@
abstract AllSpaAbs =
Lang,
IrregSpaAbs,
- ExtraSpaAbs
+ Extend
+---- ExtraSpaAbs
** {} ;
diff --git a/src/spanish/ExtendSpa.gf b/src/spanish/ExtendSpa.gf
index e29fc8807..ab45a33d7 100644
--- a/src/spanish/ExtendSpa.gf
+++ b/src/spanish/ExtendSpa.gf
@@ -1,16 +1,70 @@
--# -path=alltenses:../common:../abstract
concrete ExtendSpa of Extend =
- CatSpa ** ExtendFunctor
--- - [] -- put the names of your own definitions here
+ CatSpa ** ExtendFunctor -
+ [
+ iFem_Pron, youFem_Pron, weFem_Pron, youPlFem_Pron, theyFem_Pron, youPolFem_Pron, youPolPl_Pron, youPolPlFem_Pron,
+ ProDrop
+ ] -- put the names of your own definitions here
with
(Grammar = GrammarSpa) **
open
GrammarSpa,
ResSpa,
+ MorphoSpa,
Coordination,
Prelude,
ParadigmsSpa in {
-- put your own definitions here
-
+
+ lin
+ iFem_Pron = mkPronoun
+ "yo" "me" "me" "mí"
+ "mi" "mi" "mis" "mis"
+ Fem Sg P1 ;
+ theyFem_Pron = mkPronoun
+ "ellas" "las" "les" "ellas"
+ "su" "su" "sus" "sus"
+ Fem Pl P3 ;
+
+ weFem_Pron = mkPronoun
+ "nosotras" "nos" "nos" "nosotras"
+ "nuestro" "nuestra" "nuestros" "nuestras"
+ Fem Pl P1 ;
+
+ youFem_Pron = mkPronoun
+ "tú" "te" "te" "ti"
+ "tu" "tu" "tus" "tus"
+ Fem Sg P2 ;
+ youPlFem_Pron = mkPronoun
+ "vosotras" "os" "os" "vosotras"
+ "vuestro" "vuestra" "vuestros" "vuestras"
+ Fem Pl P2 ;
+ youPolFem_Pron = mkPronoun
+ "usted" "la" "le" "usted"
+ "su" "su" "sus" "sus"
+ Fem Sg P3 ;
+
+ youPolPl_Pron = mkPronoun
+ "ustedes" "los" "les" "usted"
+ "su" "su" "sus" "sus"
+ Masc Pl P3 ;
+ youPolPlFem_Pron = mkPronoun
+ "ustedes" "las" "les" "usted"
+ "su" "su" "sus" "sus"
+ Fem Pl P3 ;
+
+ ProDrop p = {
+ s = table {
+ Nom => let pn = p.s ! Nom in {c1 = pn.c1 ; c2 = pn.c2 ; comp = [] ; ton = pn.ton} ;
+ c => p.s ! c
+ } ;
+ a = p.a ;
+ poss = p.poss ;
+ hasClit = p.hasClit ;
+ isPol = p.isPol ;
+ isNeg = False
+ } ;
+
+
}
\ No newline at end of file
diff --git a/src/swedish/AllSwe.gf b/src/swedish/AllSwe.gf
index 66318a84f..b618260b9 100644
--- a/src/swedish/AllSwe.gf
+++ b/src/swedish/AllSwe.gf
@@ -3,5 +3,6 @@
concrete AllSwe of AllSweAbs =
LangSwe - [PassV2],
IrregSwe,
- ExtraSwe
+---- ExtraSwe
+ ExtendSwe
** {} ;
diff --git a/src/swedish/AllSweAbs.gf b/src/swedish/AllSweAbs.gf
index 7fd59eb43..2673b1807 100644
--- a/src/swedish/AllSweAbs.gf
+++ b/src/swedish/AllSweAbs.gf
@@ -1,5 +1,6 @@
abstract AllSweAbs =
Lang - [PassV2] ,
IrregSweAbs,
- ExtraSweAbs
+---- ExtraSweAbs
+ Extend
** {} ;
diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf
new file mode 100644
index 000000000..2ae788b73
--- /dev/null
+++ b/src/swedish/ExtendSwe.gf
@@ -0,0 +1,148 @@
+--# -path=.:../scandinavian:../abstract:../common:prelude
+concrete ExtendSwe of Extend = CatSwe **
+ ExtendFunctor -
+ [
+ GenNP, ComplBareVS, CompBareCN,
+ StrandRelSlash, EmptyRelSlash, StrandQuestSlash,
+ MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
+ MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
+ ICompAP,
+ RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP,
+ Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP
+ ]
+ with (Grammar = GrammarSwe)
+ **
+ open CommonScand, ResSwe, ParamX, VerbSwe, Prelude, DiffSwe, StructuralSwe, MorphoSwe,
+ NounSwe, Coordination, AdjectiveSwe, SentenceSwe, AdverbSwe, RelativeSwe, (P = ParadigmsSwe) in {
+
+ flags coding=utf8 ;
+
+ lin
+ GenNP np = {
+ s,sp = \\n,_,_,g => np.s ! NPPoss (gennum (ngen2gen g) n) Nom ;
+ det = DDef Indef
+ } ;
+
+
+ ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ;
+
+ CompBareCN cn = {s = \\a => case a.n of {
+ Sg => cn.s ! Sg ! DIndef ! Nom ;
+ Pl => cn.s ! Pl ! DIndef ! Nom
+ }
+ } ;
+
+ StrandRelSlash rp slash = {
+ s = \\t,a,p,ag,_ =>
+ rp.s ! ag.g ! ag.n ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ;
+ c = NPAcc
+ } ;
+ EmptyRelSlash slash = {
+ s = \\t,a,p,ag,_ =>
+ slash.s ! t ! a ! p ! Sub ++ slash.c2.s ;
+ c = NPAcc
+ } ;
+
+ StrandQuestSlash ip slash = {
+ s = \\t,a,p =>
+ let
+ cls = slash.s ! t ! a ! p ;
+ who = ip.s ! accusative ;
+ agr = agrP3 ip.g ip.n ;
+ in table {
+ QDir => who ++ cls ! Inv ++ slash.n3 ! agr ++ slash.c2.s ;
+ QIndir => who ++ cls ! Sub ++ slash.n3 ! agr ++ slash.c2.s
+ }
+ } ;
+
+
+ lincat
+ VPI = {s : VPIForm => Agr => Str} ;
+ [VPI] = {s1,s2 : VPIForm => Agr => Str} ;
+
+ lin
+ BaseVPI = twoTable2 VPIForm Agr ;
+ ConsVPI = consrTable2 VPIForm Agr comma ;
+
+ MkVPI vp = {
+ s = \\v,a => infVP vp a ---- no sup
+ } ;
+ ConjVPI = conjunctDistrTable2 VPIForm Agr ;
+ ComplVPIVV vv vpi = insertObj (\\a => vv.c2.s ++ vpi.s ! VPIInf ! a) (predV vv) ;
+
+ lincat
+ VPS = {s : Order => Agr => Str} ;
+ [VPS] = {s1,s2 : Order => Agr => Str} ;
+
+ lin
+ BaseVPS = twoTable2 Order Agr ;
+ ConsVPS = consrTable2 Order Agr comma ;
+
+ PredVPS np vpi =
+ let
+ subj = np.s ! nominative ;
+ agr = np.a ;
+ in {
+ s = \\o =>
+ let verb = vpi.s ! o ! agr
+ in case o of {
+ Main => subj ++ verb ;
+ Inv => verb ++ subj ; ---- älskar henne och sover jag
+ Sub => subj ++ verb
+ }
+ } ;
+
+ MkVPS t p vp = {
+ s = \\o,a =>
+ let
+ verb = vp.s ! Act ! VPFinite t.t t.a ;
+ neg = verb.a1 ! p.p ! a ;
+ compl = vp.n2 ! a ++ vp.a2 ++ vp.ext ;
+ pron = vp.n1 ! a
+ in t.s ++ p.s ++ case o of {
+ Main => verb.fin ++ neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl ;
+ Inv => verb.fin ++ neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl ; ----
+ Sub => neg.p1 ++ neg.p2 ++ verb.fin ++ verb.inf ++ pron ++ compl
+ }
+ } ;
+
+ ConjVPS = conjunctDistrTable2 Order Agr ;
+
+ ICompAP ap = {s = \\a => hur_IAdv.s ++ ap.s ! a} ;
+
+
+
+ lincat
+ RNP = {s : Agr => Str ; isPron : Bool} ; ---- inherent Agr needed: han färgar sitt hår vitt. But also depends on subject
+ RNPList = {s1,s2 : Agr => Str} ;
+
+ lin
+ ReflRNP vps rnp =
+ insertObjPron
+ (andB (notB vps.c2.hasPrep) rnp.isPron)
+ rnp.s
+ (insertObj (\\a => vps.c2.s ++ vps.n3 ! a) vps) ;
+
+ ReflPron = {s = \\a => reflPron a ; isPron = True} ; ---- agr ??
+ ReflPoss num cn = {
+ s = \\a => possPron a.n a.p num.n (ngen2gen cn.g) ++ num.s ! cn.g ++ cn.s ! num.n ! DDef Indef ! Nom ;
+ isPron = False
+ } ;
+ PredetRNP predet rnp = {
+ s = \\a => predet.s ! Utr ! Pl ++ predet.p ++ rnp.s ! a ; ---- agr needed here as well
+---- s = \\a => predet.s ! np.a.g ! np.a.n ++ predet.p ++ np.s ! a ;
+---- a = case pred.a of {PAg n => agrP3 np.a.g n ; _ => np.a} ;
+ isPron = False
+ } ;
+
+ ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ** {isPron = False} ;
+
+ Base_rr_RNP x y = twoTable Agr x y ;
+ Base_nr_RNP x y = twoTable Agr {s = \\a => x.s ! NPAcc} y ;
+ Base_rn_RNP x y = twoTable Agr x {s = \\a => y.s ! NPAcc} ;
+ Cons_rr_RNP x xs = consrTable Agr comma x xs ;
+ Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
+
+
+}
+