ParseHinUrd

This commit is contained in:
virk.shafqat
2012-06-18 07:50:26 +00:00
parent fe34a29f4f
commit 0deb6d8587
15 changed files with 165 additions and 135 deletions

View File

@@ -34,8 +34,9 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ;
VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ;
VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ; VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ;
VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "शायद" } ; -- VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "शायद" } ;
_ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "शायद" } } VPSubj => case vp.prog of { True => {fin = Prelude.glue ((vp.s ! VPTense VPFutr agr).inf ++ hw p n) (copula CFuture n p g) ; inf =[] } ;
_ => {fin = Prelude.glue (vp.s ! VPTense VPFutr agr).inf (copula CFuture n p g); inf = [] } }
}; };
@@ -54,8 +55,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "नहीं" }; Neg => "नहीं" };
in in
case vt of { case vt of {
VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ;
_ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
@@ -79,7 +80,7 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ; VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ;
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "शायद" } VPSubj => {fin = Prelude.glue (insertSubj p (vp.s ! VPStem).inf) (copula CFuture n p g ); inf = [] }
}; };
@@ -97,8 +98,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "नहीं" }; Neg => "नहीं" };
in in
case t of { case t of {
VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp;
_ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
np2pronCase ppf npc a = case npc of { np2pronCase ppf npc a = case npc of {
@@ -127,7 +128,7 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
waN = "वाँ" ; -- check with prasad waN = "वाँ" ; -- check with prasad
hE = "हे" ; hE = "हे" ;
comma = "," ; comma = "," ;
indfArt = "एक" ; -- check with prasad indfArt = "" ; -- removed
kwd = "ख़ुद" ; -- check with prasad kwd = "ख़ुद" ; -- check with prasad
oper oper

View File

@@ -346,7 +346,8 @@ oper
Inf_Fem => inf_fem Inf_Fem => inf_fem
} } ;
cvp = []
} ; } ;
rem_y : Str -> Str; rem_y : Str -> Str;
rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)य") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)य") (b ++ "(i)"++th) (if_then_else Str (eq a2 "य") (b ++ th) str) rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)य") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)य") (b ++ "(i)"++th) (if_then_else Str (eq a2 "य") (b ++ th) str)
@@ -400,54 +401,54 @@ oper
mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g ->
{s = let roo = root ; {s = let roo = root ;
a = case (last root) of { a = case (last root) of {
"ा"|"ो"|"ी" => "या" ; "ा"|"ो"|"ी" => roo + "या" ;
"े" => (tk 1 roo) + "िया" ; "े" => (tk 1 roo) + "िया" ; --* here is the problem
_ => "ा" _ => roo + "ा"
} ; } ;
y = case (last root) of { y = case (last root) of {
"ा"|"ो" => "यी" ; "ा"|"ो" => roo + "यी" ;
"ी" => "" ; "ी" => roo ;
"े" => (tk 1 roo) + "ी" ; "े" => (tk 1 roo) + "ी" ;
"िय" => (tk 2 roo) + "ी" ; "िय" => (tk 2 roo) + "ी" ;
_ => "ी" _ => roo + "ी"
} ; } ;
e = case (last root) of { e = case (last root) of {
"ा"|"ो"|"ी"|"क" => "ये" ; "ा"|"ो"|"ी"|"क" => roo + "ये" ;
"े" => (tk 1 roo) + "ी" ; "े" => (tk 1 roo) + "ी" ;
_ => "े" _ => roo + "े"
} ; } ;
yN = case (last root) of { yN = case (last root) of {
"ा"|"ो"|"ी" => "यीँ" ; "ा"|"ो"|"ी" => roo + "यीँ" ;
"िय" => (tk 2 roo) + "ी" ; "िय" => (tk 2 roo) + "ी" ;
"े" => (tk 1 roo) + "ीँ" ; "े" => (tk 1 roo) + "ीँ" ;
_ => "यँ" _ => roo + "यँ"
} ; } ;
in in
case <p,n,g> of { case <p,n,g> of {
<Pers1,Sg,Masc> => roo+a ; <Pers1,Sg,Masc> => a ; --*
<Pers1,Sg,Fem> => roo+y ; <Pers1,Sg,Fem> => y ;
<Pers1,Pl,Masc> => roo+e ; <Pers1,Pl,Masc> => e ;
<Pers1,Pl,Fem> => roo+yN ; <Pers1,Pl,Fem> => yN ;
<Pers2_Casual,Sg,Masc> => roo+a ; <Pers2_Casual,Sg,Masc> => a ; --*
<Pers2_Casual,Sg,Fem> => roo+y ; <Pers2_Casual,Sg,Fem> => y ;
<Pers2_Casual,Pl,Masc> => roo+e ; <Pers2_Casual,Pl,Masc> => e ;
<Pers2_Casual,Pl,Fem> => roo+yN ; <Pers2_Casual,Pl,Fem> => yN ;
<Pers2_Familiar,Sg,Masc> => roo+e ; <Pers2_Familiar,Sg,Masc> => e ;
<Pers2_Familiar,Sg,Fem> => roo+y; --variants{roo+y ; roo+yN} ; <Pers2_Familiar,Sg,Fem> => y; --variants{roo+y ; roo+yN} ;
<Pers2_Familiar,Pl,Masc> => roo+e ; <Pers2_Familiar,Pl,Masc> => e ;
<Pers2_Familiar,Pl,Fem> => roo+yN ; <Pers2_Familiar,Pl,Fem> => yN ;
<Pers2_Respect,Sg,Masc> => roo+e ; <Pers2_Respect,Sg,Masc> => e ;
<Pers2_Respect,Sg,Fem> => roo+yN; --variants{roo+yN ; roo+y} ; <Pers2_Respect,Sg,Fem> => yN; --variants{roo+yN ; roo+y} ;
<Pers2_Respect,Pl,Masc> => roo+e ; <Pers2_Respect,Pl,Masc> => e ;
<Pers2_Respect,Pl,Fem> => roo+yN ; <Pers2_Respect,Pl,Fem> => yN ;
<_,Sg,Masc> => roo + a; <_,Sg,Masc> => a; --*
<_,Sg,Fem> => roo+y ; <_,Sg,Fem> => y ;
<_,Pl,Masc> => roo + e; <_,Pl,Masc> => e;
<_,Pl,Fem> => roo+yN <_,Pl,Fem> => yN
} ; } ;
} ; } ;

