diff --git a/src/api/ConstructorsLat.gf b/src/api/ConstructorsLat.gf index 7103ccb8..436adba2 100644 --- a/src/api/ConstructorsLat.gf +++ b/src/api/ConstructorsLat.gf @@ -1,4 +1,4 @@ --# -path=.:alltenses:prelude:../latin resource ConstructorsLat = Constructors with (Grammar = GrammarLat) ** - open MissingLat in {} + open MissingLat in {} ; diff --git a/src/api/SymbolicLat.gf b/src/api/SymbolicLat.gf index 99836499..22d21886 100644 --- a/src/api/SymbolicLat.gf +++ b/src/api/SymbolicLat.gf @@ -1,5 +1,5 @@ ---# -path=.:../icelandic:../common:../abstract:../prelude +--# -path=.:../latin:../common:../abstract:../prelude resource SymbolicLat = Symbolic with (Symbol = SymbolLat), - (Grammar = GrammarLat) ; + (Grammar = GrammarLat) ** open MissingLat in {} ; diff --git a/src/latin/CatLat.gf b/src/latin/CatLat.gf index 7f95ff77..273a0d60 100644 --- a/src/latin/CatLat.gf +++ b/src/latin/CatLat.gf @@ -20,7 +20,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in { ---- Question -- -- TO FIX - QCl = Clause ; -- {s : ResLat.Tense => Anteriority => Polarity => QForm => Str } ; + QCl = Clause ** { q : Str } ; IP = {s : Case => Str ; n : Number} ; IComp = {s : Str} ; IDet = Determiner ; --{s : Str ; n : Number} ; @@ -60,7 +60,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in { -- ---- Numeral -- - Numeral = ResLat.Numeral ; + Numeral = ResLat.TNumeral ; Digits = {s : Str ; unit : Unit} ; -- ---- Structural @@ -90,7 +90,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in { NP = \np -> np.preap.s ! Ag np.g np.n Nom ++ np.s ! Nom ++ np.postap.s ! Ag np.g np.n Nom ; VP = \vp -> vp.adv ++ vp.inf ! VInfActPres ++ vp.obj ++ vp.compl ! Ag Masc Sg Nom ; S = \s -> combineSentence s ! SPreO ! PreO ! CPreV ! SOV ; - V, VS, VQ, VA = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ; + V, VS, VQ, VA, VV = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ; V2, V2A, V2Q, V2S = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ; Pron = \p -> p.pers.s ! PronNonDrop ! PronNonRefl ! Nom ; Conj = \c -> c.s1 ++ c.s2 ++ c.s3 ; diff --git a/src/latin/ExtendLat.gf b/src/latin/ExtendLat.gf index cf9be270..3fd492de 100644 --- a/src/latin/ExtendLat.gf +++ b/src/latin/ExtendLat.gf @@ -1 +1,9 @@ -concrete ExtendLat of Extend = ExtendFunctor with (Grammar=GrammarLat); \ No newline at end of file +concrete ExtendLat of Extend = CatLat ** ExtendFunctor-[VPS,ComplDirectVQ,ComplDirectVS,CompIQuant,EmptyRelSlash,ExistsNP,ExistCN,ExistMassCN,ExistPluralCN,GenModNP,PredAPVP,PredIAdvVP,SlashBareV2S,StrandQuestSlash,StrandRelSlash] with (Grammar=GrammarLat) ** open MissingLat in { + lincat + VPS = Comp ; + lin + -- ComplDirectVS : VS -> Utt -> VP ; -- say: "today" + ComplDirectVS vs utt = AdvVP (UseV ) (lin Adv {s = \\_ => ":" ++ quoted utt.s}) ; -- DEFAULT complement added as Adv in quotes + -- ComplDirectVQ : VQ -> Utt -> VP ; -- ask: "when" + ComplDirectVQ vq utt = AdvVP (UseV ) (lin Adv {s = \\_ => ":" ++ quoted utt.s}) ; -- DEFAULT complement added as Adv in quotes +} ; \ No newline at end of file diff --git a/src/latin/MissingLat.gf b/src/latin/MissingLat.gf index 904e40cd..59312c8e 100644 --- a/src/latin/MissingLat.gf +++ b/src/latin/MissingLat.gf @@ -4,17 +4,18 @@ oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ; oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ; +oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ; oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ; -oper BaseS : S -> S -> ListS = notYet "BaseS" ; oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ; oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; oper CompIP : IP -> IComp = notYet "CompIP" ; oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ; oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ; +oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ; +oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ; oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ; -oper ConjS : Conj -> ListS -> S = notYet "ConjS" ; +oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ; oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ; -oper ConsS : S -> ListS -> ListS = notYet "ConsS" ; oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ; oper EmbedQS : QS -> SC = notYet "EmbedQS" ; oper EmbedS : S -> SC = notYet "EmbedS" ; @@ -31,18 +32,11 @@ oper ImpersCl : VP -> Cl = notYet "ImpersCl" ; oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ; oper ImpVP : VP -> Imp = notYet "ImpVP" ; oper NumDigits : Digits -> Card = notYet "NumDigits" ; +oper NumNumeral : Numeral -> Card = notYet "NumNumeral" ; oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ; +oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ; oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ; oper PossPron : Pron -> Quant = notYet "PossPron" ; -oper pot1 : Digit -> Sub100 = notYet "pot1" ; -oper pot110 : Sub100 = notYet "pot110" ; -oper pot111 : Sub100 = notYet "pot111" ; -oper pot1plus : Digit -> Sub10 -> Sub100 = notYet "pot1plus" ; -oper pot1to19 : Digit -> Sub100 = notYet "pot1to19" ; -oper pot2 : Sub10 -> Sub1000 = notYet "pot2" ; -oper pot2plus : Sub10 -> Sub100 -> Sub1000 = notYet "pot2plus" ; -oper pot3 : Sub1000 -> Sub1000000 = notYet "pot3" ; -oper pot3plus : Sub1000 -> Sub1000 -> Sub1000000 = notYet "pot3plus" ; oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ; oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ; oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ; @@ -76,27 +70,28 @@ oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ; oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ; oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ; +oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ; oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ; oper BaseDAP : DAP -> DAP -> ListDAP = notYet "BaseDAP" ; oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ; oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ; -oper BaseS : S -> S -> ListS = notYet "BaseS" ; oper CompIP : IP -> IComp = notYet "CompIP" ; oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ; oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ; oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ; +oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ; oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ; +oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ; oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ; oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ; oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ; oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ; -oper ConjS : Conj -> ListS -> S = notYet "ConjS" ; oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ; +oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ; oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ; oper ConsDAP : DAP -> ListDAP -> ListDAP = notYet "ConsDAP" ; oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ; oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ; -oper ConsS : S -> ListS -> ListS = notYet "ConsS" ; oper CountNP : Det -> NP -> NP = notYet "CountNP" ; oper DetDAP : Det -> DAP = notYet "DetDAP" ; oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ; @@ -110,21 +105,14 @@ oper IdetIP : IDet -> IP = notYet "IdetIP" ; oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ; oper ImpVP : VP -> Imp = notYet "ImpVP" ; oper NumDigits : Digits -> Card = notYet "NumDigits" ; +oper NumNumeral : Numeral -> Card = notYet "NumNumeral" ; oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ; +oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ; oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ; oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ; oper PartNP : CN -> NP -> CN = notYet "PartNP" ; oper PossNP : CN -> NP -> CN = notYet "PossNP" ; oper PossPron : Pron -> Quant = notYet "PossPron" ; -oper pot1 : Digit -> Sub100 = notYet "pot1" ; -oper pot110 : Sub100 = notYet "pot110" ; -oper pot111 : Sub100 = notYet "pot111" ; -oper pot1plus : Digit -> Sub10 -> Sub100 = notYet "pot1plus" ; -oper pot1to19 : Digit -> Sub100 = notYet "pot1to19" ; -oper pot2 : Sub10 -> Sub1000 = notYet "pot2" ; -oper pot2plus : Sub10 -> Sub100 -> Sub1000 = notYet "pot2plus" ; -oper pot3 : Sub1000 -> Sub1000000 = notYet "pot3" ; -oper pot3plus : Sub1000 -> Sub1000 -> Sub1000000 = notYet "pot3plus" ; oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ; oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ; oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ; diff --git a/src/latin/NumeralLat.gf b/src/latin/NumeralLat.gf index 4e51cfe1..075915b6 100644 --- a/src/latin/NumeralLat.gf +++ b/src/latin/NumeralLat.gf @@ -1,77 +1,151 @@ -concrete NumeralLat of Numeral = CatLat ** open ResLat,ParadigmsLat,Prelude in { +concrete NumeralLat of Numeral = CatLat, ParamX[Number] ** open ParadigmsLat, Prelude, ResLat, Predef in { lincat Digit = TDigit ; - Sub10 = Numeral ; - Sub100 = Numeral ; - Sub1000 = Numeral ; - Sub1000000 = Numeral ; + Sub10 = TNumeral ; + Sub100 = TNumeral ; + Sub1000 = TNumeral ; + Sub1000000 = TNumeral ; lin num x = x ; - n2 = lin Digit ( mkDigit "duo" "viginti" "ducenti" "secundus" ) ; - n3 = lin Digit ( mkDigit "tres" "triginta" "trecenti" "tertius" ) ; - n4 = lin Digit ( mkDigit "quattuor" "quadraginta" "quadringenti" "quartus" ) ; - n5 = lin Digit ( mkDigit "quinque" "quinquaginta" "quingenti" "quintus" ) ; - n6 = lin Digit ( mkDigit "sex" "sexaginta" "sescenti" "sextus" ) ; - n7 = lin Digit ( mkDigit "septem" "septuaginta" "septingenti" "septimus" ) ; - n8 = lin Digit ( mkDigit "octo" "octoginta" "octingenti" "ocatvus" ) ; - n9 = lin Digit ( mkDigit "novem" "nonaginta" "nongenti" "nonus") ; + n2 = lin Digit ( mkDigit "duo" "duodecim" "viginti" "ducenti" "secundus" "triginta" Yes ) ; + n3 = lin Digit ( mkDigit "tres" "tredecim" "triginta" "trecenti" "tertius" "quadraginta" Yes ) ; + n4 = lin Digit ( mkDigit "quattuor" "quattuordecim" "quadraginta" "quadringenti" "quartus" "quinquaginta" Yes ) ; + n5 = lin Digit ( mkDigit "quinque" "quindecim" "quinquaginta" "quingenti" "quintus" "sexaginta" Yes ) ; + n6 = lin Digit ( mkDigit "sex" "sedecim" "sexaginta" "sescenti" "sextus" "septuaginta" Yes ) ; + n7 = lin Digit ( mkDigit "septem" "septendecim" "septuaginta" "septingenti" "septimus" "octoginta" Yes ) ; + n8 = lin Digit ( mkDigit "octo" "duodeviginti" "octoginta" "octingenti" "ocatvus" "nonaginta" No8 ) ; + n9 = lin Digit ( mkDigit "novem" "undeviginti" "nonaginta" "nongenti" "nonus" "centum" No9 ) ; -- 1 - pot01 = { s = n1.s ! one ; n = Sg } ; + pot01 = { s = n1.s ! one ; d = n1.s ; n = singular ; below8 = n1.below8 } ; -- d * 1 - pot0 d = { s = d.s ! one ; n = Pl } ; + pot0 d = { + s = d.s ! one ; + d = table { + thousand => \\g,c => d.s ! one ! g ! c ++ d.s ! thousand ! g ! c ; + u => \\g,c => d.s ! u ! g ! c + } ; + n = plural ; + below8 = d.below8 + } ; -- 10 - pot110 = { s = n1.s ! ten ; n = Sg } ; + pot110 = { + s = n1.s ! ten ; + d = table { + thousand => \\g,c => n1.s ! ten ! g ! c ++ n1.s ! thousand ! g ! c ; + u => \\g,c => n1.s ! u ! g ! c + } ; + n = singular ; + below8 = Yes + } ; -- 11 --- pot111 = pot1to19 pot01 ; --- -- 10 + d --- -- pot1to19 d = mkNum "" "" "" "" ; -- {s = d.s ! teen} ** {n = Pl} ; + pot111 = pot1to19 n1 ; + -- 10 + d + pot1to19 d = { + s = d.s ! eleven ; + d = table { + thousand => \\g,c => d.s ! eleven ! g ! c ++ n1.s ! thousand ! g ! c ; + u => \\g,c => d.s ! u ! g ! c + } ; + n = plural ; + below8 = Ign + } ; -- coercion of 1..9 pot0as1 n = n ; -- d * 10 - pot1 d = {s = d.s ! ten ; n = Pl} ; + pot1 d = { + s = d.s ! ten ; + d = table { + thousand => \\g,c => d.s ! ten ! g ! c ++ n1.s ! thousand ! g ! c ; + u => \\g,c => d.s ! u ! g ! c + } ; + n = plural ; + below8 = Yes + } ; -- d * 10 + n - -- pot1plus d e = { - -- s = \\c => d.s ! ten ++ "-" ++ e.s ! one ! c ; - -- n = Pl} ; + pot1plus d n = + let + newS : Gender => Case => Str = \\g,c => case n.below8 of { + No8 => "duo" ++ Prelude.BIND ++ "-" ++ Prelude.BIND ++ "de" ++ Prelude.BIND ++ "-" ++ Prelude.BIND ++ d.tenNext ; + No9 => "un" ++ Prelude.BIND ++ "-" ++ Prelude.BIND ++ "de" ++ Prelude.BIND ++ "-" ++ Prelude.BIND ++ d.tenNext ; + _ => d.s ! ten ! g ! c ++ n.s ! g ! c + } in + { + s = newS ; + d = table { + thousand => \\g,c => newS ! g ! c ++ n1.s ! thousand ! g ! c ; + u => \\g,c => n.d ! u ! g ! c + } ; + below8 = Ign ; + n = plural + } ; -- coercion of 1..99 pot1as2 n = n ; -- m * 100 --- pot2 d = {s = d.s ! hundred ; n = Pl} ; --- -- m * 100 + n --- --lin pot2plus d e = { --- -- s = \\c => d.s ! unit ! NCard ++ "hundred" ++ "and" ++ e.s ! c ; n = Pl} ; + pot2 n = { + s = n.d ! hundred ; + d = table { + thousand => \\g,c => n.d ! hundred ! g ! c ++ n1.s ! thousand ! g ! c ; + u => \\g,c => n.d ! u ! g ! c + } ; + n = plural ; + below8 = Yes} ; + -- d * 100 + n + pot2plus d n = + let + newS : Gender => Case => Str = \\g,c => d.d ! hundred ! g ! c ++ "et" ++ n.s ! g ! c + in + { + s = newS ; + d = table { + thousand => \\g,c => newS ! g ! c ++ n1.s ! thousand ! g ! c ; + u => \\g,c => n.d ! u ! g ! c + } ; + below8 = Ign ; + n = plural + } ; -- coercion of 1..999 pot2as3 n = n ; --- -- m * 1000 --- --lin pot3 n = { --- -- s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ; --- -- m * 1000 + n --- --lin pot3plus n m = { --- -- s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ; + -- m * 1000 + pot3 n = { + s = \\g,c => n.s ! g ! c ++ n.d ! thousand ! g ! c ; + d = table { thousand => \\g,c => n.s ! g ! c ++ n.d ! thousand ! g ! c ; + u => \\g,c => n.d ! u ! g ! c + } ; + below8 = Ign ; + n = plural + } ; + + -- d * 1000 + n + pot3plus d n = { + s = \\g,c => d.d ! thousand ! g ! c ++ "et" ++ n.s ! g ! c ; + d = n.d ; + below8 = Ign ; + n = plural + } ; oper - n1 : Digit = lin Digit ( fullDigit "unus" "decem" "primus" "decimus" "centesimus" "millesimus" ) ; - - mkDigit : (ones, tens, hundreds, ord : Str) -> TDigit = - \ones, tens, hundreds, ord -> + mkDigit : (ones, eleven, tens, hundreds, ord : Str) -> Str -> Below8 -> TDigit = + \ones, eleven, tens, hundreds, ord -> case of { - <"decem",_> => fullDigit ones tens hundreds ord "decimus" "centesimus" ; - <"viginti",_> => fullDigit ones tens hundreds ord "vicesimus" "ducentesimus" ; - <"triginta",_> => fullDigit ones tens hundreds ord "tricesimus" "trecentesimus" ; - => fullDigit ones tens hundreds ord (quadra + "gesimus") (quadringent + "esimus") ; + <"decem",_> => fullDigit ones eleven tens hundreds ord "decimus" "centesimus" ; + <"viginti",_> => fullDigit ones eleven tens hundreds ord "vicesimus" "ducentesimus" ; + <"triginta",_> => fullDigit ones eleven tens hundreds ord "tricesimus" "trecentesimus" ; + => fullDigit ones eleven tens hundreds ord (quadra + "gesimus") (quadringent + "esimus") ; _ => Predef.error "Invalid number" } ; - fullDigit : (ones, tens, hundreds, ord1,ord10,ord100 : Str) -> TDigit = - \ones, tens, hundreds, ord1,ord10,ord100 -> + fullDigit : (ones, eleven, tens, hundreds, ord1,ord10,ord100, tenNext : Str) -> Below8 -> TDigit = + \ones, eleven, tens, hundreds, ord1,ord10,ord100,tenNext,b8 -> { s = table { one => cardFlex ones ; + eleven => cardFlex eleven ; ten => cardFlex tens ; hundred => cardFlex hundreds ; - thousand => \\_,_ => nonExist ; + thousand => cardFlex "milia" ; ten_thousand => \\_,_ => nonExist ; - hundred_thousand => \\_,_ => nonExist } --- n = case ones of { "unus" => Sg ; _ => Pl } ; + hundred_thousand => \\_,_ => nonExist + } ; +-- n = case ones of { "unus" => singular ; _ => plural } ; -- ord = -- \\_,_ => [] ; -- -- table { one => (mkA ord1).s ! Posit; @@ -80,7 +154,11 @@ concrete NumeralLat of Numeral = CatLat ** open ResLat,ParadigmsLat,Prelude in { -- -- thousand => \\_,_ => nonExist ; -- -- ten_thousand => \\_ => nonExist ; -- -- hundred_thousand => \\_ => nonExist } ; - } ; + tenNext = tenNext ; + below8 = b8 + } ; + n1 : Digit = lin Digit ( fullDigit "unus" "decem" "undecim" "primus" "decimus" "centesimus" "millesimus" "viginti" Yes ) ; + -- numerals as sequences of digits lincat @@ -94,30 +172,31 @@ concrete NumeralLat of Numeral = CatLat ** open ResLat,ParadigmsLat,Prelude in { unit = inc i.unit } ; - D_0 = mkDig "" "" "" "" "" "" ; - D_1 = mkDig "I" "X" "C" "M" "(X)" "(C)" ; - D_2 = mkDig "II" "XX" "CC" "MM" "(XX)" "(CC)" ; - D_3 = mkDig "III" "XXX" "CCC" "MMM" "(XXX)" "(CCC)" ; - D_4 = mkDig "IV" "XL" "CD" "(IV)" "(XL)" "(CD)" ; - D_5 = mkDig "V" "L" "D" "(V)" "(L)" "(D)" ; - D_6 = mkDig "VI" "LX" "DC" "(VI)" "(LX)" "(DC)" ; - D_7 = mkDig "VII" "LXX" "DCC" "(VII)" "(LXX)" "(DCC)" ; - D_8 = mkDig "VIII" "LXXX" "DCCC" "(VIII)" "(LXXX)" "(DCCC)" ; - D_9 = mkDig "IX" "XC" "CM" "(IX)" "(XC)" "(CM)" ; + D_0 = mkDig "" "" "" "" "" "" "" ; + D_1 = mkDig "I" "XI" "X" "C" "M" "(X)" "(C)" ; + D_2 = mkDig "II" "XII" "XX" "CC" "MM" "(XX)" "(CC)" ; + D_3 = mkDig "III" "XIII" "XXX" "CCC" "MMM" "(XXX)" "(CCC)" ; + D_4 = mkDig "IV" "XIV" "XL" "CD" "(IV)" "(XL)" "(CD)" ; + D_5 = mkDig "V" "XV" "L" "D" "(V)" "(L)" "(D)" ; + D_6 = mkDig "VI" "XVI" "LX" "DC" "(VI)" "(LX)" "(DC)" ; + D_7 = mkDig "VII" "XVII" "LXX" "DCC" "(VII)" "(LXX)" "(DCC)" ; + D_8 = mkDig "VIII" "XVIII" "LXXX" "DCCC" "(VIII)" "(LXXX)" "(DCCC)" ; + D_9 = mkDig "IX" "XIX" "XC" "CM" "(IX)" "(XC)" "(CM)" ; oper TDig = { s : Unit => Str } ; - mkDig : Str -> Str -> Str -> Str -> Str -> Str -> TDig = - \one,ten,hundred,thousand,ten_thousand,hundred_thousand -> { - s = table Unit [one;ten;hundred;thousand;ten_thousand;hundred_thousand] + mkDig : Str -> Str -> Str -> Str -> Str -> Str -> Str -> TDig = + \one,eleven,ten,hundred,thousand,ten_thousand,hundred_thousand -> { + s = table Unit [one;eleven;ten;hundred;thousand;ten_thousand;hundred_thousand] } ; inc : Unit -> Unit = \u -> case u of { one => ten ; + eleven => hundred ; ten => hundred ; hundred => thousand ; thousand => ten_thousand ; diff --git a/src/latin/QuestionLat.gf b/src/latin/QuestionLat.gf index 6a039d24..f511d9e9 100644 --- a/src/latin/QuestionLat.gf +++ b/src/latin/QuestionLat.gf @@ -4,19 +4,21 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in { --` lin -- QuestCl : Cl -> QCl ; -- does John walk - -- TO FIX - -- QuestCl cl = { - -- s = \\t,a,p => - -- let cls = (combineClause cl PreS).s ! t ! a ! p - -- in table { - -- QDir => cls ! VQTrue ! VSO ! PreV ; -- cls ! OQuest ; - -- QIndir => "" -- "if" ++ cls ! ODir -- TODO - -- } - -- } ; + QuestCl cl = cl ** { + v = \\t,a,_,ap,cp => cl.v ! t ! a ! VQTrue ! ap ! cp ; + q = "" + } ; -- QuestVP : IP -> VP -> QCl ; -- who walks - -- TO FIX - -- QuestVP ip vp = + QuestVP ip vp = + { + s = \\_ => "" ; + adv = "" ; + neg = \\_,_ => "" ; + o = \\_ => vp.obj ; + q = ip.s ! Nom ; + v = \\t,a,_,ap,cp => vp.s ! VAct (anteriorityToVAnter a) (tenseToVTense t) ip.n P3 ! VQFalse + } ; -- let qcl = mkQuestion { s = ip.s ! Nom } ( mkClause emptyNP vp ) -- in {s = \\t,a,b,qd => qcl.s ! t ! a ! b ! qd} ; @@ -26,12 +28,19 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in { -- QuestSlash ip slash = -- mkQuestion (ss ( ip.s ! Acc) ) slash ; - -- TO FIX - -- QuestIAdv iadv cl = mkQuestion iadv cl ; --- - -- TO FIX - -- QuestIComp icomp np = - -- mkQuestion icomp (mkClause np (predV be_V) ) ; + -- QuestIAdv : IAdv -> Cl -> QCl + QuestIAdv iadv cl = cl ** { q = iadv.s } ; + + -- QuestIComp : IComp -> NP -> QCl ; + QuestIComp icomp np = + { + s = \\_ => "" ; + adv = "" ; + neg = \\_,_ => "" ; + o = \\_ => np.s ! Nom ; + q = icomp.s ; + v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ; + } ; -- -- -- PrepIP p ip = {s = p.s ++ ip.s ! Acc} ; diff --git a/src/latin/ResLat.gf b/src/latin/ResLat.gf index cd2a2f1f..0235bddd 100644 --- a/src/latin/ResLat.gf +++ b/src/latin/ResLat.gf @@ -190,7 +190,51 @@ param audaces audaces (audac + "ium") (audac + "ibus") g ; - + regAdj : Str -> Gender => Number => Case => Str = \s -> + case s of { + un + "us" => \\g,n,c => un + (regAdjSuffixes s g n c) + } ; + + regAdjSuffixes : Str -> Gender -> Number -> Case -> Str = \str,g,n,c -> + case of { + => "us" ; + => "i" ; + => "o" ; + => "um" ; + => "o" ; + => case str of { _ + "ius" => "i" ; _ => "e" } ; + => "i" ; + => "orum" ; + => "is" ; + => "os" ; + => "is" ; + => "i" ; + => "um" ; + => "i" ; + => "o" ; + => "um" ; + => "o" ; + => "um"; + => "a" ; + => "orum" ; + => "is" ; + => "os" ; + => "is" ; + => "a" ; + => "a" ; + => "ae" ; + => "ae" ; + => "am" ; + => "a" ; + => "a"; + => "ae" ; + => "arum" ; + => "is" ; + => "as" ; + => "is" ; + => "ae" + } ; + emptyAdj : Adjective = { s = \\_,_ => "" ; comp_adv = "" ; super_adv = "" ; adv = { s = \\_ => "" } } ; @@ -1421,11 +1465,12 @@ oper -- numerals param -- CardOrd = NCard | NOrd ; - Unit = one | ten | hundred | thousand | ten_thousand | hundred_thousand ; + Unit = one | eleven | ten | hundred | thousand | ten_thousand | hundred_thousand ; + Below8 = Yes | No8 | No9 | Ign ; oper -- Numerals are by default cardinal numbers but have a field for ordinal numbers - TDigit : Type = { s : Unit => Gender => Case => Str } ; -- ord : Unit => Agr => Str } ; - Numeral : Type = { s : Gender => Case => Str ; n : Number } ; -- ord : Unit => Agr => Str } ; + TDigit : Type = { s : Unit => Gender => Case => Str ; tenNext : Str ; below8 : Below8 } ; -- ord : Unit => Agr => Str } ; + TNumeral : Type = { s : Gender => Case => Str ; d : Unit => Gender => Case => Str ; n : Number ; below8 : Below8 } ; -- ord : Unit => Agr => Str } ; -- Inflection for cardinal numbers cardFlex : Str -> Gender => Case => Str = @@ -1442,9 +1487,9 @@ oper => "tria" ; <_, Nom | Acc | Voc > => "tres" ; <_, Gen> => "trium" ; <_, Dat | Abl > => "tribus" } ; + tre + "centi" => \\g,c => regAdj (tre + "centus") ! g ! Pl ! c ; "milia" => table { - Neutr => table Case [ "milia" ; "milia" ; "milium" ; "milibus" ; "milibus" ; "milia" ] ; - _ => \\_ => nonExist + _ => table Case [ "milia" ; "milia" ; "milium" ; "milibus" ; "milibus" ; "milia" ] } ; _ => \\_,_ => c } ; diff --git a/src/latin/SentenceLat.gf b/src/latin/SentenceLat.gf index 9e09bff4..f0582864 100644 --- a/src/latin/SentenceLat.gf +++ b/src/latin/SentenceLat.gf @@ -47,10 +47,14 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in { UseCl t p cl = -- Temp -> Pol-> Cl -> S (combineClause cl (lin Tense t) t.a (lin Pol p) VQFalse) ; - -- TO FIX - --UseQCl t p cl = - -- s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p ! q - -- { s = \\q => combineSentence (combineClause cl t t.a p VQFalse) ! PreV ! VSO } ; + -- UseQCl : Temp -> Pol -> QCl -> QS -- maybe use mkQuestion + UseQCl t p cl = + { + s = \\q => case q of { + QDir => t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV ++ cl.o ! PreV ; + QIndir => t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.o ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV + } + } ; -- UseRCl t p cl = { -- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ; diff --git a/src/latin/StructuralLat.gf b/src/latin/StructuralLat.gf index 6d9c0afe..14613326 100644 --- a/src/latin/StructuralLat.gf +++ b/src/latin/StructuralLat.gf @@ -11,21 +11,21 @@ concrete StructuralLat of Structural = CatLat ** almost_AdA, almost_AdN = ss "quasi" ; -- L... although_Subj = ss "quamquam" ; -- L... always_AdV = ss "semper" ; -- L... - and_Conj = mkConj [] "et" Pl Et ; -- L... + and_Conj = mkConj [] "et" Pl Et ; -- L177 -----b and_Conj = ss "and" ** {n = Pl} ; because_Subj = ss "cum" ; -- L... before_Prep = mkPrep "ante" Acc ; -- acc. L... behind_Prep = mkPrep "a tergo" Acc ; -- acc. L... between_Prep = mkPrep "inter" Acc ; -- acc. L... - both7and_DConj = mkConj "et" "et" Pl Et ; --L... + both7and_DConj = mkConj "et" "et" Pl Et ; --L177 but_PConj = ss "sed" ; -- L... by8agent_Prep = mkPrep "per" Abl ; -- L... by8means_Prep = mkPrep "" Abl ; -- L... - can8know_VV, can_VV = mkVV IrregLat.can_V True ; --L... + can8know_VV, can_VV = mkVV (mkV "scire" "scio" "scivi" "scitum") False ; --L... during_Prep = mkPrep "inter" Acc ; -- L... - either7or_DConj = mkConj "aut" "aut" Sg Aut ; -- L... + either7or_DConj = mkConj "aut" "aut" Sg Aut ; -- L177 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" ) Sg ; -- Pons everything_NP = regNP "omnia" "omnia" "omnium" "omnis" "omnis" "omnia" Neutr Pl ; --regNP "omnia" Pl ; -- L... everywhere_Adv = mkAdv "ubique" ; -- L... few_Det = mkDeterminer ( mkA "paulus" ) Pl ; -- L... @@ -55,7 +55,7 @@ concrete StructuralLat of Structural = CatLat ** on_Prep = mkPrep "in" Acc ; -- L... ------ one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED only_Predet = ss "solum" ; -- L... - or_Conj = mkConj [] "aut" Sg Aut ; -- L... + or_Conj = mkConj [] "aut" Sg Aut ; -- L177 otherwise_PConj = ss "praeterea" ; -- Pons part_Prep = mkPrep [] Gen ; -- Bayer-Lindauer 127 please_Voc = ss "queso" ; -- L... @@ -101,7 +101,7 @@ concrete StructuralLat of Structural = CatLat ** -----b whichPl_IDet = mkDeterminer Pl ["which"] ; -----b whichSg_IDet = mkDeterminer Sg ["which"] ; whoSg_IP = { s =pronForms "quis" "quem" "cuius" "cui" "quo" ; n = Sg } ; -- only feminine or masculine Bayer-Lindauer 59.1 - whoPl_IP = { s = \\_ => "" ; n = Pl } ; -- no plural forms Bayer-Lindauer 59.1 + whoPl_IP = { s = pronForms "qui" "quos" "quorum" "quibus" "quibus" ; n = Pl } ; why_IAdv = ss "cur" ; -- L... without_Prep = mkPrep "sine" Abl ; -- abl. L.. diff --git a/src/latin/SymbolLat.gf b/src/latin/SymbolLat.gf index 3b5252a2..6b02d862 100644 --- a/src/latin/SymbolLat.gf +++ b/src/latin/SymbolLat.gf @@ -7,23 +7,45 @@ lin IntPN i = {s = \\n,c => i.s ; g = Neutr} ; --- c FloatPN i = {s = \\n,c => i.s ; g = Neutr} ; --- c NumPN i = {s = \\n,c => i.s ! Neutr ! c; g = Neutr} ; --- c --- CNIntNP cn i = { --- s = \\c => (cn.s ! Sg ! Nom ++ i.s) ; --- a = agrgP3 Sg cn.g --- } ; --- CNSymbNP det cn xs = { + CNIntNP cn i = { + s = \\c => (cn.s ! Sg ! Nom ++ i.s) ; + g = cn.g ; + n = Sg ; + adv = [] ; + det = { s = \\_,_ => [] ; n = Sg ; sp = \\_,_ => [] } ; + p = P3 ; + postap = { s = \\_ => [] } ; + preap = { s = \\_ => [] } ; + } ; + CNSymbNP det cn xs = { + s = \\c => (cn.s ! Sg ! Nom ++ xs.s ) ; + g = cn.g ; + n = det.n ; + adv = [] ; + det = det ; + p = P3 ; + postap = { s = \\_ => [] } ; + preap = { s = \\_ => [] } ; + } ; -- s = \\c => det.s ++ cn.s ! det.n ! c ++ xs.s ; -- a = agrgP3 det.n cn.g -- } ; --- CNNumNP cn i = { --- s = \\c => (cn.s ! Sg ! Nom ++ i.s) ; --- a = agrgP3 Sg cn.g --- } ; + -- } ; + CNNumNP cn i = { + s = \\c => (cn.s ! Sg ! Nom ++ i.s ! cn.g ! Nom ) ; + g = cn.g ; + n = Sg ; + adv = [] ; + det = { s = \\_,_ => [] ; n = Sg ; sp = \\_,_ => [] } ; + p = P3 ; + postap = { s = \\_ => [] } ; + preap = { s = \\_ => [] } ; + } ; -- SymbS sy = { s = \\_ => sy.s ; neg = \\_ => "" ; o = \\_ => "" ; p = PPos ; sadv = "" ; t = TPres ; v = \\_,_ => "" } ; -- - -- SymbNum sy = {s = sy.s ; n = Pl ; hasCard = True} ; + SymbNum sy = {s = \\_,_ => sy.s ; n = Pl } ; SymbOrd sy = { s = \\g,n,c => sy.s } ; -- does not inflect properly lincat @@ -32,6 +54,6 @@ lincat lin MkSymb s = s ; --- BaseSymb = infixSS "and" ; --- ConsSymb = infixSS "," ; + BaseSymb = infixSS "et" ; + ConsSymb = infixSS "et" ; } diff --git a/src/latin/mkMissing.hs b/src/latin/mkMissing.hs new file mode 100644 index 00000000..83b1790c --- /dev/null +++ b/src/latin/mkMissing.hs @@ -0,0 +1,10 @@ +import PGF +import System.Environment + +main = + do + args <- getArgs -- first one should be pgf file and second one should be the file containing the errors/warnings about missing things + pgf <- PGF.readPGF (args !! 0) -- "tmp/Lang.pgf" + ms <- readFile (args !! 1) {- "tmp/MissingLat.tmp" -} >>= return . map (last . words) . lines + let ts = [PGF.showType [] t | m <- ms, Just t <- [PGF.functionType pgf (PGF.mkCId m)]] + putStrLn $ unlines ["oper " ++ f ++ " : " ++ t ++ " = notYet \"" ++ f ++ "\" ;" | (f,t) <- zip ms ts] diff --git a/src/latin/mkMissing.sh b/src/latin/mkMissing.sh new file mode 100755 index 00000000..d4370fda --- /dev/null +++ b/src/latin/mkMissing.sh @@ -0,0 +1,18 @@ +#!/bin/sh +echo "Create tmp dir" +mkdir tmp/ +echo "Remove old file" +echo "resource MissingLat = {} " > MissingLat.gf +echo "Look for missing functions" +# gf -src -i .. -batch TryLat.gf 2>&1 | grep "Warning: no linearization of" | sort -u > tmp/MissingLat.tmp +gf -src -i .. -batch ../api/TryLat.gf 2>&1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | grep -E "constant not found|no linearization of" | sort -u > tmp/MissingLat.tmp +echo "Compile grammar" +gf -src -make -D tmp LangLat.gf &> /dev/null +echo "Create placeholders for missing functions" +echo "resource MissingLat = open GrammarLat, Prelude in {" > MissingLat.gf +echo "" >> MissingLat.gf +echo "-- temporary definitions to enable the compilation of RGL API" >> MissingLat.gf +runghc mkMissing.hs "tmp/Lang.pgf" "tmp/MissingLat.tmp">> MissingLat.gf +echo "}" >> MissingLat.gf +echo "Cleanup" +rm -Rf tmp \ No newline at end of file