diff --git a/src/hindi/AllHin.gf b/src/hindi/AllHin.gf index 6dfe4e966..4f33ab208 100644 --- a/src/hindi/AllHin.gf +++ b/src/hindi/AllHin.gf @@ -2,5 +2,5 @@ concrete AllHin of AllHinAbs = LangHin, - ExtendHin + ExtendHin -- # notpresent ** open ExtraHin in {} ; diff --git a/src/hindi/ConstructionHin.gf b/src/hindi/ConstructionHin.gf index 316b63a86..375000c92 100644 --- a/src/hindi/ConstructionHin.gf +++ b/src/hindi/ConstructionHin.gf @@ -1,7 +1,8 @@ --# -path=.:../abstract concrete ConstructionHin of Construction = CatHin ** - open SyntaxHin, SymbolicHin, ParadigmsHin, (L = LexiconHin), (E = ExtraHin), (G = GrammarHin), (R = ResHin), (S = StructuralHin), Prelude in { + open SyntaxHin, SymbolicHin, ParadigmsHin, CommonHindustani, + (L = LexiconHin), (E = ExtraHin), (G = GrammarHin), (R = ResHin), (S = StructuralHin), Prelude in { flags coding=utf8 ; @@ -31,11 +32,22 @@ oper ---- is_right_VP = mkVP (ParadigmsHin.mkA "right") ; ---- is_wrong_VP = mkVP (ParadigmsHin.mkA "wrong") ; ----- n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; +lin + n_units_AP card cn a = { + s = \\n,g,c,d => card.s ++ cn.s ! Pl ! Dir ++ a.s ! n ! g ! c ! d + } ; + + n_units_of_NP card cn np = { + s = \\c => np.s ! NPC Obl ++ "के" ++ card.s ++ cn.s ! Pl ! constructionCase c ; + a = agrP3 cn.g card.n + } ; ---- bottle_of_CN np = mkCN (lin N2 (mkN2 "bottle")) (lin NP np) ; ----- cup_of_CN np = mkCN (lin N2 (mkN2 "cup")) (lin NP np) ; + cup_of_CN np = { + s = \\n,c => np.s ! NPC Obl ++ "का" ++ (mkN "प्याला").s ! n ! c ; + g = Masc + } ; ---- glass_of_CN np = mkCN (lin N2 (mkN2 "glass")) (lin NP np) ; {- @@ -65,14 +77,14 @@ lincat Year = NP ; lin -{- ---- - weekdayPunctualAdv w = SyntaxHin.mkAdv on_Prep (mkNP w) ; -- on Sunday - weekdayHabitualAdv w = SyntaxHin.mkAdv on_Prep (mkNP aPl_Det w) ; -- on Sundays - weekdayNextAdv w = SyntaxHin.mkAdv (mkPrep "next") (mkNP w) ; -- next Sunday - weekdayLastAdv w = SyntaxHin.mkAdv (mkPrep "last") (mkNP w) ; -- last Sunday + weekdayPunctualAdv w = {s = \\_ => w.s ! Sg ! Dir ++ "को"} ; + weekdayHabitualAdv w = {s = \\_ => "हर" ++ w.s ! Sg ! Dir ++ "को"} ; + weekdayNextAdv w = {s = \\_ => "अगले" ++ w.s ! Sg ! Dir ++ "को"} ; + weekdayLastAdv w = {s = \\_ => "पिछले" ++ w.s ! Sg ! Dir ++ "को"} ; - monthAdv m = SyntaxHin.mkAdv in_Prep (mkNP m) ; - yearAdv y = SyntaxHin.mkAdv in_Prep y ; + monthAdv m = {s = \\_ => m.s ! Sg ! Dir ++ "में"} ; + yearAdv y = {s = \\_ => y.s ! NPC Dir ++ "में"} ; +{- ---- dayMonthAdv d m = ParadigmsHin.mkAdv ("on" ++ d.s ! R.NPAcc ++ m.s ! R.Sg ! R.Nom) ; -- on 17 May monthYearAdv m y = SyntaxHin.mkAdv in_Prep (mkNP (mkCN m y)) ; -- in May 2012 dayMonthYearAdv d m y = ParadigmsHin.mkAdv ("on" ++ d.s ! R.NPAcc ++ m.s ! R.Sg ! R.Nom ++ y.s ! R.NPAcc) ; -- on 17 May 2013 @@ -95,6 +107,10 @@ lin oper mkLanguage : Str -> PN = \s -> mkPN s ; +oper constructionCase : NPCase -> Case = \c -> case c of { + NPC x => x ; NPObj => Obl ; NPErg => Obl + } ; + ---------------------------------------------- ---- lexicon of special names diff --git a/src/hindi/DiffHin.gf b/src/hindi/DiffHin.gf index 84aa19666..b1fec16a4 100644 --- a/src/hindi/DiffHin.gf +++ b/src/hindi/DiffHin.gf @@ -4,6 +4,11 @@ flags coding = utf8; oper addErgative s1 s2 = Prelude.glue s1 s2 ; + ergativePron ppf a = case a of { + Ag _ Pl Pers3_Distant => "उन्होंने" ; + Ag _ _ (Pers3_Near | Pers3_Distant) => addErgative (ppf ! Obl) nE ; + _ => addErgative (ppf ! Dir) nE + } ; conjThat = "कि" ; insertSubj : UPerson -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "वाँ" ; _ => Prelude.glue s "ए"}; -- check with prasad for vn~ @@ -12,6 +17,8 @@ oper awr = "और" ; ky = "की" ; ka = "का" ; + kE = "के" ; + rh = "रह" ; jn = "जिन" ; js = "जिस" ; jw = "जो" ; @@ -131,4 +138,4 @@ oper => "हुए" ; => "हुई" }; -} \ No newline at end of file +} diff --git a/src/hindi/ExtendHin.gf b/src/hindi/ExtendHin.gf index ee9e50b1e..4e94b55e7 100644 --- a/src/hindi/ExtendHin.gf +++ b/src/hindi/ExtendHin.gf @@ -3,9 +3,191 @@ concrete ExtendHin of Extend = CatHin ** ExtendFunctor - [ - ComplDirectVQ, ComplDirectVS + ComplDirectVQ, ComplDirectVS, + BaseVPS, ConsVPS, MkVPS, ConjVPS, PredVPS, + BaseVPI, ConsVPI, MkVPI, ConjVPI, ComplVPIVV, + BaseComp, ConsComp, ConjComp, BaseImp, ConsImp, ConjImp, + PresPartAP, PastPartAP, PastPartAgentAP, + PassVPSlash, PassAgentVPSlash, ProgrVPSlash, + ReflRNP, ReflPron, ReflPoss, PredetRNP, + AdvRNP, AdvRVP, AdvRAP, ReflA2RNP, PossPronRNP, + CompoundN, CompoundAP, GerundCN, GerundNP, GerundAdv, + WithoutVP, ByVP, InOrderToVP, ApposNP, PositAdVAdj, + UseDAP, UseDAPMasc, UseDAPFem ] with - (Grammar = GrammarHin) ** { + (Grammar = GrammarHin) ** + open Prelude, CommonHindustani, ResHin, ParadigmsHin, Coordination, + (G = GrammarHin) in { + +{- +-} --# notpresent + +lincat + VPS = {s : Agr => Str ; c : NPCase} ; + [VPS] = {s1,s2 : Agr => Str ; c : NPCase} ; + VPI = {s : Agr => Str} ; + [VPI] = {s1,s2 : Agr => Str} ; + [Comp] = {s1,s2 : Agr => Str} ; + [Imp] = {s1,s2 : CPolarity => ImpForm => Str} ; + +lin + MkVPS temp pol vp = { + s = \\a => (mkSClause [] a vp).s ! tenseOf temp ! pol.p ! ODir ; + c = case of { + => NPErg ; + => NPErg ; + _ => NPC Dir + } + } ; + BaseVPS x y = twoTable Agr x y ** {c = x.c} ; + ConsVPS x xs = consrTable Agr comma x xs ** {c = xs.c} ; + ConjVPS conj xs = conjunctDistrTable Agr conj xs ** {c = xs.c} ; + PredVPS np vps = {s = np.s ! vps.c ++ vps.s ! np.a} ; + + MkVPI vp = {s = \\a => infVP False vp a} ; + BaseVPI = twoTable Agr ; + ConsVPI = consrTable Agr comma ; + ConjVPI = conjunctDistrTable Agr ; + ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! a) (predV vv) ; + + BaseComp = twoTable Agr ; + ConsComp = consrTable Agr comma ; + ConjComp = conjunctDistrTable Agr ; + + BaseImp = twoTable2 CPolarity ImpForm ; + ConsImp = consrTable2 CPolarity ImpForm comma ; + ConjImp = conjunctDistrTable2 CPolarity ImpForm ; + + PresPartAP vp = partAP vp ; + PastPartAP vp = pastAP vp [] ; + PastPartAgentAP vp np = pastAP vp (np.s ! NPC Obl ++ "के द्वारा") ; + + PassVPSlash vp = passiveVP vp ; + PassAgentVPSlash vp np = + insertAdV (np.s ! NPC Obl ++ "के द्वारा") (passiveVP vp) ; + ProgrVPSlash vp = predProg vp ** {c2 = vp.c2} ; + + ReflRNP vp rnp = insertObject rnp vp ; + ReflPron = {s = \\_ => "स्वयं" ; a = defaultAgr ; lock_NP = <>} ; + ReflPoss num cn = { + s = \\c => reflPoss ! num.n ! cn.g ! npcase2case c ++ cn.s ! num.n ! npcase2case c ; + a = agrP3 cn.g num.n ; lock_NP = <> + } ; + PredetRNP pred np = {s = \\c => pred.s ++ np.s ! c ; a = np.a ; lock_NP = <>} ; + AdvRNP np prep rnp = { + s = \\c => rnp.s ! NPC Obl ++ prep.s ! giveGender rnp.a ++ np.s ! c ; + a = np.a ; lock_NP = <> + } ; + AdvRVP vp prep rnp = insertAdV (rnp.s ! NPC Obl ++ prep.s ! giveGender rnp.a) vp ; + AdvRAP ap prep rnp = { + s = \\n,g,c,d => rnp.s ! NPC Obl ++ prep.s ! giveGender rnp.a ++ ap.s ! n ! g ! c ! d + } ; + ReflA2RNP a rnp = { + s = \\n,g,c,d => rnp.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ! d + } ; + PossPronRNP pron num cn rnp = { + s = \\c => pron.ps ! num.n ! cn.g ++ cn.s ! num.n ! npcase2case c ++ + rnp.s ! NPC Obl ++ genPost ! num.n ! cn.g ; + a = agrP3 cn.g num.n + } ; + + CompoundN modifier head = { + s = \\n,c => modifier.s ! Sg ! Dir ++ head.s ! n ! c ; + g = head.g + } ; + CompoundAP noun adj = { + s = \\n,g,c,d => noun.s ! Sg ! Dir ++ adj.s ! n ! g ! c ! d + } ; + + GerundCN vp = { + s = \\_,c => vp.obj.s ++ vp.ad ++ vp.comp ! defaultAgr ++ vp.cvp ++ + case c of { + Dir => vp.inf ; + _ => (vp.s ! VPInf).fin + } ; + g = Masc + } ; + GerundNP vp = {s = \\_ => infVP False vp defaultAgr ; a = defaultAgr} ; + GerundAdv vp = {s = \\_ => vp.obj.s ++ vp.ad ++ vp.comp ! defaultAgr ++ + vp.cvp ++ conjunctive vp} ; + WithoutVP vp = {s = \\_ => infVP False vp defaultAgr ++ "बिना"} ; + ByVP vp = {s = \\_ => vp.obj.s ++ vp.ad ++ vp.comp ! defaultAgr ++ + vp.cvp ++ conjunctive vp} ; + InOrderToVP vp = {s = \\_ => infVP False vp defaultAgr ++ "के लिए"} ; + ApposNP x y = {s = \\c => x.s ! c ++ comma ++ y.s ! c ; a = x.a} ; + PositAdVAdj a = {s = a.s ! Sg ! Masc ! Dir ! Posit} ; + + UseDAP dap = dapNP Masc dap ; + UseDAPMasc dap = dapNP Masc dap ; + UseDAPFem dap = dapNP Fem dap ; + +oper + tenseOf : Temp -> VPHTense = \temp -> case of { + => VPGenPres ; => VPPerfPres ; + => VPImpPast ; => VPPerfPast ; + => VPFut ; => VPPerfFut ; + => VPFut ; => VPSubj + } ; + + npcase2case : NPCase -> Case = \c -> case c of { + NPC x => x ; NPObj => Obl ; NPErg => Obl + } ; + + reflPoss : Number => Gender => Case => Str = table { + Sg => table { + Masc => table {Dir => "अपना" ; _ => "अपने"} ; + Fem => table {_ => "अपनी"} + } ; + Pl => table { + Masc => table {_ => "अपने"} ; + Fem => table {_ => "अपनी"} + } + } ; + + genPost : Number => Gender => Str = table { + Sg => table {Masc => "का" ; Fem => "की"} ; + Pl => table {Masc => "के" ; Fem => "की"} + } ; + + partAP : VPH -> AP = \vp -> { + s = \\n,g,_,_ => let a = agrP3 g n in + vp.obj.s ++ vp.ad ++ vp.comp ! a ++ vp.cvp ++ + (vp.s ! VPTense VPPres a).inf ++ hwa a ; + lock_AP = <> + } ; + + conjunctive : VPH -> Str = \vp -> (vp.s ! VPStem).inf ++ "के" ; + + pastAP : VPHSlash -> Str -> AP = \vp,agent -> { + s = \\n,g,_,_ => vp.obj.s ++ vp.ad ++ vp.comp ! (agrP3 g n) ++ agent ++ vp.cvp ++ + (vp.s ! VPTense VPPast (agrP3 g n)).inf ; + lock_AP = <> + } ; + + passiveVP : VPHSlash -> VPH = \vp -> + let aux = predV (mkV "जाना") in { + s = table { + VPTense tense agr => { + inf = (vp.s ! VPTense VPPast agr).inf ++ (aux.s ! VPTense tense agr).inf ; + fin = (aux.s ! VPTense tense agr).fin + } ; + form => { + inf = (vp.s ! VPTense VPPast defaultAgr).inf ++ (aux.s ! form).inf ; + fin = (aux.s ! form).fin + } + } ; + obj = vp.obj ; subj = VIntrans ; inf = vp.inf ++ "जाना" ; + ad = vp.ad ; embComp = vp.embComp ; prog = vp.prog ; + comp = vp.comp ; cvp = vp.cvp + } ; + + dapNP : Gender -> DAP -> CommonHindustani.NP = \g,dap -> { + s = \\c => dap.s ! dap.n ! g ! npcase2case c ; + a = agrP3 g dap.n + } ; + +{- --# notpresent +-} } diff --git a/src/hindi/GrammarHin.gf b/src/hindi/GrammarHin.gf index 31085f41d..fe8400f0b 100644 --- a/src/hindi/GrammarHin.gf +++ b/src/hindi/GrammarHin.gf @@ -14,7 +14,8 @@ TextX - [Adv,AdN,SC], StructuralHin, TenseX - [Adv,AdN,SC], - IdiomHin + IdiomHin, + NamesHin ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/src/hindi/IdiomHin.gf b/src/hindi/IdiomHin.gf index 32bfae4e0..361665fff 100644 --- a/src/hindi/IdiomHin.gf +++ b/src/hindi/IdiomHin.gf @@ -18,14 +18,28 @@ concrete IdiomHin of Idiom = CatHin ** open Prelude,Predef, ResHin,ParamX,Common mkSClause "" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) --removed waha:n (insertObj (\\_ => np.s ! NPC Dir) (predAux auxBe)) ; - ExistIP ip = + ExistIP ip = let cl = mkSClause ("वहाँ" ++ ip.s ! Dir) (agrP3 ip.g ip.n) (predAux auxBe); in { s = \\t,p,qf => case qf of { QDir => cl.s ! t ! p ! ODir; QIndir => cl.s ! t! p ! ODir } - }; + }; + + ExistNPAdv np adv = + mkSClause "" np.a + (insertAdV (adv.s ! giveGender np.a) + (insertObj (\\_ => np.s ! NPC Dir) (predAux auxBe))) ; + + ExistIPAdv ip adv = + let cl = mkSClause (ip.s ! Dir) (agrP3 ip.g ip.n) + (insertAdV (adv.s ! ip.g) (predAux auxBe)) + in {s = \\t,p,_ => cl.s ! t ! p ! ODir} ; + + SelfAdvVP vp = insertAdV "स्वयं" vp ; + SelfAdVVP vp = insertAdV "स्वयं" vp ; + SelfNP np = {s = \\c => np.s ! c ++ "स्वयं" ; a = np.a} ; -- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; ProgrVP vp = (predProg vp) ; diff --git a/src/hindi/MorphoHin.gf b/src/hindi/MorphoHin.gf index e91ea56cb..26de3e6f0 100644 --- a/src/hindi/MorphoHin.gf +++ b/src/hindi/MorphoHin.gf @@ -32,28 +32,26 @@ oper g = g } ; - - regNoun : Str -> Noun ; - regNoun s = case s of { - _ + "या" => mkN05 (s); - _ + ("ा") => mkN01 (s); - _ + "ी" => mkN03 (s); - _ + ("ाँ"|"ा") => mkN04 (s); - _ + "ाँव" => mkN12 s; - _ + "w^" => mkN12 (s); - _ => regNoun2 (s) - }; - regNoun2 : Str -> Noun; - regNoun2 s = let c = if_then_else Bool (eq (last s) "" ) True (if_then_else Bool (eq (last s) "ह") True (if_then_else Bool (eq (last s) "e") True False)) - in case c of { - False => mkN02 (s); - True => mkN01 (s) - }; + regNoun s = + case s of { + _ + "या" => mkN05 s; + _ + "ता" => mkN04 s; + _ + ("ा") => mkN01 s; + _ + "ी" => mkN03 s; + _ + ("ाँ"|"ा") => mkN04 s; + _ + "ाँव" => mkN12 s; + _ + "e" => mkN01 s; + _ => mkN02 s + }; reggNoun : Str -> Gender -> Noun ; reggNoun s g = let c = if_then_else Bool (eq (last s) "" ) True (if_then_else Bool (eq (dp 2 s) "ण") True (if_then_else Bool (eq (dp 2 s) "wण") True False)) - in case of { + in case of { + <_ + "या",Fem,_> => mkN05 (s); + <_ + "ता",Fem,_> => mkN04 (s); + <_ + "ा",Fem,_> => mkN04 (s); + <_ + ("ी"|"ि"),Fem,_> => mkN03 (s); <_ + "त",Fem,_> => mkN10 (s); <_ + "त",Masc,_> => mkN02 (s); <_ + "ू",Masc,_> => mkN11 (s); @@ -79,7 +77,7 @@ oper -- masculine nouns does not end with a, h, e, an mkN02 : Str -> Noun ; - mkN02 mrd = let mrdwN = mrd+"ोँ" ; + mkN02 mrd = let mrdwN = mrd+"ों" ; mrdw = tk 1 mrdwN in mkNoun mrd mrd mrd mrd mrdwN mrdw @@ -88,8 +86,9 @@ oper -- feminine Nouns end with y mkN03 : Str -> Noun ; - mkN03 krsy = let krsyaN = krsy+"ँ" ; - krsywN = krsy+"योँ" ; + mkN03 krsy = let stem = tk 1 krsy ; + krsyaN = stem+"ियाँ" ; + krsywN = stem+"ियों" ; krsyw = tk 1 krsywN in mkNoun krsy krsy krsy krsyaN krsywN krsyw @@ -97,8 +96,8 @@ oper -- masculine nouns ending at i: e.g Admi: mkN13 : Str -> Noun ; - mkN13 krsy = let - krsywN = krsy+"योँ" ; + mkN13 krsy = let stem = tk 1 krsy ; + krsywN = stem+"ियों" ; krsyw = tk 1 krsywN in mkNoun krsy krsy krsy krsy krsywN krsyw @@ -106,30 +105,30 @@ oper -- feminine nouns end with a, aN, wN mkN04 : Str -> Noun ; - mkN04 n = case last n of { - "ा" => mkNoun n n n - (n+"ाेँ") (n+"ाोँ") (n+"ाो") + mkN04 n = case last n of { + "ा" => let stem = tk 1 n in mkNoun n n n + (stem+"ाएँ") (stem+"ाओं") (stem+"ाओ") Fem ; _ => let maN = n ; -- ends with aN and wN ma = tk 1 maN in mkNoun maN maN maN - (maN+"ाँेँ") (maN+"ाँोँ") (maN+"ाँो") + (maN+"एँ") (maN+"ओं") (maN+"ओ") Fem }; --feminine nouns end with ya mkN05 : Str -> Noun ; - mkN05 gRya = let gRy = (tk 1 gRya) + mkN05 gRya = let gRy = (tk 1 gRya) in mkNoun gRya gRya gRya - (gRya+"ँ") (gRy+"ोँ") (gRy+"ो") + (gRy+"ाँ") (gRy+"ों") (gRy+"ो") Fem ; -- feminine nouns end with w mkN07 : Str -> Noun ; mkN07 khshbw = mkNoun khshbw khshbw khshbw - (khshbw + "ेँ") (khshbw + "ोँ") (khshbw + "ो") + (khshbw + "एँ") (khshbw + "ओं") (khshbw + "ओ") Fem ; -- Loan arabic feminine nouns end with t @@ -153,7 +152,7 @@ oper mkN08 : Str -> Noun ; mkN08 ktab = mkNoun ktab ktab ktab - (ktab+"ेँ") (ktab+"ोँ") (ktab+"ो") + (ktab+"ें") (ktab+"ों") (ktab+"ो") Fem ; -- Loan arabic feminine nouns @@ -167,7 +166,7 @@ oper mkN11 : Str -> Noun ; mkN11 alw = mkNoun alw alw alw - alw (alw+"ोँ") (alw+"ो") + alw (alw+"ों") (alw+"ो") Masc ; @@ -337,8 +336,8 @@ oper regAdjective : Str -> Adjective; - regAdjective x = case x of { - acch + ("ा"|"न") => mkAdjective x ("बहुत" ++ x) ("सब से" ++ x) (acch + "े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") (acch + "े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") + regAdjective x = case x of { + acch + "ा" => mkAdjective x ("बहुत" ++ x) ("सब से" ++ x) (acch + "े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") (acch + "े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") (acch + "ी") ("बहुत" ++ acch + "ी") ("सब से" ++ acch + "ी") (acch + "ी") ("बहुत" ++ acch + "ी") ("सब से" ++ acch + "ी") (acch + "ी") ("बहुत" ++ acch + "ी") ("सब से" ++ acch + "ी") (acch +"े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") (acch + "े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") (acch + "े") ("बहुत" ++ acch + "े") ("सब से" ++ acch + "े") (acch + "ी") ("बहुत" ++ acch + "ी") ("सब से" ++ acch + "ी") (acch + "ी") ("बहुत" ++ acch + "ी") ("सब से" ++ acch + "ी") (acch + "ी") ("बहुत" ++ acch + "ी") ("सब से" ++ acch + "ी"); @@ -387,20 +386,14 @@ oper "ा"|"ो" => root + "एँ"; "ी" => root + "येँ"; "े" => (tk 1 root)+ "ेँ"; - _ => root + "ेँ" + _ => root + "ें" } in case of { => form1 ; => form2 ; => (mkImpert root p n g).s ; - => case root of { - "हो" => (mkPastInd root p n g).s ; - "जा" => (mkPastInd "गय" p n g).s ; - "कर" => (mkPastInd "किय" p n g).s ; - -- "दE" => (mkPastInd "द" p n g).s ; - -- "लE" => (mkPastInd "ल" p n g).s ; - _ => (mkPastInd root p n g).s }; + => (mkPastInd root p n g).s ; => root + "ते"; => root + "ती"; --variants{root+"तय" ; root+"तयण"}; => root + "ते"; @@ -418,8 +411,21 @@ oper } ; mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> - {s = let roo = root ; - a = case (last root) of { + {s = case of { + <"हो",Sg,Masc> => "हुआ" ; <"हो",Sg,Fem> => "हुई" ; + <"हो",Pl,Masc> => "हुए" ; <"हो",Pl,Fem> => "हुईं" ; + <"जा",Sg,Masc> => "गया" ; <"जा",Sg,Fem> => "गई" ; + <"जा",Pl,Masc> => "गए" ; <"जा",Pl,Fem> => "गईं" ; + <"कर",Sg,Masc> => "किया" ; <"कर",Sg,Fem> => "की" ; + <"कर",Pl,Masc> => "किए" ; <"कर",Pl,Fem> => "कीं" ; + <"दे",Sg,Masc> => "दिया" ; <"दे",Sg,Fem> => "दी" ; + <"दे",Pl,Masc> => "दिए" ; <"दे",Pl,Fem> => "दीं" ; + <"ले",Sg,Masc> => "लिया" ; <"ले",Sg,Fem> => "ली" ; + <"ले",Pl,Masc> => "लिए" ; <"ले",Pl,Fem> => "लीं" ; + <"आ",Sg,Masc> => "आया" ; <"आ",Sg,Fem> => "आई" ; + <"आ",Pl,Masc> => "आए" ; <"आ",Pl,Fem> => "आईं" ; + _ => let roo = root ; + a = case (last root) of { "ा"|"ो"|"ी" => roo + "या" ; "े" => (tk 1 roo) + "िया" ; --* here is the problem _ => roo + "ा" @@ -432,19 +438,20 @@ oper _ => roo + "ी" } ; e = case (last root) of { - "ा"|"ो"|"ी"|"क" => roo + "ये" ; + "ा"|"ो"|"ी" => roo + "ए" ; + "क" => roo + "े" ; "े" => (tk 1 roo) + "ी" ; _ => roo + "े" } ; yN = case (last root) of { - "ा"|"ो"|"ी" => roo + "यीँ" ; - "िय" => (tk 2 roo) + "ी" ; - "े" => (tk 1 roo) + "ीँ" ; - _ => roo + "यँ" + "ा"|"ो"|"ी" => roo + "यीं" ; + "िय" => (tk 2 roo) + "ी" ; + "े" => (tk 1 roo) + "ीं" ; + _ => roo + "ीं" } ; - in - case of { + in + case of { => a ; --* => y ; => e ; @@ -467,10 +474,10 @@ oper <_,Sg,Masc> => a; --* <_,Sg,Fem> => y ; <_,Pl,Masc> => e; - <_,Pl,Fem> => yN - - } ; - } ; + <_,Pl,Fem> => yN + } + } ; + } ; mkImpert : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> {s = let roo = root ; @@ -479,15 +486,16 @@ oper "ो" => "ओ" ; _ => "ो" } ; - yN = case (last root) of { - "ा"|"ो" => "एँ" ; - _ => "एँ" + yN = case (last root) of { + "ा"|"ो" => "एँ" ; + "े" => "ं" ; + _ => "ें" } ; e = case (last root) of { "ा"|"ो" => "ए" ; "े" => "" ; "ी" => "ये" ; - _ => "ए" + _ => "े" } in case of { => ""; --nonExist ; diff --git a/src/hindi/NamesHin.gf b/src/hindi/NamesHin.gf new file mode 100644 index 000000000..d2b005aa8 --- /dev/null +++ b/src/hindi/NamesHin.gf @@ -0,0 +1,20 @@ +--# -path=.:../abstract:../common:../hindustani + +concrete NamesHin of Names = CatHin ** open ResHin, CommonHindustani in { + + lin + GivenName name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + MaleSurname name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + FemaleSurname name = {s = \\_ => name.s ; a = agrP3 Fem Sg} ; + PlSurname name = {s = \\_ => name.s ; a = agrP3 Masc Pl} ; + + FullName given surname = { + s = \\_ => given.s ++ surname.s ; + a = agrP3 Masc Sg + } ; + + UseLN name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + PlainLN name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + InLN name = {s = \\_ => name.s ++ "में"} ; + AdjLN ap name = {s = ap.s ! Sg ! Masc ! Dir ! Posit ++ name.s} ; +} diff --git a/src/hindi/NumeralHin.gf b/src/hindi/NumeralHin.gf index 8775ebcf2..a43a90222 100644 --- a/src/hindi/NumeralHin.gf +++ b/src/hindi/NumeralHin.gf @@ -18,6 +18,8 @@ lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ; lincat Sub100 = {s : Str ; size : Size ; n : Number} ; lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ; lincat Sub1000000 = { s : Str ; n : Number } ; +lincat Sub1000000000 = {s : Str ; n : Number} ; +lincat Sub1000000000000 = {s : Str ; n : Number} ; lin num x0 = {s = table { @@ -82,6 +84,7 @@ lin pot1 d = {s = d.s ! ten ; size = less100 ; n = Pl} ; lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = Pl} ; lin pot1as2 n = {s = n.s ; s2 = "दमी" ; size = n.size ; n = n.n} ; +lin pot21 = {s = "सौ" ; s2 = "एक लाख" ; size = more100 ; n = Pl} ; lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; s2 = d.s ! unit ++ "लाख" ; size = more100 ; n = Pl} ; lin pot2plus d e = @@ -90,6 +93,7 @@ lin pot2plus d e = size = more100 ; n = Pl} ; lin pot2as3 n = {s = n.s ; n = n.n} ; +lin pot31 = {s = "एक हज़ार" ; n = Pl} ; lin pot3 n = {s = table { singl => ekhazar ; less100 => n.s ++ "हज़ार" ; more100 => n.s2 } ! n.size ; n = Pl} ; @@ -98,6 +102,20 @@ lin pot3plus n m = less100 => n.s ++ "हज़ार" ; more100 => n.s2 } ! n.size ++ m.s ; n = Pl} ; +lin pot3as4 n = n ; +lin pot3decimal n = {s = n.s ! NCard ++ "हज़ार" ; n = Pl} ; + +lin pot41 = {s = "दस लाख" ; n = Pl} ; +lin pot4 n = {s = n.s ++ "दस लाख" ; n = Pl} ; +lin pot4plus n m = {s = n.s ++ "दस लाख" ++ m.s ; n = Pl} ; +lin pot4as5 n = n ; +lin pot4decimal n = {s = n.s ! NCard ++ "दस लाख" ; n = Pl} ; + +lin pot51 = {s = "एक अरब" ; n = Pl} ; +lin pot5 n = {s = n.s ++ "अरब" ; n = Pl} ; +lin pot5plus n m = {s = n.s ++ "अरब" ++ m.s ; n = Pl} ; +lin pot5decimal n = {s = n.s ! NCard ++ "अरब" ; n = Pl} ; + lin D_0 = { s = "०" ; n = Sg}; lin D_1 = { s = "१" ; n = Sg}; lin D_2 = { s = "२" ; n = Pl}; @@ -111,6 +129,11 @@ lin D_9 = { s = "९" ; n = Pl}; lin IDig d = { s = \\_ => d.s ; n = d.n} ; lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl }; lin PosDecimal d = d ** {hasDot=False} ; +lin NegDecimal d = {s = \\f => "-" ++ d.s ! f ; n = d.n ; hasDot = False} ; +lin IFrac d x = { + s = \\f => d.s ! f ++ case d.hasDot of {True => [] ; False => "."} ++ x.s ; + n = Pl ; hasDot = True + } ; oper ekhazar : Str = variants {"हज़ार" ; "एक" ++ "हज़ार"} ; oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "हज़ार"} ! sz ; diff --git a/src/hindi/ParadigmsHin.gf b/src/hindi/ParadigmsHin.gf index 5d4e664c2..d0b59856f 100644 --- a/src/hindi/ParadigmsHin.gf +++ b/src/hindi/ParadigmsHin.gf @@ -53,6 +53,10 @@ oper = \n -> {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ; } ; + mkLN : Str -> LN = \s -> lin LN {s=s} ; + mkSN : Str -> SN = \s -> lin SN {s=s} ; + mkGN : Str -> GN = \s -> lin GN {s=s} ; + personalPN : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Number -> Gender -> UPerson -> Pron = \s1,s2,s3,smp,sfp,pmp,pfp,nn,g,p -> let n = mkPron s1 s2 s3 in {s = n.s ; @@ -106,6 +110,10 @@ oper dirV2 : V -> V2 = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; dirdirV3 : V -> V3 ; dirdirV3 v = v ** { c2 = [] ; c3 = [] ; lock_V3 = <>} ; + + mkVA : V -> VA = \v -> lin VA v ; + mkV2S : V -> V2S = \v -> lin V2S v ** {c2={s = [] ; c = VTrans}} ; + mkAuxVV : V -> VV = \v -> lin VV (v ** {isAux = True}) ; -- compund verbs compoundV = overload { @@ -116,6 +124,7 @@ oper ----2 Adverbs mkAdv : Str -> Adv = \str -> {s = \\_ => str ; lock_Adv = <>}; + mkAdV : Str -> AdV = \s -> lin AdV {s=s} ; ----2 Prepositions diff --git a/src/hindi/StructuralHin.gf b/src/hindi/StructuralHin.gf index 2c54fe8b8..d185a5fa4 100644 --- a/src/hindi/StructuralHin.gf +++ b/src/hindi/StructuralHin.gf @@ -48,7 +48,7 @@ concrete StructuralHin of Structural = CatHin ** more_CAdv = {s = "ज़्यादा" ; p = "से" } ; most_Predet = ss "सब से ज़्यादा" ; much_Det = mkDet "बहुत" "बहुत" "बहुत" "बहुत" Sg ; --- must_VV = { + must_VV = mkVV (mkV "पड़ना") ; -- s = table { -- VVF VInf => ["हवe तo"] ; -- VVF VPres => "मुसत" ; @@ -104,21 +104,23 @@ concrete StructuralHin of Structural = CatHin ** whoSg_IP = mkIP "कौन" "किस" "किस" Sg Masc ; whoPl_IP = mkIP "कौन" "किन" "किनहों" Pl Masc ; why_IAdv = ss "क्यों" ; --- without_Prep = mkPrep ; + without_Prep = mkPrep "के बिना" "के बिना" ; with_Prep = mkPrep ["के साथ"] ["के साथ"] ; -- yes_Phr = ss "???" ; yes_Utt = ss "हाँ" ; youSg_Pron = personalPN "तू" "तुम" "तुम" "तुम्हारा" "तुम्हारी" "तुम्हारे" "तुम्हारी" Sg Masc Pers2_Casual ; youPl_Pron = personalPN "तुम" "तुम" "तुम" "तुम्हारा" "तुम्हारी" "तुम्हारे" "तुम्हारी" Pl Masc Pers2_Casual ; youPol_Pron = personalPN "आप" "आप" "आप" "आप का" "आप की" "आप के" "आप की" Sg Masc Pers2_Respect ; --- no_Quant = demoPN "कोई नहीं" ; + no_Quant = demoPN "कोई नहीं" "कोई नहीं" "कोई नहीं" "कोई नहीं" ; not_Predet = {s="नहीं"} ; -- if_then_Conj = sd2 "अगर तो" ** {n = Sg} ; at_least_AdN = mkAdN ["कम से कम"] ; at_most_AdN = mkAdN ["ज़्यादा से ज़्यादा"]; --- nothing_NP = MassNP (UseN (ParadigmsHin.mkN "कुछ नहीं" Masc )); + nothing_NP = MassNP (UseN (ParadigmsHin.mkN + "कुछ नहीं" "कुछ नहीं" "कुछ नहीं" "कुछ नहीं" "कुछ नहीं" "कुछ नहीं" Masc)) ; except_Prep = mkPrep "के सिवाय" "के सिवाय"; --- nobody_NP = MassNP (UseN (ParadigmsHin.mkN "कोई नहीं" Masc )); + nobody_NP = MassNP (UseN (ParadigmsHin.mkN + "कोई नहीं" "कोई नहीं" "कोई नहीं" "कोई नहीं" "कोई नहीं" "कोई नहीं" Masc)) ; as_CAdv = {s = "इतना" ; p = "जितना"} ; @@ -127,4 +129,3 @@ concrete StructuralHin of Structural = CatHin ** language_title_Utt = ss "हिन्दी" ; } - diff --git a/src/hindi/src/DiffHin.gf b/src/hindi/src/DiffHin.gf index 5c0533e8e..7ec9c3222 100644 --- a/src/hindi/src/DiffHin.gf +++ b/src/hindi/src/DiffHin.gf @@ -4,6 +4,11 @@ flags coding = utf8; oper addErgative s1 s2 = Prelude.glue s1 s2 ; + ergativePron ppf a = case a of { + Ag _ Pl Pers3_Distant => "unhwN nE" ; + Ag _ _ (Pers3_Near | Pers3_Distant) => addErgative (ppf ! Obl) nE ; + _ => addErgative (ppf ! Dir) nE + } ; conjThat = "ki" ; insertSubj : UPerson -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "va:n~" ; _ => Prelude.glue s "E:"}; -- check with prasad for vn~ @@ -12,6 +17,8 @@ oper awr = "O+r" ; ky = "ki:" ; ka = "ka:" ; + kE = "ke:" ; + rh = "rh" ; jn = "jin" ; js = "jis" ; jw = "jo:" ; @@ -131,4 +138,4 @@ oper => "huE:" ; => "huI:" }; -} \ No newline at end of file +} diff --git a/src/hindustani/AdjectiveHindustani.gf b/src/hindustani/AdjectiveHindustani.gf index 0849de126..39be6edf0 100644 --- a/src/hindustani/AdjectiveHindustani.gf +++ b/src/hindustani/AdjectiveHindustani.gf @@ -21,7 +21,7 @@ incomplete concrete AdjectiveHindustani of Adjective = CatHindustani ** open Com SentAP ap sc = { s = \\n,g,c,d => case sc.fromVP of { - True => sc.s ++ kw ++ ap.s ! n ! g ! c ! d ; + True => sc.s ++ mein ++ ap.s ! n ! g ! c ! d ; False => ap.s ! n ! g ! c ! d ++ sc.s } ; } ; diff --git a/src/hindustani/AdverbHindustani.gf b/src/hindustani/AdverbHindustani.gf index 475c20d3a..48063e975 100644 --- a/src/hindustani/AdverbHindustani.gf +++ b/src/hindustani/AdverbHindustani.gf @@ -4,13 +4,13 @@ incomplete concrete AdverbHindustani of Adverb = CatHindustani ** open CommonHin PositAdvAdj a = {s = \\g => a.s ! Sg ! g ! Obl ! Posit} ; PositAdAAdj a = {s = a.s ! Sg ! Masc ! Obl ! Posit} ; ComparAdvAdj cadv a np = { - s = \\g => np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit; + s = \\g => np.s ! NPC Obl ++ cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit; } ; ComparAdvAdjS cadv a s = { s = \\g => cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit ++ s.s; } ; - PrepNP prep np = {s = \\g => np.s ! NPObj ++ prep.s ! g } ; + PrepNP prep np = {s = \\g => np.s ! NPC Obl ++ prep.s ! g } ; AdAdv ada adv = { s = \\g => ada.s ++ adv.s ! g} ; diff --git a/src/hindustani/CatHindustani.gf b/src/hindustani/CatHindustani.gf index 22ada04b2..abb8d63f8 100644 --- a/src/hindustani/CatHindustani.gf +++ b/src/hindustani/CatHindustani.gf @@ -61,10 +61,12 @@ incomplete concrete CatHindustani of Cat = Det = ResHindustani.Determiner ; Predet = {s : Str} ; Num = {s : Str ; n : Number} ; - Card = {s : Str; n : Number} ; - Ord = {s : Str; n : Number} ; + Card = {s : Str; n : Number} ; + ACard = {s : Str} ; + Ord = {s : Str; n : Number} ; Quant = {s:Number => Gender => Case => Str ; a:Agr}; - Art = {s : Str} ; + Art = {s : Str} ; + DAP = {s : Number => Gender => Case => Str ; n : Number} ; ---- Numeral diff --git a/src/hindustani/ConjunctionHindustani.gf b/src/hindustani/ConjunctionHindustani.gf index 237f3d0e1..75a5db879 100644 --- a/src/hindustani/ConjunctionHindustani.gf +++ b/src/hindustani/ConjunctionHindustani.gf @@ -19,7 +19,12 @@ incomplete concrete ConjunctionHindustani of Conjunction = } ; ConjAP conj ss = conjunctDistrTable4 Number Gender Case Degree conj ss ; - ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c}; + ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c}; + ConjCN conj cns = conjunctDistrTable2 Number Case conj cns ** {g = cns.g} ; + ConjAdV conj xs = conjunctDistrSS conj xs ; + ConjIAdv conj xs = conjunctDistrSS conj xs ; + ConjDet conj xs = conjunctDistrTable3 Number Gender Case conj xs ** {n = conj.n} ; + ConjDAP conj xs = conjunctDistrTable3 Number Gender Case conj xs ** {n = conj.n} ; ---- These fun's are generated from the list cat's. @@ -32,13 +37,26 @@ incomplete concrete ConjunctionHindustani of Conjunction = ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ; ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c}; BaseAP x y = twoTable4 Number Gender Case Degree x y ; -- ** {isPre = andB x.isPre y.isPre} ; - ConsAP xs x = consrTable4 Number Gender Case Degree comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; + ConsAP xs x = consrTable4 Number Gender Case Degree comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; + BaseCN x y = twoTable2 Number Case x y ** {g = x.g} ; + ConsCN xs x = consrTable2 Number Case comma xs x ** {g = xs.g} ; + BaseAdV = twoSS ; + ConsAdV = consrSS comma ; + BaseIAdv = twoSS ; + ConsIAdv = consrSS comma ; + BaseDet x y = twoTable3 Number Gender Case x y ** {n = conjNumber x.n y.n} ; + ConsDet xs x = consrTable3 Number Gender Case comma xs x ** {n = conjNumber xs.n x.n} ; + BaseDAP x y = twoTable3 Number Gender Case x y ** {n = conjNumber x.n y.n} ; + ConsDAP xs x = consrTable3 Number Gender Case comma xs x ** {n = conjNumber xs.n x.n} ; lincat [S] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Gender => Str} ; [NP] = {s1,s2 : NPCase => Str ; a : Agr} ; [AP] = {s1,s2 : Number => Gender => Case => Degree => Str} ; - [RS] = {s1,s2 : Agr => Str ; c : Case}; + [RS] = {s1,s2 : Agr => Str ; c : Case}; + [CN] = {s1,s2 : Number => Case => Str ; g : Gender} ; + [AdV], [IAdv] = {s1,s2 : Str} ; + [Det], [DAP] = {s1,s2 : Number => Gender => Case => Str ; n : Number} ; } diff --git a/src/hindustani/DiffHindustani.gf b/src/hindustani/DiffHindustani.gf index 1f4e83db0..18db5ae68 100644 --- a/src/hindustani/DiffHindustani.gf +++ b/src/hindustani/DiffHindustani.gf @@ -1,12 +1,15 @@ interface DiffHindustani = open Prelude in { oper addErgative : Str -> Str -> Str ; + ergativePron : (Case => Str) -> Agr -> Str ; conjThat : Str ; -- = "kh" ; insertSubj : UPerson -> Str -> Str ; kwd : Str ; ky : Str ; ka : Str ; + kE : Str ; + rh : Str ; agr : Str ; awr : Str ; jn : Str ; @@ -34,4 +37,4 @@ interface DiffHindustani = open Prelude in { cka : Gender -> Number -> Str ; hw : UPerson -> Number -> Str ; hwa : Agr -> Str ; -} \ No newline at end of file +} diff --git a/src/hindustani/NounHindustani.gf b/src/hindustani/NounHindustani.gf index fb6778140..2bf886489 100644 --- a/src/hindustani/NounHindustani.gf +++ b/src/hindustani/NounHindustani.gf @@ -34,6 +34,11 @@ incomplete concrete NounHindustani of Noun = a = np.a } ; + ExtAdvNP np adv = { + s = \\c => np.s ! c ++ comma ++ adv.s ! (giveGender np.a) ; + a = np.a + } ; + DetQuantOrd quant num ord = { -- s = \\ c => detquant2det quant.s num.s c ++ ord.s ; s = \\n,g,c => quant.s!n!g!c ++ num.s ++ ord.s ; @@ -51,6 +56,13 @@ incomplete concrete NounHindustani of Noun = a = agrP3 Masc Sg } ; + DetDAP det = {s = det.s ; n = det.n} ; + + AdjDAP dap ap = { + s = \\n,g,c => dap.s ! n ! g ! c ++ ap.s ! n ! g ! c ! Posit ; + n = dap.n + } ; + -- PossPron p = {s = \\n,g,_ => p.ps ! n ! g ; a = p.a} ; PossPron p = {s = \\n,g,c => case c of { Obl => p.ps ! Pl ! g ; @@ -91,6 +103,14 @@ incomplete concrete NounHindustani of Noun = MassNP cn = {s = \\c => toNP (cn.s ! Sg) c ; a = agrP3 cn.g Sg} ; + QuantityNP decimal unit = { + s = \\_ => case unit.isPre of { + True => unit.s ++ decimal.s ! NCard ; + False => decimal.s ! NCard ++ unit.s + } ; + a = agrP3 Masc decimal.n + } ; + UseN n = n ; UseN2 n = { s = n.s ; g = n.g }; @@ -144,11 +164,11 @@ incomplete concrete NounHindustani of Noun = PossNP cn np = {s = \\n,c => case cn.g of {Masc => cn.s ! n ! c ++ ka ++ np.s ! NPC Dir ; Fem => cn.s ! n ! c ++ ky ++ np.s ! NPC Dir } ; - g = cn.g} ; + g = cn.g} ; PartNP cn np = {s = \\n,c => case cn.g of {Masc => cn.s ! n ! c ++ ka ++ np.s ! NPC Dir ; Fem => cn.s ! n ! c ++ ky ++ np.s ! NPC Dir } ; - g = cn.g} ; + g = cn.g} ; CountNP det np = { s = \\c => np.s ! NPC Obl ++ mein ++ sE ++ det.s ! (giveNumber np.a) ! (giveGender np.a) ! Dir ; diff --git a/src/hindustani/ResHindustani.gf b/src/hindustani/ResHindustani.gf index 06c4714d5..a2300a766 100644 --- a/src/hindustani/ResHindustani.gf +++ b/src/hindustani/ResHindustani.gf @@ -65,12 +65,12 @@ param detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of { -- NPC c => dt.s ! Sg ! Masc ++ cn.s ! nn ! c ; --changed while phrasebook e.g tyry beti where gender of determiner 'tyry' should be dependent on gender of common noum e.g 'beti' NPC c => dt.s ! nn ! cn.g ! c ++ cn.s ! nn ! c ; - NPObj => dt.s ! nn ! cn.g ! Obl ++ cn.s ! nn ! Dir ; + NPObj => dt.s ! nn ! cn.g ! Obl ++ cn.s ! nn ! Dir ; NPErg => dt.s ! nn ! cn.g ! Obl ++ cn.s ! nn ! Obl ++ nE } ; det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of { NPC c => dt.s ! Sg ! Masc ! c ; - NPObj => dt.s ! Sg ! Masc ! Dir ; + NPObj => dt.s ! Sg ! Masc ! Dir ; NPErg => dt.s ! Sg ! Masc ! Obl ++ nE } ; @@ -142,7 +142,7 @@ param VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = part } ; VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = part } ; VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = part ++ hw p n } ; - VPStem => {fin = [] ; inf = "rh" }; + VPStem => {fin = [] ; inf = rh }; _ => {fin = part ; inf = [] } }; obj = {s = [] ; a = defaultAgr} ; @@ -289,10 +289,7 @@ param np2pronCase ppf npc a = case npc of { NPC c => ppf ! c; NPObj => ppf ! Obl ; - NPErg =>case (fromAgr a).p of { - (Pers3_Near|Pers3_Distant) => addErgative (ppf ! Obl) nE; -- in hindi in case of pronouns nE is tagged to pron rather than a separate word - _ => addErgative (ppf ! Dir) nE - } + NPErg => ergativePron ppf a } ; insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> { diff --git a/src/hindustani/SentenceHindustani.gf b/src/hindustani/SentenceHindustani.gf index fcb7ad7c4..3dd1ae9e2 100644 --- a/src/hindustani/SentenceHindustani.gf +++ b/src/hindustani/SentenceHindustani.gf @@ -11,11 +11,15 @@ incomplete concrete SentenceHindustani of Sentence = PredSCVP sc vp = mkSClause sc.s (defaultAgr) vp ; - ImpVP vp = { - s = \\pol,n => - let - agr = Ag Masc (numImp n) Pers2_Casual ; - verb = infVP True vp agr ; + ImpVP vp = { + s = \\pol,n => + let + agr = case n of { + ImpF _ True => Ag Masc Pl Pers2_Respect ; + ImpF num False => Ag Masc num Pers2_Casual + } ; + verb = vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ + (vp.s ! VPTense VPFutr agr).inf ; dont = case pol of { CNeg True => mt ; CNeg False => nh ; @@ -28,10 +32,14 @@ incomplete concrete SentenceHindustani of Sentence = SlashVP np vp = mkClause np vp ** {c2 = vp.c2} ; - AdvSlash slash adv = { + AdvSlash slash adv = { s = \\t,p,o => adv.s ! Masc ++ slash.s ! t ! p ! o ; c2 = slash.c2 - } ; + } ; + + AdvImp adv imp = { + s = \\p,n => adv.s ! Masc ++ imp.s ! p ! n + } ; SlashPrep cl prep = cl ** {c2 = { s = prep.s ! Masc ; c = VIntrans}} ; diff --git a/src/hindustani/VerbHindustani.gf b/src/hindustani/VerbHindustani.gf index 6977f559e..a26d6be22 100644 --- a/src/hindustani/VerbHindustani.gf +++ b/src/hindustani/VerbHindustani.gf @@ -32,6 +32,8 @@ incomplete concrete VerbHindustani of Verb = CatHindustani ** open CommonHindust AdvVP vp adv = insertAdV (adv.s ! Masc) vp ; AdVVP adv vp = insertAdV adv.s vp ; + + ExtAdvVP vp adv = insertAdV (comma ++ adv.s ! Masc) vp ; AdvVPSlash vp adv = insertObj (\\a => adv.s ! giveGender a) vp ** {c2 = vp.c2} ; --need to confirm diff --git a/src/urdu/AllUrd.gf b/src/urdu/AllUrd.gf index d83c00a29..4eef7240b 100644 --- a/src/urdu/AllUrd.gf +++ b/src/urdu/AllUrd.gf @@ -2,5 +2,5 @@ concrete AllUrd of AllUrdAbs = LangUrd, - ExtendUrd + ExtendUrd --# notpresent ** open ExtraUrd in {} ; diff --git a/src/urdu/ConstructionUrd.gf b/src/urdu/ConstructionUrd.gf index 66d09eecd..ace31b42a 100644 --- a/src/urdu/ConstructionUrd.gf +++ b/src/urdu/ConstructionUrd.gf @@ -1,27 +1,28 @@ --# -path=.:../abstract concrete ConstructionUrd of Construction = CatUrd ** - open SyntaxUrd, SymbolicUrd, ParadigmsUrd, (L = LexiconUrd), (E = ExtraUrd), (G = GrammarUrd), (R = ResUrd), (S = StructuralUrd), Prelude in { + open SyntaxUrd, SymbolicUrd, ParadigmsUrd, CommonHindustani, + (L = LexiconUrd), (E = ExtraUrd), (G = GrammarUrd), (R = ResUrd), (S = StructuralUrd), Prelude in { flags coding=utf8 ; lin -{- - hungry_VP = mkVP (mkA "भूखा") ; - thirsty_VP = mkVP (mkA "प्यासा") ; --- tired_VP = mkVP (mkCompoundA "थका" "हुआ") ; --- scared_VP = mkVP (mkCompoundA "डरा" "हुआ") ; - ill_VP = mkVP (mkA "बीमार") ; - ready_VP = mkVP (mkA "तैयार") ; --} ----- has_age_VP card = mkVP (mkNP (mkCN (mmodN L.year_N))) ; + hungry_VP = mkVP (mkA "بھوکا") ; + thirsty_VP = mkVP (mkA "پیاسا") ; + ill_VP = mkVP (mkA "بیمار") ; + ready_VP = mkVP (mkA "تیار") ; + + has_age_VP card = mkVP (mkNP (mkCN (mmodN L.year_N))) ; have_name_Cl x y = mkCl (mkNP (E.GenNP x) L.name_N) (lin NP y) ; married_Cl x y = mkCl (lin NP x) L.married_A2 (lin NP y) ; what_name_QCl x = mkQCl (mkIComp whatSg_IP) (mkNP (E.GenNP x) L.name_N) ; ----- how_old_QCl x = mkQCl (lin IAdv {s = "कितनी"}) (mkNP (E.GenNP x) (mkN "उम्र" "उम्र" "उम्र" "उम्र" "उम्र" "उम्र" feminine)) ; - how_far_QCl x = mkQCl (E.IAdvAdv (ParadigmsUrd.mkAdv "दूर")) (lin NP x) ; + how_old_QCl x = mkQCl (lin IAdv {s = "کتنی"}) (mkNP (E.GenNP x) (mkN "عمر" feminine)) ; + how_far_QCl x = mkQCl (E.IAdvAdv (ParadigmsUrd.mkAdv "دور")) (lin NP x) ; + +oper + mmodN : N -> N = \noun -> lin N {s = \\n,c => noun.s ! n ! c ++ "کا" ; g = noun.g} ; ---- oper ---- mmodN : N -> N = \noun -> lin N {s = \\n,c =>noun.s!n!c++"का" ; g =noun.g} ; @@ -32,11 +33,22 @@ lin ---- is_right_VP = mkVP (ParadigmsUrd.mkA "right") ; ---- is_wrong_VP = mkVP (ParadigmsUrd.mkA "wrong") ; ----- n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; +lin + n_units_AP card cn a = { + s = \\n,g,c,d => card.s ++ cn.s ! Pl ! Dir ++ a.s ! n ! g ! c ! d + } ; + + n_units_of_NP card cn np = { + s = \\c => np.s ! NPC Obl ++ "کے" ++ card.s ++ cn.s ! Pl ! constructionCase c ; + a = agrP3 cn.g card.n + } ; ---- bottle_of_CN np = mkCN (lin N2 (mkN2 "bottle")) (lin NP np) ; ----- cup_of_CN np = mkCN (lin N2 (mkN2 "cup")) (lin NP np) ; + cup_of_CN np = { + s = \\n,c => np.s ! NPC Obl ++ "کا" ++ (mkN "پیالہ").s ! n ! c ; + g = Masc + } ; ---- glass_of_CN np = mkCN (lin N2 (mkN2 "glass")) (lin NP np) ; {- @@ -66,14 +78,14 @@ lincat Year = NP ; lin -{- ---- - weekdayPunctualAdv w = SyntaxUrd.mkAdv on_Prep (mkNP w) ; -- on Sunday - weekdayHabitualAdv w = SyntaxUrd.mkAdv on_Prep (mkNP aPl_Det w) ; -- on Sundays - weekdayNextAdv w = SyntaxUrd.mkAdv (mkPrep "next") (mkNP w) ; -- next Sunday - weekdayLastAdv w = SyntaxUrd.mkAdv (mkPrep "last") (mkNP w) ; -- last Sunday + weekdayPunctualAdv w = {s = \\_ => w.s ! Sg ! Dir ++ "کو"} ; + weekdayHabitualAdv w = {s = \\_ => "ہر" ++ w.s ! Sg ! Dir ++ "کو"} ; + weekdayNextAdv w = {s = \\_ => "اگلے" ++ w.s ! Sg ! Dir ++ "کو"} ; + weekdayLastAdv w = {s = \\_ => "پچھلے" ++ w.s ! Sg ! Dir ++ "کو"} ; - monthAdv m = SyntaxUrd.mkAdv in_Prep (mkNP m) ; - yearAdv y = SyntaxUrd.mkAdv in_Prep y ; + monthAdv m = {s = \\_ => m.s ! Sg ! Dir ++ "میں"} ; + yearAdv y = {s = \\_ => y.s ! NPC Dir ++ "میں"} ; +{- ---- dayMonthAdv d m = ParadigmsUrd.mkAdv ("on" ++ d.s ! R.NPAcc ++ m.s ! R.Sg ! R.Nom) ; -- on 17 May monthYearAdv m y = SyntaxUrd.mkAdv in_Prep (mkNP (mkCN m y)) ; -- in May 2012 dayMonthYearAdv d m y = ParadigmsUrd.mkAdv ("on" ++ d.s ! R.NPAcc ++ m.s ! R.Sg ! R.Nom ++ y.s ! R.NPAcc) ; -- on 17 May 2013 @@ -96,29 +108,33 @@ lin oper mkLanguage : Str -> PN = \s -> mkPN s ; +oper constructionCase : NPCase -> Case = \c -> case c of { + NPC x => x ; NPObj => Obl ; NPErg => Obl + } ; + ---------------------------------------------- ---- lexicon of special names -lin monday_Weekday = mkN "सोमवार" ; -lin tuesday_Weekday = mkN "मंगलवार" ; -lin wednesday_Weekday = mkN "बुधवार" ; -lin thursday_Weekday = mkN "गुरुवार" ; -lin friday_Weekday = mkN "शुक्रवार" ; -lin saturday_Weekday = mkN "शनिवार" ; -lin sunday_Weekday = mkN "रविवार" ; +lin monday_Weekday = mkN "پیر" ; +lin tuesday_Weekday = mkN "منگل" ; +lin wednesday_Weekday = mkN "بدھ" ; +lin thursday_Weekday = mkN "جمعرات" ; +lin friday_Weekday = mkN "جمعہ" ; +lin saturday_Weekday = mkN "ہفتہ" ; +lin sunday_Weekday = mkN "اتوار" ; -lin january_Month = mkN "जनवरी" ; -lin february_Month = mkN "फ़रवरी" ; -lin march_Month = mkN "मार्च" ; -lin april_Month = mkN "अप्रैल" ; -lin may_Month = mkN "मई" ; -lin june_Month = mkN "जून" ; -lin july_Month = mkN "जुलाई" ; -lin august_Month = mkN "अगस्त" ; -lin september_Month = mkN "सितम्बर" ; -lin october_Month = mkN "अक्टूबर" ; -lin november_Month = mkN "नवम्बर" ; -lin december_Month = mkN "दिसम्बर" ; +lin january_Month = mkN "جنوری" ; +lin february_Month = mkN "فروری" ; +lin march_Month = mkN "مارچ" ; +lin april_Month = mkN "اپریل" ; +lin may_Month = mkN "مئی" ; +lin june_Month = mkN "جون" ; +lin july_Month = mkN "جولائی" ; +lin august_Month = mkN "اگست" ; +lin september_Month = mkN "ستمبر" ; +lin october_Month = mkN "اکتوبر" ; +lin november_Month = mkN "نومبر" ; +lin december_Month = mkN "دسمبر" ; lin afrikaans_Language = mkLanguage "Afrikaans" ; lin amharic_Language = mkLanguage "Amharic" ; diff --git a/src/urdu/DiffUrd.gf b/src/urdu/DiffUrd.gf index de3eff6df..a5e950170 100644 --- a/src/urdu/DiffUrd.gf +++ b/src/urdu/DiffUrd.gf @@ -5,6 +5,11 @@ flags coding = utf8 ; oper addErgative s1 s2 = s1 ++ s2 ; +ergativePron ppf a = case a of { + Ag _ Pl Pers3_Distant => "انہوں نے" ; + Ag _ _ (Pers3_Near | Pers3_Distant) => addErgative (ppf ! Obl) nE ; + _ => addErgative (ppf ! Dir) nE + } ; conjThat = "کہ" ; insertSubj : UPerson -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "واں" ; _ => s ++ "ے"}; -- check with prasad for vn~ @@ -13,6 +18,8 @@ conjThat = "کہ" ; awr = "اور" ; ky = "کی" ; ka = "کا" ; + kE = "کے" ; + rh = "رہ" ; jn = "جن" ; js = "جس" ; jw = "جو" ; diff --git a/src/urdu/ExtendUrd.gf b/src/urdu/ExtendUrd.gf index 129412285..0a0e0fe78 100644 --- a/src/urdu/ExtendUrd.gf +++ b/src/urdu/ExtendUrd.gf @@ -3,9 +3,152 @@ concrete ExtendUrd of Extend = CatUrd ** ExtendFunctor - [ - ComplDirectVQ, ComplDirectVS - ] + ComplDirectVQ, ComplDirectVS, + BaseVPS, ConsVPS, MkVPS, ConjVPS, PredVPS, + BaseVPI, ConsVPI, MkVPI, ConjVPI, ComplVPIVV, + BaseComp, ConsComp, ConjComp, BaseImp, ConsImp, ConjImp, + PresPartAP, PastPartAP, PastPartAgentAP, + PassVPSlash, PassAgentVPSlash, ProgrVPSlash, + ReflRNP, ReflPron, ReflPoss, PredetRNP, + AdvRNP, AdvRVP, AdvRAP, ReflA2RNP, PossPronRNP, + CompoundN, CompoundAP, GerundCN, GerundNP, GerundAdv, + WithoutVP, ByVP, InOrderToVP, ApposNP, PositAdVAdj, + UseDAP, UseDAPMasc, UseDAPFem + ] with - (Grammar = GrammarUrd) ** { + (Grammar = GrammarUrd) ** + open Prelude, CommonHindustani, ResUrd, ParadigmsUrd, Coordination, + (G = GrammarUrd) in { +{- +-} --# notpresent + +lincat + VPS = {s : Agr => Str ; c : NPCase} ; + [VPS] = {s1,s2 : Agr => Str ; c : NPCase} ; + VPI = {s : Agr => Str} ; + [VPI] = {s1,s2 : Agr => Str} ; + [Comp] = {s1,s2 : Agr => Str} ; + [Imp] = {s1,s2 : CPolarity => ImpForm => Str} ; + +lin + MkVPS temp pol vp = { + s = \\a => (mkSClause [] a vp).s ! tenseOf temp ! pol.p ! ODir ; + c = case of { + => NPErg ; + => NPErg ; + _ => NPC Dir + } + } ; + BaseVPS x y = twoTable Agr x y ** {c = x.c} ; + ConsVPS x xs = consrTable Agr comma x xs ** {c = xs.c} ; + ConjVPS conj xs = conjunctDistrTable Agr conj xs ** {c = xs.c} ; + PredVPS np vps = {s = np.s ! vps.c ++ vps.s ! np.a} ; + + MkVPI vp = {s = \\a => infVP False vp a} ; + BaseVPI = twoTable Agr ; + ConsVPI = consrTable Agr comma ; + ConjVPI = conjunctDistrTable Agr ; + ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! a) (predV vv) ; + + BaseComp = twoTable Agr ; + ConsComp = consrTable Agr comma ; + ConjComp = conjunctDistrTable Agr ; + BaseImp = twoTable2 CPolarity ImpForm ; + ConsImp = consrTable2 CPolarity ImpForm comma ; + ConjImp = conjunctDistrTable2 CPolarity ImpForm ; + + PresPartAP vp = partAP vp ; + PastPartAP vp = pastAP vp [] ; + PastPartAgentAP vp np = pastAP vp (np.s ! NPC Obl ++ "کے ذریعے") ; + PassVPSlash vp = passiveVP vp ; + PassAgentVPSlash vp np = insertAdV (np.s ! NPC Obl ++ "کے ذریعے") (passiveVP vp) ; + ProgrVPSlash vp = predProg vp ** {c2 = vp.c2} ; + + ReflRNP vp rnp = insertObject rnp vp ; + ReflPron = {s = \\_ => "خود" ; a = defaultAgr ; lock_NP = <>} ; + ReflPoss num cn = { + s = \\c => reflPoss ! num.n ! cn.g ! npcase2case c ++ cn.s ! num.n ! npcase2case c ; + a = agrP3 cn.g num.n ; lock_NP = <> + } ; + PredetRNP pred np = {s = \\c => pred.s ++ np.s ! c ; a = np.a ; lock_NP = <>} ; + AdvRNP np prep rnp = { + s = \\c => rnp.s ! NPC Obl ++ prep.s ! giveGender rnp.a ++ np.s ! c ; + a = np.a ; lock_NP = <> + } ; + AdvRVP vp prep rnp = insertAdV (rnp.s ! NPC Obl ++ prep.s ! giveGender rnp.a) vp ; + AdvRAP ap prep rnp = {s = \\n,g,c,d => rnp.s ! NPC Obl ++ prep.s ! giveGender rnp.a ++ ap.s ! n ! g ! c ! d} ; + ReflA2RNP a rnp = {s = \\n,g,c,d => rnp.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ! d} ; + PossPronRNP pron num cn rnp = { + s = \\c => pron.ps ! num.n ! cn.g ++ cn.s ! num.n ! npcase2case c ++ + rnp.s ! NPC Obl ++ genPost ! num.n ! cn.g ; + a = agrP3 cn.g num.n + } ; + + CompoundN modifier head = {s = \\n,c => modifier.s ! Sg ! Dir ++ head.s ! n ! c ; g = head.g} ; + CompoundAP noun adj = {s = \\n,g,c,d => noun.s ! Sg ! Dir ++ adj.s ! n ! g ! c ! d} ; + GerundCN vp = { + s = \\_,c => vp.obj.s ++ vp.ad ++ vp.comp ! defaultAgr ++ vp.cvp ++ + case c of {Dir => vp.inf ; _ => (vp.s ! VPInf).fin} ; + g = Masc + } ; + GerundNP vp = {s = \\_ => infVP False vp defaultAgr ; a = defaultAgr} ; + GerundAdv vp = {s = \\_ => vp.obj.s ++ vp.ad ++ vp.comp ! defaultAgr ++ vp.cvp ++ conjunctive vp} ; + WithoutVP vp = {s = \\_ => infVP False vp defaultAgr ++ "کے بغیر"} ; + ByVP vp = {s = \\_ => vp.obj.s ++ vp.ad ++ vp.comp ! defaultAgr ++ vp.cvp ++ conjunctive vp} ; + InOrderToVP vp = {s = \\_ => infVP False vp defaultAgr ++ "کے لیے"} ; + ApposNP x y = {s = \\c => x.s ! c ++ comma ++ y.s ! c ; a = x.a} ; + PositAdVAdj a = {s = a.s ! Sg ! Masc ! Dir ! Posit} ; + UseDAP dap = dapNP Masc dap ; + UseDAPMasc dap = dapNP Masc dap ; + UseDAPFem dap = dapNP Fem dap ; + +oper + tenseOf : Temp -> VPHTense = \temp -> case of { + => VPGenPres ; => VPPerfPres ; + => VPImpPast ; => VPPerfPast ; + => VPFut ; => VPPerfFut ; + => VPFut ; => VPSubj + } ; + npcase2case : NPCase -> Case = \c -> case c of {NPC x => x ; NPObj => Obl ; NPErg => Obl} ; + reflPoss : Number => Gender => Case => Str = table { + Sg => table {Masc => table {Dir => "اپنا" ; _ => "اپنے"} ; Fem => table {_ => "اپنی"}} ; + Pl => table {Masc => table {_ => "اپنے"} ; Fem => table {_ => "اپنی"}} + } ; + genPost : Number => Gender => Str = table { + Sg => table {Masc => "کا" ; Fem => "کی"} ; + Pl => table {Masc => "کے" ; Fem => "کی"} + } ; + partAP : VPH -> AP = \vp -> { + s = \\n,g,_,_ => let a = agrP3 g n in vp.obj.s ++ vp.ad ++ vp.comp ! a ++ vp.cvp ++ + (vp.s ! VPTense VPPres a).inf ++ hwa a ; + lock_AP = <> + } ; + conjunctive : VPH -> Str = \vp -> (vp.s ! VPStem).inf ++ "کے" ; + pastAP : VPHSlash -> Str -> AP = \vp,agent -> { + s = \\n,g,_,_ => vp.obj.s ++ vp.ad ++ vp.comp ! (agrP3 g n) ++ agent ++ vp.cvp ++ + (vp.s ! VPTense VPPast (agrP3 g n)).inf ; + lock_AP = <> + } ; + passiveVP : VPHSlash -> VPH = \vp -> + let aux = predV (mkV "جانا") in { + s = table { + VPTense tense agr => { + inf = (vp.s ! VPTense VPPast agr).inf ++ (aux.s ! VPTense tense agr).inf ; + fin = (aux.s ! VPTense tense agr).fin + } ; + form => { + inf = (vp.s ! VPTense VPPast defaultAgr).inf ++ (aux.s ! form).inf ; + fin = (aux.s ! form).fin + } + } ; + obj = vp.obj ; subj = VIntrans ; inf = vp.inf ++ "جانا" ; + ad = vp.ad ; embComp = vp.embComp ; prog = vp.prog ; comp = vp.comp ; cvp = vp.cvp + } ; + dapNP : Gender -> DAP -> CommonHindustani.NP = \g,dap -> { + s = \\c => dap.s ! dap.n ! g ! npcase2case c ; a = agrP3 g dap.n + } ; + +{- --# notpresent +-} } diff --git a/src/urdu/GrammarUrd.gf b/src/urdu/GrammarUrd.gf index be020bc01..e9b4f8a17 100644 --- a/src/urdu/GrammarUrd.gf +++ b/src/urdu/GrammarUrd.gf @@ -15,7 +15,8 @@ -- TextX - [Adv,AdN], StructuralUrd, TenseX - [Adv,AdN,SC], - IdiomUrd + IdiomUrd, + NamesUrd ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/src/urdu/IdiomUrd.gf b/src/urdu/IdiomUrd.gf index dad69ccd1..0649a6112 100644 --- a/src/urdu/IdiomUrd.gf +++ b/src/urdu/IdiomUrd.gf @@ -27,6 +27,20 @@ concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd,ParamX,Common } }; + ExistNPAdv np adv = + mkSClause "" np.a + (insertAdV (adv.s ! giveGender np.a) + (insertObj (\\_ => np.s ! NPC Dir) (predAux auxBe))) ; + + ExistIPAdv ip adv = + let cl = mkSClause (ip.s ! Dir) (agrP3 ip.g ip.n) + (insertAdV (adv.s ! ip.g) (predAux auxBe)) + in {s = \\t,p,_ => cl.s ! t ! p ! ODir} ; + + SelfAdvVP vp = insertAdV "خود" vp ; + SelfAdVVP vp = insertAdV "خود" vp ; + SelfNP np = {s = \\c => np.s ! c ++ "خود" ; a = np.a} ; + -- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; ProgrVP vp = (predProg vp) ; diff --git a/src/urdu/NamesUrd.gf b/src/urdu/NamesUrd.gf new file mode 100644 index 000000000..3ba1b5de3 --- /dev/null +++ b/src/urdu/NamesUrd.gf @@ -0,0 +1,14 @@ +--# -path=.:../abstract:../common:../hindustani + +concrete NamesUrd of Names = CatUrd ** open ResUrd, CommonHindustani in { + lin + GivenName name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + MaleSurname name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + FemaleSurname name = {s = \\_ => name.s ; a = agrP3 Fem Sg} ; + PlSurname name = {s = \\_ => name.s ; a = agrP3 Masc Pl} ; + FullName given surname = {s = \\_ => given.s ++ surname.s ; a = agrP3 Masc Sg} ; + UseLN name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + PlainLN name = {s = \\_ => name.s ; a = agrP3 Masc Sg} ; + InLN name = {s = \\_ => name.s ++ "میں"} ; + AdjLN ap name = {s = ap.s ! Sg ! Masc ! Dir ! Posit ++ name.s} ; +} diff --git a/src/urdu/NumeralUrd.gf b/src/urdu/NumeralUrd.gf index d51264053..415569329 100644 --- a/src/urdu/NumeralUrd.gf +++ b/src/urdu/NumeralUrd.gf @@ -18,6 +18,8 @@ lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ; lincat Sub100 = {s : Str ; size : Size ; n : Number} ; lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ; lincat Sub1000000 = { s : Str ; n : Number } ; +lincat Sub1000000000 = {s : Str ; n : Number} ; +lincat Sub1000000000000 = {s : Str ; n : Number} ; lin num x0 = {s = table { @@ -82,6 +84,7 @@ lin pot1 d = {s = d.s ! ten ; size = less100 ; n = Pl} ; --changed from d.n lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = Pl} ; --changed from d.n lin pot1as2 n = {s = n.s ; s2 = "دمی" ; size = n.size ; n = n.n} ; +lin pot21 = {s = "سو" ; s2 = "ایک لاکھ" ; size = more100 ; n = Pl} ; lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; s2 = d.s ! unit ++ "لاکھ" ; size = more100 ; n = Pl} ; --changed from d.n lin pot2plus d e = @@ -90,6 +93,7 @@ lin pot2plus d e = size = more100 ; n = Pl} ; lin pot2as3 n = {s = n.s ; n = n.n} ; +lin pot31 = {s = "ایک ہزار" ; n = Pl} ; lin pot3 n = {s = table { singl => ekhazar ; less100 => n.s ++ "ہزار" ; more100 => n.s2 } ! n.size ; n = Pl} ; --changed from d.n @@ -98,6 +102,18 @@ lin pot3plus n m = less100 => n.s ++ "ہزار" ; more100 => n.s2 } ! n.size ++ m.s ; n = Pl} ; --changed from d.n +lin pot3as4 n = n ; +lin pot3decimal n = {s = n.s ! NCard ++ "ہزار" ; n = Pl} ; +lin pot41 = {s = "دس لاکھ" ; n = Pl} ; +lin pot4 n = {s = n.s ++ "دس لاکھ" ; n = Pl} ; +lin pot4plus n m = {s = n.s ++ "دس لاکھ" ++ m.s ; n = Pl} ; +lin pot4as5 n = n ; +lin pot4decimal n = {s = n.s ! NCard ++ "دس لاکھ" ; n = Pl} ; +lin pot51 = {s = "ایک ارب" ; n = Pl} ; +lin pot5 n = {s = n.s ++ "ارب" ; n = Pl} ; +lin pot5plus n m = {s = n.s ++ "ارب" ++ m.s ; n = Pl} ; +lin pot5decimal n = {s = n.s ! NCard ++ "ارب" ; n = Pl} ; + lin D_0 = { s = "۰" ; n = Sg}; lin D_1 = { s = "۱" ; n = Sg}; lin D_2 = { s = "۲" ; n = Pl}; @@ -109,7 +125,7 @@ lin D_7 = { s = "۷" ; n = Pl}; lin D_8 = { s = "۸" ; n = Pl}; lin D_9 = { s = "۹" ; n = Pl}; lin IDig d = { s = \\_ => d.s ; n = d.n} ; -lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl }; +lin IIDig d dg = {s = \\df => Prelude.glue d.s (dg.s ! df) ; n = Pl} ; lin PosDecimal d = d ** {hasDot=False} ; lin NegDecimal d = { s = \\df => Prelude.glue "-" (d.s ! df) ; diff --git a/src/urdu/ParadigmsUrd.gf b/src/urdu/ParadigmsUrd.gf index 54d1aaa8e..f8dca6d49 100644 --- a/src/urdu/ParadigmsUrd.gf +++ b/src/urdu/ParadigmsUrd.gf @@ -78,8 +78,8 @@ oper mkA : Str -> Str -> A2 -- e.g sE Xady krna = \a,c -> let n = regAdjective a in {s = n.s; c2 = c} ** {lock_A2 = <>} ; } ; - mkA2 : A -> Str -> A2 ; - mkA2 a str = a ** {c2=str ; lock_A2 = <>} ; + mkA2 : A -> Prep -> A2 ; + mkA2 a prep = a ** {c2 = prep.s ! Masc ; lock_A2 = <>} ; -- compound Adjectives mkCompoundA : Str -> Str -> A ; -- e.g dra hwa diff --git a/src/urdu/StructuralUrd.gf b/src/urdu/StructuralUrd.gf index 673573850..59932a44b 100644 --- a/src/urdu/StructuralUrd.gf +++ b/src/urdu/StructuralUrd.gf @@ -48,6 +48,7 @@ concrete StructuralUrd of Structural = CatUrd ** more_CAdv = {s = "زیادہ" ; p = "سے" } ; most_Predet = ss "زیادہ تر" ; much_Det = mkDet "بہت" "بہت" "بہت" "بہت" Sg ; + must_VV = mkVV (mkV "پڑنا") ; -- must_VV = { -- s = table { -- VVF VInf => ["ہاvع تo"] ; @@ -71,7 +72,7 @@ concrete StructuralUrd of Structural = CatUrd ** please_Voc = ss "مہربانی" ; possess_Prep = mkPrep "کا" "کی" ; quite_Adv = ss "خاموش" ; - she_Pron = personalPN "وہ" "اس" "وہ" ["اس کی"] ["اس کی"] ["اس کے"] ["اس کی"] Sg Fem Pers3_Distant ; + she_Pron = personalPN "وہ" "اس" "وہ" ["اس کا"] ["اس کی"] ["اس کے"] ["اس کی"] Sg Fem Pers3_Distant ; so_AdA = ss "اس لیے" ; somebody_NP = MassNP (UseN (ParadigmsUrd.mkN "کوی" "کوی" "کوی" "کوی" "کوی" "کوی" Masc )); someSg_Det = mkDet "کچھ" "کچھ" "کچھ" "کچھ" Sg ; @@ -84,7 +85,7 @@ concrete StructuralUrd of Structural = CatUrd ** there7to_Adv = mkAdv ["وہاں پر"] ; there7from_Adv = mkAdv ["وہاں سے"] ; therefore_PConj = ss "اس لیے" ; - they_Pron = personalPN "وہ" "وہ" "وہ" ["ان کا"] ["ان کی"] ["ان کے"] ["ان کی"] Pl Masc Pers3_Distant ; ---- + they_Pron = personalPN "وہ" "ان" "وہ" ["ان کا"] ["ان کی"] ["ان کے"] ["ان کی"] Pl Masc Pers3_Distant ; ---- this_Quant = demoPN "یہ" "اس" "ان"; through_Prep = mkPrep ["میں سے"] ["میں سے"] ; too_AdA = ss "بہت" ; diff --git a/src/urdu/src/DiffUrd.gf b/src/urdu/src/DiffUrd.gf index e9aa4cbaa..456a94c0b 100644 --- a/src/urdu/src/DiffUrd.gf +++ b/src/urdu/src/DiffUrd.gf @@ -5,6 +5,11 @@ flags coding = utf8 ; oper addErgative s1 s2 = s1 ++ s2 ; +ergativePron ppf a = case a of { + Ag _ Pl Pers3_Distant => "anhwN nE" ; + Ag _ _ (Pers3_Near | Pers3_Distant) => addErgative (ppf ! Obl) nE ; + _ => addErgative (ppf ! Dir) nE + } ; conjThat = "kh" ; insertSubj : UPerson -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "waN" ; _ => s ++ "E"}; -- check with prasad for vn~ @@ -13,6 +18,8 @@ conjThat = "kh" ; awr = "awr" ; ky = "ky" ; ka = "ka" ; + kE = "kE" ; + rh = "rh" ; jn = "jn" ; js = "js" ; jw = "jw" ; diff --git a/src/urdu/src/StructuralUrd.gf b/src/urdu/src/StructuralUrd.gf index dac873e1b..4da49c57b 100644 --- a/src/urdu/src/StructuralUrd.gf +++ b/src/urdu/src/StructuralUrd.gf @@ -71,7 +71,7 @@ concrete StructuralUrd of Structural = CatUrd ** please_Voc = ss "mhrbany" ; possess_Prep = mkPrep "ka" "ky" ; quite_Adv = ss "KamwX" ; - she_Pron = personalPN "wh" "as" "wh" ["as ky"] ["as ky"] ["as kE"] ["as ky"] Sg Fem Pers3_Distant ; + she_Pron = personalPN "wh" "as" "wh" ["as ka"] ["as ky"] ["as kE"] ["as ky"] Sg Fem Pers3_Distant ; so_AdA = ss "as lyE" ; somebody_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy" "kwy" "kwy" "kwy" "kwy" "kwy" Masc )); someSg_Det = mkDet "kch'" "kch'" "kch'" "kch'" Sg ; @@ -84,7 +84,7 @@ concrete StructuralUrd of Structural = CatUrd ** there7to_Adv = mkAdv ["whaN pr"] ; there7from_Adv = mkAdv ["whaN sE"] ; therefore_PConj = ss "as lyE" ; - they_Pron = personalPN "wh" "wh" "wh" ["an ka"] ["an ky"] ["an kE"] ["an ky"] Pl Masc Pers3_Distant ; ---- + they_Pron = personalPN "wh" "an" "wh" ["an ka"] ["an ky"] ["an kE"] ["an ky"] Pl Masc Pers3_Distant ; ---- this_Quant = demoPN "yh" "as" "an"; through_Prep = mkPrep ["myN sE"] ["myN sE"] ; too_AdA = ss "bht" ;