View File

@@ -103,8 +103,8 @@ oper
-- compund verbs -- compund verbs
compoundV = overload { compoundV = overload {
compoundV : Str -> V -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; compoundV : Str -> V -> V = \s,v -> {s = \\vf => v.s ! vf ; cvp = s ; lock_V = <>} ;
compoundV : Str -> V2 -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; compoundV : Str -> V2 -> V = \s,v -> {s = \\vf => v.s ! vf ; cvp = s ; lock_V = <>} ;
}; };

View File

@@ -34,8 +34,9 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ;
VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ;
VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ; VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ;
VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "s*a:yd" } ; -- VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "s*a:yd" } ;
_ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "s*a:yd" } } VPSubj => case vp.prog of { True => {fin = Prelude.glue ((vp.s ! VPTense VPFutr agr).inf ++ hw p n) (copula CFuture n p g) ; inf =[] } ;
_ => {fin = Prelude.glue (vp.s ! VPTense VPFutr agr).inf (copula CFuture n p g); inf = [] } }
}; };
@@ -54,8 +55,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "nahi:m." }; Neg => "nahi:m." };
in in
case vt of { case vt of {
VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ;
_ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
@@ -79,7 +80,7 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ; VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ;
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "s*a:yd" } VPSubj => {fin = Prelude.glue (insertSubj p (vp.s ! VPStem).inf) (copula CFuture n p g ); inf = [] }
}; };
@@ -97,8 +98,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "nahi:m." }; Neg => "nahi:m." };
in in
case t of { case t of {
VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp;
_ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
np2pronCase ppf npc a = case npc of { np2pronCase ppf npc a = case npc of {
@@ -127,7 +128,7 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
waN = "va:n~" ; -- check with prasad waN = "va:n~" ; -- check with prasad
hE = "he:" ; hE = "he:" ;
comma = "," ; comma = "," ;
indfArt = "E:k" ; -- check with prasad indfArt = "" ; -- removed
kwd = "xud" ; -- check with prasad kwd = "xud" ; -- check with prasad
oper oper

View File

@@ -346,7 +346,8 @@ oper
Inf_Fem => inf_fem Inf_Fem => inf_fem
} } ;
cvp = []
} ; } ;
rem_y : Str -> Str; rem_y : Str -> Str;
rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)y") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)y") (b ++ "(i)"++th) (if_then_else Str (eq a2 "y") (b ++ th) str) rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)y") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)y") (b ++ "(i)"++th) (if_then_else Str (eq a2 "y") (b ++ th) str)
@@ -400,54 +401,54 @@ oper
mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g ->
{s = let roo = root ; {s = let roo = root ;
a = case (last root) of { a = case (last root) of {
"a:"|"o:"|"i:" => "ya:" ; "a:"|"o:"|"i:" => roo + "ya:" ;
"e:" => (tk 1 roo) + "iya:" ; "e:" => (tk 1 roo) + "iya:" ; --* here is the problem
_ => "a:" _ => roo + "a:"
} ; } ;
y = case (last root) of { y = case (last root) of {
"a:"|"o:" => "yi:" ; "a:"|"o:" => roo + "yi:" ;
"i:" => "" ; "i:" => roo ;
"e:" => (tk 1 roo) + "i:" ; "e:" => (tk 1 roo) + "i:" ;
"iy" => (tk 2 roo) + "i:" ; "iy" => (tk 2 roo) + "i:" ;
_ => "i:" _ => roo + "i:"
} ; } ;
e = case (last root) of { e = case (last root) of {
"a:"|"o:"|"i:"|"k" => "ye:" ; "a:"|"o:"|"i:"|"k" => roo + "ye:" ;
"e:" => (tk 1 roo) + "i:" ; "e:" => (tk 1 roo) + "i:" ;
_ => "e:" _ => roo + "e:"
} ; } ;
yN = case (last root) of { yN = case (last root) of {
"a:"|"o:"|"i:" => "yi:n~" ; "a:"|"o:"|"i:" => roo + "yi:n~" ;
"iy" => (tk 2 roo) + "i:" ; "iy" => (tk 2 roo) + "i:" ;
"e:" => (tk 1 roo) + "i:n~" ; "e:" => (tk 1 roo) + "i:n~" ;
_ => "yn~" _ => roo + "yn~"
} ; } ;
in in
case <p,n,g> of { case <p,n,g> of {
<Pers1,Sg,Masc> => roo+a ; <Pers1,Sg,Masc> => a ; --*
<Pers1,Sg,Fem> => roo+y ; <Pers1,Sg,Fem> => y ;
<Pers1,Pl,Masc> => roo+e ; <Pers1,Pl,Masc> => e ;
<Pers1,Pl,Fem> => roo+yN ; <Pers1,Pl,Fem> => yN ;
<Pers2_Casual,Sg,Masc> => roo+a ; <Pers2_Casual,Sg,Masc> => a ; --*
<Pers2_Casual,Sg,Fem> => roo+y ; <Pers2_Casual,Sg,Fem> => y ;
<Pers2_Casual,Pl,Masc> => roo+e ; <Pers2_Casual,Pl,Masc> => e ;
<Pers2_Casual,Pl,Fem> => roo+yN ; <Pers2_Casual,Pl,Fem> => yN ;
<Pers2_Familiar,Sg,Masc> => roo+e ; <Pers2_Familiar,Sg,Masc> => e ;
<Pers2_Familiar,Sg,Fem> => roo+y; --variants{roo+y ; roo+yN} ; <Pers2_Familiar,Sg,Fem> => y; --variants{roo+y ; roo+yN} ;
<Pers2_Familiar,Pl,Masc> => roo+e ; <Pers2_Familiar,Pl,Masc> => e ;
<Pers2_Familiar,Pl,Fem> => roo+yN ; <Pers2_Familiar,Pl,Fem> => yN ;
<Pers2_Respect,Sg,Masc> => roo+e ; <Pers2_Respect,Sg,Masc> => e ;
<Pers2_Respect,Sg,Fem> => roo+yN; --variants{roo+yN ; roo+y} ; <Pers2_Respect,Sg,Fem> => yN; --variants{roo+yN ; roo+y} ;
<Pers2_Respect,Pl,Masc> => roo+e ; <Pers2_Respect,Pl,Masc> => e ;
<Pers2_Respect,Pl,Fem> => roo+yN ; <Pers2_Respect,Pl,Fem> => yN ;
<_,Sg,Masc> => roo + a; <_,Sg,Masc> => a; --*
<_,Sg,Fem> => roo+y ; <_,Sg,Fem> => y ;
<_,Pl,Masc> => roo + e; <_,Pl,Masc> => e;
<_,Pl,Fem> => roo+yN <_,Pl,Fem> => yN
} ; } ;
} ; } ;

