diff --git a/src/abstract/Numeral.gf b/src/abstract/Numeral.gf index be0d904e..874de674 100644 --- a/src/abstract/Numeral.gf +++ b/src/abstract/Numeral.gf @@ -28,8 +28,10 @@ cat Sub1000000000 ; -- 1..999999999 Sub1000000000000 ; -- 1..999999999999 -data +data + num : Sub1000000 -> Numeral ; -- 123456 [coercion to top category] + ---- num : Sub1000000000000 -> Numeral ; ---- should be this, but not yet available in most langs AR 6/2/2024 n2, n3, n4, n5, n6, n7, n8, n9 : Digit ; diff --git a/src/api/TryAra.gf b/src/api/TryAra.gf index 98187a36..7413f226 100644 --- a/src/api/TryAra.gf +++ b/src/api/TryAra.gf @@ -1,6 +1,6 @@ ---# -path=.:../arabic:../common:../abstract:../prelude +--# -path=.:../arabic:../common:../abstract:../prelude:../morphodict -resource TryAra = SyntaxAra, LexiconAra, ParadigmsAra - [mkAdN, mkAdv,mkOrd,mkQuant] ** +resource TryAra = SyntaxAra, LexiconAra, MorphoDictAra, ParadigmsAra - [mkAdN, mkAdv,mkOrd,mkQuant] ** open (P = ParadigmsAra) in { } diff --git a/src/arabic/DocumentationAra.gf b/src/arabic/DocumentationAra.gf new file mode 100644 index 00000000..09b77a70 --- /dev/null +++ b/src/arabic/DocumentationAra.gf @@ -0,0 +1,270 @@ +--# -path=.:../abstract:../common + +-- documenting Arabic inflection +---- so far with English titles and tags, AR 2024-01-31 + +concrete DocumentationAra of Documentation = CatAra ** open + ResAra, + Prelude, + HTML in { + +lincat + Inflection = {t : Str; s1,s2 : Str} ; + Definition = {s : Str} ; + Document = {s : Str} ; + Tag = {s : Str} ; + +lin + InflectionN, InflectionN2, InflectionN3 = \noun -> { + t = "n" ; + s1 = heading1 ("Noun" ++ case noun.g of { + Masc => "(masculine)"; + Fem => "(feminine)" + }) ; + s2 = frameTable ( + tr (th "" ++ th "nominative" ++ th "genitive" ++ th "accusative") ++ + tr (th "singular" ++ td (noun.s ! Sg ! Indef ! Nom) ++ td (noun.s ! Sg ! Indef ! Gen) ++ + td (noun.s ! Sg ! Indef ! Acc)) ++ + tr (th "dual" ++ td (noun.s ! Dl ! Indef ! Nom) ++ td (noun.s ! Dl ! Indef ! Gen) ++ + td (noun.s ! Dl ! Indef ! Acc)) ++ + tr (th "plural" ++ td (noun.s ! Pl ! Indef ! Nom) ++ td (noun.s ! Pl ! Indef ! Gen) ++ + td (noun.s ! Pl ! Indef ! Acc)) + ) + } ; + + InflectionPN, InflectionLN, InflectionGN, InflectionSN = \pn -> { ---- TODO: special for LN, GN, SN + t = "pn" ; + s1 = heading1 ("Proper Name" ++ + case pn.g of { + Masc => "(masculine)"; + Fem => "(feminine)" + }) ; + s2 = frameTable ( + tr (th "nominative" ++ th "genitive" ++ th "accusative") ++ + tr (td (pn.s ! Nom) ++ td (pn.s ! Gen) ++ td (pn.s ! Acc)) + ) + } ; + + InflectionA, InflectionA2 = \adj -> { + t = "a" ; + s1 = heading1 "Adjective" ; + s2 = frameTable ( + tr (th "" ++ th "Nominative" ++ th "Genitive" ++ th "Accusative") ++ + tr (th "Positive Masculine Singular" ++ + td (adj.s ! APosit Masc Sg Indef Nom) ++ + td (adj.s ! APosit Masc Sg Indef Gen) ++ + td (adj.s ! APosit Masc Sg Indef Acc) + ) ++ + tr (th "Positive Masculine Dual" ++ + td (adj.s ! APosit Masc Dl Indef Nom) ++ + td (adj.s ! APosit Masc Dl Indef Gen) ++ + td (adj.s ! APosit Masc Dl Indef Acc) + ) ++ + tr (th "Positive Masculine Plural" ++ + td (adj.s ! APosit Masc Pl Indef Nom) ++ + td (adj.s ! APosit Masc Pl Indef Gen) ++ + td (adj.s ! APosit Masc Pl Indef Acc) + ) ++ + tr (th "Positive Feminine Singular" ++ + td (adj.s ! APosit Fem Sg Indef Nom) ++ + td (adj.s ! APosit Fem Sg Indef Gen) ++ + td (adj.s ! APosit Fem Sg Indef Acc) + ) ++ + tr (th "Positive Feminine Dual" ++ + td (adj.s ! APosit Fem Dl Indef Nom) ++ + td (adj.s ! APosit Fem Dl Indef Gen) ++ + td (adj.s ! APosit Fem Dl Indef Acc) + ) ++ + tr (th "Positive Feminine Plural" ++ + td (adj.s ! APosit Fem Pl Indef Nom) ++ + td (adj.s ! APosit Fem Pl Indef Gen) ++ + td (adj.s ! APosit Fem Pl Indef Acc) + ) ++ + tr (th "Comparative" ++ + td (adj.s ! AComp Indef Nom) ++ + td (adj.s ! AComp Indef Gen) ++ + td (adj.s ! AComp Indef Acc) + ) + ) + } ; + + InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> { + t = "adv" ; + s1= heading1 "Adverb" ; + s2= paragraph (adv.s) ; + s3= "" + } ; + + InflectionPrep = \prep -> { + t = "prep" ; + s1= heading1 "Preposition" ; + s2= paragraph (prep.s) ; + s3= "" + } ; + + InflectionV, + InflectionV3, InflectionV2A, InflectionV2Q, InflectionV2S, InflectionV2V, InflectionVA, InflectionVQ, InflectionVS, InflectionVV ---- + = \v -> { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (v.s ! (VPerf Act (Per3 Masc Sg)) ++ + pp "subject"); + s2= inflVerb v + } ; + + InflectionV2 v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (v.s ! (VPerf Act (Per3 Masc Sg)) ++ + pp "subject" ++ + pp "object") ; + s2= inflVerb v + } ; +{- + InflectionV3 v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + v.c2 ++ pp "arg1" ++ + v.c3 ++ pp "arg2") ; + s2= inflVerb v + } ; + + InflectionV2V v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + v.c2 ++ pp "object" ++ + v.c3 ++ case v.typ of { + VVAux => pp "verb" ; + VVInf => "to" ++ pp "verb" ; + VVPresPart => pp "verb+ing" + }) ; + s2= inflVerb v + } ; + + InflectionV2S v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + v.c2 ++ pp "object" ++ + "that" ++ pp "sentence") ; + s2= inflVerb v + } ; + + InflectionV2Q v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + pp "question") ; + s2= inflVerb v + } ; + + InflectionV2A v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + v.c2 ++ pp "object" ++ + pp "adjective") ; + s2= inflVerb v + } ; + + InflectionVV v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VVF VInf ++ v.p ++ + case v.typ of { + VVAux => pp "verb" ; + VVInf => "to" ++ pp "verb" ; + VVPresPart => pp "verb+ing" + }) ; + s2= frameTable ( + tr (th "infitive" ++ td (v.s ! VVF VInf)) ++ + tr (th "present" ++ td (v.s ! VVF VPres ++ " " ++ v.s ! VVPresNeg)) ++ + tr (th "past" ++ td (v.s ! VVF VPast ++ " " ++ v.s ! VVPastNeg)) ++ --# notpresent + tr (th "past part." ++ td (v.s ! VVF VPPart)) ++ + tr (th "present part." ++ td (v.s ! VVF VPresPart)) + ) + } ; + + InflectionVS v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + "that" ++ pp "sentence") ; + s2= inflVerb v + } ; + + InflectionVQ v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + pp "question") ; + s2= inflVerb v + } ; + + InflectionVA v = { + t = "v" ; + s1= heading1 "Verb" ++ + paragraph (pp "subject" ++ + v.s ! VInf ++ v.p ++ + pp "adjective") ; + s2= inflVerb v + } ; +-} + +oper + inflVerb : Verb -> Str = \verb -> + frameTable ( + tr (th "Active" ++ th "Perfect" ++ th "Imperfect Indicative" ++ th "Conjunctive" ++ th "Jussive" ++ th "Imperative") ++ + inflVerbRow "3 Masculine Singular" (Per3 Masc Sg) verb ++ + inflVerbRow "3 Feminine Singular" (Per3 Fem Sg) verb ++ + inflVerbRow "2 Masculine Singular" (Per2 Masc Sg) verb ++ + inflVerbRow "2 Feminine Singular" (Per2 Fem Sg) verb ++ + inflVerbRow "1 Singular" (Per1 Sing) verb ++ + inflVerbRow "3 Masculine Dual" (Per3 Masc Dl) verb ++ + inflVerbRow "3 Feminine Dual" (Per3 Fem Dl) verb ++ + inflVerbRow "2 Dual" (Per2 Masc Dl) verb ++ + inflVerbRow "3 Masculine Plural" (Per3 Masc Pl) verb ++ + inflVerbRow "3 Feminine Plural" (Per3 Fem Pl) verb ++ + inflVerbRow "2 Masculine Plural" (Per2 Masc Pl) verb ++ + inflVerbRow "2 Feminine Plural" (Per2 Fem Pl) verb ++ + inflVerbRow "1 Plural" (Per1 Plur) verb + ) ; + + inflVerbRow : (h : Str) -> (pgn : PerGenNum) -> (verb : Verb) -> Str = \h, pgn, verb -> + tr (th h ++ + td (verb.s ! (VPerf Act pgn)) ++ + td (verb.s ! (VImpf Ind Act pgn)) ++ + td (verb.s ! (VImpf Cnj Act pgn)) ++ + td (verb.s ! (VImpf Jus Act pgn)) ++ + td (imperativeForm pgn verb) + ) ; + + imperativeForm : PerGenNum -> Verb -> Str = \pgn, verb -> + case pgn of { + Per2 g n => verb.s ! VImp g n ; + _ => "-" + } ; + + + pp : Str -> Str = \s -> "<"+s+">"; + +lin + NoDefinition t = {s=t.s}; + MkDefinition t d = {s="

Definition:"++t.s++d.s++"

"}; + MkDefinitionEx t d e = {s="

Definition:"++t.s++d.s++"

Example:"++e.s++"

