diff --git a/lib/src/abstract/Common.gf b/lib/src/abstract/Common.gf index 2aa8f0d59..773cc4a75 100644 --- a/lib/src/abstract/Common.gf +++ b/lib/src/abstract/Common.gf @@ -3,14 +3,6 @@ -- This module defines the categories that uniformly have the linearization -- ${s : Str}$ in all languages. --- Moreover, this module defines the abstract parameters of tense, polarity, and --- anteriority, which are used in [``Phrase`` Phrase.html] to generate different --- forms of sentences. Together they give 4 x 2 x 2 = 16 sentence forms. - --- These tenses are defined for all languages in the library. More tenses --- can be defined in the language extensions, e.g. the "passé simple" of --- Romance languages in [``ExtraRomance`` ../romance/ExtraRomance.gf]. - abstract Common = { cat @@ -51,14 +43,4 @@ abstract Common = { Pol ; -- polarity e.g. positive, negative Ant ; -- anteriority e.g. simultaneous, anterior - fun - TTAnt : Tense -> Ant -> Temp ; - - PPos, PNeg : Pol ; -- I sleep/don't sleep - - TPres : Tense ; - ASimul : Ant ; - TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent - AAnter : Ant ; -- I have slept --# notpresent - } diff --git a/lib/src/abstract/Grammar.gf b/lib/src/abstract/Grammar.gf index 2e1528444..d19ed6869 100644 --- a/lib/src/abstract/Grammar.gf +++ b/lib/src/abstract/Grammar.gf @@ -18,6 +18,6 @@ abstract Grammar = Phrase, Text, Structural, - Idiom ; - + Idiom, + Tense ; diff --git a/lib/src/abstract/Tense.gf b/lib/src/abstract/Tense.gf new file mode 100644 index 000000000..661284959 --- /dev/null +++ b/lib/src/abstract/Tense.gf @@ -0,0 +1,22 @@ +--1 Common: Structures with Common Implementations. + +-- This module defines the abstract parameters of tense, polarity, and +-- anteriority, which are used in [``Phrase`` Phrase.html] to generate different +-- forms of sentences. Together they give 4 x 2 x 2 = 16 sentence forms. + +-- These tenses are defined for all languages in the library. More tenses +-- can be defined in the language extensions, e.g. the "passé simple" of +-- Romance languages in [``ExtraRomance`` ../romance/ExtraRomance.gf]. + +abstract Tense = Common ** { + + fun + TTAnt : Tense -> Ant -> Temp ; + + PPos, PNeg : Pol ; -- I sleep/don't sleep + + TPres : Tense ; + ASimul : Ant ; + TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent + AAnter : Ant ; -- I have slept --# notpresent +} diff --git a/lib/src/arabic/GrammarAra.gf b/lib/src/arabic/GrammarAra.gf index f276984ad..d305f8f6e 100644 --- a/lib/src/arabic/GrammarAra.gf +++ b/lib/src/arabic/GrammarAra.gf @@ -13,7 +13,8 @@ concrete GrammarAra of Grammar = PhraseAra, TextX - [Utt], StructuralAra, - IdiomAra + IdiomAra, + TenseX - [Utt] ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/bulgarian/GrammarBul.gf b/lib/src/bulgarian/GrammarBul.gf index 21e437b74..c1cf21597 100644 --- a/lib/src/bulgarian/GrammarBul.gf +++ b/lib/src/bulgarian/GrammarBul.gf @@ -13,7 +13,8 @@ concrete GrammarBul of Grammar = PhraseBul, TextBul, StructuralBul, - IdiomBul + IdiomBul, + TenseX - [CAdv,IAdv] ** { flags coding=cp1251 ; diff --git a/lib/src/catalan/GrammarCat.gf b/lib/src/catalan/GrammarCat.gf index 097b882c4..59a817600 100644 --- a/lib/src/catalan/GrammarCat.gf +++ b/lib/src/catalan/GrammarCat.gf @@ -11,9 +11,10 @@ concrete GrammarCat of Grammar = RelativeCat, ConjunctionCat, PhraseCat, - TextX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond], + TextX - [Temp,Tense], IdiomCat, - StructuralCat + StructuralCat, + TenseCat ** { diff --git a/lib/src/catalan/TenseCat.gf b/lib/src/catalan/TenseCat.gf new file mode 100644 index 000000000..458777ac1 --- /dev/null +++ b/lib/src/catalan/TenseCat.gf @@ -0,0 +1,3 @@ +concrete TenseCat of Tense = CatCat, TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** + TenseRomance with + (ResRomance = ResCat) ; diff --git a/lib/src/common/CommonX.gf b/lib/src/common/CommonX.gf index 5dcd7ce15..3cee26a12 100644 --- a/lib/src/common/CommonX.gf +++ b/lib/src/common/CommonX.gf @@ -19,16 +19,4 @@ concrete CommonX of Common = open (R = ParamX) in { Ant = {s : Str ; a : R.Anteriority} ; Pol = {s : Str ; p : R.Polarity} ; - lin - TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a} ; - - PPos = {s = []} ** {p = R.Pos} ; - PNeg = {s = []} ** {p = R.Neg} ; - TPres = {s = []} ** {t = R.Pres} ; - TPast = {s = []} ** {t = R.Past} ; --# notpresent - TFut = {s = []} ** {t = R.Fut} ; --# notpresent - TCond = {s = []} ** {t = R.Cond} ; --# notpresent - ASimul = {s = []} ** {a = R.Simul} ; - AAnter = {s = []} ** {a = R.Anter} ; --# notpresent - } diff --git a/lib/src/common/TenseX.gf b/lib/src/common/TenseX.gf index 665bb146d..aabad746e 100644 --- a/lib/src/common/TenseX.gf +++ b/lib/src/common/TenseX.gf @@ -1,18 +1,14 @@ -concrete TenseX of Tense = open (R = ParamX) in { - - lincat - Tense = {s : Str ; t : R.Tense} ; - Ant = {s : Str ; a : R.Anteriority} ; - Pol = {s : Str ; p : R.Polarity} ; +concrete TenseX of Tense = CommonX ** open (R = ParamX) in { lin + TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a} ; + PPos = {s = []} ** {p = R.Pos} ; PNeg = {s = []} ** {p = R.Neg} ; TPres = {s = []} ** {t = R.Pres} ; - TPast = {s = []} ** {t = R.Past} ; - TFut = {s = []} ** {t = R.Fut} ; - TCond = {s = []} ** {t = R.Cond} ; + TPast = {s = []} ** {t = R.Past} ; --# notpresent + TFut = {s = []} ** {t = R.Fut} ; --# notpresent + TCond = {s = []} ** {t = R.Cond} ; --# notpresent ASimul = {s = []} ** {a = R.Simul} ; - AAnter = {s = []} ** {a = R.Anter} ; - + AAnter = {s = []} ** {a = R.Anter} ; --# notpresent } diff --git a/lib/src/danish/GrammarDan.gf b/lib/src/danish/GrammarDan.gf index 1c2424787..bdcf6473d 100644 --- a/lib/src/danish/GrammarDan.gf +++ b/lib/src/danish/GrammarDan.gf @@ -13,7 +13,8 @@ concrete GrammarDan of Grammar = PhraseDan, TextX, IdiomDan, - StructuralDan + StructuralDan, + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/dutch/GrammarDut.gf b/lib/src/dutch/GrammarDut.gf index c03598c53..14084207a 100644 --- a/lib/src/dutch/GrammarDut.gf +++ b/lib/src/dutch/GrammarDut.gf @@ -13,4 +13,5 @@ concrete GrammarDut of Grammar = PhraseDut, TextX, IdiomDut, - StructuralDut ; + StructuralDut, + TenseX ; diff --git a/lib/src/english/GrammarEng.gf b/lib/src/english/GrammarEng.gf index 932dd9821..6b7474ac6 100644 --- a/lib/src/english/GrammarEng.gf +++ b/lib/src/english/GrammarEng.gf @@ -13,7 +13,8 @@ concrete GrammarEng of Grammar = PhraseEng, TextX, StructuralEng, - IdiomEng + IdiomEng, + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/finnish/GrammarFin.gf b/lib/src/finnish/GrammarFin.gf index 6ae2ee9ea..1ea74f534 100644 --- a/lib/src/finnish/GrammarFin.gf +++ b/lib/src/finnish/GrammarFin.gf @@ -13,7 +13,8 @@ concrete GrammarFin of Grammar = PhraseFin, TextX, IdiomFin, - StructuralFin + StructuralFin, + TenseX ** { flags startcat = Phr ; unlexer = finnish ; lexer = text ; diff --git a/lib/src/french/GrammarFre.gf b/lib/src/french/GrammarFre.gf index c3726d163..a7f779448 100644 --- a/lib/src/french/GrammarFre.gf +++ b/lib/src/french/GrammarFre.gf @@ -11,9 +11,10 @@ concrete GrammarFre of Grammar = RelativeFre, ConjunctionFre, PhraseFre, - TextX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond], + TextX - [Temp,Tense], IdiomFre, - StructuralFre + StructuralFre, + TenseFre ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/french/TenseFre.gf b/lib/src/french/TenseFre.gf new file mode 100644 index 000000000..5953d11fe --- /dev/null +++ b/lib/src/french/TenseFre.gf @@ -0,0 +1,3 @@ +concrete TenseFre of Tense = CatFre, TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** + TenseRomance with + (ResRomance = ResFre) ; diff --git a/lib/src/german/CatGer.gf b/lib/src/german/CatGer.gf index e1dae718b..1971358b0 100644 --- a/lib/src/german/CatGer.gf +++ b/lib/src/german/CatGer.gf @@ -1,5 +1,5 @@ concrete CatGer of Cat = - CommonX - [Tense,TPres,TPast,TFut,TCond,TTAnt,Temp] ** + CommonX - [Tense,Temp] ** open ResGer, Prelude in { flags optimize=all_subs ; @@ -93,11 +93,4 @@ concrete CatGer of Cat = Temp = {s : Str ; t : ResGer.Tense ; a : Anteriority ; m : Mood} ; Tense = {s : Str ; t : ResGer.Tense ; m : Mood} ; - lin - TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a ; m = t.m} ; - - TPres = {s = [] ; t = Pres ; m = MIndic} ; - TPast = {s = [] ; t = Past ; m = MIndic} ; --# notpresent - TFut = {s = [] ; t = Fut ; m = MIndic} ; --# notpresent - TCond = {s = [] ; t = Cond ; m = MIndic} ; --# notpresent } diff --git a/lib/src/german/GrammarGer.gf b/lib/src/german/GrammarGer.gf index 2df4bf203..ea79032a7 100644 --- a/lib/src/german/GrammarGer.gf +++ b/lib/src/german/GrammarGer.gf @@ -11,9 +11,10 @@ concrete GrammarGer of Grammar = RelativeGer, ConjunctionGer, PhraseGer, - TextX - [Tense,TPres,TPast,TFut,TCond,TTAnt,Temp], + TextX - [Tense,Temp], IdiomGer, - StructuralGer + StructuralGer, + TenseGer ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/german/ResGer.gf b/lib/src/german/ResGer.gf index 9cd581499..ea87cabbd 100644 --- a/lib/src/german/ResGer.gf +++ b/lib/src/german/ResGer.gf @@ -152,7 +152,7 @@ resource ResGer = ParamX ** open Prelude in { } ; conjAgr : Agr -> Agr -> Agr = \a,b -> { - g = Utr ; ---- + g = Neutr ; ---- n = conjNumber a.n b.n ; p = conjPerson a.p b.p } ; diff --git a/lib/src/german/TenseGer.gf b/lib/src/german/TenseGer.gf new file mode 100644 index 000000000..a48228859 --- /dev/null +++ b/lib/src/german/TenseGer.gf @@ -0,0 +1,12 @@ +concrete TenseGer of Tense = + CatGer [Tense,Temp], TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** open ResGer in { + + lin + TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a ; m = t.m} ; + + TPres = {s = [] ; t = Pres ; m = MIndic} ; + TPast = {s = [] ; t = Past ; m = MIndic} ; --# notpresent + TFut = {s = [] ; t = Fut ; m = MIndic} ; --# notpresent + TCond = {s = [] ; t = Cond ; m = MIndic} ; --# notpresent + +} diff --git a/lib/src/hindi/GrammarHin.gf b/lib/src/hindi/GrammarHin.gf index 21367747b..484f367b0 100644 --- a/lib/src/hindi/GrammarHin.gf +++ b/lib/src/hindi/GrammarHin.gf @@ -13,7 +13,8 @@ concrete GrammarHin of Grammar = PhraseHin, TextX, StructuralHin, - IdiomHin + IdiomHin, + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/italian/GrammarIta.gf b/lib/src/italian/GrammarIta.gf index 905fe522b..bf6ed9e87 100644 --- a/lib/src/italian/GrammarIta.gf +++ b/lib/src/italian/GrammarIta.gf @@ -11,9 +11,10 @@ concrete GrammarIta of Grammar = RelativeIta, ConjunctionIta, PhraseIta, - TextX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond], + TextX - [Temp,Tense], IdiomIta, - StructuralIta + StructuralIta, + TenseIta ** { diff --git a/lib/src/italian/TenseIta.gf b/lib/src/italian/TenseIta.gf new file mode 100644 index 000000000..1710c9a7a --- /dev/null +++ b/lib/src/italian/TenseIta.gf @@ -0,0 +1,3 @@ +concrete TenseIta of Tense = CatIta, TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** + TenseRomance with + (ResRomance = ResIta) ; diff --git a/lib/src/latin/GrammarLat.gf b/lib/src/latin/GrammarLat.gf index 1efddceb4..efa7f6927 100644 --- a/lib/src/latin/GrammarLat.gf +++ b/lib/src/latin/GrammarLat.gf @@ -12,7 +12,8 @@ concrete GrammarLat of Grammar = -- ConjunctionLat, -- PhraseLat, TextX, - StructuralLat + StructuralLat, -- IdiomLat + TenseX ** { } ; diff --git a/lib/src/norwegian/GrammarNor.gf b/lib/src/norwegian/GrammarNor.gf index ed36ad496..caaf9803d 100644 --- a/lib/src/norwegian/GrammarNor.gf +++ b/lib/src/norwegian/GrammarNor.gf @@ -13,7 +13,8 @@ concrete GrammarNor of Grammar = PhraseNor, TextX, IdiomNor, - StructuralNor + StructuralNor, + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/polish/GrammarPol.gf b/lib/src/polish/GrammarPol.gf index ab922857d..543bb0946 100644 --- a/lib/src/polish/GrammarPol.gf +++ b/lib/src/polish/GrammarPol.gf @@ -15,5 +15,6 @@ concrete GrammarPol of Grammar = PhrasePol, TextX - [CAdv], StructuralPol, - IdiomPol + IdiomPol, + TenseX - [CAdv] ** { flags startcat = Phr ; unlexer = text ; lexer = text ;} ; diff --git a/lib/src/romance/CatRomance.gf b/lib/src/romance/CatRomance.gf index 188f535f5..6923d26f0 100644 --- a/lib/src/romance/CatRomance.gf +++ b/lib/src/romance/CatRomance.gf @@ -1,5 +1,4 @@ -incomplete concrete CatRomance of Cat = - CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] +incomplete concrete CatRomance of Cat = CommonX ** open Prelude, CommonRomance, ResRomance, (R = ParamX) in { flags optimize=all_subs ; @@ -102,14 +101,8 @@ incomplete concrete CatRomance of Cat = PN = {s : Str ; g : Gender} ; -- tense augmented with passé simple - + lincat Temp = {s : Str ; t : RTense ; a : Anteriority} ; Tense = {s : Str ; t : RTense} ; - lin - TTAnt t a = {s = a.s ++ t.s ; a = a.a ; t = t.t} ; - TPres = {s = []} ** {t = RPres} ; - TPast = {s = []} ** {t = RPast} ; --# notpresent - TFut = {s = []} ** {t = RFut} ; --# notpresent - TCond = {s = []} ** {t = RCond} ; --# notpresent } diff --git a/lib/src/romance/TenseRomance.gf b/lib/src/romance/TenseRomance.gf new file mode 100644 index 000000000..fae0b4b00 --- /dev/null +++ b/lib/src/romance/TenseRomance.gf @@ -0,0 +1,12 @@ +incomplete concrete TenseRomance of Tense = + CatRomance [Tense,Temp], TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** + open ResRomance, CommonRomance in { + + lin + TTAnt t a = {s = a.s ++ t.s ; a = a.a ; t = t.t} ; + TPres = {s = []} ** {t = RPres} ; + TPast = {s = []} ** {t = RPast} ; --# notpresent + TFut = {s = []} ** {t = RFut} ; --# notpresent + TCond = {s = []} ** {t = RCond} ; --# notpresent + +} diff --git a/lib/src/romanian/CatRon.gf b/lib/src/romanian/CatRon.gf index 47d1cd62b..c500867fd 100644 --- a/lib/src/romanian/CatRon.gf +++ b/lib/src/romanian/CatRon.gf @@ -1,7 +1,7 @@ --# -path=.:../Romance:../common:../abstract:../common:prelude concrete CatRon of Cat = - CommonX - [CAdv,Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] + CommonX - [CAdv,Temp,Tense] ** open Prelude, ResRon, MorphoRon,(R = ParamX) in { flags optimize=all_subs ; @@ -136,15 +136,6 @@ concrete CatRon of Cat = Tense = {s : Str ; t : RTense} ; - lin - TTAnt t a = {s = a.s ++ t.s ; a = a.a ; t = t.t} ; - TPres = {s = []} ** {t = RPres} ; - TPast = {s = []} ** {t = RPast} ; --# notpresent - TFut = {s = []} ** {t = RFut} ; --# notpresent - TCond = {s = []} ** {t = RCond} ; --# notpresent - - - oper aagr : Gender -> Number -> AAgr = \g,n -> diff --git a/lib/src/romanian/GrammarRon.gf b/lib/src/romanian/GrammarRon.gf index ae055e7ff..ee77db396 100644 --- a/lib/src/romanian/GrammarRon.gf +++ b/lib/src/romanian/GrammarRon.gf @@ -12,9 +12,10 @@ concrete GrammarRon of Grammar = RelativeRon, ConjunctionRon, PhraseRon, - TextX - [CAdv,Temp,TTAnt,Tense,TPres,TPast,TFut,TCond], + TextX - [CAdv,Temp,Tense], Prelude, MorphoRon, Coordination, - StructuralRon + StructuralRon, + TenseRon ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/romanian/TenseRon.gf b/lib/src/romanian/TenseRon.gf new file mode 100644 index 000000000..6f2a8d915 --- /dev/null +++ b/lib/src/romanian/TenseRon.gf @@ -0,0 +1,11 @@ +concrete TenseRon of Tense = + CatRon [Tense,Temp], TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** open ResRon in { + + lin + TTAnt t a = {s = a.s ++ t.s ; a = a.a ; t = t.t} ; + TPres = {s = []} ** {t = RPres} ; + TPast = {s = []} ** {t = RPast} ; --# notpresent + TFut = {s = []} ** {t = RFut} ; --# notpresent + TCond = {s = []} ** {t = RCond} ; --# notpresent + +} diff --git a/lib/src/russian/GrammarRus.gf b/lib/src/russian/GrammarRus.gf index 052d5204c..3bb28f99f 100644 --- a/lib/src/russian/GrammarRus.gf +++ b/lib/src/russian/GrammarRus.gf @@ -13,5 +13,6 @@ concrete GrammarRus of Grammar = PhraseRus, TextX, StructuralRus, - IdiomRus + IdiomRus, + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ; coding=utf8 ;} ; diff --git a/lib/src/spanish/GrammarSpa.gf b/lib/src/spanish/GrammarSpa.gf index e9ca3d7d4..1c5465dc4 100644 --- a/lib/src/spanish/GrammarSpa.gf +++ b/lib/src/spanish/GrammarSpa.gf @@ -11,9 +11,10 @@ concrete GrammarSpa of Grammar = RelativeSpa, ConjunctionSpa, PhraseSpa, - TextSpa - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond], -- special punctuation + TextSpa - [Temp,Tense], -- special punctuation IdiomSpa, - StructuralSpa + StructuralSpa, + TenseSpa ** { diff --git a/lib/src/spanish/TenseSpa.gf b/lib/src/spanish/TenseSpa.gf new file mode 100644 index 000000000..6578de100 --- /dev/null +++ b/lib/src/spanish/TenseSpa.gf @@ -0,0 +1,3 @@ +concrete TenseSpa of Tense = CatSpa, TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** + TenseRomance with + (ResRomance = ResSpa) ; diff --git a/lib/src/swedish/GrammarSwe.gf b/lib/src/swedish/GrammarSwe.gf index 109669dfb..49cf78275 100644 --- a/lib/src/swedish/GrammarSwe.gf +++ b/lib/src/swedish/GrammarSwe.gf @@ -13,7 +13,8 @@ concrete GrammarSwe of Grammar = PhraseSwe, TextX, IdiomSwe, - StructuralSwe + StructuralSwe, + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/thai/GrammarTha.gf b/lib/src/thai/GrammarTha.gf index 28105857a..9445ef6f8 100644 --- a/lib/src/thai/GrammarTha.gf +++ b/lib/src/thai/GrammarTha.gf @@ -12,8 +12,9 @@ concrete GrammarTha of Grammar = -- ConjunctionTha, PhraseTha, -- TextX, - StructuralTha + StructuralTha, -- IdiomTha + TenseX ** { flags startcat = Phr ; unlexer = text ; lexer = text ;