View File

@@ -19,6 +19,7 @@ resource CommonHindustani = ParamX ** open Prelude, Predef in {
ad : Str; ad : Str;
embComp : Str ; embComp : Str ;
prog : Bool ; prog : Bool ;
cvp : Str ;
} ; } ;
NP : Type = {s : NPCase => Str ; a : Agr} ; NP : Type = {s : NPCase => Str ; a : Agr} ;
param param
@@ -155,7 +156,7 @@ resource CommonHindustani = ParamX ** open Prelude, Predef in {
Adjective = { s: Number => Gender => Case => Degree => Str }; Adjective = { s: Number => Gender => Case => Degree => Str };
Verb : Type = {s : VerbForm => Str} ; Verb : Type = {s : VerbForm => Str ; cvp : Str} ;
defaultAgr : Agr = agrP3 Masc Sg ; defaultAgr : Agr = agrP3 Masc Sg ;
agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ; agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ;
toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g -> toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g ->

View File

@@ -127,7 +127,8 @@ param
ad = []; ad = [];
embComp = []; embComp = [];
prog = False ; prog = False ;
comp = \\_ => [] comp = \\_ => [] ;
cvp = v.cvp
} ; } ;
predAux : Aux -> VPH = \verb -> { predAux : Aux -> VPH = \verb -> {
s = \\vh => s = \\vh =>
@@ -150,7 +151,8 @@ param
ad = []; ad = [];
embComp = []; embComp = [];
prog = False ; prog = False ;
comp = \\_ => [] comp = \\_ => [] ;
cvp = []
} ; } ;
Aux = { Aux = {
@@ -179,7 +181,8 @@ param
ad = verb.ad; ad = verb.ad;
embComp = verb.embComp; embComp = verb.embComp;
prog = True ; prog = True ;
comp = verb.comp comp = verb.comp ;
cvp = verb.cvp
} ; } ;
@@ -191,7 +194,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp; embComp = vp.embComp;
prog = vp.prog ; prog = vp.prog ;
comp = \\a => vp.comp ! a ++ obj1 ! a comp = \\a => vp.comp ! a ++ obj1 ! a ;
cvp = vp.cvp
} ; } ;
insertVV : Str -> VPH -> Str -> VPH = \obj1,vp,emb -> { insertVV : Str -> VPH -> Str -> VPH = \obj1,vp,emb -> {
s = vp.s ; s = vp.s ;
@@ -201,7 +205,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ++ emb ; embComp = vp.embComp ++ emb ;
prog = vp.prog ; prog = vp.prog ;
comp = \\a => vp.comp ! a ++ obj1 comp = \\a => vp.comp ! a ++ obj1 ;
cvp = vp.cvp
} ; } ;
insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> {
@@ -212,7 +217,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ++ obj1; embComp = vp.embComp ++ obj1;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp
} ; } ;
@@ -238,7 +244,8 @@ param
ad = vps.ad; ad = vps.ad;
embComp = vps.embComp; embComp = vps.embComp;
prog = vps.prog ; prog = vps.prog ;
comp = vps.comp comp = vps.comp ;
cvp = vps.cvp
} ; } ;
insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> { insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> {
@@ -249,7 +256,8 @@ param
ad = vp.ad ; ad = vp.ad ;
embComp = vp.embComp; embComp = vp.embComp;
prog = vp.prog ; prog = vp.prog ;
comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a ;
cvp = vp.cvp
} ; } ;
insertAdV : Str -> VPH -> VPH = \ad,vp -> { insertAdV : Str -> VPH -> VPH = \ad,vp -> {
@@ -260,7 +268,8 @@ param
ad = vp.ad ++ ad ; ad = vp.ad ++ ad ;
embComp = vp.embComp; embComp = vp.embComp;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp
} ; } ;
-- conjThat : Str = "kh" ; -- conjThat : Str = "kh" ;
@@ -273,7 +282,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ++ emb; embComp = vp.embComp ++ emb;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp ;
} ; } ;
insertTrans : VPH -> VType -> VPH = \vp,vtype -> { insertTrans : VPH -> VType -> VPH = \vp,vtype -> {
s = vp.s ; s = vp.s ;
@@ -283,7 +293,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ; embComp = vp.embComp ;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp
} ; } ;
compoundAdj : Str -> Str -> Adjective = \s1,s2 -> mkCompoundAdj (regAdjective s1) (regAdjective s2) ; compoundAdj : Str -> Str -> Adjective = \s1,s2 -> mkCompoundAdj (regAdjective s1) (regAdjective s2) ;

