From c019609e230a95bcb9df93583e49e93c05799451 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sun, 7 Feb 2010 09:10:08 +0000 Subject: [PATCH] some changes in Urdu by Shafqat --- lib/src/urdu/CatUrd.gf | 16 +- lib/src/urdu/IdiomUrd.gf | 4 +- lib/src/urdu/LexiconUrd.gf | 41 ++-- lib/src/urdu/NounUrd.gf | 24 +-- lib/src/urdu/NumeralUrd.gf | 212 ++++++++++-------- lib/src/urdu/ParadigmsUrd.gf | 43 +--- lib/src/urdu/QuestionUrd.gf | 10 +- lib/src/urdu/RelativeUrd.gf | 4 +- lib/src/urdu/ResUrd.gf | 393 +++++++++++++++++++--------------- lib/src/urdu/StructuralUrd.gf | 6 +- lib/src/urdu/VerbUrd.gf | 10 +- 11 files changed, 395 insertions(+), 368 deletions(-) diff --git a/lib/src/urdu/CatUrd.gf b/lib/src/urdu/CatUrd.gf index 016542840..dfbb826c0 100644 --- a/lib/src/urdu/CatUrd.gf +++ b/lib/src/urdu/CatUrd.gf @@ -30,7 +30,7 @@ concrete CatUrd of Cat = CommonX ** open ResUrd, Prelude in { -- IP = {s : Number => Case => Str} ; -- IComp = {s : Str} ; IDet = {s :Gender => Str ; n : Number} ; --- IQuant = {s : Number => Str} ; + IQuant = {s : Number => Str} ; ---- Relative @@ -42,7 +42,7 @@ concrete CatUrd of Cat = CommonX ** open ResUrd, Prelude in { -- RP = {s : RCase => Str ; a : RAgr} ; ---- Verb --- VP = ResUrd.Verb; + VP = ResUrd.VPH ; VPSlash = ResUrd.VPHSlash ; Comp = {s : Agr => Str} ; @@ -56,21 +56,21 @@ concrete CatUrd of Cat = CommonX ** open ResUrd, Prelude in { CN = ResUrd.Noun ; NP = ResUrd.NP ; Pron = {s : PersPronForm => Str; a : Agr} ; --- Pron = {s : PronCase => Str ; a : Agr} ; + Det = {s:Determiner => Str ; n : Number}; --- Det = {s : Gender => Case => Str ; n : Number} ; + Predet, Ord = {s : Str} ; - Num = Str; --- Num = {s : Str ; n : Number} ; --- Card = {s : Str; n : Number} ; +-- Num = Str; + Num = {s : Str ; n : Number} ; + Card = {s : Str; n : Number} ; Quant = {s:DemPronForm => Str ; a : Agr}; -- Quant = {s : Number => Gender => Case => Str} ; Art = {s : Str} ; ---- Numeral --- Numeral = {s : CardOrd => Str ; n : Number} ; + Numeral = {s : CardOrd => Str ; n : Number} ; -- Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ; ---- Structural diff --git a/lib/src/urdu/IdiomUrd.gf b/lib/src/urdu/IdiomUrd.gf index dedca8afe..8ecf08061 100644 --- a/lib/src/urdu/IdiomUrd.gf +++ b/lib/src/urdu/IdiomUrd.gf @@ -38,8 +38,8 @@ concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { -- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; -- -- ImpPl1 vp = {s = "Aw" ++ infVP True vp (agrP1 Masc Pl)} ; - ImpPl1 vp = {s = "Aw" ++ (vp.s ! Pos ! VPTense VPFut (Ag Masc Pl Pers3_Near) ! ODir).inf2} ; - ImpP3 np vp = {s = np.s!NPC Dir ++ "kw" ++ (vp.s ! Pos ! VPImp ! ODir).inf2 ++ "dw"}; +-- ImpPl1 vp = {s = "Aw" ++ (vp.s ! VPTense VPFutr (Ag Masc Pl Pers3_Near)).inf2} ; +-- ImpP3 np vp = {s = np.s!NPC Dir ++ "kw" ++ (vp.s ! VPImp ).inf2 ++ "dw"}; -- } diff --git a/lib/src/urdu/LexiconUrd.gf b/lib/src/urdu/LexiconUrd.gf index 6a57f68e7..73d0d2c6b 100644 --- a/lib/src/urdu/LexiconUrd.gf +++ b/lib/src/urdu/LexiconUrd.gf @@ -9,8 +9,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** lin airplane_N = mkN "jhaz" ; --- answer_V2S = mkV_3 (mkCmpdVerb (mkN "jwab" ) "dyna" ) (mkCmpdVerb (mkN "jwab") "dlwana") ; - answer_V2S = mkV2 (mkV (mkCmpdVerb (mkN "jwab" ) "dyna" )) ; + answer_V2S = mkV2 (compoundV "jwab" (mkV "dyna")) ; apartment_N = mkN "kmrh" ; apple_N = mkN "syb" ; art_N = mkN "fn" ; @@ -54,7 +53,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** clean_A = mkA "Saf" ; clever_A = mkA "hwXyar" ; --- close_V2 = mkV2 (mkV (mkCmpdVerb1 (mkN "bnd" ) (mkV "krna"))); + close_V2 = mkV2 (compoundV "bnd" do_V2); coat_N = mkN "kwT" ; cold_A = mkA "Th-nDa" ; come_V = mkV "Ana" ; @@ -70,7 +69,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** door_N = mkN "drwzh" ; drink_V2 = mkV2 (mkV "pyna"); easy_A2V = mkA "Asan" "" ; - eat_V2 = mkV2 (mkV "kh-ana") "kw" ; + eat_V2 = mkV2 (mkV "kh-ana") "" ; -- empty_A = mkA "Kaly" ; enemy_N = mkN "dXmn" ; factory_N = mkN "karKanh" ; @@ -92,12 +91,12 @@ concrete LexiconUrd of Lexicon = CatUrd ** go_V = mkV "jana" ; green_A = mkA "sbz" ; -- harbour_N = mkN "harbour" ; - hate_V2 = mkV2 (mkV (mkCmpdVerb (mkN "nfrt" ) "krna" )) ; + hate_V2 = mkV2 (compoundV "nfrt" do_V2) ; hat_N = mkN "twpy" ; -- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; hear_V2 = mkV2 (mkV "snna") ; hill_N = mkN "phaRy" ; - hope_VS = mkV (mkCmpdVerb (mkN "amyd" ) "krna" ); + hope_VS = (compoundV "amyd" do_V2); horse_N = mkN "gh-wRa" ; hot_A = mkA "grm" ; house_N = mkN "gh-r" ; @@ -111,13 +110,13 @@ concrete LexiconUrd of Lexicon = CatUrd ** learn_V2 = mkV2 (mkV "sykh-na") ; leather_N = mkN "cmRa" ; -- leave_V2 = dirV2 (irregV "leave" "left" "left") ; - like_V2 = mkV2 (mkV (mkCmpdVerb (mkN "psnd" ) "krna" )); + like_V2 = mkV2 (compoundV "psnd" do_V2); listen_V2 = mkV2 (mkV "snna") ; live_V = mkV "rhna" ; ---- touch long_A = mkA "lmba" ; - lose_V2 = mkV2 (mkV (mkCmpdVerb (mkN "kh-w" ) "dyna" )) ; + lose_V2 = mkV2 (compoundV "kh-w" do_V2) ; love_N = mkN "mHbt" ; - love_V2 = mkV2 (mkV (mkCmpdVerb (mkN "pyar" ) "krna" )) ; + love_V2 = mkV2 (compoundV "pyar" do_V2) ; man_N = mkN "Admy" ; -- not correct according to rules should be discussed married_A2 = mkA "Xady krna" "sE" ; meat_N = mkN "gwXt" ; @@ -132,7 +131,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** oil_N = mkN "tyl" ; old_A = mkA "bwRh-a" ; open_V2 = mkV2 (mkV "kh-wlna") ; - paint_V2A = mkV2 (mkV (mkCmpdVerb (mkN "rng" ) "krna" )) ; + paint_V2A = mkV2 (compoundV "rng" do_V2) ; paper_N = mkN "kaGz" ; -- paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ; peace_N = mkN "amn" ; @@ -145,7 +144,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** -- probable_AS = mkAS (regA "probable") ; queen_N = mkN "Xhzady" ; -- radio_N = mkN "radio" ; - rain_V0 = mkV (mkCmpdVerb (mkN "barX" ) "hwna" ) ; + rain_V0 = compoundV "barX" (mkV "hwna" ) ; read_V2 = mkV2 (mkV "pRh-na"); red_A = mkA "lal" ; religion_N = mkN "mzhb" ; @@ -159,7 +158,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** school_N = mkN "skwl" ; -- science_N = mkN "science" ; sea_N = mkN "smndr" ; - seek_V2 = mkV2 (mkV (mkCmpdVerb (mkN "tlaX" ) "krna" )) ; + seek_V2 = mkV2 (compoundV "tlaX" do_V2) ; see_V2 = mkV2 (mkV "dykh-na") ; sell_V3 = mkV3 (mkV "bycna") "kw" ""; send_V3 = mkV3 (mkV "bh-yjna") "kw" ""; @@ -194,14 +193,14 @@ concrete LexiconUrd of Lexicon = CatUrd ** thin_A = mkA "ptla" ; train_N = mkN "gaRy" ; -- travel_V = mkV - travel_V = mkV (mkCmpdVerb (mkN "sfr" ) "krna" ) ; + travel_V = (compoundV "sfr" do_V2) ; tree_N = mkN "drKt" masculine ; -- ---- trousers_N = mkN "trousers" ; ugly_A = mkA "bdSwrt" ; understand_V2 = mkV2 (mkV "smjh-na") ; -- university_N = mkN "university" ; village_N = mkN "gawN" ; - wait_V2 = mkV2 (mkV (mkCmpdVerb (mkN "antz-ar" ) "krna" )) ; + wait_V2 = mkV2 (compoundV "antz-ar" do_V2) ; walk_V = mkV "clna" ; warm_A = mkA "grm" ; war_N = mkN "jng" ; @@ -222,7 +221,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** -- now_Adv = mkAdv "now" ; -- already_Adv = mkAdv "already" ; song_N = mkN "gana" ; --- add_V3 = mkV (mkCmpdVerb (mkN "aZ-afh" ) "krna" ) ; + add_V3 = mkV3 (compoundV "aZ-afh" do_V2) "" "" ; number_N = mkN "hndsh" ; put_V2 = mkV2 (mkV "Dalna") ; stop_V = mkV "rkna" ; @@ -308,7 +307,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** worm_N = mkN "grm" ; year_N = mkN "sal" ; blow_V = mkV "clna" ; - breathe_V = mkV (mkCmpdVerb (mkN "sans" ) "lyna" ) ; + breathe_V = compoundV "sans" (mkV "lyna" ) ; burn_V = mkV "jlna" ; dig_V = mkV "kh-wdna" ; fall_V = mkV "grna" ; @@ -319,9 +318,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** give_V3 = mkV3 (mkV "dyna") "kw" ""; laugh_V = mkV "hnsna" ; -- lie_N = mkN "jh-wt" masculine ; --- lie_V = mkV_3 (mkCmpd lie_N "bwlna") (mkCmpd lie_N "bwlwana") ; --- lie_V = mkV_3 (mkCmpdVerb (mkN "jh-wt" masculine) "bwlna" ) (mkCmpdVerb (mkN "jh-wt" masculine) "bwlwana") ; - lie_V = mkV (mkCmpdVerb (mkN "jh-wt" masculine) "bwlna" ); + lie_V = compoundV "jh-wt" (mkV "bwlna" ); play_V = mkV "kh-ylna" ; sew_V = mkV "syna" ; sing_V = mkV "gana" ; @@ -340,10 +337,10 @@ concrete LexiconUrd of Lexicon = CatUrd ** cut_V2 = mkV2 (mkV "katna") ; fear_V2 = mkV2 (mkV "Drna") ; fight_V2 = mkV2 (mkV "lRna") ; - hit_V2 = mkV2 (mkV (mkCmpdVerb (mkN "th-wkr" ) "marna" )); + hit_V2 = mkV2 (compoundV "th-wkr" (mkV "marna" )); hold_V2 = mkV2 (mkV "pkRna") ; - hunt_V2 = mkV2 (mkV (mkCmpdVerb (mkN "Xkar" ) "krna" )); - kill_V2 = mkV2 (mkV (mkCmpdVerb (mkN "mar" ) "Dalna" )) ; + hunt_V2 = mkV2 (compoundV "Xkar" do_V2); + kill_V2 = mkV2 (compoundV "mar" (mkV "Dalna" )) ; pull_V2 = mkV2 (mkV "kh-ncna"); -- push_V2 = dirV2 (regV "push") ; rub_V2 = mkV2 (mkV "rgRna") ; diff --git a/lib/src/urdu/NounUrd.gf b/lib/src/urdu/NounUrd.gf index 89cf358bb..c99ec3554 100644 --- a/lib/src/urdu/NounUrd.gf +++ b/lib/src/urdu/NounUrd.gf @@ -33,13 +33,13 @@ concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in { } ; DetQuantOrd quant num ord = { - s = \\ c => detquant2det quant.s num c ++ ord.s ; - n = Sg + s = \\ c => detquant2det quant.s num.s c ++ ord.s ; + n = num.n } ; DetQuant quant num = { - s = \\c => detquant2det quant.s num c; - n = Sg + s = \\c => detquant2det quant.s num.s c; + n = num.n } ; DetNP det = { @@ -49,15 +49,15 @@ concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in { -- PossPron p = {s = \\_,_,_ => p.s ! PPoss} ; -- --- NumSg = {s = []; n = Sg} ; --- NumPl = {s = []; n = Pl} ; + NumSg = {s = []; n = Sg} ; + NumPl = {s = []; n = Pl} ; --- NumCard n = n ** {hasCard = True} ; + NumCard n = n ** {hasCard = True} ; -- -- NumDigits n = {s = n.s ! NCard ; n = n.n} ; -- OrdDigits n = {s = n.s ! NOrd} ; -- --- NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; + NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; -- OrdNumeral numeral = {s = numeral.s ! NOrd} ; -- -- AdNum adn num = {s = adn.s ++ num.s ; n = num.n} ; @@ -123,10 +123,10 @@ concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in { g = cn.g } ; --- RelCN cn rs = { --- s = \\n,c => cn.s ! n ! c ++ rs.s ! agrgP3 n cn.g ; --- g = cn.g --- } ; + RelCN cn rs = { + s = \\n,c => cn.s ! n ! c ++ rs.s ! agrP3 cn.g n ; + g = cn.g + } ; AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; -- -- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ; diff --git a/lib/src/urdu/NumeralUrd.gf b/lib/src/urdu/NumeralUrd.gf index 459d84a80..dbd890d35 100644 --- a/lib/src/urdu/NumeralUrd.gf +++ b/lib/src/urdu/NumeralUrd.gf @@ -1,95 +1,117 @@ -concrete NumeralUrd of Numeral = CatUrd ** open ResUrd in { --- ---lincat --- Digit = {s : DForm => CardOrd => Str} ; --- Sub10 = {s : DForm => CardOrd => Str ; n : Number} ; --- Sub100 = {s : CardOrd => Str ; n : Number} ; --- Sub1000 = {s : CardOrd => Str ; n : Number} ; --- Sub1000000 = {s : CardOrd => Str ; n : Number} ; --- ---lin num x = x ; ---lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in --- {s = \\f,c => case of { --- => "twelfth" ; --- _ => two.s ! f ! c --- } --- } ; --- ---lin n3 = mkNum "three" "thirteen" "thirty" "third" ; ---lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; ---lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; ---lin n6 = regNum "six" ; ---lin n7 = regNum "seven" ; ---lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; ---lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ; --- ---lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; ---lin pot0 d = d ** {n = Pl} ; ---lin pot110 = regCardOrd "ten" ** {n = Pl} ; ---lin pot111 = regCardOrd "eleven" ** {n = Pl} ; ---lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; ---lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; ---lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; ---lin pot1plus d e = { --- s = \\c => d.s ! ten ! NCard ++ "-" ++ e.s ! unit ! c ; n = Pl} ; ---lin pot1as2 n = n ; ---lin pot2 d = {s = \\c => d.s ! unit ! NCard ++ mkCard c "hundred"} ** {n = Pl} ; ---lin pot2plus d e = { --- s = \\c => d.s ! unit ! NCard ++ "hundred" ++ "and" ++ e.s ! c ; n = Pl} ; ---lin pot2as3 n = n ; ---lin pot3 n = { --- s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ; ---lin pot3plus n m = { --- s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ; --- ----- numerals as sequences of digits --- --- lincat --- Dig = TDigit ; --- --- lin --- IDig d = d ** {tail = T1} ; --- --- IIDig d i = { --- s = \\o => d.s ! NCard ++ commaIf i.tail ++ i.s ! o ; --- n = Pl ; --- tail = inc i.tail --- } ; --- --- D_0 = mkDig "0" ; --- D_1 = mk3Dig "1" "1st" Sg ; --- D_2 = mk2Dig "2" "2nd" ; --- D_3 = mk2Dig "3" "3rd" ; --- D_4 = mkDig "4" ; --- D_5 = mkDig "5" ; --- D_6 = mkDig "6" ; --- D_7 = mkDig "7" ; --- D_8 = mkDig "8" ; --- D_9 = mkDig "9" ; --- --- oper --- commaIf : DTail -> Str = \t -> case t of { --- T3 => "," ; --- _ => [] --- } ; --- --- inc : DTail -> DTail = \t -> case t of { --- T1 => T2 ; --- T2 => T3 ; --- T3 => T1 --- } ; --- --- mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; --- mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ; --- --- mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { --- s = table {NCard => c ; NOrd => o} ; --- n = n --- } ; --- --- TDigit = { --- n : Number ; --- s : CardOrd => Str --- } ; --- -} +concrete NumeralUrd of Numeral = CatUrd ** open ResUrd in { +-- By Harald Hammarström +-- flags coding=devanagari ; +--- still old Devanagari coding + + +param DForm = unit | ten ; +param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ; +param Size = sing | less100 | more100 ; + +oper LinDigit = {s : DForm => Str ; size : DSize} ; + +--lincat Numeral = { s : Str } ; +lincat Dig = { s:Str}; +lincat Digit = LinDigit ; +lincat Sub10 = {s : DForm => Str ; size : DSize} ; +lincat Sub100 = {s : Str ; size : Size} ; +lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ; +lincat Sub1000000 = { s : Str } ; + +lin num x0 = + {s = \\_ => x0.s ; n = Pl} ; -- the Devana:gari environment + + +-- H is for aspiration (h is a sepaarate letter) +-- M is anusvara +-- ~ is candrabindhu +-- c is is Eng. ch in e.g chop +-- cH is chH +-- _: is length +-- T, D, R are the retroflexes + +oper mkNum : Str -> Str -> DSize -> LinDigit = + \do -> \bis -> \sz -> + {s = table {unit => do ; ten => bis } ; + size = sz } ; + +--lin n1 mkNum "ek" "gya:rah" "das" ; +lin n2 = mkNum "do" "bi:s" r2 ; +lin n3 = mkNum "ti:n" "ti:s" r3 ; +lin n4 = mkNum "ca:r" "ca:li:s" r4 ; +lin n5 = mkNum "pa:~nc" "paca:s" r5 ; +lin n6 = mkNum (variants {"cHah" ; "cHa;" ; "cHai"}) "sa:TH" r6 ; +lin n7 = mkNum "sa:t" "sattar" r7; +lin n8 = mkNum "a:TH" "assi:" r8; +lin n9 = mkNum "nau" (variants {"navve" ; "nabbe" }) r9 ; + +oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table { + sg => a1 + "ah" ; + r2 => a2 + "i:s" ; + r3 => a3 + "ti:s" ; + r4 => a4 + "a:li:s" ; + r5 => a5 + "an" ; + r6 => a6 + "saTH" ; + r7 => a7 + "hattar" ; + r8 => a8 + "a:si:" ; + r9 => a9 + "a:nave" +} ; + +oper rows : DSize => DSize => Str = table { + sg => mkR "gya:r" "ikk" "ikat" "ekt" "ikya:v" "ik" "ik" "iky" "iky" ; + r2 => mkR "ba:r" "ba:" "bat" "bay" "ba:v" "ba:" "ba" "bay" "b" ; + r3 => mkR "ter" "te" "taiM" "taiMt" "tirp" "tir" "ti" "tir" "tir" ; + r4 => mkR "caud" "caub" "cauM" "cav" "caup" "cauM" "cau" "caur" "caur" ; + r5 => mkR "paMdr" "pacc" "paiM" "paiMt" "pacp" "paiM" "pac" "pac" "pac" ; + r6 => mkR "sol" "cHabb" "cHat" "cHiy" "cHapp" "cHiya:" "cHi" "cHiy" "cHiy" ; + r7 => mkR (variants { "sattr" ; "satr"}) "satta:v" "saiM" "saiMt" "satta:" "sar" "sat" (variants {"satt" ; "sat" }) "satt" ; + r8 => mkR "aTHa:r" "aTTHa:" "aR" "aRt" "aTTHa:v" "aR" "aTH" (variants { "aTTH" ; "aTH" }) "aTTH" ; + r9 => table {sg => "unni:s" ; r2 => "unati:s" ; r3 => "unata:li:s" ; + r4 => "unaca:s" ; r5 => "unasaTH" ; r6 => "unahattar" ; + r7 => (variants{"unna:si:" ; "unya:si:"}) ; + r8 => "nava:si:" ; r9 => "ninya:nave" } +} ; + +oper ss : Str -> {s : Str} = \s -> {s = s} ; + +lin pot01 = {s = table {unit => "ek" ; _ => "dummy" } ; size = sg} ; +lin pot0 d = d ; +lin pot110 = {s = "das" ; size = less100} ; +lin pot111 = {s = rows ! sg ! sg ; size = less100} ; +lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100} ; +lin pot0as1 n = {s = n.s ! unit ; size = table {sg => sing ; _ => less100} ! n.size } ; + +lin pot1 d = {s = d.s ! ten ; size = less100} ; +lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100} ; + +lin pot1as2 n = {s = n.s ; s2 = "dummy" ; size = n.size } ; +lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; + s2 = d.s ! unit ++ "la:kH" ; size = more100} ; +lin pot2plus d e = + {s = (mksau (d.s ! unit) d.size) ++ e.s ; + s2 = (d.s ! unit) ++ "la:kH" ++ (mkhazar e.s e.size) ; + size = more100} ; + +lin pot2as3 n = {s = n.s } ; +lin pot3 n = {s = table { sing => ekhazar ; + less100 => n.s ++ "haza:r" ; + more100 => n.s2 } ! n.size} ; +lin pot3plus n m = + {s = table {sing => ekhazar ; + less100 => n.s ++ "haza:r" ; + more100 => n.s2 } ! n.size ++ m.s} ; + +lin D_0 = { s = "0"}; +lin D_1 = { s = "1"}; +lin D_2 = { s = "2"}; +lin D_3 = { s = "3"}; +lin D_4 = { s = "4"}; +lin D_5 = { s = "5"}; +lin D_6 = { s = "6"}; +lin D_7 = { s = "7"}; +lin D_8 = { s = "8"}; +lin D_9 = { s = "9"}; +oper ekhazar : Str = variants {"haza:r" ; "ek" ++ "haza:r"} ; +oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "haza:r"} ! sz ; +oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "sau" ; _ => s ++ "sau"} ! sz ; +} diff --git a/lib/src/urdu/ParadigmsUrd.gf b/lib/src/urdu/ParadigmsUrd.gf index f2435d2ce..6b19bf6e8 100644 --- a/lib/src/urdu/ParadigmsUrd.gf +++ b/lib/src/urdu/ParadigmsUrd.gf @@ -35,12 +35,6 @@ oper mkN2 : N -> Prep -> N2; mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s } ; - --mkN02 : Str -> Noun ; - --mkN02 mrd = let mrdwN = mrd+"wN" ; - -- mrdw = tk 1 mrdwN - -- in mkNoun mrd mrd mrd - -- mrd mrdwN mrdw - -- Masc ; -- mkPN = overload { @@ -61,10 +55,6 @@ oper = \s -> regAdjective s ** {lock_A = <>} ; mkA : Str -> Str -> A2 = \a,c -> let n = regAdjective a in {s = n.s; c2 = c} ** {lock_A2 = <>} ; --- mkADeg1 : Str -> A --- = \s -> adjDeg1 s ** {lock_A = <>} ; --- mkA : (x1,_,x3 : Str) -> A --- = \msd,m,f -> mkAdjective msd m f ** {lock_A = <>} ; } ; --2 Verbs @@ -72,18 +62,6 @@ oper -- mkV = overload { mkV : Str -> V = \s -> mkVerb s ** {lock_V = <>} ; --- mkV_3 : Str -> Str -> V --- = \s,t -> mkVerb3 s t ** {lock_V = <>} ; --- mkV_2 : Str -> Str -> V --- = \s,c1 -> mkVerb2 s c1 ** {lock_V = <>} ; --- mkV_1_2 : Str -> Str -> Str -> V --- = \s,c1,c2 -> mkVerb1_2 s c1 c2 ** {lock_V = <>} ; --- mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> V --- = \inf,stem,ims,imp,ifs,ifp,pms,pmp,pfs,pfp,ss1,ss2,sp2,sp3,r -> --- mkVerb inf stem ims imp ifs ifp pms pmp pfs pfp ss1 ss2 sp2 sp3 r ** --- {lock_V = <>} ; --- } ; - mkV2 = overload { mkV2 : Str -> V2 @@ -91,26 +69,17 @@ oper mkV2 : V -> V2 = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; mkV2 : V -> Str -> V2 - = \v,p -> v ** {c2 = {s = p ; c = VTransPost} ; lock_V2 = <>} ; + = \v,p -> v ** {c2 = {s = p ; c = VTrans} ; lock_V2 = <>} ; } ; - --mkV2 = overload { --- mkV2 : Str -> V2 --- = \s -> mkVerb s ** { lock_V2 = <>} ; - -- mkV2 : V -> V2 - -- = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; - -- mkV2 : V -> Str -> V2 - -- = \v,p -> v ** {c2 = {s = p ; c = VTransPost} ; lock_V2 = <>} ; - -- } ; -- compund verbs + compoundV = overload { + compoundV : Str -> V -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; + compoundV : Str -> V2 -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; + }; + - mkCmpdVerb1 : N -> V -> Str = - \n,v -> n.s ! Sg ! Dir ++ v.s ! Inf ; - mkCmpdVerb = overload { - mkCmpdVerb : N -> Str -> Str - = \n,x -> n.s ! Sg ! Dir ++ x; - }; mkCmpdNoun = overload { mkCmpdNoun : N -> N -> Str = \n1,n2 -> n1.s ! Sg ! Dir ++ n2.s ! Sg ! Dir; diff --git a/lib/src/urdu/QuestionUrd.gf b/lib/src/urdu/QuestionUrd.gf index 6eae3ee6e..fb1c0d606 100644 --- a/lib/src/urdu/QuestionUrd.gf +++ b/lib/src/urdu/QuestionUrd.gf @@ -58,11 +58,11 @@ concrete QuestionUrd of Question = CatUrd ** open ResUrd, Prelude in { g = Masc; } ; --- IdetQuant idet num = { --- s = idet.s ! num.n ++ num.s ; --- n = num.n --- } ; --- + IdetQuant iqant num = { + s = \\g => iqant.s ! num.n ++ num.s ; + n = num.n + } ; + CompIAdv a = a ; CompIP p = ss (p.s ! Dir) ; diff --git a/lib/src/urdu/RelativeUrd.gf b/lib/src/urdu/RelativeUrd.gf index 1beebf65d..04aeac94f 100644 --- a/lib/src/urdu/RelativeUrd.gf +++ b/lib/src/urdu/RelativeUrd.gf @@ -13,7 +13,7 @@ concrete RelativeUrd of Relative = CatUrd ** open ResUrd in { c = Dir } ; - RelVP rp vp = { +{- RelVP rp vp = { s = \\t,p,o,ag => let agr = case rp.a of { @@ -42,7 +42,7 @@ concrete RelativeUrd of Relative = CatUrd ** open ResUrd in { -- }; c = Dir } ; - +-} FunRP p np rp = { s = \\n,c => rp.s ! n ! c ++ np.s ! NPC c ++ p.s ! PP n (giveGender np.a) ; a = RAg np.a diff --git a/lib/src/urdu/ResUrd.gf b/lib/src/urdu/ResUrd.gf index d75e10e4f..ec5c82e2e 100644 --- a/lib/src/urdu/ResUrd.gf +++ b/lib/src/urdu/ResUrd.gf @@ -27,7 +27,9 @@ resource ResUrd = ParamX ** open Prelude,Predef in { RAgr = RNoAg | RAg Agr ; RCase = RC Number Case ; - +-- for Numerial + + CardOrd = NCard | NOrd ; ----------------------------------------- -- Urd Pronouns @@ -35,19 +37,19 @@ resource ResUrd = ParamX ** open Prelude,Predef in { Pronoun = P Number Gender Case UPerson; DemPronForm = DPF Number Case; PersPronForm = PPF Number UPerson Case; - PossPronForm = PossF Number UPerson Gender; -- to be implemented +-- PossPronForm = PossF Number UPerson Gender; -- to be implemented RefPronForm = RefPF; - InterrPronForm = IntPF Number Case; - InterrPronForm1 = IntPF1; - InterrPronForm2 = IntPF2 Number Case Gender; - InterrPronForm3 = IntPF3 Number Gender; - IndefPronForm = IPF Case Gender; - IndefPronForm1 = IPF1 Case; - IndefPronForm2 = IPF2; - RelPronForm = RPF Number Case; - RelPronForm1 = RPF1 Number Gender; - RelPronForm2 = RPF2 Case; - RelPronForm3 = RPF3; +-- InterrPronForm = IntPF Number Case; +-- InterrPronForm1 = IntPF1; +-- InterrPronForm2 = IntPF2 Number Case Gender; +-- InterrPronForm3 = IntPF3 Number Gender; +-- IndefPronForm = IPF Case Gender; +-- IndefPronForm1 = IPF1 Case; +-- IndefPronForm2 = IPF2; +-- RelPronForm = RPF Number Case; +-- RelPronForm1 = RPF1 Number Gender; +-- RelPronForm2 = RPF2 Case; +-- RelPronForm3 = RPF3; ----------------------------------------------- -- Determiners @@ -73,11 +75,7 @@ resource ResUrd = ParamX ** open Prelude,Predef in { | Root | Inf_Obl | Inf_Fem; -{- -- Adverbs - AdjectiveForm = Adj1 AdjectiveForm1 | Adj2 AdjectiveForm2; - AdjectiveForm1 = AdjF1 Gender Number Case; - AdjectiveForm2 = AdjF2 Degree; --} + oper Noun = {s : Number => Case => Str ; g : Gender} ; @@ -240,11 +238,6 @@ resource ResUrd = ParamX ** open Prelude,Predef in { -- a useful oper -- eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ; - - - - - oper -- Combining all verb patterns @@ -314,7 +307,7 @@ resource ResUrd = ParamX ** open Prelude,Predef in { mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> {s = let roo = root ; a = case (last root) of { - "a"|"A"|"w" => "ya" ; + "a"|"A"|"w"|"k" => "ya" ; _ => "a" } ; y = case (last root) of { @@ -322,7 +315,7 @@ resource ResUrd = ParamX ** open Prelude,Predef in { _ => "y" } ; e = case (last root) of { - "a"|"A"|"w" => "y^E" ; + "a"|"A"|"w"|"k" => "y^E" ; _ => "E" } ; yN = case (last root) of { @@ -518,6 +511,7 @@ resource ResUrd = ParamX ** open Prelude,Predef in { Voc => y3 } }; +{- -- makeIntPronForm : IntPronForm ; -- makeIntPronForm = mkIntPronForm "k(a)ya" "k(i)s" "k(a)wn" "k(a)ya" "k(i)n " "k(a)wn"; @@ -665,7 +659,7 @@ resource ResUrd = ParamX ** open Prelude,Predef in { makeRelvPronForm3 : Str -> RelvPronForm3 ; makeRelvPronForm3 aya = mkRelvPronForm3 aya; - + -} ----------------------------------------------- -- Urd Adjectives @@ -828,7 +822,7 @@ resource ResUrd = ParamX ** open Prelude,Predef in { toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of { NPC c => pn ! c ; - NPObj => pn ! Obl ; + NPObj => pn ! Dir ; NPErg => pn ! Obl ++ "ne" } ; detcn2NP : (Determiner => Str) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of { @@ -974,6 +968,11 @@ resource ResUrd = ParamX ** open Prelude,Predef in { } ; param + VPPTense = + VPPres + |VPPast + |VPFutr + |VPGen; VPHTense = VPGenPres -- impf hum nahim "I go" | VPImpPast -- impf Ta nahim "I went" @@ -988,10 +987,11 @@ resource ResUrd = ParamX ** open Prelude,Predef in { | VPPerfPastCont | VPPerfFutCont | VPSubj -- subj na "I may go" +-- | VPImp ; VPHForm = - VPTense VPHTense Agr -- 9 * 12 + VPTense VPPTense Agr -- 9 * 12 | VPReq | VPImp | VPReqFut @@ -1009,8 +1009,9 @@ resource ResUrd = ParamX ** open Prelude,Predef in { } ; VPH : Type = { - s : Polarity => VPHForm => Order => {fin, inf,inf2, neg,quest : Str} ; --- s : Polarity => VPHForm => {fin, inf,inf2, neg : Str} ; +-- s : Polarity => VPHForm => Order => {fin, inf,inf2, neg,quest : Str} ; + s : VPHForm => {fin, inf,inf2 : Str} ; +-- s : Verb; obj : {s : Str ; a : Agr} ; subj : VType ; comp : Agr => Str; @@ -1026,52 +1027,39 @@ resource ResUrd = ParamX ** open Prelude,Predef in { predV : Verb -> VPH = \verb -> { - s = \\b,vh,ord => - let na = - case b of - { Pos => []; - Neg => "na" }; - nahim = - case b of - { Pos => []; - Neg => "nhyN" }; - q = - case ord of - { ODir => []; - OQuest => "kya" }; - --- na = if_then_Str b [] "na" ; --- nahim = if_then_Str b [] "nhyN" ; - in + s = \\vh => + case vh of { + VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = verb.s ! VF Imperf p n g; inf = [] } ; + VPTense VPPast (Ag g n p) => {fin = [] ; inf2 =verb.s ! VF Perf p n g ; inf = []} ; + VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! VF Subj p n g ; inf = [] } ; + VPTense VPGen (Ag g n p) => {fin = []; inf2 = verb.s ! Root ; inf = [] } ; + VPImp => {fin = verb.s ! Root ; inf = [] ; inf2 = verb.s ! Inf_Obl}; + _ => {fin = [] ; inf2 = verb.s ! Root ; inf = [] } + }; + + {- case vh of { - VPTense VPGenPres (Ag g n p) => - {fin = copula CPresent n p g ; inf2 = verb.s ! VF Imperf p n g; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPImpPast (Ag g n p) => - {fin = [] ; inf2 =verb.s ! VF Perf p n g ; inf = []; neg = nahim ; quest = q} ; --- {fin = copula CPast n p g ; inf = verb.s ! Pat1 (VF1 Perf Pers1 n Masc) ; neg = nahim} ; - VPTense VPFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! VF Subj p n g ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPContPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = verb.s ! Root ++ raha g n ; inf = []; neg = nahim ; quest = q} ; - VPTense VPContPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = verb.s ! Root ++ raha g n ; inf = []; neg = nahim ; quest = q} ; - VPTense VPContFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! Root ++ raha g n ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPres (Ag g n p) => - {fin = copula CPresent n p g ; inf2 = verb.s ! Root ++ cka g n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPast (Ag g n p) => - {fin = copula CPast n p g ; inf2 = verb.s !Root ++ cka g n ; inf = []; neg = nahim ; quest = q} ; - VPTense VPPerfFut (Ag g n p) => - {fin = copula CFuture n p g ; inf2 = verb.s ! Root ++ cka g n ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPresCont (Ag g n p) => - {fin = copula CPresent n p g ; inf2 = verb.s ! VF Imperf p n g ++ raha g n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPastCont (Ag g n p) => - {fin = copula CPast n p g ; inf2 = verb.s ! VF Imperf p n g ++ raha g n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfFutCont (Ag g n p) => - {fin = copula CFuture n p g ; inf2 = verb.s ! VF Imperf p n g ++ raha g n ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPSubj (Ag g n p) => {fin = [] ++ verb.s ! VF Subj p n g ; inf2 = [] ; inf = "Xayd" ; neg = na; quest = []} ; + VPTense VPGenPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = verb.s ! VF Imperf p n g; inf = [] } ; + VPTense VPImpPast (Ag g n p) => {fin = [] ; inf2 =verb.s ! VF Perf p n g ; inf = []} ; + VPTense VPFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! VF Subj p n g ; inf = [] } ; + VPTense VPContPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = verb.s ! Root ++ raha g n ; inf = [] } ; + VPTense VPContPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = verb.s ! Root ++ raha g n ; inf = [] } ; +-- VPTense VPContFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! Root ++ raha g n ++ hw p n ; inf = [] } ; + VPTense VPPerfPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = verb.s ! Root ++ cka g n ; inf = [] } ; + VPTense VPPerfPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = verb.s !Root ++ cka g n ; inf = [] } ; + VPTense VPPerfFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! Root ++ cka g n ++ hw p n ; inf = [] } ; +-- VPTense VPPerfPresCont (Ag g n p) => {fin = copula CPresent n p g ; inf2 = verb.s ! VF Imperf p n g ++ raha g n ; inf = [] } ; +-- VPTense VPPerfPastCont (Ag g n p) => {fin = copula CPast n p g ; inf2 = verb.s ! VF Imperf p n g ++ raha g n ; inf = [] } ; +-- VPTense VPPerfFutCont (Ag g n p) => {fin = copula CFuture n p g ; inf2 = verb.s ! VF Imperf p n g ++ raha g n ++ hw p n ; inf = [] } ; +-- VPTense VPSubj (Ag g n p) => {fin = [] ++ verb.s ! VF Subj p n g ; inf2 = [] ; inf = "Xayd" } ; - VPImp => {fin = verb.s ! Root ; inf = [] ; inf2 = verb.s ! Inf_Obl ; neg = na ; quest = []}; - _ => {fin = verb.s ! Root ; inf = [] ; inf2 = []; neg = na ; quest = []} ---- - } ; - obj = {s = [] ; a = defaultAgr} ; --- subj = VIntrans ; + VPImp => {fin = verb.s ! Root ; inf = [] ; inf2 = verb.s ! Inf_Obl}; + _ => {fin = [] ; inf2 = verb.s ! Root ; inf = []} ---- + } ; + + -} +-- s = verb; + obj = {s = [] ; a = defaultAgr} ; subj = VTrans ; inf = verb.s ! Inf; ad = []; @@ -1082,55 +1070,6 @@ resource ResUrd = ParamX ** open Prelude,Predef in { predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ; --- predV2 was supposed to be used with compl to get rid of ergativity...but that issue has been solved....delet it or use some where else -{- predV2 : Verb -> NP -> VPH = \verb,np -> { - s = \\b,vh => - let - na = if_then_Str b [] "na" ; - nahim = if_then_Str b [] "nhyN" ; - in - case vh of { - VPTense VPGenPres (Ag g n p) => - {fin = copula CPresent n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! VF Imperf p n g ; neg = nahim} ; - VPTense VPImpPast (Ag g n p) => - {inf = np.s ! NPObj; inf2 = verb.s ! VF Perf Pers1 Sg g ; fin =[] ; neg = nahim} ; - VPTense VPFut (Ag g n p) => {fin = copula CFuture n p g ; inf = np.s ! NPObj; inf2 = verb.s ! VF Subj p n g ; neg = nahim} ; --- {fin = copula CPast n p g ; inf = verb.s ! Pat1 (VF1 Perf Pers1 n Masc) ; neg = nahim} ; - VPTense VPContPres (Ag g n p) => - {fin = copula CPresent n p g ; - inf = np.s ! NPObj ; inf2 = verb.s ! Root ++ raha g n ; neg = nahim} ; - VPTense VPContPast (Ag g n p) => - {fin = copula CPast n p g ; - inf = np.s ! NPObj ; inf2 = verb.s ! Root ++ raha g n ; neg = nahim} ; - VPTense VPContFut (Ag g n p) => - {fin = copula CFuture n p g ; inf =np.s ! NPObj ; inf2 = verb.s ! Root ++ raha g n ++ hw p n ; neg = nahim} ; - VPTense VPPerfPres (Ag g n p) => - {fin = copula CPresent n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! Root ++ cka g n ; neg = nahim} ; - VPTense VPPerfPast (Ag g n p) => - {fin = copula CPast n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! Root ++ cka g n ; neg = nahim} ; - VPTense VPPerfFut (Ag g n p) => - {fin = copula CFuture n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! Root ++ cka g n ++ hw p n ; neg = nahim} ; - VPTense VPPerfPresCont (Ag g n p) => - {fin = copula CPresent n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! VF Imperf Pers1 n g ++ raha g n ; neg = nahim} ; - VPTense VPPerfPastCont (Ag g n p) => - {fin = copula CPast n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! VF Imperf Pers1 n g ++ raha g n ; neg = nahim} ; - VPTense VPPerfFutCont (Ag g n p) => - {fin = copula CFuture n p g ; inf = np.s ! NPObj ; inf2 = verb.s ! VF Imperf Pers1 n g ++ raha g n ++ hw p n ; neg = nahim} ; - VPTense VPSubj (Ag _ n p) => {inf = "Xayd" ++ np.s ! NPObj ; inf2 = verb.s ! VF Subj p n Masc ; fin = [] ; neg = na}; - --- VPInf => {fin = verb.s ! Pat1 Root1 ; inf = [] ; neg = na} ; - _ => {fin = verb.s ! Root ; inf = [] ; inf2 = []; neg = na} - }; - - - obj = {s = verb.s ! Inf ; a = np.a} ; --- subj = VIntrans ; - subj = VTrans ; - inf = verb.s ! Inf; - ad = []; - comp = \\_ => []; - } ; --} raha : Gender -> Number -> Str = \g,n -> (regAdjective "rha").s ! n ! g ! Dir ! Posit ; -- (regAdjective "rha").s !Adj1 (AdjF1 g n Dir) ; @@ -1146,21 +1085,9 @@ resource ResUrd = ParamX ** open Prelude,Predef in { }; predAux : Aux -> VPH = \verb -> { - s = \\b,vh,ord => - let na = - case b of - { Pos => []; - Neg => "na" }; - nahim = - case b of - { Pos => []; - Neg => "nhyN" }; - q = - case ord of - { ODir => []; - OQuest => "kya" }; --- na = if_then_Str b [] "na" ; --- nahim = if_then_Str b [] "nhyN" ; + s = \\vh => + let + inf = verb.inf ; --fin = verb.pres ! b ! agr ; --finp = verb.pres ! Pos ! agr ; @@ -1168,36 +1095,37 @@ resource ResUrd = ParamX ** open Prelude,Predef in { in case vh of { - VPTense VPGenPres (Ag g n p) => - {fin = copula CPresent n p g ; inf2 = part; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPImpPast (Ag g n p) => - {fin = copula CPast n p g ; inf2 = part ; inf = []; neg = nahim ; quest = q} ; --- {fin = copula CPast n p g ; inf = verb.s ! Pat1 (VF1 Perf Pers1 n Masc) ; neg = nahim ; quest = q} ; - VPTense VPFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPContPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = part ++ raha g n ; inf = []; neg = nahim ; quest = q} ; - VPTense VPContPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = part ++ raha g n ; inf = []; neg = nahim ; quest = q} ; - VPTense VPContFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ raha g n ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPres (Ag g n p) => - {fin = copula CPresent n p g ; inf2 = part ++ "rh" ++ cka g n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPast (Ag g n p) => - {fin = copula CPast n p g ; inf2 = part ++ "rh" ++ cka g n ; inf = []; neg = nahim ; quest = q} ; - VPTense VPPerfFut (Ag g n p) => - {fin = copula CFuture n p g ; inf2 = part ++ "rh" ++ cka g n ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPresCont (Ag g n p) => - {fin = copula CPresent n p g ; inf2 = part ++ raha g n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfPastCont (Ag g n p) => - {fin = copula CPast n p g ; inf2 = part ++ raha g n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPPerfFutCont (Ag g n p) => - {fin = copula CFuture n p g ; inf2 = part ++ raha g n ++ hw p n ; inf = [] ; neg = nahim ; quest = q} ; - VPTense VPSubj (Ag g n p) => {fin = copula CPresent n p g ++ part ; inf2 = [] ; inf = "Xayd" ; neg = nahim ; quest = []} ; + VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = part; inf = [] } ; + VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = part ; inf = []} ; + VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ hw p n ; inf = [] } ; + VPTense VPGen (Ag g n p) => {fin = [] ; inf = "rh" ; inf2 = part}; + _ => {fin = part ; inf = [] ; inf2 = []} + }; + +{- + VPTense VPGenPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = part; inf = [] } ; + VPTense VPImpPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = part ; inf = []} ; + VPTense VPFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ hw p n ; inf = [] } ; + VPTense VPContPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = part ++ raha g n ; inf = [] } ; + VPTense VPContPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = part ++ raha g n ; inf = []} ; + VPTense VPContFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ raha g n ++ hw p n ; inf = [] } ; + VPTense VPPerfPres (Ag g n p) => {fin = copula CPresent n p g ; inf2 = part ++ "rh" ++ cka g n ; inf = [] } ; + VPTense VPPerfPast (Ag g n p) => {fin = copula CPast n p g ; inf2 = part ++ "rh" ++ cka g n ; inf = []} ; +-- VPTense VPPerfFut (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ "rh" ++ cka g n ++ hw p n ; inf = [] } ; +-- VPTense VPPerfPresCont (Ag g n p) => {fin = copula CPresent n p g ; inf2 = part ++ raha g n ; inf = []} ; +-- VPTense VPPerfPastCont (Ag g n p) => {fin = copula CPast n p g ; inf2 = part ++ raha g n ; inf = []} ; +-- VPTense VPPerfFutCont (Ag g n p) => {fin = copula CFuture n p g ; inf2 = part ++ raha g n ++ hw p n ; inf = [] } ; +-- VPTense VPSubj (Ag g n p) => {fin = copula CPresent n p g ++ part ; inf2 = [] ; inf = "Xayd" } ; - _ => {fin = part ; inf = [] ; inf2 = []; neg = na ; quest = []} ---- + _ => {fin = part ; inf = [] ; inf2 = []} ---- } ; - obj = {s = [] ; a = defaultAgr} ; + +-} +-- s = {s = \\_ => " "}; + obj = {s = [] ; a = defaultAgr} ; subj = VIntrans ; --- subj = VTrans ; - inf = verb.inf; - ad = []; + inf = verb.inf; + ad = []; comp = \\_ => [] } ; @@ -1206,11 +1134,10 @@ resource ResUrd = ParamX ** open Prelude,Predef in { Aux = { --pres : Polarity => Agr => Str ; --past : Polarity => Agr => Str ; --# notpresent - inf,ppart,prpart : Str + inf,ppart,prpart : Str } ; auxBe : Aux = { - inf = "" ; ppart = "" ; prpart = "" @@ -1231,20 +1158,135 @@ resource ResUrd = ParamX ** open Prelude,Predef in { } ; subj = subjagr.p1 ; agr = subjagr.p2 ; - vps = vp.s ! b ! VPTense vt agr ! ord ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case vt of { +{- VPGenPres => {fin = copula CPresent n p g ; inf2 = vp.s.s ! VF Imperf p n g; inf = [] } ; + VPImpPast => {fin = [] ; inf2 = vp.s.s ! VF Perf p n g ; inf = []} ; + VPFut => {fin = copula CFuture n p g ; inf2 = vp.s.s ! VF Subj p n g ; inf = [] } ; + VPContPres => {fin = copula CPresent n p g ; inf2 = vp.s.s ! Root ++ raha g n ; inf = [] } ; + VPContPast => {fin = copula CPast n p g ; inf2 = vp.s.s ! Root ++ raha g n ; inf = [] } ; + VPContFut => {fin = copula CFuture n p g ; inf2 = vp.s.s ! Root ++ raha g n ++ hw p n ; inf = [] } ; + VPPerfPres => {fin = copula CPresent n p g ; inf2 = vp.s.s ! Root ++ cka g n ; inf = [] } ; + VPPerfPast => {fin = copula CPast n p g ; inf2 = vp.s.s !Root ++ cka g n ; inf = [] } ; + VPPerfFut => {fin = copula CFuture n p g ; inf2 = vp.s.s ! Root ++ cka g n ++ hw p n ; inf = [] } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf2 = vp.s.s ! VF Imperf p n g ++ raha g n ; inf = [] } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf2 = vp.s.s ! VF Imperf p n g ++ raha g n ; inf = [] } ; + VPPerfFutCont => {fin = copula CFuture n p g ; inf2 = vp.s.s ! VF Imperf p n g ++ raha g n ++ hw p n ; inf = [] } ; + VPSubj => {fin = [] ++ vp.s.s ! VF Subj p n g ; inf2 = [] ; inf = "Xayd" } ; + VPImp => {fin = vp.s.s ! Root ; inf = [] ; inf2 = vp.s.s ! Inf_Obl} + }; +-} + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => vp.s ! VPTense VPFutr agr ; + VPContPres => + {fin = copula CPresent n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ; inf = [] } ; + VPContPast => + {fin = copula CPast n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ; inf = [] } ; + VPContFut => + {fin = copula CFuture n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ++ hw p n ; inf = [] } ; + VPPerfPres => + {fin = copula CPresent n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ cka g n ; inf = [] } ; + VPPerfPast => + {fin = copula CPast n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ cka g n ; inf = [] } ; + VPPerfFut => + {fin = copula CFuture n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ cka g n ++ hw p n ; inf = [] } ; + VPPerfPresCont => + {fin = copula CPresent n p g ; inf2 = (vp.s ! VPTense VPPres agr).inf2 ++ raha g n ; inf = [] } ; + VPPerfPastCont => + {fin = copula CPast n p g ; inf2 = (vp.s ! VPTense VPPres agr).inf2 ++ raha g n ; inf = [] } ; + VPPerfFutCont => + {fin = copula CFuture n p g ; inf2 = (vp.s ! VPTense VPPres agr).inf2 ++ raha g n ++ hw p n ; inf = [] } ; + VPSubj => vp.s ! VPTense VPGen agr + }; + + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; in - vps.quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vps.inf ++ vps.neg ++ vps.inf2 ++ vps.fin --- np.s ! subj ++ vps.inf ++ vp.comp ! np.a ++ vps.neg ++ vps.inf2 ++ vps.fin --- np.s ! subj ++ vp.comp ! np.a ++ vp.obj.s ++ vps.neg ++ vps.inf ++ vps.fin + case vt of { + VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vps.inf ++ na ++ vps.inf2 ++ vps.fin; + _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vps.inf ++ nahim ++ vps.inf2 ++ vps.fin}; + } ; mkSClause : Str -> Agr -> VPH -> Clause = \subj,agr,vp -> { - s = \\t,b,o => + s = \\t,b,ord => let - vps = vp.s ! b ! VPTense t agr ! o ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case t of { +{- VPGenPres => {fin = copula CPresent n p g ; inf2 = vp.s.s ! VF Imperf p n g; inf = [] } ; + VPImpPast => {fin = [] ; inf2 = vp.s.s ! VF Perf p n g ; inf = []} ; + VPFut => {fin = copula CFuture n p g ; inf2 = vp.s.s ! VF Subj p n g ; inf = [] } ; + VPContPres => {fin = copula CPresent n p g ; inf2 = vp.s.s ! Root ++ raha g n ; inf = [] } ; + VPContPast => {fin = copula CPast n p g ; inf2 = vp.s.s ! Root ++ raha g n ; inf = [] } ; + VPContFut => {fin = copula CFuture n p g ; inf2 = vp.s.s ! Root ++ raha g n ++ hw p n ; inf = [] } ; + VPPerfPres => {fin = copula CPresent n p g ; inf2 = vp.s.s ! Root ++ cka g n ; inf = [] } ; + VPPerfPast => {fin = copula CPast n p g ; inf2 = vp.s.s !Root ++ cka g n ; inf = [] } ; + VPPerfFut => {fin = copula CFuture n p g ; inf2 = vp.s.s ! Root ++ cka g n ++ hw p n ; inf = [] } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf2 = vp.s.s ! VF Imperf p n g ++ raha g n ; inf = [] } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf2 = vp.s.s ! VF Imperf p n g ++ raha g n ; inf = [] } ; + VPPerfFutCont => {fin = copula CFuture n p g ; inf2 = vp.s.s ! VF Imperf p n g ++ raha g n ++ hw p n ; inf = [] } ; + VPSubj => {fin = [] ++ vp.s.s ! VF Subj p n g ; inf2 = [] ; inf = "Xayd" } ; + VPImp => {fin = vp.s.s ! Root ; inf = [] ; inf2 = vp.s.s ! Inf_Obl} + }; +-} + + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => vp.s ! VPTense VPFutr agr ; + VPContPres => + {fin = copula CPresent n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ; inf = [] } ; + VPContPast => + {fin = copula CPast n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ; inf = []} ; + VPContFut => + {fin = copula CFuture n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ++ hw p n ; inf = [] } ; + VPPerfPres => + {fin = copula CPresent n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ cka g n ; inf = [] } ; + VPPerfPast => + {fin = copula CPast n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ cka g n ; inf = []} ; + VPPerfFut => + {fin = copula CFuture n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ cka g n ++ hw p n ; inf = [] } ; + VPPerfPresCont => + {fin = copula CPresent n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ; inf = []} ; + VPPerfPastCont => + {fin = copula CPast n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ; inf = []} ; + VPPerfFutCont => + {fin = copula CFuture n p g ; inf2 = (vp.s ! VPTense VPGen agr).inf2 ++ raha g n ++ hw p n ; inf = [] } ; + VPSubj => vp.s ! VPTense VPGen agr + }; + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; in - vps.quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vps.inf ++ vps.neg ++ vps.inf2 ++ vps.fin + case t of { + VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vps.inf ++ na ++ vps.inf2 ++ vps.fin; + _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vps.inf ++ nahim ++ vps.inf2 ++ vps.fin}; } ; @@ -1297,8 +1339,5 @@ resource ResUrd = ParamX ** open Prelude,Predef in { } ; conjThat : Str = "kh" ; - - - } diff --git a/lib/src/urdu/StructuralUrd.gf b/lib/src/urdu/StructuralUrd.gf index 2b4c2ac3b..a15831972 100644 --- a/lib/src/urdu/StructuralUrd.gf +++ b/lib/src/urdu/StructuralUrd.gf @@ -113,9 +113,9 @@ can_VV = mkV "skna" ** { isAux = True} ; -- when_IAdv = ss "when" ; -- when_Subj = ss "when" ; where_IAdv = ss "khaN" ; --- which_IQuant = {s = \\_ => "which"} ; --- whichPl_IDet = makeDet "kwn sa" "kwon sy" "kwn sE" "kwn sy" ; --- whichSg_IDet = makeDet "kwn sa" "kwon sy" "kwn sE" "kwn sy" ; + which_IQuant = {s = \\_ => "kwn sy"} ; +-- whichPl_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ; +-- whichSg_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ; whoSg_IP = mkIP "kwn" "kis" "kis" Sg Masc ; whoPl_IP = mkIP "kwn" "kn" "knhwN" Pl Masc ; -- why_IAdv = ss "why" ; diff --git a/lib/src/urdu/VerbUrd.gf b/lib/src/urdu/VerbUrd.gf index dfabde90c..d650d095e 100644 --- a/lib/src/urdu/VerbUrd.gf +++ b/lib/src/urdu/VerbUrd.gf @@ -8,15 +8,15 @@ concrete VerbUrd of Verb = CatUrd ** open ResUrd in { Slash2V3 v np = insertObjc (\\_ => np.s ! NPObj ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ; Slash3V3 v np = - insertObjc (\\_ => np.s ! NPObj ++ v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ; + insertObjc (\\_ => np.s ! NPC Obl ++ v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ; ComplVV v vp = insertObj (\\a => infVP v.isAux vp a) (predV v) ; --- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ; --- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; + ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ; + ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; ComplVA v ap = insertObj (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v) ; SlashV2V v vp = insertObjc (\\a => infVP v.isAux vp a) (predVc v) ; --- SlashV2S v s = insertObjc (\\_ => conjThat ++ s.s) (predVc v) ; --- SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ; + SlashV2S v s = insertObjc (\\_ => conjThat ++ s.s) (predV v ** {c2 = {s = "" ; c = VTrans}}) ; + SlashV2Q v q = insertObjc (\\_ => conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = "" ; c = VTrans}}) ; SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v ** {c2 = {s = "kw" ; c = VTrans}}) ; ---- ComplSlash vp np = insertObject np vp ; SlashVV vv vp =