From 029d90adc83ab306f48a2f3f6a7111e115e8918c Mon Sep 17 00:00:00 2001 From: "virk.shafqat" Date: Tue, 9 Apr 2013 13:48:04 +0000 Subject: [PATCH] implementation of few more functions in ParseHin,Urd and new entries in DictUrd2 --- lib/src/hindi/DiffHin.gf | 1 + lib/src/hindi/ParseHin.gf | 14 +++++------ lib/src/hindi/src/DiffHin.gf | 1 + lib/src/hindustani/AdverbHindustani.gf | 1 + lib/src/hindustani/DiffHindustani.gf | 1 + lib/src/hindustani/ExtraHindustani.gf | 6 +++++ lib/src/hindustani/NounHindustani.gf | 7 +++++- lib/src/urdu/DictUrd2.gf | 24 +++++++++++++++++++ lib/src/urdu/DiffUrd.gf | 1 + lib/src/urdu/ParseUrd.gf | 33 ++++++++++++++++++++++---- lib/src/urdu/src/DiffUrd.gf | 1 + 11 files changed, 78 insertions(+), 12 deletions(-) diff --git a/lib/src/hindi/DiffHin.gf b/lib/src/hindi/DiffHin.gf index 7158db77f..b9b61061a 100644 --- a/lib/src/hindi/DiffHin.gf +++ b/lib/src/hindi/DiffHin.gf @@ -29,6 +29,7 @@ oper nahen = "नहीं" ; xayad = "शायद" ; kya = "क्या" ; + mein = "में" ; oper copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> diff --git a/lib/src/hindi/ParseHin.gf b/lib/src/hindi/ParseHin.gf index 45ab3f38b..25edb7253 100644 --- a/lib/src/hindi/ParseHin.gf +++ b/lib/src/hindi/ParseHin.gf @@ -35,7 +35,8 @@ lin itself_NP = {s = \\_ => kwd ; a = Ag Masc Sg Pers3_Near }; --regNP "itself" singular ; ourself_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers1 }; --regNP "ourself" plural ; yourselfPl_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers2_Respect }; --regNP "yourself" plural ; - themself_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers3_Distant }; --regNP "themself" plural ; + themselves_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers3_Distant }; --regNP "themself" plural ; + themself_NP = {s = \\_ => kwd ; a = Ag Masc Sg Pers3_Distant }; --regNP "themself" plural ; CompoundCN num noun cn = { s = \\n,c => num.s ++ cn.s ! n ! c ++ noun.s ! num.n ! Dir; @@ -135,17 +136,16 @@ lin UncNeg = {s = [] ; p = Neg} ; VPSlashPrep vp p = vp ** {c2 = {s = p.s!Masc ; c = VTrans}} ; - {- + PastPartRS ant pol vps = { - s = \\agr => vps.ad ++ vps.ptp ++ vps.s2 ! agr ; - c = npNom + s = \\agr => (vps.s!VPTense VPPast agr).inf ; + c = Dir } ; PresPartRS ant pol vp = { - s = \\agr => vp.ad ++ vp.prp ++ vp.s2 ! agr ; - c = npNom + s = \\agr => (vp.s!VPTense VPPres agr).inf ; + c = Dir } ; - -} ApposNP np1 np2 = { s = \\c => np1.s!NPC Dir ++ "," ++ np2.s ! c ; diff --git a/lib/src/hindi/src/DiffHin.gf b/lib/src/hindi/src/DiffHin.gf index d2609ad90..e0ca8d18c 100644 --- a/lib/src/hindi/src/DiffHin.gf +++ b/lib/src/hindi/src/DiffHin.gf @@ -29,6 +29,7 @@ oper nahen = "nahi:m." ; xayad = "s*a:yd" ; kya = "kX,ya:" ; + mein = "me:m." ; oper copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> diff --git a/lib/src/hindustani/AdverbHindustani.gf b/lib/src/hindustani/AdverbHindustani.gf index 27df5819a..475c20d3a 100644 --- a/lib/src/hindustani/AdverbHindustani.gf +++ b/lib/src/hindustani/AdverbHindustani.gf @@ -2,6 +2,7 @@ incomplete concrete AdverbHindustani of Adverb = CatHindustani ** open CommonHin lin 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; } ; diff --git a/lib/src/hindustani/DiffHindustani.gf b/lib/src/hindustani/DiffHindustani.gf index a3070bc6d..77159240e 100644 --- a/lib/src/hindustani/DiffHindustani.gf +++ b/lib/src/hindustani/DiffHindustani.gf @@ -22,6 +22,7 @@ interface DiffHindustani = open Prelude in { indfArt : Str ; nE : Str ; hE : Str ; + mein : Str ; na : Str ; nahen : Str ; diff --git a/lib/src/hindustani/ExtraHindustani.gf b/lib/src/hindustani/ExtraHindustani.gf index 7c78fc0a0..8abe658d0 100644 --- a/lib/src/hindustani/ExtraHindustani.gf +++ b/lib/src/hindustani/ExtraHindustani.gf @@ -11,6 +11,12 @@ incomplete concrete ExtraHindustani of ExtraHindustaniAbs = CatHindustani ** }; a = np.a} ; + + EmptyRelSlash slash = { + s = \\t,p,o,_ => slash.s ! t ! p ! o ++ slash.c2.s ; + c = Obl + } ; + each_Det = mkDet "hr kwy" "hr kwy" "hr kwy" "hr kwy" Sg ; have_V = mkV "rakh'na"; diff --git a/lib/src/hindustani/NounHindustani.gf b/lib/src/hindustani/NounHindustani.gf index b689e4c98..d9f951d31 100644 --- a/lib/src/hindustani/NounHindustani.gf +++ b/lib/src/hindustani/NounHindustani.gf @@ -31,7 +31,7 @@ incomplete concrete NounHindustani of Noun = AdvNP np adv = { -- s = \\c => np.s ! c ++ adv.s ! (fromAgr np.a).g ; -- jan ka bh'ay so order is changed s = \\c => adv.s ! (fromAgr np.a).g ++ np.s ! c ; - a = np.a + a = np.a } ; DetQuantOrd quant num ord = { @@ -149,4 +149,9 @@ incomplete concrete NounHindustani of Noun = Fem => cn.s ! n ! c ++ ky ++ np.s ! NPC Dir } ; g = cn.g} ; + CountNP det np = { + s = \\c => np.s ! NPC Obl ++ mein ++ sE ++ det.s ! (giveNumber np.a) ! (giveGender np.a) ! Dir ; + a = agrP3 (giveGender np.a) det.n + } ; + } diff --git a/lib/src/urdu/DictUrd2.gf b/lib/src/urdu/DictUrd2.gf index 1b4e85a5c..e18b27fcb 100644 --- a/lib/src/urdu/DictUrd2.gf +++ b/lib/src/urdu/DictUrd2.gf @@ -30023,6 +30023,7 @@ lin zoology_N = mkN "حیوانیات" ; -- from DictUrd lin zoom_N = mkN "تیزی سے آنا" ; lin zoom_V = compoundV "سیدھا" (mkV "اوپر چڑھنا") ; -- from DictUrd + -- Structural lin of_Prep = mkPrep "کا" "کی" ; @@ -30219,4 +30220,27 @@ lin should_VV = mkV "چاہنا" ** { isAux = True} ; --this need to be fixed lin must_VV = (mkV "ضرور چاہنا") ** { isAux = True} ; -- this need to be fixed lin half_Predet = ss "آدھا" ; lin till_Prep = mkPrep "جب تک" "جب تک" ; +--added 2013/04/09 + + +lin unit_3_N = mkN ["یونٹ تھری"]; +lin minneapolis_PN = mkPN "مینیاپولیس" ; +lin pretty_AdA = ss "کافی" ; +lin upon_Prep = mkPrep "پر" "پر" ; +lin anyPl_Det = mkDet "کوئی" "کوئی" "کوئی" "کوئی" Pl ; +--lin as_Prep = mkPrep "جیسا" "جیسی" ; +lin also_AdV = ss "بھی" ; +lin even_AdA = ss "چاھے" ; +lin such_Predet = ss "ایسی" ; +lin outside_Prep = mkPrep "باہر" "باہر" ; +lin another_Quant = demoPN "کوئی اور" "کوئی اور" "کوئی اور"; +lin japaneseMasc_N = mkN "جاپانی" ; +lin in_addition_Adv = mkAdv "مزید" ; +lin for_starters_Adv = mkAdv "آغاز کرنے والوں کیلئے" ; +lin never_AdV = ss "کھبی نہیں" ; +lin among_Prep = mkPrep "میں سے" "میں سے" ; +lin throughout_Prep = mkPrep "مکمل" "مکمل" ; +lin further_AdV = ss "مزید" ; +lin for_instance_Adv = mkAdv "مثال کے طور پر" ; + } diff --git a/lib/src/urdu/DiffUrd.gf b/lib/src/urdu/DiffUrd.gf index 2bd4b010d..dca736172 100644 --- a/lib/src/urdu/DiffUrd.gf +++ b/lib/src/urdu/DiffUrd.gf @@ -26,6 +26,7 @@ conjThat = "کہ" ; comma = "," ; indfArt = "" ; kwd = "خود" ; + mein = "میں" ; na = "نا" ; nahen = "نہیں" ; diff --git a/lib/src/urdu/ParseUrd.gf b/lib/src/urdu/ParseUrd.gf index 63f0bc59e..e44b19359 100644 --- a/lib/src/urdu/ParseUrd.gf +++ b/lib/src/urdu/ParseUrd.gf @@ -1,4 +1,4 @@ ---# -path=.:alltenses:../abstract:../english +--# -path=.:alltenses:../abstract:../english:../hindustani concrete ParseUrd of ParseEngAbs = TenseX - [AdN,Adv,SC,PPos,PNeg], -- TextX - [AdN,Adv,SC], @@ -25,6 +25,7 @@ open MorphoUrd, ResUrd, ParadigmsUrd,CommonX, CommonHindustani, Prelude in { flags literal=Symb ; + coding=utf8 ; lin myself_NP = {s = \\_ => kwd ; a = Ag Masc Sg Pers1 }; @@ -34,7 +35,8 @@ lin itself_NP = {s = \\_ => kwd ; a = Ag Masc Sg Pers3_Near }; --regNP "itself" singular ; ourself_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers1 }; --regNP "ourself" plural ; yourselfPl_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers2_Respect }; --regNP "yourself" plural ; - themself_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers3_Distant }; --regNP "themself" plural ; + themselves_NP = {s = \\_ => kwd ; a = Ag Masc Pl Pers3_Distant }; --regNP "themself" plural ; + themself_NP = {s = \\_ => kwd ; a = Ag Masc Sg Pers3_Distant }; --regNP "themself" plural ; CompoundCN num noun cn = { s = \\n,c => num.s ++ cn.s ! n ! c ++ noun.s ! num.n ! Dir; @@ -117,7 +119,7 @@ CompVP ant p vp = {s = \\a => ant.s ++ p.s ++ infVP False vp a} ; -- check for vp.isAux that_RP = { - s = \\_,_ => "kh" ; + s = \\_,_ => "کہ" ; a = RNoAg } ; --no_RP = { @@ -125,12 +127,35 @@ CompVP ant p vp = {s = \\a => ant.s ++ p.s ++ -- a = RNoAg -- } ; - CompS s = {s = \\_ => "kh" ++ s.s} ; + CompS s = {s = \\_ => "کہ" ++ s.s} ; -- CompVP vp = {s = \\a => infVP VVInf vp a} ; lin PPos = {s = [] ; p = Pos} ; PNeg = {s = [] ; p = Neg} ; -- contracted: don't UncNeg = {s = [] ; p = Neg} ; + + --VPSlashPrep vp p = vp ** {c2 = {s = p.s!Masc ; c = VTrans}} ; + + PastPartRS ant pol vps = { + s = \\agr => (vps.s!VPTense VPPast agr).inf ; + c = Dir + } ; + + PresPartRS ant pol vp = { + s = \\agr => (vp.s!VPTense VPPres agr).inf ; + c = Dir + } ; + + ApposNP np1 np2 = { + s = \\c => np1.s!NPC Dir ++ "," ++ np2.s ! c ; + a = np2.a + } ; + + AdAdV = cc2 ; + + UttAdV adv = adv; + + CompQS qs = {s = \\_ => qs.s ! QIndir} ; } diff --git a/lib/src/urdu/src/DiffUrd.gf b/lib/src/urdu/src/DiffUrd.gf index e27a8890f..0036bef57 100644 --- a/lib/src/urdu/src/DiffUrd.gf +++ b/lib/src/urdu/src/DiffUrd.gf @@ -26,6 +26,7 @@ conjThat = "kh" ; comma = "," ; indfArt = "" ; kwd = "Kwd" ; + mein = "myN" ; na = "na" ; nahen = "nhyN" ;