View File

@@ -19,6 +19,7 @@ resource CommonHindustani = ParamX ** open Prelude, Predef in {
ad : Str; ad : Str;
embComp : Str ; embComp : Str ;
prog : Bool ; prog : Bool ;
cvp : Str ;
} ; } ;
NP : Type = {s : NPCase => Str ; a : Agr} ; NP : Type = {s : NPCase => Str ; a : Agr} ;
param param
@@ -155,7 +156,7 @@ resource CommonHindustani = ParamX ** open Prelude, Predef in {
Adjective = { s: Number => Gender => Case => Degree => Str }; Adjective = { s: Number => Gender => Case => Degree => Str };
Verb : Type = {s : VerbForm => Str} ; Verb : Type = {s : VerbForm => Str ; cvp : Str} ;
defaultAgr : Agr = agrP3 Masc Sg ; defaultAgr : Agr = agrP3 Masc Sg ;
agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ; agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ;
toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g -> toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g ->

View File

@@ -56,8 +56,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "نہیں" }; Neg => "نہیں" };
in in
case vt of { case vt of {
VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ;
_ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
@@ -99,8 +99,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "نہیں" }; Neg => "نہیں" };
in in
case t of { case t of {
VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp;
_ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
@@ -132,7 +132,7 @@ conjThat = "كہ" ;
waN = "واں" ; waN = "واں" ;
hE = "ہے" ; hE = "ہے" ;
comma = "," ; comma = "," ;
indfArt = "اك" ; indfArt = "" ;
kwd = "خود" ; kwd = "خود" ;
copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g ->
@@ -153,13 +153,13 @@ copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g ->
<CPast,Sg,Pers1,Fem > => "تھی" ; <CPast,Sg,Pers1,Fem > => "تھی" ;
<CPast,Sg,Pers2_Casual,Masc > => "تھا" ; <CPast,Sg,Pers2_Casual,Masc > => "تھا" ;
<CPast,Sg,Pers2_Casual,Fem > => "تھی" ; <CPast,Sg,Pers2_Casual,Fem > => "تھی" ;
<CPast,Sg,Pers2_Familiar,Masc > => "تh-ا" ; <CPast,Sg,Pers2_Familiar,Masc > => "تھا" ;
<CPast,Sg,Pers2_Familiar,Fem > => "تھی" ; <CPast,Sg,Pers2_Familiar,Fem > => "تھی" ;
<CPast,Sg,Pers2_Respect,Masc > => "تھے" ; <CPast,Sg,Pers2_Respect,Masc > => "تھے" ;
<CPast,Sg,Pers2_Respect,Fem > => "تھیں" ; <CPast,Sg,Pers2_Respect,Fem > => "تھیں" ;
<CPast,Sg,Pers3_Near,Masc > => "تh-ا" ; <CPast,Sg,Pers3_Near,Masc > => "تھا" ;
<CPast,Sg,Pers3_Near,Fem > => "تھی" ; <CPast,Sg,Pers3_Near,Fem > => "تھی" ;
<CPast,Sg,Pers3_Distant,Masc > => "تh-ا" ; <CPast,Sg,Pers3_Distant,Masc > => "تھا" ;
<CPast,Sg,Pers3_Distant,Fem > => "تھی" ; <CPast,Sg,Pers3_Distant,Fem > => "تھی" ;
<CPast,Pl,Pers1,Masc > => "تھے" ; <CPast,Pl,Pers1,Masc > => "تھے" ;
<CPast,Pl,Pers1,Fem > => "تھیں" ; <CPast,Pl,Pers1,Fem > => "تھیں" ;

View File

@@ -365,7 +365,8 @@ makeIQuant : Str -> {s : Number => Gender => Case => Str} = \str -> {
Inf_Fem => inf_fem Inf_Fem => inf_fem
} };
cvp = []
} ; } ;
rem_y : Str -> Str; rem_y : Str -> Str;
rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)ی") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)ی") (b ++ "(i)"++th) (if_then_else Str (eq a2 "ی") (b ++ th) str) rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)ی") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)ی") (b ++ "(i)"++th) (if_then_else Str (eq a2 "ی") (b ++ th) str)