"}; + +lin + MkDocument d i e = {s = i.s1 ++ d.s ++ i.s2 ++ paragraph e.s} ; + MkTag i = {s = i.t} ; + +} diff --git a/src/arabic/ExtendAra.gf b/src/arabic/ExtendAra.gf index 782d5c39..16d134fa 100644 --- a/src/arabic/ExtendAra.gf +++ b/src/arabic/ExtendAra.gf @@ -6,7 +6,9 @@ concrete ExtendAra of Extend = EmptyRelSlash, PredAPVP, ComplDirectVS, ComplDirectVQ, -- because of Utt VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS, - EmbedSSlash, AdjAsNP, GerundNP + EmbedSSlash, AdjAsNP, GerundNP, + PassVPSlash, ---- bogus implementation, see below + CompoundN ] with (Grammar=GrammarAra) ** open @@ -91,4 +93,16 @@ lin s = \\_ => np.s ! Nom ++ vps.s ! np.a.pgn -- first quick version with order always Nominal. } ; -- if necessary, change VPS into {s : PerGenNum => Order => {before,after : Str}} + +-- AR 24-02-08 + PassVPSlash vpslash = vpslash ** {s = \\pgn, vpf => vpslash.s ! pgn ! vpf} ; + ---- vpf does not have passive forms left, + ---- so this function is not possible with the current lincat of VP and VPSlash + + ---- very unsure about this as well + CompoundN a b = b ** { + s = \\n, s, c => b.s ! n ! Const ! c ++ a.s ! n ! s ! c ; + s2 = \\n, s, c => b.s2 ! n ! Const ! c ++ a.s2 ! n ! s ! c + } ; + } diff --git a/src/arabic/LangAra.gf b/src/arabic/LangAra.gf index fc08a4a8..7e8333af 100644 --- a/src/arabic/LangAra.gf +++ b/src/arabic/LangAra.gf @@ -3,7 +3,8 @@ concrete LangAra of Lang = GrammarAra, LexiconAra, - ConstructionAra + ConstructionAra, + DocumentationAra ** { flags startcat = Phr ; unlexer = text ; lexer = text ; coding = utf8 ; diff --git a/src/arabic/MorphoAra.gf b/src/arabic/MorphoAra.gf index 53f7a260..dbb4f752 100644 --- a/src/arabic/MorphoAra.gf +++ b/src/arabic/MorphoAra.gf @@ -491,6 +491,28 @@ oper AComp d c => indeclN aHmar ! d ! c }; +-- NTable = Number => State => Case => Str; +-- Adj : Type = {s : AForm => Str} ; +-- AForm = APosit Gender Number State Case | AComp State Case ; + + ntablesAdj : (masc, fem, comp : NTable) -> Adj = \masc, fem, comp -> { + s = table { + APosit Masc n d c => masc ! n ! d ! c ; + APosit Fem n d c => fem ! n ! d ! c ; + AComp d c => comp ! Sg ! d ! c + } + } ; + + mascFemCompAdj : (kabir, kabira, akbar : Str) -> Adj = + \kabir, kabira, akbar -> + ntablesAdj (positAdj kabir ! Masc) (positAdj kabir ! Fem) (positAdj akbar ! Masc) ; + + mascFemAdj : (kabir, kabira : Str) -> Adj = \kabir, kabira -> + mascFemCompAdj kabir kabira kabir ; ---- comp + + mascAdj : (kabir : Str) -> Adj = \kabir -> + mascFemAdj kabir (kabir + "َة") ; + ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- diff --git a/src/arabic/NamesAra.gf b/src/arabic/NamesAra.gf index d8928696..a362cc02 100644 --- a/src/arabic/NamesAra.gf +++ b/src/arabic/NamesAra.gf @@ -1,4 +1,4 @@ -concrete NamesAra of Names = CatAra ** open ResAra, Prelude in { +concrete NamesAra of Names = CatAra ** open ResAra, Prelude, (N=NounAra), (A=AdverbAra), (S=StructuralAra) in { lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> emptyNP ** { s = n.s ; @@ -14,4 +14,6 @@ lin UseLN pn = emptyNP ** { a = {pgn = Per3 pn.g Sg ; isPron = False} ; } ; +lin InLN n = A.PrepNP S.in_Prep (N.UsePN n) ; ---- TODO: alternative prepositions + } diff --git a/src/arabic/NumeralAra.gf b/src/arabic/NumeralAra.gf index 1fe70634..2de4439c 100644 --- a/src/arabic/NumeralAra.gf +++ b/src/arabic/NumeralAra.gf @@ -9,15 +9,10 @@ lincat n : Size } ; Sub10 = {s : DForm => CardOrd => Gender => State => Case => Str ; n : Size } ; - Sub100 = {s : CardOrd => Gender => State => Case => Str ; - n : Size} ; - Sub1000 = {s : CardOrd => Gender => State => Case => Str ; - n : Size } ; - Sub1000000 = {s : CardOrd => Gender => State => Case => Str ; + Sub100, Sub1000, Sub1000000, Sub1000000000, Sub1000000000000 + = {s : CardOrd => Gender => State => Case => Str ; n : Size} ; - - lin num x = x ; lin n2 = num2 ** {n = Two }; @@ -109,6 +104,9 @@ lincat --lin pot3plus n m = { -- s = \\c => n.s ! NCard ++ "تهُْسَند" ++ m.s ! c ; n = Pl} ; +lin pot3as4 n = n ; +lin pot4as5 n = n ; + -- numerals as sequences of digits lincat diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index 80506ebb..9712bf8b 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -95,6 +95,16 @@ resource ParadigmsAra = open = mkFullPN ; } ; + mkLN = overload { + mkLN : Str -> LN -- Predictable LN from a Str: fem hum if ends in ة, otherwise masc hum. + = \s -> lin LN (smartPN s) ; + mkLN : N -> LN -- Make a LN out of N. The LN is in construct state. + = \n -> lin LN (n ** { + s = \\c => n.s ! Sg ! Const ! c + ++ n.s2 ! Sg ! Def ! c -- NB this hack works for idaafa constructions (if you used mkN : N -> N -> N), but wrong for mkN : N -> A -> N. /IL + }) ; + } ; + --3 Relational nouns mkN2 : overload { @@ -128,6 +138,13 @@ resource ParadigmsAra = open = \s,a -> a ** {s = table {af => s ++ a.s ! af}} } ; + mascA : (kabir : Str) -> A + = \kabir -> lin A (mascAdj kabir) ; + mascFemA : (kabir, kabira : Str) -> A + = \kabir, kabira -> lin A (mascFemAdj kabir kabira) ; + mascFemCompA : (kabir, kabira, akbar : Str) -> A + = \kabir, kabira, akbar -> lin A (mascFemCompAdj kabir kabira akbar) ; + nisbaA : Str -> Adj ; -- Forms relative adjectives with the suffix ِيّ. Takes either the stem and adds يّ, or the whole word ending in يّ and just adds declension. idaafaA : N -> A -> A ; -- Forms adjectives of type غَيْرُ طَيِّبٍ 'not good'. Noun is in construct state but inflects in case. Adjective is in genitive, but inflects in gender, number and state. @@ -715,6 +732,15 @@ resource ParadigmsAra = open } }; + commonA : (pos, comp : Str) -> Adj = + \kabIr, akbar -> + { + s = table { + APosit g n d c => positAdj kabIr ! g ! n ! d ! c ; + AComp d c => indeclN akbar ! d ! c + } + }; + irregFemA : (masc : A) -> (fem : A) -> A = \m,f -> m ** { s = table { APosit Masc n d c => m.s ! APosit Masc n d c ; @@ -869,7 +895,7 @@ param VerbForm = FormI | FormII | FormIII | FormIV | FormV | FormVI | FormVII | FormVIII | FormX | FormXI ; -{- temporarily moved to wiktionary/MoreAra.gf + -- paradigms for Wiktionary extraction ---- TODO: better usage of information in Wiktionary @@ -913,25 +939,25 @@ oper wmkA : {masc_sg, masc_pl, root, sg_patt : Str} -> A = \r -> mkA r.root r.sg_patt ; wmkA : {masc_sg, fem_sg, masc_pl, fem_pl, root, pl_patt : Str} -> A - = \r -> mkA r.root ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg, fem_sg, masc_pl, fem_pl, root : Str} -> A - = \r -> mkA r.root ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg, fem_sg, root : Str} -> A = \r -> mkA r.root ; ---- wmkA : {masc_sg, fem_sg, masc_pl, fem_pl, pl_patt : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg : Str; fem_sg : Str; fem_pl : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg : Str; fem_sg : Str; root : Str ; sg_patt : Str} -> A = \r -> mkA r.root r.sg_patt ; wmkA : {masc_sg : Str; fem_sg : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg : Str; masc_pl : Str; fem_sg : Str; fem_pl : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg : Str; masc_pl : Str; fem_sg : Str; root : Str} -> A = \r -> mkA r.root ; wmkA : {masc_sg : Str; masc_pl : Str; fem_sg : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascFemAdj r.masc_sg r.fem_sg ; wmkA : {masc_sg : Str; masc_pl : Str; root : Str} -> A = \r -> mkA r.root ; wmkA : {masc_sg : Str; masc_pl, pl_patt : Str; root : Str} -> A @@ -939,28 +965,28 @@ oper wmkA : {masc_sg : Str; masc_pl, pl_patt, sg_patt : Str; root : Str} -> A = \r -> mkA r.sg_patt r.pl_patt ; wmkA : {masc_sg : Str; masc_pl : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascA r.masc_sg ; ---- wmkA : {masc_sg : Str; masc_pl, pl_patt : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascA r.masc_sg ; ---- wmkA : {masc_sg : Str; root : Str} -> A = \r -> mkA r.root ; wmkA : {masc_sg : Str} -> A - = \r -> mkA r.masc_sg ; ---- + = \r -> mascA r.masc_sg ; ---- } ; wmkV = overload { wmkV : {perfect : Str; cls : VerbForm; root : Str} -> V = \r -> mkV r.root r.cls ; ---- wmkV : {perfect : Str; cls : VerbForm} -> V - = \r -> mkV r.perfect r.cls ; ---- + = \r -> mkV r.perfect r.cls ; ---- expects root wmkV : {perfect : Str; imperfect : Str; cls : VerbForm; root : Str} -> V = \r -> mkV r.root r.cls ; ---- wmkV : {perfect : Str; imperfect : Str; cls : VerbForm} -> V - = \r -> mkV r.perfect r.cls ; ---- + = \r -> mkV r.perfect r.cls ; ---- expects root wmkV : {root : Str ; cls : VerbForm} -> V = \r -> mkV r.root r.cls ; wmkV : {imperfect : Str} -> V - = \r -> variants {} ; ---- mkV r.imperfect ; + = \r -> variants {} ; ---- mkV r.imperfect ; -- expects cls I } ; --} + } ; diff --git a/src/arabic/VerbAra.gf b/src/arabic/VerbAra.gf index 9eb5b165..27ff4690 100644 --- a/src/arabic/VerbAra.gf +++ b/src/arabic/VerbAra.gf @@ -130,6 +130,6 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in { CompNP np = {s = \\_,_ => [] ; obj = {s = np.s ! Nom ; a = agrLite np.a} ; isNP = True} ; --- + -- } diff --git a/src/arabic/wiktionary/WordNetAra.gf b/src/arabic/wiktionary/WordNetAra.gf index 992775b6..dd3d7206 100644 --- a/src/arabic/wiktionary/WordNetAra.gf +++ b/src/arabic/wiktionary/WordNetAra.gf @@ -243,8 +243,8 @@ lin kilometre_1_N = 'كَمّ_N' ; -- 647 [['quantity, multitude'], ['quantum']] -- lin kilometre_1_N = 'كِمّ_N' ; -- 6304 [['calyx of a flower, the envelope or spathe of a palm-tree or the like']] -- lin kilometre_1_N = 'كُمّ_N' ; -- 16436 [['sleeve of a garment']] lin kina_N = mkN "كينا" ; --- guess from كينا -lin king_1_N = 'مَلَك_N' ; -- 1462 [['angel']] --- lin king_1_N = 'مَلِك_N' ; -- 11923 [['king, sovereign, monarch']] +-- lin king_1_N = 'مَلَك_N' ; -- 1462 [['angel']] +lin king_1_N = 'مَلِك_N' ; -- 11923 [['king, sovereign, monarch']] -- lin king_1_N = 'مَلَك_1_N' ; -- 14484 [['possession, property'], ['food and water, resources; anything which regulates, maintains, or sustains; essentials, supplies, utilities'], ['foundation of ones existence'], ['foundation of ones existence', 'agent or effective cause']] -- lin king_1_N = 'مِلْك_N' ; -- 117902 [['verbal noun of مَلَكَ (malaka) (form I)'], ['property, possession, goods and chattels, fortune, wealth'], ['estate'], ['real estate, landed property']] -- lin king_1_N = 'مُلْك_N' ; -- 117903 [['verbal noun of مَلَكَ (malaka) (form I)'], ['rule, reign, supreme authority, dominion, dominance, sway, power'], ['sovereignty, kingship, royalty'], ['monarchy']] diff --git a/src/basque/NumeralEus.gf b/src/basque/NumeralEus.gf index 69d6cb73..4cb1c5fb 100644 --- a/src/basque/NumeralEus.gf +++ b/src/basque/NumeralEus.gf @@ -123,7 +123,7 @@ lin IFrac d i = { if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! co ; n = Pl ; - hasDot=False + hasDot=True } ; } diff --git a/src/catalan/NumeralCat.gf b/src/catalan/NumeralCat.gf index 374ba782..d1bc08be 100644 --- a/src/catalan/NumeralCat.gf +++ b/src/catalan/NumeralCat.gf @@ -140,11 +140,12 @@ param Dig = TDigit ; lin - IDig d = d ; + IDig d = d ** {tail = T1} ; IIDig d i = { - s = \\o => d.s ! NCard Masc ++ BIND ++ i.s ! o ; - n = Pl + s = \\o => d.s ! NCard Masc ++ spaceIf i.tail ++ i.s ! o ; + n = Pl ; + tail = inc i.tail } ; D_0 = mkDig "0" ; @@ -166,12 +167,24 @@ param } ; IFrac d i = { s = \\o => d.s ! NCard Masc ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ + if_then_Str d.hasDot BIND (BIND++","++BIND) ++ i.s ! o ; n = Pl ; hasDot=True } ; + oper + spaceIf : DTail -> Str = \t -> case t of { + T3 => SOFT_SPACE ; + _ => BIND + } ; + + inc : DTail -> DTail = \t -> case t of { + T1 => T2 ; + T2 => T3 ; + T3 => T1 + } ; + oper mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ; diff --git a/src/estonian/NumeralEst.gf b/src/estonian/NumeralEst.gf index 712f5f12..0fb7dd31 100644 --- a/src/estonian/NumeralEst.gf +++ b/src/estonian/NumeralEst.gf @@ -157,7 +157,7 @@ oper if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! o ; n = Pl ; - hasDot=False + hasDot=True } ; oper diff --git a/src/finnish/CatFin.gf b/src/finnish/CatFin.gf index 7e93e5b4..849e8ad6 100644 --- a/src/finnish/CatFin.gf +++ b/src/finnish/CatFin.gf @@ -97,7 +97,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in { N2 = SNoun ** {c2 : Compl ; isPre : Bool ; postmod : Number => Str} ; N3 = SNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ; PN = SPN ; - LN = SPN ** {n : Number} ; + LN = SPN ** {n : Number ; extCase : Bool} ; -- extCase=True -> Adessive, Ablative, Allative GN = SPN ** {g : Sex} ; SN = {s : Sex => SPN; pl : SPN} ; diff --git a/src/finnish/ConstructionFin.gf b/src/finnish/ConstructionFin.gf index 0d7e3f32..047cb263 100644 --- a/src/finnish/ConstructionFin.gf +++ b/src/finnish/ConstructionFin.gf @@ -74,9 +74,10 @@ lin yearAdv y = SyntaxFin.mkAdv (prePrep nominative "vuonna") y ; dayMonthAdv d m = ParadigmsFin.mkAdv ((mkUtt d).s ++ BIND ++ "." ++ (mkUtt (mkNP m)).s) ; monthYearAdv m y = SyntaxFin.mkAdv in_Prep (mkNP (mkNP m) (SyntaxFin.mkAdv (casePrep nominative) y)) ; ----- dayMonthYearAdv d m y = ----- lin Adv {s = d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part ++ y.s ! R.NPCase R.Nom} ; - + dayMonthYearAdv d m y = + ParadigmsFin.mkAdv ((mkUtt d).s ++ BIND ++ "." ++ + (SyntaxFin.mkAdv part_Prep (mkNP m)).s ++ + (SyntaxFin.mkAdv (casePrep nominative) y).s) ; intYear = symb ; intMonthday = symb ; diff --git a/src/finnish/DocumentationFinFunctor.gf b/src/finnish/DocumentationFinFunctor.gf index 05a8f85c..b81fd9a3 100644 --- a/src/finnish/DocumentationFinFunctor.gf +++ b/src/finnish/DocumentationFinFunctor.gf @@ -33,7 +33,7 @@ lin InflectionPN = \pn -> { t = "s" ; - s1 = heading1 "Oikea Nimi" ; + s1 = heading1 "Erisnimi" ; s2 = inflPN (\c -> pn.s ! c) } ; diff --git a/src/finnish/NamesFin.gf b/src/finnish/NamesFin.gf index 8ecbf92f..3bc88884 100644 --- a/src/finnish/NamesFin.gf +++ b/src/finnish/NamesFin.gf @@ -32,12 +32,8 @@ lin UseLN, PlainLN = \ln -> { isPron = False ; isNeg = False } ; -lin InLP ln = { - s = appCompl True Pos ln.c { s = snoun2np ln.n ln ; - a = agrP3 ln.n ; - isPron = False ; - isNeg = False - } - } ; +lin InLN ln = + let c = case ln.extCase of {True => Adess ; False => Iness} + in {s = ln.s ! c} ; } diff --git a/src/finnish/NumeralFin.gf b/src/finnish/NumeralFin.gf index 2e136b3e..2849304b 100644 --- a/src/finnish/NumeralFin.gf +++ b/src/finnish/NumeralFin.gf @@ -191,7 +191,7 @@ oper if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! o ; n = Pl ; - hasDot=False + hasDot=True } ; oper diff --git a/src/finnish/ParadigmsFin.gf b/src/finnish/ParadigmsFin.gf index 2d4c9ca9..c44570a6 100644 --- a/src/finnish/ParadigmsFin.gf +++ b/src/finnish/ParadigmsFin.gf @@ -843,10 +843,14 @@ mkVS = overload { } ; mkLN = overload { - mkLN : Str -> LN = \s -> lin LN (snoun2spn (mk1N s) ** {n = Sg}) ; - mkLN : Str -> Number -> LN = \s,n -> lin LN (snoun2spn (mk1N s) ** {n = n}) ; - mkLN : N -> LN = \noun -> lin LN (snoun2spn noun ** {n = Sg}) ; - mkLN : N -> Number -> LN = \noun,n -> lin LN (snoun2spn noun ** {n = n}) ; + mkLN : Str -> LN = \s -> lin LN (snoun2spn (mk1N s) ** {n = Sg ; extCase = False}) ; + mkLN : Str -> Number -> LN = \s,n -> lin LN (snoun2spnGen (mk1N s) n ** {n = n ; + extCase = case n of {Pl => True ; Sg => False}}) ; -- default case for Sg is In, for Pl is On + mkLN : N -> LN = \noun -> lin LN (snoun2spn noun ** {n = Sg ; extCase = False}) ; + mkLN : N -> Number -> LN = \noun,n -> lin LN (snoun2spnGen noun n ** {n = n ; + extCase = case n of {Pl => True ; Sg => False}}) ; + mkLN : Str -> Number -> Bool -> LN = \s,n,c -> lin LN (snoun2spnGen (mk1N s) n ** {n = n ; extCase = c}) ; + mkLN : N -> Number -> Bool -> LN = \noun,n,c -> lin LN (snoun2spnGen noun n ** {n = n ; extCase = c}) ; } ; mkGN = overload { diff --git a/src/finnish/StemFin.gf b/src/finnish/StemFin.gf index 00eb3558..5237e55b 100644 --- a/src/finnish/StemFin.gf +++ b/src/finnish/StemFin.gf @@ -38,7 +38,9 @@ oper SPN : Type = {s : Case => Str} ; - snoun2spn : SNoun -> SPN = \n -> {s = \\c => n.s ! NCase Sg c} ; + + snoun2spn : SNoun -> SPN = \n -> snoun2spnGen n Sg ; + snoun2spnGen : SNoun -> Number -> SPN = \n,nb -> {s = \\c => n.s ! NCase nb c} ; exceptNomSNoun : SNoun -> Str -> SNoun = \noun,nom -> { s = table { diff --git a/src/french/NumeralFre.gf b/src/french/NumeralFre.gf index 56e505cf..6ad455d3 100644 --- a/src/french/NumeralFre.gf +++ b/src/french/NumeralFre.gf @@ -153,11 +153,12 @@ oper hyphen = BIND ++ "-" ++ BIND ; Dig = TDigit ; lin - IDig d = d ; + IDig d = d ** {tail = T1} ; IIDig d i = { - s = \\o => d.s ! NCard Masc ++ BIND ++ i.s ! o ; - n = Pl + s = \\o => d.s ! NCard Masc ++ spaceIf i.tail ++ i.s ! o ; + n = Pl ; + tail = inc i.tail } ; D_0 = mkDig "0" ; @@ -179,12 +180,24 @@ oper hyphen = BIND ++ "-" ++ BIND ; } ; IFrac d i = { s = \\o => d.s ! NCard Masc ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ + if_then_Str d.hasDot BIND (BIND++","++BIND) ++ i.s ! o ; n = Pl ; hasDot=True } ; + oper + spaceIf : DTail -> Str = \t -> case t of { + T3 => SOFT_SPACE ; + _ => BIND + } ; + + inc : DTail -> DTail = \t -> case t of { + T1 => T2 ; + T2 => T3 ; + T3 => T1 + } ; + oper mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; mkDig : Str -> TDigit = \c -> mk2Dig c (c + "ème") ; diff --git a/src/german/AdjectiveGer.gf b/src/german/AdjectiveGer.gf index 6ec3599f..8f4448c7 100644 --- a/src/german/AdjectiveGer.gf +++ b/src/german/AdjectiveGer.gf @@ -3,29 +3,28 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { flags optimize=all_subs ; lin - PositA a = { s = a.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] } ; - ComparA a np = - let nps = np.s ! False ! Nom ++ bigNP np - in { - s = \\af => a.s ! Compar ! af ++ conjThan ++ nps ; + ComparA a np = { + s = \\af => a.s ! Compar ! af ; + s2 = \\c => conjThan ++ np.s ! False ! c ++ np.ext ++ np.rc ; isPre = True ; c = <[],[]> ; ext = [] } ; - CAdvAP ad ap np = - let nps = np.s ! False ! Nom ++ bigNP np in - ap ** { - s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ nps ; - isPre = False + CAdvAP adv ap np = ap ** { + s = \\af => adv.s ++ ap.s ! af ; + s2 = \\c => adv.p ++ np.s ! False ! c ++ np.ext ++ np.rc ; + isPre = True -- HL 1/2023 } ; UseComparA a = { s = \\af => a.s ! Compar ! af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -33,6 +32,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { AdjOrd a = { s = a.s ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -41,25 +41,24 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { -- $SuperlA$ belongs to determiner syntax in $Noun$. ComplA2 a np = - let CExt = case a.c2.t of { - isCase => ; - _ => <[], appPrepNP a.c2 np> } + let + obj = appPrepNP a.c2 np in { - s = a.s ! Posit ; - isPre = True ; - c = CExt ; - ext = [] + s = a.s ! Posit ; + s2 = \\_ => [] ; + isPre = True ; + c = case a.c2.t of {isCase => ; _ => <[], obj>} ; + ext = [] } ; ReflA2 a = let - compl = appPrep a.c2 (reflPron ! agrP3 Sg) ; - CExt = case a.c2.t of - {isCase => ; _ => <[], compl> } + obj = appPrep a.c2 (reflPron ! agrP3 Sg) ; in { s = a.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; - c = CExt ; + c = case a.c2.t of {isCase => ; _ => <[], obj>} ; ext = [] } ; @@ -72,9 +71,12 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { UseA2 a = { s = a.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] } ; + AdvAP ap adv = ap ** {s = \\a => adv.s ++ ap.s ! a} ; -- HL 1/2024 + } diff --git a/src/german/CatGer.gf b/src/german/CatGer.gf index 5654bf63..be5a5b3a 100644 --- a/src/german/CatGer.gf +++ b/src/german/CatGer.gf @@ -44,10 +44,13 @@ concrete CatGer of Cat = -- Adjective (HL 7/23: we need c : Agr => Str * Str to handle reflexive objects, cf ReflA2) - AP = {s : AForm => Str ; isPre : Bool ; c: Str * Str ; ext : Str} ; - -- ich bin [c1 ihm] treu - -- du bist so klug gewesen [ext ihn zu lesen] - -- ich bin stolz [c2 auf dich] + AP = { + s : AForm => Str ; -- (strong) adjective paradigm + s2 : Case => Str ; -- comparison np, e.g. [s kleineres] (Tier) [s2 als den Hund] HL 1/34 + isPre : Bool ; -- pre-nominal as attribute, e.g. False with sentential complement + c: Str * Str ; -- np,pp-complement, e.g. (ich bin) [c1 ihm] treu ; stolz [c2 auf dich] + ext : Str -- s,inf-complement, (du bist) so klug (gewesen) [ext ihn zu lesen] + } ; -- Noun @@ -65,7 +68,8 @@ concrete CatGer of Cat = DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef,hasDefArt : Bool} ; Quant = { - s,sp : GenNum => Case => Str ; + s : Bool => GenNum => Case => Str ; -- True if leading DefArtSg is dropped + sp : GenNum => Case => Str ; -- and contracted with preposition a : Adjf ; isDefArt : Bool ; delCardOne : Bool -- delete following cardinal 1 (IndefArt and no_Quant) @@ -127,7 +131,7 @@ concrete CatGer of Cat = VP = \vp -> useInfVP False vp ; VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ! GPl ++ vps.ext; - AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ; + AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.s2 ! Nom ++ ap.ext ; A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ! GPl ; V, VS, VQ, VA = \v -> useInfVP False (predV v) ; diff --git a/src/german/ConjunctionGer.gf b/src/german/ConjunctionGer.gf index 790461bd..a8bc7b09 100644 --- a/src/german/ConjunctionGer.gf +++ b/src/german/ConjunctionGer.gf @@ -20,6 +20,7 @@ concrete ConjunctionGer of Conjunction = in (conjAgr agr ss.a) }) ; ConjAP conj ss = conjunctDistrTable AForm conj ss ** { + s2 = \\c => [] ; -- comparison np of ap = {s:AForm => Str; s2:Case => Str} HL 1/23 isPre = ss.isPre ; c = ss.c ; ext = ss.ext} ; ConjRS conj ss = conjunctDistrTable RelGenNum conj ss ** { @@ -87,8 +88,8 @@ concrete ConjunctionGer of Conjunction = [CN] = {s1,s2 : Adjf => Number => Case => Str ; g : Gender} ; oper - bigAP : AP -> AForm => Str = \ap -> - \\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext; + bigAP : AP -> AForm => Str = \ap -> -- HL 1/23: not always ok: + \\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext ++ ap.s2 ! Nom ; -- comparison np in Nom bigCN : CN -> Adjf => Number => Case => Str = \cn -> \\a,n,c => cn.s ! a ! n ! c ++ cn.adv ++ cn.ext ++ cn.rc ! n ; diff --git a/src/german/ExtendGer.gf b/src/german/ExtendGer.gf index b11584e6..ac224679 100644 --- a/src/german/ExtendGer.gf +++ b/src/german/ExtendGer.gf @@ -26,11 +26,14 @@ concrete ExtendGer of Extend = (P = ParadigmsGer) in { lin - GenNP np = { - s,sp = \\gn,c => np.s ! False ! Gen ++ np.ext ++ np.rc ; - a = Strong ; - isDefArt = False ; - delCardOne = False + GenNP np = + let tab : GenNum => Case => Str = + \\gn,c => np.s ! False ! Gen ++ np.ext ++ np.rc + in {s = \\_ => tab ; + sp = tab ; + a = Strong ; + isDefArt = False ; + delCardOne = False } ; EmptyRelSlash slash = { @@ -164,6 +167,7 @@ concrete ExtendGer of Extend = let a = agrP3 Sg in { s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj ++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = vp.ext @@ -177,6 +181,7 @@ concrete ExtendGer of Extend = ++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2 ++ vp.c2.s ! GPl -- junk if not TV ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -291,6 +296,7 @@ concrete ExtendGer of Extend = compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement in { s = adj.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; c = case adj.c2.t of {isCase => ; _ => <[], compl>} ; ext = rnp.ext ++ rnp.rc diff --git a/src/german/ExtraGer.gf b/src/german/ExtraGer.gf index d0eff2f2..e7586f5e 100644 --- a/src/german/ExtraGer.gf +++ b/src/german/ExtraGer.gf @@ -71,6 +71,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** let a = agrP3 Sg in { s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj ++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = vp.ext @@ -84,6 +85,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** ++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2 ++ vp.c2.s ! GPl -- junk if not TV ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -230,6 +232,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement in { s = adj.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; c = case adj.c2.t of {isCase => ; _ => <[], compl>} ; ext = rnp.ext ++ rnp.rc diff --git a/src/german/MakeStructuralGer.gf b/src/german/MakeStructuralGer.gf index 4ec6b347..50d7c5d5 100644 --- a/src/german/MakeStructuralGer.gf +++ b/src/german/MakeStructuralGer.gf @@ -27,11 +27,13 @@ oper -- e.g. das selbe mmkQuant : Quant -> A -> Quant = \q,a -> q ** { - s,sp = \\gn,c => q.s ! gn ! c ++ a.s ! Posit ! agrAdj q.a gn c + s = \\b,gn,c => q.s ! b ! gn ! c ++ a.s ! Posit ! agrAdj q.a gn c ; + sp = \\gn,c => q.s ! False ! gn ! c ++ a.s ! Posit ! agrAdj q.a gn c } ; -- e.g. derjenige mmbQuant : Quant -> A -> Quant = \q,a -> q ** { - s,sp = \\gn,c => q.s ! gn ! c + a.s ! Posit ! agrAdj q.a gn c + s = \\b,gn,c => q.s ! b ! gn ! c + a.s ! Posit ! agrAdj q.a gn c ; + sp = \\gn,c => q.s ! False ! gn ! c + a.s ! Posit ! agrAdj q.a gn c } ; } diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index c205f9e3..a15ad223 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -71,11 +71,6 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { } ; oper - dropDefArtSg : Number -> Bool -> (GenNum => Case => Str) -> (Bool => GenNum => Case => Str) = - \n,isDefArt,qnt -> case of { - => table{True => \\gn,c => [] ; False => qnt} ; - _ => \\b => qnt - } ; einziger : AForm => Str = table{AMod gn c => "einzig" + adjEnding ! gn ! c ; _ => "einziges"} ; lin @@ -85,7 +80,6 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { a = quant.a ; d = quant.isDefArt ; isCardOne = case n of {Sg => num.isNum ; _ => False} ; - qunt : Bool => GenNum => Case => Str = dropDefArtSg n d quant.s ; nums : AForm => Str = \\af => case af of { AMod (GSg g) c => case of { => einziger ! af ; -- (ein,kein) einziger @@ -94,7 +88,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { _ => num.s ! APred} in { s,sp = \\b,g,c => let gn = gennum g n in - qunt ! b ! gn ! c ++ nums ! agrAdj a gn c ++ ord.s ! agrAdj a gn c ; + quant.s ! b ! gn ! c ++ nums ! agrAdj a gn c ++ ord.s ! agrAdj a gn c ; n = n ; a = a ; isDef = case a of {Strong => False ; _ => True} ; @@ -107,9 +101,8 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { a = quant.a ; d = quant.isDefArt ; isCardOne = case n of {Sg => num.isNum ; _ => False} ; - quants = dropDefArtSg n d quant.s ; quantsp : Bool => GenNum => Case => Str = - dropDefArtSg n d (case num.isNum of {True => quant.s ; False => quant.sp}) ; + case num.isNum of {True => quant.s ; False => \\b => quant.sp} ; nums : AForm => Str = \\af => case af of { AMod (GSg g) c => case of { => einziger ! af ; -- (k)ein einziger, drop cardinal "ein" of num @@ -119,7 +112,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { APred => num.s ! APred} in { s = \\b,g,c => let gn = gennum g n in - quants ! b ! gn ! c ++ nums ! agrAdj a gn c ; + quant.s ! b ! gn ! c ++ nums ! agrAdj a gn c ; sp = \\b,g,c => let gn = gennum g n in quantsp ! b ! gn ! c ++ nums ! agrAdj a gn c ; n = n ; @@ -129,8 +122,8 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { } ; PossPron p = { - s = \\gn,c => p.s ! NPPoss gn c ; -- mein (dritter) - sp = \\gn,c => p.sp ! PossF gn c ; -- meiner + s = \\_,gn,c => p.s ! NPPoss gn c ; -- mein (dritter) + sp = \\gn,c => p.sp ! PossF gn c ; -- meiner a = Mixed ; isDefArt = False ; delCardOne = False ; @@ -166,7 +159,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { af => n.s ! NOrd APred ++ BIND ++ a.s ! Superl ! af} -- drittbeste } ; DefArt = { - s = \\gn,c => artDef ! gn ! c ; + s = \\b,gn,c => case of { => [] ; _ => artDef ! gn ! c} ; sp = \\gn,c => case of { => "dessen" ; => "derer" ; @@ -180,8 +173,8 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { } ; IndefArt = { - s = table {GSg g => \\c => "ein" + pronEnding ! (GSg g) ! c ; - GPl => \\c => []} ; + s = \\_ => table {GSg g => \\c => "ein" + pronEnding ! (GSg g) ! c ; + GPl => \\c => []} ; sp = table {GSg g => \\c => "ein" + detEnding ! (GSg g) ! c ; GPl => caselist "einige" "einige" "einigen" "einiger"} ; a = MixedStrong ; -- Sg Mixed, Pl Strong @@ -233,10 +226,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { let g = cn.g in cn ** { - s = \\a,n,c => - preOrPost ap.isPre + s = case ap.isPre of { -- HL 1/2023 False only for ap = SentAP ap' sc + True => \\a,n,c => -- besserer cn als a.s2 [instead: cn, besser als a.s2,] (ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj a (gennum g n) c) - (cn.s ! a ! n ! c) ++ ap.ext ; -- comparison part of ap HL 11/2023; + ++ (cn.s ! a ! n ! c) ++ ap.s2 ! c ++ ap.ext ; + False => \\a,n,c => cn.s ! a ! n ! c ++ -- postnominal ap with sc + embedInCommas (ap.c.p1 ++ ap.c.p2 ++ ap.s ! APred ++ ap.s2 ! c ++ ap.ext)} ; g = g } ; diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index ff28926c..e54a65dd 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -103,17 +103,18 @@ concrete StructuralGer of Structural = CatGer ** } ; something_NP = nameNounPhrase Neutr {s = \\_ => "etwas"} ; somewhere_Adv = ss "irgendwo" ; - that_Quant = { - s,sp = \\gn,c => "jen" + detEnding ! gn ! c ; a = Weak ; isDefArt,delCardOne = False} ; + that_Quant = let jener : GenNum => Case => Str = \\gn,c => "jen" + detEnding ! gn ! c + in {s = \\_ => jener ; sp = jener ; a = Weak ; isDefArt,delCardOne = False} ; ---b that_NP = nameNounPhrase Neutr {s = caselist "das" "das" "dem" "dessen"} ; ---- there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ; there7to_Adv = ss "dahin" ; there7from_Adv = ss ["daher"] ; therefore_PConj = ss "deshalb" ; ---b these_NP = {s = caselist "diese" "diese" "diesen" "dieser" ; a = agrP3 Pl} ; + they_Pron = mkPronPers "sie" "sie" "ihnen" "ihrer" "ihr" Fem Pl P3 ; - this_Quant = { - s,sp = \\gn,c => "dies" + detEnding ! gn ! c ; a = Weak ; isDefArt, delCardOne = False} ; + this_Quant = let dieser : GenNum => Case => Str = \\gn,c => "dies" + detEnding ! gn ! c + in {s = \\_ => dieser ; sp = dieser ; a = Weak ; isDefArt, delCardOne = False} ; ---b this_NP = nameNounPhrase Neutr {s = caselist "dies" "dies" "diesem" "dieses"} ; ---- ---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ; through_Prep = mkPrep "durch" P.accusative ; @@ -148,8 +149,8 @@ concrete StructuralGer of Structural = CatGer ** not_Predet = {s = \\_,_,_ => "nicht" ; c = noCase ; a = PAgNone} ; no_Quant = { - s = table {GSg g => \\c => "kein" + pronEnding ! GSg g ! c ; - GPl => \\c => "kein" + detEnding ! GPl ! c} ; + s = \\_ => table {GSg g => \\c => "kein" + pronEnding ! GSg g ! c ; + GPl => \\c => "kein" + detEnding ! GPl ! c} ; sp = \\gn,c => "kein" + detEnding ! gn ! c ; a = Mixed ; isDefArt = False ; delCardOne = True} ; -- HL kein+ein(er) => kein(er) if_then_Conj = {s1 = "wenn" ; s2 = "dann" ; n = Sg ; lock_Conj = <>} ; diff --git a/src/german/VerbGer.gf b/src/german/VerbGer.gf index 9053eb10..d5688a3b 100644 --- a/src/german/VerbGer.gf +++ b/src/german/VerbGer.gf @@ -37,7 +37,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ; SlashV2A v ap = - insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ; + insertAdj (ap.s ! APred ++ ap.s2 ! Nom) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ; ComplSlash vps np = -- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np. diff --git a/src/greek/NumeralGre.gf b/src/greek/NumeralGre.gf index 1c3eddd1..15f4da14 100644 --- a/src/greek/NumeralGre.gf +++ b/src/greek/NumeralGre.gf @@ -302,7 +302,7 @@ Xilias : CardOrd -> (CardOrd => Str) -> Number -> Str = \co,d,n -> if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! o ; n = Pl ; - hasDot=False + hasDot=True } ; oper diff --git a/src/italian/NumeralIta.gf b/src/italian/NumeralIta.gf index 93a55a2f..db458899 100644 --- a/src/italian/NumeralIta.gf +++ b/src/italian/NumeralIta.gf @@ -120,11 +120,12 @@ param Pred = pred | indip ; Dig = TDigit ; lin - IDig d = d ; + IDig d = d ** {tail = T1} ; IIDig d i = { - s = \\o => d.s ! NCard Masc ++ BIND ++ i.s ! o ; - n = Pl + s = \\o => d.s ! NCard Masc ++ spaceIf i.tail ++ i.s ! o ; + n = Pl ; + tail = inc i.tail } ; D_0 = mkDig "0" ; @@ -146,12 +147,24 @@ param Pred = pred | indip ; } ; IFrac d i = { s = \\o => d.s ! NCard Masc ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ + if_then_Str d.hasDot BIND (BIND++","++BIND) ++ i.s ! o; n = Pl ; hasDot=True } ; + oper + spaceIf : DTail -> Str = \t -> case t of { + T3 => SOFT_SPACE ; + _ => BIND + } ; + + inc : DTail -> DTail = \t -> case t of { + T1 => T2 ; + T2 => T3 ; + T3 => T1 + } ; + oper mkDig : Str -> TDigit = \c -> mk2Dig c Pl ; diff --git a/src/malay/AdjectiveMay.gf b/src/malay/AdjectiveMay.gf index bee168c4..e203fec2 100644 --- a/src/malay/AdjectiveMay.gf +++ b/src/malay/AdjectiveMay.gf @@ -59,6 +59,7 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in { -- : AdA -> AP -> AP ; -- AdAP ada ap = ap ** { } ; + -- It can also be postmodified by an adverb, typically a prepositional phrase. diff --git a/src/malay/AdverbMay.gf b/src/malay/AdverbMay.gf index d7b65fd7..15465cab 100644 --- a/src/malay/AdverbMay.gf +++ b/src/malay/AdverbMay.gf @@ -20,9 +20,13 @@ lin --AdAdv : AdA -> Adv -> Adv ; -- very quickly -- AdAdv ada adv = adv ** -- Like adverbs, adadjectives can be produced by adjectives. + AdAdv ada adv = adv ** { + s = ada.s ++ adv.s ; + } ; -- : A -> AdA ; -- extremely -- PositAdAAdj a = { } ; + -- PositAdAAdj a = {s = a.s} ; -- Subordinate clauses can function as adverbs. diff --git a/src/malay/ExtendMay.gf b/src/malay/ExtendMay.gf index a646139c..d72a25ce 100644 --- a/src/malay/ExtendMay.gf +++ b/src/malay/ExtendMay.gf @@ -8,6 +8,7 @@ concrete ExtendMay of Extend = CatMay , ListVPI -- infinitive VP's (TODO: with anteriority and polarity) , MkVPS , PredVPS, RelVPS, QuestVPS, SQuestVPS + , PassVPSlash, PassAgentVPSlash -- excluded because RGL funs needed for them not implemented yet , PredAPVP @@ -79,6 +80,7 @@ concrete ExtendMay of Extend = CatMay PastPartAP vp = { s = linVP vp } ; + -- GenModNP : Num -> NP -> CN -> NP ; -- this man's car(s) GenModNP n np cn = variants {}; @@ -100,6 +102,22 @@ concrete ExtendMay of Extend = CatMay ByVP vp = cc2 by8means_Prep (GerundAdv vp) ; + -- PassVPSlash : VPS -> VP ; + -- be begged to sleep + PassVPSlash vps = vps ** { + s = \\vf,pol => vps.s ! Passive ! pol ++ vps.adjCompl; + }; + + -- PassAgentVPSlash : VPSlash -> NP -> VP ; -- be begged by her to go + PassAgentVPSlash vps np = { + s = \\vf,pol => vps.s ! Passive ! pol ++ vps.adjCompl ++ (applyPrep by8agent_Prep np); + }; + -- PassAgentVPSlash vps np = { + -- s = \\vf,pol => vps.s ! Passive ! pol ++ (applyPrep by8agent_Prep np) ; + -- }; + + + -- MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved -- ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates -- ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person diff --git a/src/malay/LexiconMay.gf b/src/malay/LexiconMay.gf index effc63b4..6ca8163b 100644 --- a/src/malay/LexiconMay.gf +++ b/src/malay/LexiconMay.gf @@ -27,7 +27,7 @@ lin bank_N = mkN "bank" ; lin beautiful_A = mkA "cantik" ; -- lin become_VA = mkVA "jadi" ; lin beer_N = mkN "bir" ; --- lin beg_V2V = mkV2 "" ; +lin beg_V2V = mkV2 "rayu" ; -- lin belly_N = mkN "" ; lin big_A = mkA "besar" ; lin bike_N = mkN "basikal" ; @@ -95,8 +95,9 @@ lin day_N = mkN "hari" ; -- lin doctor_N = mkN "" ; lin dog_N = mkN "anjing" ; lin door_N = mkN "pintu" ; -lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** { - s = \\_ => "minum" ; +lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** { s = table { + Passive => "diminum" ; + _ => "minum"} ; }; -- lin dry_A = mkA "" ; -- lin dull_A = mkA "" ; @@ -108,7 +109,9 @@ lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** { -- lin ear_N = mkN "" ; -- lin earth_N = mkN "" ; lin eat_V2 = let eat' : V2 = mkV2 "makan" in eat' ** { - s = \\_ => "makan" ; + s = table { + Passive => "dimakan" ; + _ => "makan"} ; }; -- lin egg_N = mkN "" ; -- lin empty_A = mkA "" ; @@ -208,15 +211,16 @@ lin king_N = mkN "raja" ; -- lin language_N = mkN "" ; -- lin laugh_V = mkV "" ; -- lin leaf_N = mkN "" ; -lin learn_V2 = mkV2 (prefixV (mkV "ajar" Ber)) emptyPrep ; +lin learn_V2 = mkV2 (prefixV (mkV "belajar" NoPrefix)) emptyPrep ; -- lin leather_N = mkN "" ; -- lin leave_V2 = mkV2 "" ; -- lin leg_N = mkN "" ; -- lin lie_V = mkV "" ; lin like_V2 = let like' : V2 = mkV2 "suka" in like' ** { - s = \\_ => "suka" ; - passive = "disukai" ; -} ; + s = table { + Passive => "disukai" ; + _ => "suka"} ; +}; -- lin listen_V2 = mkV2 "" ; -- lin live_V = mkV ""; -- lin liver_N = mkN "" ; @@ -224,11 +228,12 @@ lin long_A = mkA "panjang" ; -- lin lose_V2 = mkV2 "" ; -- lin louse_N = mkN "" ; -- lin love_N = mkN "" ; --- lin love_V2 = let love' : V2 = mkV2 "cinta" in love' ** { --- s = \\_ => "mencintai" ; --- passive = "dicintai" ; --- } ; -lin love_V2 = mkV4 "cinta" "i"; +lin love_V2 = let love' : V2 = mkV2 "cinta" in love' ** { + s = table { + Passive => "dicintai" ; + _ => "mencintai" }; +}; +-- lin love_V2 = mkV4 "cinta" "i"; ---- -- M @@ -288,7 +293,7 @@ lin queen_N = mkN "ratu" ; -- lin radio_N = mkN "" ; lin rain_N = mkN "hujan" ; lin rain_V0 = mkV "hujan" ; -lin read_V2 = mkV2 "baca" ; +lin read_V2 = mkV2 (prefixV (mkV "baca" Meng)) emptyPrep ; -- lin ready_A = mkA "" ; -- lin reason_N = mkN "" ; -- lin red_A = mkA "" ; @@ -336,7 +341,7 @@ lin sing_V = mkV "nyanyi" ; -- lin sit_V = mkV "" ; -- lin skin_N = mkN "" ; -- lin sky_N = mkN "" ; --- lin sleep_V = mkV "" ; +lin sleep_V = mkV "tidur" ; lin small_A = mkA "kecil" ; -- lin smell_V = mkV "" ; -- lin smoke_N = mkN "" ; @@ -345,7 +350,8 @@ lin small_A = mkA "kecil" ; -- lin snow_N = mkN "" ; -- lin sock_N = mkN "" ; lin song_N = mkN "lagu" ; --- lin speak_V2 = mkV2 "" ; +lin speak_V2 = mkV2 (prefixV (mkV "cakap" Ber)) emptyPrep ; + -- lin spit_V = mkV "" ; -- lin split_V2 = mkV2 "" ; -- lin squeeze_V2 = mkV2 "" ; @@ -372,7 +378,7 @@ lin stop_V = mkV "henti" ; -- lin table_N = mkN "" ; -- lin tail_N = mkN "" ; lin talk_V3 = mkV3 (mkV "cakap" Ber) (mkPrep "tentang") (mkPrep "dengan") ; -lin teach_V2 = mkV2 "ajar" ; +lin teach_V2 = mkV2 (prefixV (mkV "ajar" Meng)) emptyPrep; -- lin teacher_N = mkN "" ; -- lin television_N = mkN "" ; -- lin thick_A = mkA "" ; @@ -402,7 +408,7 @@ lin ugly_A = mkA "jelek" ; -- W - Y -- lin wait_V2 = mkV2 "" ; -lin walk_V = mkV "jalan" ; +lin walk_V = (prefixV (mkV "jalan" Ber)) ; -- lin war_N = mkN "" ; -- lin warm_A = mkA "" ; -- lin wash_V2 = mkV2 "" ; diff --git a/src/malay/NounMay.gf b/src/malay/NounMay.gf index 72d85a76..be459693 100644 --- a/src/malay/NounMay.gf +++ b/src/malay/NounMay.gf @@ -13,7 +13,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { -- TODO classifier is necessary if numeral comes after noun. See Mintz p. 298. -- ++ if_then_Str (isNum det.n) "buah" [] -- TODO store classifier in CN ++ case det.poss of { - Bare => cn.s ! NF (toNum det.n) poss ; + Bare => cn.s ! NF (toNum det.n) det.poss ; _ => cn.s ! NF (toNum det.n) det.poss -- TODO check if this make sense } ++ det.s ++ cn.heavyMod ; } ; diff --git a/src/malay/ParadigmsMay.gf b/src/malay/ParadigmsMay.gf index dd22ff33..18cb71f7 100644 --- a/src/malay/ParadigmsMay.gf +++ b/src/malay/ParadigmsMay.gf @@ -75,12 +75,16 @@ oper -- mkVQ : Str -> VQ -- = \s -> lin VQ (regV s) ; - + mkV2A : overload { + mkV2A : Str -> V2A ; + } ; -- -- mkV2A : Str -> V2A -- = \s -> lin V2A (regV s ** {c2 = noPrep}) ; - -- mkV2Q : Str -> V2Q - -- = \s -> lin V2Q (regV s ** {c2 = noPrep}) ; + mkV2Q : overload { + mkV2Q : Str -> V2Q ; + mkV2Q : V -> Prep -> V2Q ; + } ; ----- diff --git a/src/malay/ParamMay.gf b/src/malay/ParamMay.gf index 5ea50b37..af9f0cd3 100644 --- a/src/malay/ParamMay.gf +++ b/src/malay/ParamMay.gf @@ -27,8 +27,11 @@ oper prefix : Prefix -> Str -> Str = \p -> case p of { Meng => prefixMeng ; - Ber => prefixBer + Ber => prefixBer ; + NoPrefix => prefixNone } ; + + prefixNone : Str -> Str = \belajar -> belajar ; prefixMeng : Str -> Str = \makan -> case makan of { @@ -63,8 +66,6 @@ oper } ; prefixBer : Str -> Str = \jalan -> case jalan of { - -- Exception - "ajar" => "belajar" ; -- Drop the r (#c + "er" + _ -- be+kerja @@ -149,6 +150,7 @@ param Prefix = Meng | Ber + | NoPrefix ; -- TODO more? -------------------------------------------------------------------------------- diff --git a/src/malay/PhraseMay.gf b/src/malay/PhraseMay.gf index 45e29644..6bba6689 100644 --- a/src/malay/PhraseMay.gf +++ b/src/malay/PhraseMay.gf @@ -7,9 +7,9 @@ concrete PhraseMay of Phrase = CatMay ** open Prelude, ResMay in { UttQS qs = qs ; UttIAdv iadv = iadv ; UttNP np = {s = np.s ! Bare} ; - UttIP ip = {s = ip.sp ! NF Sg Bare} ; + UttIP ip = {s = ip.s ! Bare} ; UttImpSg pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p } ; - UttImpPol pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p} ; + UttImpPol pol imp = {s = "tolong" ++ pol.s ++ imp.s ! Sg ! pol.p} ; UttImpPl pol imp = {s = pol.s ++ imp.s ! Pl ! pol.p} ; UttVP vp = {s = linVP vp} ; UttAP ap = {s = ap.s} ; diff --git a/src/malay/QuestionMay.gf b/src/malay/QuestionMay.gf index 17d03521..42a5fa39 100644 --- a/src/malay/QuestionMay.gf +++ b/src/malay/QuestionMay.gf @@ -8,9 +8,18 @@ concrete QuestionMay of Question = CatMay ** open -- determiners, with or without a noun. lin -- : IDet -> CN -> IP ; -- which five songs - IdetCN idet cn = NM.DetCN idet cn ** { - sp = \\nf => idet.sp ! nf ++ cn.s ! nf - } ; +-- IdetCN idet cn = NM.DetCN idet cn ** { +-- sp = \\nf => idet.sp ! nf ++ cn.s ! nf +-- } ; + IdetCN idet cn = emptyNP ** { + s = \\poss => + idet.pr + ++ case idet.poss of { + Bare => cn.s ! NF (toNum idet.n) idet.poss ; + _ => cn.s ! NF (toNum idet.n) idet.poss -- TODO check if this make sense + } ++ idet.s ++ cn.heavyMod ; + sp = \\nf => idet.sp ! nf ++ cn.s ! nf; + } ; -- : IDet -> IP ; -- which five IdetIP idet = NM.DetNP idet ** {sp = idet.sp}; diff --git a/src/malay/ResMay.gf b/src/malay/ResMay.gf index 65863162..9fd53433 100644 --- a/src/malay/ResMay.gf +++ b/src/malay/ResMay.gf @@ -230,7 +230,7 @@ oper -- VV : Type = Verb ** {vvtype : VVForm} ; regVerb : Str -> Prefix -> Verb = \str,p -> - mkVerb str (prefix p str) ("di" + str) (str + "kan") ; + mkVerb str (prefix p str) ("di" + str) (str ++ BIND ++ "kan") ; mkVerb : (makan, memakan, dimakan, makankan : Str) -> Verb = \rt,act,pass,imp -> { s = table { @@ -251,7 +251,7 @@ oper mkVerb4 : Verb -> Preposition -> Str -> Verb4 = \v,pr,str -> v ** { s = \\_ => v.s ! Active ++ str; c2 = pr ; - passive = "di" ++ BIND ++ v.s ! Root ++ str + -- passive = "di" ++ BIND ++ v.s ! Root ++ str } ; copula : Verb = {s = \\_ => "ada"} ; -- TODO @@ -292,8 +292,11 @@ oper useV : Verb -> VerbPhrase = \v -> v ** { s = \\vf,pol => verbneg pol ++ v.s ! vf } ; - + useComp : Str -> VerbPhrase = \s -> { + s = \\vf,pol => verbneg pol ++ s ; + } ; + useCompN : Str -> VerbPhrase = \s -> { s = \\vf,pol => nounneg pol ++ s ; } ; diff --git a/src/malay/SentenceMay.gf b/src/malay/SentenceMay.gf index d09387f9..ddda0769 100644 --- a/src/malay/SentenceMay.gf +++ b/src/malay/SentenceMay.gf @@ -95,7 +95,7 @@ lin oper advS : (comma : Str) -> Adverb -> S -> S = \comma,a,sent -> sent ** { - s = sent.s ++ comma ++ a.s + s = a.s ++ comma ++ sent.s } ; } diff --git a/src/malay/StructuralMay.gf b/src/malay/StructuralMay.gf index 14a10dea..567149fd 100644 --- a/src/malay/StructuralMay.gf +++ b/src/malay/StructuralMay.gf @@ -47,9 +47,9 @@ lin or_Conj = {s2 = "atau" ; s1 = [] ; n = Sg} ; -- lin both7and_DConj = mkConj "" "" pl ; -- lin either7or_DConj = {s2 = \\_ => "" ; s1 = "" ; n = Sg} ; -- --- lin but_PConj = ss "" ; +lin but_PConj = ss "tetapi" ; -- lin otherwise_PConj = ss "" ; --- lin therefore_PConj = ss "" ; +lin therefore_PConj = ss "oleh itu" ; ----------------- @@ -104,7 +104,7 @@ lin by8agent_Prep = mkPrep "oleh" ; -- for pronoun agent, see Mintz p. 170, 5.4. lin by8means_Prep = mkPrep "dengan" ; -- lin during_Prep = mkPrep ; -- lin except_Prep = mkPrep ; --- lin for_Prep = mkPrep ; +lin for_Prep = mkPrep "untuk" ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; lin in_Prep = mkPrep "di" ; diff --git a/src/malay/VerbMay.gf b/src/malay/VerbMay.gf index 64b6ccbb..4ab5da38 100644 --- a/src/malay/VerbMay.gf +++ b/src/malay/VerbMay.gf @@ -1,4 +1,4 @@ -concrete VerbMay of Verb = CatMay ** open ResMay, AdverbMay, Prelude in { +concrete VerbMay of Verb = CatMay ** open ResMay, AdverbMay, StructuralMay, Prelude in { lin @@ -16,7 +16,7 @@ lin -- : VV -> VP -> VP ; ComplVV vv vp = vp ** useV { - s = \\vf => vv.s ++ linVP vp + s = \\vf => vv.s ++ vp.s ! Root! Pos; } ; -- : VA -> AP -> VP ; -- they become red @@ -56,7 +56,13 @@ lin -- : V3 -> NP -> VPSlash ; -- give (it) to her Slash3V3 v3 iobj = useV { - s = \\vf => v3.s ! vf ++ applyPrep v3.c3 emptyNP ++ iobj.s ! Bare; + s = \\vf => v3.s ! vf ++ + case iobj.a of { + IsPron p => applyPrep v3.c2 emptyNP ++ applyPrep v3.c3 iobj ; + _ => applyPrep v3.c2 iobj ++ applyPrep v3.c3 emptyNP + } + -- ++ applyPrep v3.c2 iobj ++ + -- applyPrep v3.c3 emptyNP ; --iobj.s ! Bare -- applyPrep v3.c3 iobj -- TODO check if this works for all -- probably not } ** { c2 = v3.c2 ;-- Now the VPSlash is missing only the direct object @@ -72,20 +78,24 @@ lin } ; -- : V2V -> VP -> VPSlash ; -- beg (her) to go - SlashV2V v2 vp = vp ** useV { - s = \\vf => v2.s ! vf ++ (linVP vp); + SlashV2V v2 vp = useV { + s = \\vf => v2.s ! vf; } ** { - c2 = v2.c2; - adjCompl = [] ; + c2 = v2.c2 ; + adjCompl = for_Prep.s ++ vp.s ! Root ! Pos; } ; - -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good SlashV2S v2 s = useV v2 ** { c2 = v2.c2; adjCompl = "yang" ++ s.s ; -- TODO check /Inari } ; + -- : V2Q -> QS -> VPSlash ; -- ask (him) who came + -- SlashV2Q v2q qs = useV v2q ** { + -- s = + -- }; + {- -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good @@ -102,12 +112,9 @@ lin -- : VPSlash -> NP -> VP ComplSlash vps np = vps ** { s = \\vf,pol => - vps.s ! vf ! pol - ++ applyPrep vps.c2 np ++ vps.adjCompl - -- s = \\vf,pol => vps.s ! vf ! pol ++ applyPrep vps.c2 np + vps.s ! vf ! pol ++ applyPrep vps.c2 np ++ vps.adjCompl } ; - -- : VV -> VPSlash -> VPSlash ; SlashVV vv vps = ComplVV vv vps ** { c2 = vps.c2 ; -- like ComplVV except missing object @@ -141,7 +148,12 @@ lin AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ; -} -- : VP -> Prep -> VPSlash ; -- live in (it) - -- VPSlashPrep vp prep = vp ** {c2 = prep} ; + VPSlashPrep vp prep = vp ** { + s = \\vf,pol => vp.s ! vf ! pol ; + } ** { + c2 = prep ; + adjCompl =[] ; + } ; --2 Complements to copula @@ -152,10 +164,10 @@ lin CompAP ap = useComp ap.s ; -- : CN -> Comp ; - CompCN cn = useComp (cn.s ! NF Sg Bare) ; + CompCN cn = useCompN (cn.s ! NF Sg Bare) ; -- NP -> Comp ; - CompNP np = useComp (np.s ! Bare) ; + CompNP np = useCompN (np.s ! Bare) ; -- : Adv -> Comp ; --"Both bukan and tidak may negate prepositional phrases. The choice of either diff --git a/src/malay/unittest/complements.gftest b/src/malay/unittest/complements.gftest index 9e07837e..f5becfcb 100644 --- a/src/malay/unittest/complements.gftest +++ b/src/malay/unittest/complements.gftest @@ -4,6 +4,7 @@ LangMay: dia memberi kucing kepadaku Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (Slash3V3 give_V3 (UsePron i_Pron)) (MassNP (UseN cat_N))))) LangMay: dia memberi aku kucing +-- dia memberi aku kepada kucing -- Sentence complements diff --git a/src/malay/unittest/passive.gftest b/src/malay/unittest/passive.gftest index d0df9e0f..23d192a7 100644 --- a/src/malay/unittest/passive.gftest +++ b/src/malay/unittest/passive.gftest @@ -16,4 +16,4 @@ LangMay: buku itu dibaca Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN book_N)) (AdvVP (PassV2 read_V2) (PrepNP to_Prep (UsePron youSg_Pron)))) LangEng: that book is read to you -LangMay: buku itu dibacakan kepada kamu \ No newline at end of file +LangMay: buku itu dibaca kepadamu \ No newline at end of file diff --git a/src/malay/unittest/questions.gftest b/src/malay/unittest/questions.gftest index 76c47836..78634e9d 100644 --- a/src/malay/unittest/questions.gftest +++ b/src/malay/unittest/questions.gftest @@ -8,7 +8,7 @@ LangMay: kamu suka lagu-lagu yang mana Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestSlash (IdetCN how8many_IDet (UseN cat_N)) (SlashVP (UsePron youPl_Pron) (SlashV2a have_V2))))) NoVoc LangEng: how many cats do you have -LangMay: kamu ada berapa kucing +LangMay: kamu ada berapa banyak kucing Lang: PhrUtt NoPConj (UttIP (IdetCN how8many_IDet (UseN cat_N))) NoVoc LangEng: how many cats @@ -70,4 +70,12 @@ LangMay: mengapa dia makan daging Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN meat_N) (UseRCl (TTAnt TPast ASimul) PPos (RelVP IdRP (PassV2 eat_V2)))))))) LangEng: what was the meat that was eaten -LangMay: apa daging yang dimakan \ No newline at end of file +LangMay: apa daging yang dimakan + +AllEngAbs: (PassAgentVPSlash (SlashV2V beg_V2V (UseV go_V)) (UsePron i_Pron)) +AllEng: be begged to go by me +AllMay: dirayu untuk pergi olehku + +AllEngAbs: (PassVPSlash (SlashV2V beg_V2V (UseV sleep_V))) +AllEng: be begged to sleep +AllMay: dirayu untuk tidur \ No newline at end of file diff --git a/src/malay/unittest/relative.gftest b/src/malay/unittest/relative.gftest index be6748d6..552309cc 100644 --- a/src/malay/unittest/relative.gftest +++ b/src/malay/unittest/relative.gftest @@ -49,7 +49,7 @@ LangMay: bapanya memberi buku kepadanya -- 2. A book that her father gave her -- TODO: would it be better as "buku yang bapanya beri kepadanya"? (Or any other variation?) Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash3V3 give_V3 (UsePron she_Pron)))))) -LangMay: buku yang bapanya memberi kepada dia +LangMay: buku yang bapanya memberi kepadanya -- The preposition "kepada" comes from the definition of give_V3 in LexiconMay.gf. -- If "buku yang bapanya beri kepadanya" is correct in general, but sometimes @@ -64,7 +64,7 @@ LangMay: buku yang bapanya memberi kepada dia -- I want to read the book that my father gave me -- TODO check: would "aku mahu baca buku yang bapaku beri kepadaku" be better? Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron i_Pron))) (Slash3V3 give_V3 (UsePron i_Pron))))))))) -LangMay: aku mahu membaca buku yang bapaku memberi kepada aku +LangMay: aku mahu membaca buku yang bapaku memberi kepadaku -- I want to read the book that my father read Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron i_Pron))) (SlashV2a read_V2)))))))) diff --git a/src/malay/unittest/tenses.gftest b/src/malay/unittest/tenses.gftest index da1b8df1..c0f5df54 100644 --- a/src/malay/unittest/tenses.gftest +++ b/src/malay/unittest/tenses.gftest @@ -13,8 +13,9 @@ Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (Use LangEng: the cat will walk LangMay: kucing akan berjalan -Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (UseV go_V)) (UsePron she_Pron)) +Lang: UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (UseV go_V)) (DetNP (DetQuant (PossPron she_Pron) NumPl))))) LangEng: I begged her to go +LangMay: aku merayu dia untuk pergi ------------- -- Conditions diff --git a/src/malay/unittest/verbal_affixes.gftest b/src/malay/unittest/verbal_affixes.gftest index 26e1c5df..d9e17d4d 100644 --- a/src/malay/unittest/verbal_affixes.gftest +++ b/src/malay/unittest/verbal_affixes.gftest @@ -108,14 +108,14 @@ LangMay: sekiranya tidak hujan sekarang , aku akan berjalan Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a open_V2) (DetCN (DetQuant DefArt NumSg) (UseN door_N)))) LangEng: open the door -LangMay: buka pintu +LangMay: bukakan pintu Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a open_V2) (DetCN (DetQuant DefArt NumSg) (UseN door_N)))) LangEng: don't open the door -LangMay: jangan buka pintu +LangMay: jangan bukakan pintu Lang: UttImpPol PPos (ImpVP (ComplSlash (SlashV2a open_V2) (DetCN (DetQuant DefArt NumSg) (UseN door_N)))) LangEng: open the door -LangMay: bukakan pintu +LangMay: tolong bukakan pintu ---------------------------------------- -- Questions diff --git a/src/morphodict/MorphoDictAra.gf b/src/morphodict/MorphoDictAra.gf new file mode 100644 index 00000000..a94708a7 --- /dev/null +++ b/src/morphodict/MorphoDictAra.gf @@ -0,0 +1,144 @@ +resource MorphoDictAra = CatAra ** open ParadigmsAra, SyntaxAra, (S=StructuralAra), (L=LexiconAra) in { + +--- this should be abstract + concrete, but this serves the first purpose to support WordNetAra. +-- AR 2024-02-08 + +oper 'صِينِيَّة_N' = wmkN { g = fem ; sg = "صِينِيَّة" } ; +oper 'دارِيَّة_N' = wmkN { g = fem ; sg = "دارِيَّة" } ; +oper 'تَطْوِير_N' = wmkN { g = masc ; sg = "تَطْوِير" } ; +oper 'إِيطالِيَّة_N' = wmkN { g = fem ; sg = "إِيطالِيَّة" } ; +oper 'كَرون_N' = wmkN { g = fem ; sg = "كَرون" } ; +oper 'لاتفية_N' = wmkN { g = fem ; sg = "لاتفية" } ; +oper 'وَصِي_N' = wmkN { g = masc ; pl = "أوصياء" ; sg = "وَصِي" } ; +oper 'اِحْتِياطَي_N' = wmkN { g = masc ; sg = "اِحْتِياطَي" } ; +oper 'إِسْبانِيَّة_N' = wmkN { g = fem ; sg = "إِسْبانِيَّة" } ; +oper 'إِرْهابِي_N' = wmkN { g = masc ; sg = "إِرْهابِي" } ; +oper 'عَاصِمَة_N' = wmkN { g = fem ; pl = "عَوَاصِم" ; root = "عصم" ; sg = "عَاصِمَة" } ; +oper 'رِعايَة_N' = wmkN { g = fem ; root = "رعي" ; sg = "رِعايَة" } ; +oper 'طِفْل_N' = wmkN { g = masc ; pl = "أَطْفَال" ; root = "طفل" ; sg = "طِفْل" } ; +oper 'طِفْل_N' = wmkN { g = masc ; pl = "أَطْفَال" ; root = "طفل" ; sg = "طِفْل" } ; +oper 'مَدِينَة_N' = wmkN { g = fem ; pl = "مُدُن" ; root = "مدن" ; sg = "مَدِينَة" } ; +oper 'دَوْلَة_N' = wmkN { g = fem ; pl = "دُوَل" ; sg = "دَوْلَة" } ; +oper 'دَوْلَة_N' = wmkN { g = fem ; pl = "دُوَل" ; sg = "دَوْلَة" } ; +oper 'ثَقَافَة_N' = wmkN { g = fem ; pl = "ثَقَافَات" ; root = "ثقف" ; sg = "ثَقَافَة" } ; +oper 'اِنْخِفَاض_N' = wmkN { g = masc ; pl = "اِنْخِفَاضَات" ; sg = "اِنْخِفَاض" } ; +oper 'تَوْزِيع_N' = wmkN { g = masc ; sg = "تَوْزِيع" } ; +oper 'اِقْتِصَاد_N' = wmkN { g = masc ; sg = "اِقْتِصَاد" } ; +oper 'تَعْلِيم_N' = wmkN { g = masc ; pl = "تَعْلِيماتٌ" ; root = "علم" ; sg = "تَعْلِيم" } ; +oper 'خُصُوبَة_N' = wmkN { g = fem ; root = "خصب" ; sg = "خُصُوبَة" } ; +oper 'طَعَام_N' = wmkN { g = masc ; pl = "أَطْعِمَة" ; root = "طعم" ; sg = "طَعَام" } ; +oper 'حُرِّيَّة_N' = wmkN { g = fem ; pl = "حُرِّيَّات" ; root = "حرر" ; sg = "حُرِّيَّة" } ; +oper 'حُكُومَة_N' = wmkN { g = fem ; pl = "حُكُومَات" ; root = "حكم" ; sg = "حُكُومَة" } ; +oper 'نُمُو_N' = wmkN { g = masc ; root = "نمو" ; sg = "نُمُو" } ; +oper 'صِحِّيَّة_N' = wmkN { g = fem ; sg = "صِحِّيَّة" } ; +oper 'إِنْسَان_N' = wmkN { g = masc ; pl = "أَنَاسِيّ" ; root = "ءنس" ; sg = "إِنْسَان" } ; +oper 'كِيلُومِتْر_N' = wmkN { g = masc ; pl = "كِيلُومِتْرَات" ; sg = "كِيلُومِتْر" } ; +oper 'لُغَة_N' = wmkN { g = fem ; pl = "لُغَات" ; root = "لغو" ; sg = "لُغَة" } ; +oper 'قَائِد_N' = wmkN { g = masc ; pl = "قَائِدُونَ" ; sg = "قَائِد" } ; +oper 'عُضْو_N' = wmkN { g = masc ; pl = "أَعْضَاء" ; root = "عضو" ; sg = "عُضْو" } ; +oper 'وَزِير_N' = wmkN { g = masc ; pl = "وُزَرَاء" ; root = "وزر" ; sg = "وَزِير" } ; +oper 'جَرِيدَة_N' = wmkN { g = fem ; pl = "جَرَائِد" ; root = "جرد" ; sg = "جَرِيدَة" } ; +oper 'مَكْتَب_N' = wmkN { g = masc ; pl = "مَكاتِب" ; root = "كتب" ; sg = "مَكْتَب" } ; +oper 'سِيَاسَة_N' = wmkN { g = fem ; pl = "سِيَاسَات" ; root = "سوس" ; sg = "سِيَاسَة" } ; +oper 'جُنَيْه_N' = wmkN { g = masc ; pl = "جُنَيْهَات" ; sg = "جُنَيْه" } ; +oper 'تَأْجِير_N' = wmkN { g = masc ; root = "ءجر" ; sg = "تَأْجِير" } ; +oper 'رِيَاضَة_N' = wmkN { g = fem ; pl = "رِيَاضَات" ; root = "روض" ; sg = "رِيَاضَة" } ; +oper 'نِظَام_N' = wmkN { g = masc ; pl = "نُظُم" ; root = "نظم" ; sg = "نِظَام" } ; +oper 'ضَرِيبَة_N' = wmkN { pl = "ضَرَائِب" ; root = "ضرب" ; sg = "ضَرِيبَة" } ; +oper 'وَحْدَة_N' = wmkN { g = fem ; pl = "وَحَدَات" ; sg = "وَحْدَة" } ; +oper 'قِيمَة_N' = wmkN { g = fem ; pl = "قِيَم" ; root = "قوم" ; sg = "قِيمَة" } ; +oper 'اِمْرَأَة_N' = wmkN { g = fem ; pl = "نِسَاء" ; root = "مرء" ; sg = "اِمْرَأَة" } ; +oper 'أَفْغَانِي_N' = wmkN { g = masc ; pl = "أَفْغَان" ; sg = "أَفْغَانِي" } ; +oper 'آشُورِي_N' = wmkN { g = masc ; pl = "آشُورِيُّون" ; sg = "آشُورِي" } ; +oper 'مَنْع_N' = wmkN { g = masc ; root = "منع" ; sg = "مَنْع" } ; +oper 'بِيلَارُوسِي_N' = wmkN { g = masc ; sg = "بِيلَارُوسِي" } ; +oper 'حُدُود_N' = wmkN { g = fem ; sg = "حُدُود" } ; +oper 'بُلْغَارِيَّة_N' = wmkN { g = fem ; pl = "بُلْغَارِيَّات" ; sg = "بُلْغَارِيَّة" } ; +oper 'رَئِيس_N' = wmkN { g = masc ; pl = "رُؤَسَاء" ; root = "رءس" ; sg = "رَئِيس" } ; +oper 'نَصْرَانِيَّة_N' = wmkN { g = fem ; sg = "نَصْرَانِيَّة" } ; +oper 'هُولَنْدِي_N' = wmkN { g = masc ; pl = "هُولَنْدِيُّونَ" ; sg = "هُولَنْدِي" } ; +oper 'مُسَاوَاة_N' = wmkN { g = fem ; sg = "مُسَاوَاة" } ; +oper 'عَيْب_N' = wmkN { g = masc ; pl = "عُيُوب" ; sg = "عَيْب" } ; +oper 'دَقِيق_N' = wmkN { g = masc ; sg = "دَقِيق" } ; +oper 'فَرَنْسِيَّة_N' = wmkN { g = fem ; pl = "فَرَنْسِيَّات" ; sg = "فَرَنْسِيَّة" } ; +oper 'فُنْدُق_N' = wmkN { g = masc ; pl = "فَنَادِق" ; sg = "فُنْدُق" } ; +oper 'فِهْرِس_N' = wmkN { g = masc ; pl = "فَهَارِس" ; sg = "فِهْرِس" } ; +oper 'تَضَخُّم_N' = wmkN { g = masc ; root = "ضخم" ; sg = "تَضَخُّم" } ; +oper 'مَوْضِع_N' = wmkN { g = masc ; pl = "مَوَاضِع" ; root = "وضع" ; sg = "مَوْضِع" } ; +oper 'رَئِيس_N' = wmkN { g = masc ; pl = "رُؤَسَاء" ; root = "رءس" ; sg = "رَئِيس" } ; +oper 'رَئِيس_N' = wmkN { g = masc ; pl = "رُؤَسَاء" ; root = "رءس" ; sg = "رَئِيس" } ; +oper 'مُنْتَج_N' = wmkN { g = masc ; pl = "مُنْتَجَات" ; sg = "مُنْتَج" } ; +oper 'مَلِكَة_N' = wmkN { g = fem ; pl = "مَلِكَات" ; sg = "مَلِكَة" } ; +oper 'مُعَدَّل_N' = wmkN { g = masc ; root = "عدل" ; sg = "مُعَدَّل" } ; +oper 'مُعَدَّل_N' = wmkN { g = masc ; root = "عدل" ; sg = "مُعَدَّل" } ; +oper 'مَاء_N' = wmkN { g = masc ; pl = "مِيَاه" ; root = "موه" ; sg = "مَاء" } ; +oper 'عَالَم_N' = wmkN { g = masc ; pl = "عَالَمُون" ; sg = "عَالَم" } ; +oper 'عَالَم_N' = wmkN { g = masc ; pl = "عَالَمُون" ; sg = "عَالَم" } ; +oper 'مَنْطِقَة_N' = wmkN { g = fem ; pl = "مَنْطِقَات" ; root = "نطق" ; sg = "مَنْطِقَة" } ; +oper 'كِتَاب_N' = wmkN { g = masc ; pl = "كُتُب" ; sg = "كِتَاب" } ; +oper 'عُمْلَة_N' = wmkN { g = fem ; pl = "عُمْلَات" ; root = "عمل" ; sg = "عُمْلَة" } ; +oper 'دِيمُقْرَاطِيَّة_N' = wmkN { g = fem ; pl = "دِيمُقْرَاطِيَّات" ; sg = "دِيمُقْرَاطِيَّة" } ; +oper 'شَرْق_N' = wmkN { g = masc ; sg = "شَرْق" } ; +oper 'رَأْس_N' = wmkN { g = masc ; pl = "رُؤُوس" ; sg = "رَأْس" } ; +oper 'سُكّان_N' = wmkN { g = fem ; sg = "سُكّان" } ; +oper 'مَلَكِيَّة_N' = wmkN { g = fem ; pl = "مَلَكِيَّات" ; root = "ملك" ; sg = "مَلَكِيَّة" } ; +oper 'سُكّان_N' = wmkN { g = fem ; sg = "سُكّان" } ; +oper 'جُمْهُورِيَّة_N' = wmkN { g = fem ; pl = "جُمْهُورِيَّات" ; sg = "جُمْهُورِيَّة" } ; +oper 'رُوسِيَّة_N' = wmkN { g = fem ; pl = "رُوسِيَّات" ; sg = "رُوسِيَّة" } ; +oper 'جَنُوب_N' = wmkN { g = masc ; root = "جنب" ; sg = "جَنُوب" } ; +oper 'تَايْلَانْدِيَّة_N' = wmkN { g = fem ; sg = "تَايْلَانْدِيَّة" } ; +oper 'تُرْكِيَّة_N' = wmkN { g = fem ; sg = "تُرْكِيَّة" } ; +oper 'سَنَة_N' = wmkN { g = fem ; pl = "سَنَوَات" ; sg = "سَنَة" } ; +oper 'دَخْل_N' = wmkN { g = masc ; sg = "دَخْل" } ; +oper 'شَمَال_N' = wmkN { g = fem ; root = "شمل" ; sg = "شَمَال" } ; +oper 'عَلَم_N' = wmkN { g = masc ; pl = "أَعْلَام" ; sg = "عَلَم" } ; +oper 'دِين_N' = wmkN { g = masc ; pl = "أَدْيَان" ; sg = "دِين" } ; +oper 'أُم_N' = wmkN { g = fem ; pl = "أُمَّهَات" ; root = "ءمم" ; sg = "أُم" } ; +oper 'نَشَاء_N' = wmkN { g = masc ; root = "نشو" ; sg = "نَشَاء" } ; +oper 'عُمْر_N' = wmkN { g = masc ; pl = "أَعْمَار" ; root = "عمر" ; sg = "عُمْر" } ; +oper 'غَرْب_N' = wmkN { g = masc ; sg = "غَرْب" } ; +oper 'مَلِك_N' = wmkN { g = masc ; pl = "مُلُوك" ; sg = "مَلِك" } ; +oper 'بِير_N' = wmkN { g = masc ; pl = "بيرات" ; sg = "بِير" } ; +oper 'مُضاف_A' = wmkA { fem_sg = "nan" ; masc_sg = "مُضاف" } ; +oper 'اِسْتِبْدادِي_A' = wmkA { fem_sg = "nan" ; masc_sg = "اِسْتِبْدادِي" } ; +oper 'الوَسِيط_A' = wmkA { fem_sg = "nan" ; masc_sg = "الوَسِيط" } ; +oper 'الشَّمال_A' = wmkA { fem_sg = "nan" ; masc_sg = "الشَّمال" } ; +oper 'مَحَلِّي_A' = wmkA { fem_pl = "مَحَلِّيَّات" ; fem_sg = "مَحَلِّيَّة" ; masc_pl = "مَحَلِّيُّون" ; masc_sg = "مَحَلِّي" } ; +oper 'تَالِي_A' = wmkA { fem_sg = "تَالِية" ; masc_sg = "تَالِي" } ; +oper 'مُمْتَلِئ_A' = wmkA { fem_pl = "مُمْتَلِئَات" ; fem_sg = "مُمْتَلِئَة" ; masc_pl = "مُمْتَلِئُون" ; masc_sg = "مُمْتَلِئ" ; root = "ملء" } ; +oper 'إِجْمَالِي_A' = wmkA { fem_pl = "إِجْمَالِيَّات" ; fem_sg = "إِجْمَالِيَّة" ; masc_pl = "إِجْمَالِيُّون" ; masc_sg = "إِجْمَالِي" ; root = "جمل" } ; +oper 'فَرْدِي_A' = wmkA { fem_pl = "فَرْدِيَّات" ; fem_sg = "فَرْدِيَّة" ; masc_pl = "فَرْدِيُّون" ; masc_sg = "فَرْدِي" ; root = "فرد" } ; +oper 'مُعْتَدِل_A' = wmkA { fem_pl = "مُعْتَدِلَات" ; fem_sg = "مُعْتَدِلَة" ; masc_pl = "مُعْتَدِلُون" ; masc_sg = "مُعْتَدِل" ; root = "عدل" } ; +oper 'مُطْلَق_A' = wmkA { fem_pl = "مُطْلَقَات" ; fem_sg = "مُطْلَقَة" ; masc_pl = "مُطْلَقُون" ; masc_sg = "مُطْلَق" ; root = "طلق" } ; +oper 'حَاكِم_A' = wmkA { fem_pl = "حَاكِمَات" ; fem_sg = "حَاكِمَة" ; masc_pl = "حَاكِمُون" ; masc_sg = "حَاكِم" ; root = "حكم" } ; +oper 'شُيُوعِي_A' = wmkA { fem_pl = "شُيُوعِيَّات" ; fem_sg = "شُيُوعِيَّة" ; masc_pl = "شُيُوعِيُّون" ; masc_sg = "شُيُوعِي" } ; +oper 'دُسْتُورِي_A' = wmkA { fem_pl = "دُسْتُورِيَّات" ; fem_sg = "دُسْتُورِيَّة" ; masc_pl = "دُسْتُورِيُّون" ; masc_sg = "دُسْتُورِي" } ; +oper 'دِيمُقْرَاطِي_A' = wmkA { fem_pl = "دِيمُقْرَاطِيَّات" ; fem_sg = "دِيمُقْرَاطِيَّة" ; masc_pl = "دِيمُقْرَاطِيُّون" ; masc_sg = "دِيمُقْرَاطِي" } ; +oper 'سَابِق_A' = wmkA { fem_pl = "سَابِقَات" ; fem_sg = "سَابِقَة" ; masc_pl = "سُبَّاق" ; masc_sg = "سَابِق" ; root = "سبق" } ; +oper 'عَالِي_A' = wmkA { fem_sg = "nan" ; masc_sg = "nan" } ; +oper 'كَبِير_A' = wmkA { fem_pl = "كَبِيرَات" ; fem_sg = "كَبِيرَة" ; masc_pl = "كُبَرَاء" ; masc_sg = "كَبِير" ; root = "كبر" } ; +oper 'قَلِيل_A' = wmkA { fem_pl = "قَلِيلَات" ; fem_sg = "قَلِيلَة" ; masc_pl = "أَقِلَّاء" ; masc_sg = "قَلِيل" ; root = "قلل" } ; +oper 'عَسْكَرِي_A' = wmkA { fem_pl = "عَسْكَرِيَّات" ; fem_sg = "عَسْكَرِيَّة" ; masc_pl = "عَسَاكِر" ; masc_sg = "عَسْكَرِي" } ; +oper 'وَاجِب_A' = wmkA { fem_pl = "وَاجِبَات" ; fem_sg = "وَاجِبَة" ; masc_pl = "وَاجِبُون" ; masc_sg = "وَاجِب" ; root = "وجب" } ; +oper 'بَرْلَمَانِي_A' = wmkA { fem_pl = "بَرْلَمَانِيَّات" ; fem_sg = "بَرْلَمَانِيَّة" ; masc_pl = "بَرْلَمَانِيُّون" ; masc_sg = "بَرْلَمَانِي" } ; +oper 'مَجْمُوع_A' = wmkA { fem_pl = "مَجْمُوعَات" ; fem_sg = "مَجْمُوعَة" ; masc_pl = "مَجْمُوعُون" ; masc_sg = "مَجْمُوع" ; root = "جمع" } ; +oper 'عَرَبِي_A' = wmkA { fem_pl = "عَرَبِيَّات" ; fem_sg = "عَرَبِيَّة" ; masc_pl = "عَرَب" ; masc_sg = "عَرَبِي" } ; +oper 'حُر_A' = wmkA { fem_pl = "حُرَّات" ; fem_sg = "حُرَّة" ; masc_pl = "أَحْرَار" ; masc_sg = "حُر" ; root = "حرر" } ; +oper 'هَجِين_A' = wmkA { fem_pl = "هَجَائِن" ; fem_sg = "هَجِين" ; masc_pl = "هِجَان" ; masc_sg = "هَجِين" ; root = "هجن" } ; +oper 'رَسْمِي_A' = wmkA { fem_pl = "رَسْمِيَّات" ; fem_sg = "رَسْمِيَّة" ; masc_pl = "رَسْمِيُّون" ; masc_sg = "رَسْمِي" } ; +oper 'رَسْمِي_A' = wmkA { fem_pl = "رَسْمِيَّات" ; fem_sg = "رَسْمِيَّة" ; masc_pl = "رَسْمِيُّون" ; masc_sg = "رَسْمِي" } ; +oper 'أُرْثُوذُكْسِيَّة_A' = wmkA { fem_sg = "nan" ; masc_sg = "nan" } ; +oper 'مُرَبَّع_A' = wmkA { fem_pl = "مُرَبَّعَات" ; fem_sg = "مُرَبَّعَة" ; masc_pl = "مُرَبَّعُون" ; masc_sg = "مُرَبَّع" } ; +oper 'مُسْلِم_A' = wmkA { fem_pl = "مُسْلِمَات" ; fem_sg = "مُسْلِمَة" ; masc_pl = "مُسْلِمُون" ; masc_sg = "مُسْلِم" ; root = "سلم" } ; +oper 'حَاضِر_A' = wmkA { fem_pl = "حَاضِرَات" ; fem_sg = "حَاضِرَة" ; masc_pl = "حُضُور" ; masc_sg = "حَاضِر" ; root = "حضر" } ; +oper 'مُمَثِّل_A' = wmkA { fem_sg = "مُمَثِّلة" ; masc_sg = "مُمَثِّل" ; root = "مثل" } ; +oper 'اِعْتَبَر_V' = wmkV { cls = FormVIII ; imperfect = "يَعْتَبِر" ; perfect = "اِعْتَبَر" ; root = "عبر" } ; +oper 'نَجَح_V' = wmkV { cls = FormI ; imperfect = "يَنْجَح" ; perfect = "نَجَح" ; root = "نجح" } ; +oper 'صَنَّف_V' = wmkV { cls = FormII ; imperfect = "يُصَنِّف" ; perfect = "صَنَّف" ; root = "صنف" } ; +oper 'عَيَّن_V' = wmkV { cls = FormII ; imperfect = "يُعَيِّن" ; perfect = "عَيَّن" ; root = "عين" } ; +oper 'وَصَل_V' = wmkV { cls = FormI ; imperfect = "يَصِل" ; perfect = "وَصَل" ; root = "وصل" } ; +oper 'تَكَلَّم_V' = wmkV { cls = FormV ; imperfect = "يَتَكَلَّم" ; perfect = "تَكَلَّم" ; root = "كلم" } ; +oper 'مَلَك_V' = wmkV { cls = FormI ; imperfect = "يَمْلِك" ; perfect = "مَلَك" ; root = "ملك" } ; +oper 'عَرَض_V' = wmkV { cls = FormI ; imperfect = "يَعْرِض" ; perfect = "عَرَض" ; root = "عرض" } ; + +} diff --git a/src/portuguese/NumeralPor.gf b/src/portuguese/NumeralPor.gf index b1ddce78..91e0abd3 100644 --- a/src/portuguese/NumeralPor.gf +++ b/src/portuguese/NumeralPor.gf @@ -189,11 +189,12 @@ concrete NumeralPor of Numeral = CatPor [Numeral,Digits,Decimal] ** Dig = TDigit ; lin - IDig d = d ; + IDig d = d ** {tail = T1} ; IIDig d i = { - s = \\o => d.s ! NCard Masc ++ BIND ++ i.s ! o ; - n = Pl + s = \\o => d.s ! NCard Masc ++ spaceIf i.tail ++ i.s ! o ; + n = Pl ; + tail = inc i.tail } ; D_0 = mkDig "0" Sg ; @@ -215,12 +216,24 @@ concrete NumeralPor of Numeral = CatPor [Numeral,Digits,Decimal] ** } ; IFrac d i = { s = \\o => d.s ! NCard Masc ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ + if_then_Str d.hasDot BIND (BIND++","++BIND) ++ i.s ! o; n = Pl ; hasDot=True } ; + oper + spaceIf : DTail -> Str = \t -> case t of { + T3 => SOFT_SPACE ; + _ => BIND + } ; + + inc : DTail -> DTail = \t -> case t of { + T1 => T2 ; + T2 => T3 ; + T3 => T1 + } ; + oper mk4Dig : Str -> Str -> Str -> Number -> TDigit = \c,o,a,n -> { s = table { diff --git a/src/romance/CatRomance.gf b/src/romance/CatRomance.gf index dc56e066..9395627a 100644 --- a/src/romance/CatRomance.gf +++ b/src/romance/CatRomance.gf @@ -89,7 +89,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol,MU] -- Numeral Numeral = {s : CardOrd => Str ; n : Number} ; - Digits = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ; Decimal = {s : CardOrd => Str ; n : Number ; hasDot : Bool} ; -- Structural diff --git a/src/spanish/NumeralSpa.gf b/src/spanish/NumeralSpa.gf index dff59581..fbdb1ad2 100644 --- a/src/spanish/NumeralSpa.gf +++ b/src/spanish/NumeralSpa.gf @@ -114,11 +114,12 @@ param Dig = TDigit ; lin - IDig d = d ; + IDig d = d ** {tail = T1} ; IIDig d i = { - s = \\o => d.s ! NCard Masc ++ BIND ++ i.s ! o ; - n = Pl + s = \\o => d.s ! NCard Masc ++ spaceIf i.tail ++ i.s ! o ; + n = Pl ; + tail = inc i.tail } ; D_0 = mkDig "0" ; @@ -140,12 +141,24 @@ param } ; IFrac d i = { s = \\o => d.s ! NCard Masc ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ + if_then_Str d.hasDot BIND (BIND++","++BIND) ++ i.s ! o ; n = Pl ; hasDot=True } ; + oper + spaceIf : DTail -> Str = \t -> case t of { + T3 => SOFT_SPACE ; + _ => BIND + } ; + + inc : DTail -> DTail = \t -> case t of { + T1 => T2 ; + T2 => T3 ; + T3 => T1 + } ; + oper mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ; diff --git a/src/swedish/NumeralSwe.gf b/src/swedish/NumeralSwe.gf index 7e1d5e2e..d348d77a 100644 --- a/src/swedish/NumeralSwe.gf +++ b/src/swedish/NumeralSwe.gf @@ -1,3 +1,5 @@ +--# -path=.:../abstract + concrete NumeralSwe of Numeral = CatSwe [Numeral,Digits,Decimal] ** open ResSwe, MorphoSwe, Prelude in { flags coding=utf8 ; @@ -50,21 +52,24 @@ lin {s = \\g => n.s ! invNum ++ BIND ++ "tusen" ++ m.s ! g ; n = Pl} ; pot3as4 n = n ; - pot41 = numPl (cardOrd "miljon" "miljonde") ; + pot41 = numPl (cardOrd "en miljon" "miljonde") ; pot4 n = numPl (\\g => n.s ! NCard Utr ++ cardOrd (case n.n of { Sg => "miljon" ; Pl => "miljoner" }) - "miljonde" ! g) ; + "miljonte" ! g) ; pot4plus n m = - {s = \\g => n.s ! NCard Utr ++ BIND ++ "miljon" ++ m.s ! g ; n = Pl} ; + {s = \\g => n.s ! NCard Utr ++ case n.n of { + Sg => "miljon" ; + Pl => "miljoner" + } ++ m.s ! g ; n = Pl} ; pot4as5 n = n ; pot4decimal d = - numPl (\\g => d.s ! NCard Utr ++ cardOrd "miljoner" "miljonde" ! g) ; + numPl (\\g => d.s ! NCard Utr ++ cardOrd "miljoner" "miljonte" ! g) ; - pot51 = numPl (cardOrd "miljard" "miljarde") ; + pot51 = numPl (cardOrd "en miljard" "miljarde") ; pot5 n = numPl (\\g => n.s ! NCard Utr ++ cardOrd (case n.n of { @@ -73,7 +78,7 @@ lin }) "miljarde" ! g) ; pot5plus n m = - {s = \\g => n.s ! NCard Utr ++ BIND ++ "miljard" ++ m.s ! g ; n = Pl} ; + {s = \\g => n.s ! NCard Utr ++ "miljard" ++ m.s ! g ; n = Pl} ; pot5decimal d = numPl (\\g => d.s ! NCard Utr ++ cardOrd "miljarder" "miljarde" ! g) ; diff --git a/tests/german/TestLangGer.gf b/tests/german/TestLangGer.gf index 52213c97..80e24c52 100644 --- a/tests/german/TestLangGer.gf +++ b/tests/german/TestLangGer.gf @@ -69,6 +69,7 @@ concrete TestLangGer of TestLang = s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ (vp.nn ! agrP3 Sg).p4 ++ vp.adj ++ vp.a2 ++ vp.inf.inpl.p2 ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; adj = [] ; @@ -183,7 +184,7 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa s = \\m,t,a,p => let cls = slash.s ! m ! t ! a ! p ; - who = appPrepC slash.c2 ip.s ; + who = appPrep slash.c2 ip.s ; in table { QDir => who ++ cls ! Inv ! (RGenNum gn); QIndir => who ++ cls ! Sub ! (RGenNum gn) @@ -201,10 +202,10 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa } ; SlashVS np vs slash = - let subj = mkSubj np PrepNom ; + let subj = mkSubject np PrepNom ; vps = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs) ** {c2 = slash.c2 ; objCtrl = False} -- default objCtrl guessed - in mkClSlash subj.p1 subj.p2 vps ; + in mkClSlash subj.s subj.a vps ; UseSlash t p cl = { s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o ! RSentence ; @@ -213,9 +214,9 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa oper gnToAgr : RelGenNum -> Agr = \gn -> - case gn of {RGenNum (GSg g) => Ag g Sg P3 ; - RGenNum GPl => Ag Neutr Pl P3 ; - RSentence => Ag Neutr Sg P3} ; + case gn of {RGenNum (GSg g) => AgSgP3 g ; + RGenNum GPl => AgPl P3 ; + RSentence => AgSgP3 Neutr} ; mkClSlash : Str -> Agr -> ResGer.VPSlash -> ClauseSlash = \subj,agr,vp -> @@ -227,7 +228,8 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa Sub => True ; -- glue prefix to verb _ => False } ; - verb = vps.s ! ord ! agr ! VPFinite m t a ; + vagr = agr2vagr agr ; + verb = vps.s ! ord ! vagr ! VPFinite m t a ; haben = verb.inf2 ; neg = negation ! b ; ag : Agr = case vp.objCtrl of {True => gnToAgr gn ; _ => agr} ; diff --git a/tests/german/TestLexiconEng.gf b/tests/german/TestLexiconEng.gf index 0f485244..e7c22293 100644 --- a/tests/german/TestLexiconEng.gf +++ b/tests/german/TestLexiconEng.gf @@ -51,8 +51,6 @@ lin kaufen_bei_fuer_V4 = dirV4 (irregV "buy" "bought" "bought") (mkPrep "from") (mkPrep "for") ; mieten_von_fuer_V4 = dirV4 (regV "rent") (mkPrep "from") (mkPrep "for") ; - neugierig_auf_A2 = mkA2 (regA "curious") (mkPrep "about") ; - wagen_VV = mkVV (regV "dare") ; -- typ=VVInf versuchen_VV = mkVV (irregV "try" "tried" "tried") ; -- typ=VVInf helfen_V2V = defaultV2V (regV "help") ; @@ -62,4 +60,10 @@ lin -- aci verb: sehen_V2V = mkV2V (I.see_V) ; hoeren_V2V = mkV2V (I.hear_V) ; + + -- Adjectives + + neugierig_auf_A2 = mkA2 (regA "curious") (mkPrep "about") ; + treu_A2 = mkA2 (compoundA (mkA "faithful")) (mkPrep "to") ; + stolz_A2 = mkA2 (mkA "proud" "prouder") (mkPrep "of") ; } diff --git a/tests/german/TestLexiconGer.gf b/tests/german/TestLexiconGer.gf index 38baf297..40bdbb22 100644 --- a/tests/german/TestLexiconGer.gf +++ b/tests/german/TestLexiconGer.gf @@ -55,8 +55,6 @@ lin kaufen_bei_fuer_V4 = dirV4 (regV "kaufen") bei_Prep fuer_Prep ; mieten_von_fuer_V4 = dirV4 (regV "mieten") von_Prep fuer_Prep ; - neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ; - -- verbs with infinitival object (non-modal): wagen_VV = mkVV (regV "wagen") ; versuchen_VV = mkVV (irregV "versuchen" "versucht" "versuchte" "versuchte" "versucht") ; @@ -72,4 +70,11 @@ lin -- aci verb: sehen_V2V = auxV2V (irregV "sehen" "sieht" "sah" "sähe" "gesehen") accPrep ; hoeren_V2V = auxV2V (regV "hören") accPrep ; + + -- Adjectives + + neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ; + treu_A2 = mkA2 (mk3A "treu" "treuer" "treueste") datPrep ; + stolz_A2 = mkA2 (mk3A "stolz" "stolzer" "stolzeste") (mkPrep "auf" accusative) ; + } diff --git a/tests/german/TestLexiconGerAbs.gf b/tests/german/TestLexiconGerAbs.gf index aa3113ee..c475c3ec 100644 --- a/tests/german/TestLexiconGerAbs.gf +++ b/tests/german/TestLexiconGerAbs.gf @@ -24,8 +24,6 @@ fun entschuldigen_bei_fuer_rV3 : V3 ; raechen_am_fuer_rV3 : V3 ; - neugierig_auf_A2 : A2 ; - wagen_VV : VV ; versuchen_VV : VV ; @@ -43,4 +41,10 @@ fun kaufen_bei_fuer_V4 : V4 ; mieten_von_fuer_V4 : V4 ; + -- Adjectives + + neugierig_auf_A2 : A2 ; + treu_A2 : A2 ; -- Ger: dative complement + stolz_A2 : A2 ; + }