View File

@@ -2,7 +2,7 @@
-- Modification for Urdu Shafqat Virk -- Modification for Urdu Shafqat Virk
concrete NumeralUrd of Numeral = CatUrd [Digits, Numeral] ** open ResUrd,CommonHindustani,ParamX, Prelude in { concrete NumeralUrd of Numeral = CatUrd ** open ResUrd,CommonHindustani,ParamX, Prelude in {
flags coding=utf8 ; flags coding=utf8 ;
param DForm = unit | ten ; param DForm = unit | ten ;

View File

@@ -105,9 +105,9 @@ oper
-- compund verbs -- compund verbs
compoundV = overload { compoundV = overload {
compoundV : Str -> V -> V -- e.g barX hwna compoundV : Str -> V -> V -- e.g barX hwna
= \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; = \s,v -> {s = \\vf => v.s ! vf ; cvp = s ; lock_V = <>} ;
compoundV : Str -> V2 -> V -- e.g bnd krna compoundV : Str -> V2 -> V -- e.g bnd krna
= \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; = \s,v -> {s = \\vf => v.s ! vf ; cvp = s ; lock_V = <>} ;
}; };

View File

@@ -127,7 +127,8 @@ param
ad = []; ad = [];
embComp = []; embComp = [];
prog = False ; prog = False ;
comp = \\_ => [] comp = \\_ => [] ;
cvp = v.cvp
} ; } ;
predAux : Aux -> VPH = \verb -> { predAux : Aux -> VPH = \verb -> {
s = \\vh => s = \\vh =>
@@ -150,7 +151,8 @@ param
ad = []; ad = [];
embComp = []; embComp = [];
prog = False ; prog = False ;
comp = \\_ => [] comp = \\_ => [] ;
cvp = []
} ; } ;
Aux = { Aux = {
@@ -179,7 +181,8 @@ param
ad = verb.ad; ad = verb.ad;
embComp = verb.embComp; embComp = verb.embComp;
prog = True ; prog = True ;
comp = verb.comp comp = verb.comp ;
cvp = verb.cvp
} ; } ;
@@ -191,7 +194,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp; embComp = vp.embComp;
prog = vp.prog ; prog = vp.prog ;
comp = \\a => vp.comp ! a ++ obj1 ! a comp = \\a => vp.comp ! a ++ obj1 ! a ;
cvp = vp.cvp
} ; } ;
insertVV : Str -> VPH -> Str -> VPH = \obj1,vp,emb -> { insertVV : Str -> VPH -> Str -> VPH = \obj1,vp,emb -> {
s = vp.s ; s = vp.s ;
@@ -201,7 +205,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ++ emb ; embComp = vp.embComp ++ emb ;
prog = vp.prog ; prog = vp.prog ;
comp = \\a => vp.comp ! a ++ obj1 comp = \\a => vp.comp ! a ++ obj1 ;
cvp = vp.cvp
} ; } ;
insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> {
@@ -212,7 +217,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ++ obj1; embComp = vp.embComp ++ obj1;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp
} ; } ;
@@ -238,7 +244,8 @@ param
ad = vps.ad; ad = vps.ad;
embComp = vps.embComp; embComp = vps.embComp;
prog = vps.prog ; prog = vps.prog ;
comp = vps.comp comp = vps.comp ;
cvp = vps.cvp
} ; } ;
insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> { insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> {
@@ -249,7 +256,8 @@ param
ad = vp.ad ; ad = vp.ad ;
embComp = vp.embComp; embComp = vp.embComp;
prog = vp.prog ; prog = vp.prog ;
comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a ;
cvp = vp.cvp
} ; } ;
insertAdV : Str -> VPH -> VPH = \ad,vp -> { insertAdV : Str -> VPH -> VPH = \ad,vp -> {
@@ -260,7 +268,8 @@ param
ad = vp.ad ++ ad ; ad = vp.ad ++ ad ;
embComp = vp.embComp; embComp = vp.embComp;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp
} ; } ;
-- conjThat : Str = "كہ" ; -- conjThat : Str = "كہ" ;
@@ -273,7 +282,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ++ emb; embComp = vp.embComp ++ emb;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp ;
} ; } ;
insertTrans : VPH -> VType -> VPH = \vp,vtype -> { insertTrans : VPH -> VType -> VPH = \vp,vtype -> {
s = vp.s ; s = vp.s ;
@@ -283,7 +293,8 @@ param
ad = vp.ad; ad = vp.ad;
embComp = vp.embComp ; embComp = vp.embComp ;
prog = vp.prog ; prog = vp.prog ;
comp = vp.comp comp = vp.comp ;
cvp = vp.cvp
} ; } ;
compoundAdj : Str -> Str -> Adjective = \s1,s2 -> mkCompoundAdj (regAdjective s1) (regAdjective s2) ; compoundAdj : Str -> Str -> Adjective = \s1,s2 -> mkCompoundAdj (regAdjective s1) (regAdjective s2) ;

View File

@@ -56,8 +56,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "nhyN" }; Neg => "nhyN" };
in in
case vt of { case vt of {
VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ;
_ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
@@ -99,8 +99,8 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
Neg => "nhyN" }; Neg => "nhyN" };
in in
case t of { case t of {
VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ na ++ vps.inf ++ vps.fin ++ vp.embComp;
_ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vp.cvp ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
} ; } ;
@@ -132,7 +132,7 @@ conjThat = "kh" ;
waN = "waN" ; waN = "waN" ;
hE = "hE" ; hE = "hE" ;
comma = "," ; comma = "," ;
indfArt = "ak" ; indfArt = "" ;
kwd = "Kwd" ; kwd = "Kwd" ;
copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g ->
@@ -153,13 +153,13 @@ copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g ->
<CPast,Sg,Pers1,Fem > => "th'y" ; <CPast,Sg,Pers1,Fem > => "th'y" ;
<CPast,Sg,Pers2_Casual,Masc > => "th'a" ; <CPast,Sg,Pers2_Casual,Masc > => "th'a" ;
<CPast,Sg,Pers2_Casual,Fem > => "th'y" ; <CPast,Sg,Pers2_Casual,Fem > => "th'y" ;
<CPast,Sg,Pers2_Familiar,Masc > => "th-a" ; <CPast,Sg,Pers2_Familiar,Masc > => "th'a" ;
<CPast,Sg,Pers2_Familiar,Fem > => "th'y" ; <CPast,Sg,Pers2_Familiar,Fem > => "th'y" ;
<CPast,Sg,Pers2_Respect,Masc > => "th'E" ; <CPast,Sg,Pers2_Respect,Masc > => "th'E" ;
<CPast,Sg,Pers2_Respect,Fem > => "th'yN" ; <CPast,Sg,Pers2_Respect,Fem > => "th'yN" ;
<CPast,Sg,Pers3_Near,Masc > => "th-a" ; <CPast,Sg,Pers3_Near,Masc > => "th'a" ;
<CPast,Sg,Pers3_Near,Fem > => "th'y" ; <CPast,Sg,Pers3_Near,Fem > => "th'y" ;
<CPast,Sg,Pers3_Distant,Masc > => "th-a" ; <CPast,Sg,Pers3_Distant,Masc > => "th'a" ;
<CPast,Sg,Pers3_Distant,Fem > => "th'y" ; <CPast,Sg,Pers3_Distant,Fem > => "th'y" ;
<CPast,Pl,Pers1,Masc > => "th'E" ; <CPast,Pl,Pers1,Masc > => "th'E" ;
<CPast,Pl,Pers1,Fem > => "th'yN" ; <CPast,Pl,Pers1,Fem > => "th'yN" ;

View File

@@ -365,7 +365,8 @@ makeIQuant : Str -> {s : Number => Gender => Case => Str} = \str -> {
Inf_Fem => inf_fem Inf_Fem => inf_fem
} };
cvp = []
} ; } ;
rem_y : Str -> Str; rem_y : Str -> Str;
rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)y") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)y") (b ++ "(i)"++th) (if_then_else Str (eq a2 "y") (b ++ th) str) rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)y") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)y") (b ++ "(i)"++th) (if_then_else Str (eq a2 "y") (b ++ th) str)