forked from GitHub/gf-core
hindi-resource-grammar
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
incomplete concrete AdjectiveHindustani of Adjective = CatHindustani ** open CommonHindustani,ResHindustani, StringsHindustani, Prelude in {
|
||||
incomplete concrete AdjectiveHindustani of Adjective = CatHindustani ** open CommonHindustani,ResHindustani, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
@@ -19,8 +19,10 @@ incomplete concrete AdjectiveHindustani of Adjective = CatHindustani ** open Com
|
||||
s = \\n,g,c,d => a.s ! n ! g ! c ! d ++ RefPron ++ sE ;
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
s = \\n,g,c,d => ap.s ! n ! g ! c ! d ++ sc.s ;
|
||||
SentAP ap sc = {
|
||||
s = \\n,g,c,d => case sc.fromVP of {
|
||||
True => sc.s ++ kw ++ ap.s ! n ! g ! c ! d ;
|
||||
False => ap.s ! n ! g ! c ! d ++ sc.s } ;
|
||||
} ;
|
||||
|
||||
AdAP ada ap = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
incomplete concrete AdverbHindustani of Adverb = CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
incomplete concrete AdverbHindustani of Adverb = CatHindustani ** open CommonHindustani, ResHindustani, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = \\g => a.s ! Sg ! g ! Obl ! Posit} ;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--concrete CatUrd of Cat = CommonX - [Adv,AdN] ** open ResUrd, Prelude in {
|
||||
incomplete concrete CatHindustani of Cat =
|
||||
CommonX - [Adv,AdN]** open ResHindustani, Prelude, CommonHindustani, (R = ParamX) in {
|
||||
CommonX - [Adv,AdN,SC]** open ResHindustani, Prelude, CommonHindustani, (R = ParamX) in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
@@ -11,6 +11,7 @@ incomplete concrete CatHindustani of Cat =
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
||||
SSlash = {s : Str ; c2 : ResHindustani.Compl} ;
|
||||
SC = {s : Str ; fromVP : Bool} ;
|
||||
|
||||
---- Sentence
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
--
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work.
|
||||
resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
|
||||
resource CommonHindustani = ParamX ** open Prelude, Predef in {
|
||||
--interface CommonHindustani = ParamX ** open Prelude,Predef,StringsHindustani1 in {
|
||||
flags coding = utf8 ;
|
||||
|
||||
oper
|
||||
@@ -71,105 +71,8 @@ resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
NPCase = NPC Case | NPObj | NPErg ;
|
||||
Order = ODir | OQuest ;
|
||||
|
||||
|
||||
oper
|
||||
copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g ->
|
||||
case <t,n,p,g> of {
|
||||
<CPresent,Sg,Pers1,_ > => "hwN" ;
|
||||
<CPresent,Sg,Pers2_Casual,_ > => "hE" ;
|
||||
<CPresent,Sg,Pers2_Familiar,_ > => "hw" ;
|
||||
<CPresent,Sg,Pers2_Respect,_ > => "hyN" ;
|
||||
<CPresent,Sg,Pers3_Near,_ > => "hE" ;
|
||||
<CPresent,Sg,Pers3_Distant,_ > => "hE" ;
|
||||
<CPresent,Pl,Pers1,_ > => "hyN" ;
|
||||
<CPresent,Pl,Pers2_Casual,_ > => "hw" ;
|
||||
<CPresent,Pl,Pers2_Familiar,_ > => "hw" ;
|
||||
<CPresent,Pl,Pers2_Respect,_ > => "hyN" ;
|
||||
<CPresent,Pl,Pers3_Near,_ > => "hyN" ;
|
||||
<CPresent,Pl,Pers3_Distant,_ > => "hyN" ;
|
||||
<CPast,Sg,Pers1,Masc > => "th'a" ;
|
||||
<CPast,Sg,Pers1,Fem > => "th'y" ;
|
||||
<CPast,Sg,Pers2_Casual,Masc > => "th'a" ;
|
||||
<CPast,Sg,Pers2_Casual,Fem > => "th'y" ;
|
||||
<CPast,Sg,Pers2_Familiar,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers2_Familiar,Fem > => "th'y" ;
|
||||
<CPast,Sg,Pers2_Respect,Masc > => "th'E" ;
|
||||
<CPast,Sg,Pers2_Respect,Fem > => "th'yN" ;
|
||||
<CPast,Sg,Pers3_Near,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers3_Near,Fem > => "th'y" ;
|
||||
<CPast,Sg,Pers3_Distant,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers3_Distant,Fem > => "th'y" ;
|
||||
<CPast,Pl,Pers1,Masc > => "th'E" ;
|
||||
<CPast,Pl,Pers1,Fem > => "th'yN" ;
|
||||
<CPast,Pl,Pers2_Casual,Masc > => "th'E" ;
|
||||
<CPast,Pl,Pers2_Casual,Fem > => "th'yN" ;
|
||||
<CPast,Pl,Pers2_Familiar,Masc > => "th'E" ;
|
||||
<CPast,Pl,Pers2_Familiar,Fem > => "th'yN" ;
|
||||
<CPast,Pl,Pers2_Respect,Masc > => "th'E" ;
|
||||
<CPast,Pl,Pers2_Respect,Fem > => "th'yN" ;
|
||||
<CPast,Pl,Pers3_Near,Masc > => "th'E" ;
|
||||
<CPast,Pl,Pers3_Near,Fem > => "th'yN" ;
|
||||
<CPast,Pl,Pers3_Distant,Masc > => "th'E" ;
|
||||
<CPast,Pl,Pers3_Distant,Fem > => "th'yN" ;
|
||||
<CFuture,Sg,Pers1,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers1,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers2_Casual,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers2_Casual,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers2_Familiar,Masc > => "gE" ;
|
||||
<CFuture,Sg,Pers2_Familiar,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers2_Respect,Masc > => "gE" ;
|
||||
<CFuture,Sg,Pers2_Respect,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers3_Near,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers3_Near,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers3_Distant,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers3_Distant,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers1,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers1,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers2_Casual,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers2_Casual,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers2_Familiar,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers2_Familiar,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers2_Respect,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers2_Respect,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers3_Near,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers3_Near,Fem > => "gE" ;
|
||||
<CFuture,Pl,Pers3_Distant,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers3_Distant,Fem > => "gy"
|
||||
|
||||
|
||||
} ;
|
||||
raha : Gender -> Number -> Str = \g,n ->
|
||||
(regAdjective "rha").s ! n ! g ! Dir ! Posit ;
|
||||
|
||||
cka : Gender -> Number -> Str = \g,n ->
|
||||
(regAdjective "cka").s ! n ! g ! Dir ! Posit ;
|
||||
|
||||
hw : UPerson -> Number -> Str = \pp,n ->
|
||||
case <pp,n> of {
|
||||
<Pers1,_> => "hwN";
|
||||
<_,Pl> => "hwN";
|
||||
<_,_> => "hw"
|
||||
};
|
||||
|
||||
-----------------------------------------------
|
||||
-- Hindustani Adjectives
|
||||
-----------------------------------------------
|
||||
|
||||
Adjective = { s: Number => Gender => Case => Degree => Str };
|
||||
regAdjective : Str -> Adjective;
|
||||
regAdjective x = case x of {
|
||||
acch + ("a"|"aN") => mkAdjective x ("bht" ++ x) ("sb sE" ++ x) (acch + "E") ("bht" ++ acch + "E") ("sb sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sb sE" ++ acch + "E")
|
||||
(acch + "y") ("bht" ++ acch + "y") ("sb sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sb sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sb sE" ++ acch + "y")
|
||||
(acch +"E") ("bht" ++ acch + "E") ("sb sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sb sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sb sE" ++ acch + "E")
|
||||
(acch + "y") ("bht" ++ acch + "y") ("sb sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sb sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sb sE" ++ acch + "y");
|
||||
|
||||
_ => mkAdjective x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x)
|
||||
x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x)
|
||||
x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x)
|
||||
x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x) x ("bht" ++ x) ("sb sE" ++ x)
|
||||
|
||||
};
|
||||
|
||||
|
||||
oper
|
||||
|
||||
mkAdjective : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> Adjective =
|
||||
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> {
|
||||
@@ -249,34 +152,10 @@ resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
}
|
||||
};
|
||||
|
||||
compoundAdj : Str -> Str -> Adjective = \s1,s2 -> mkCompoundAdj (regAdjective s1) (regAdjective s2) ;
|
||||
mkCompoundAdj : Adjective -> Adjective -> Adjective ;
|
||||
mkCompoundAdj adj1 adj2 = {s = \\n,g,c,d => adj1.s ! n ! g ! c ! d ++ adj2.s ! n ! g ! c ! d} ;
|
||||
Adjective = { s: Number => Gender => Case => Degree => Str };
|
||||
|
||||
|
||||
Verb : Type = {s : VerbForm => Str} ;
|
||||
|
||||
predV : Verb -> VPH ;
|
||||
predV v = {
|
||||
s = \\vh =>
|
||||
case vh of {
|
||||
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = v.s ! VF Imperf p n g } ;
|
||||
VPTense VPPast (Ag g n p) => {fin = [] ; inf =v.s ! VF Perf p n g} ;
|
||||
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = v.s ! VF Subj p n g } ;
|
||||
VPTense VPPerf (Ag g n p) => { fin = [] ; inf = v.s ! Root ++ cka g n } ;
|
||||
VPStem => {fin = [] ; inf = v.s ! Root};
|
||||
VPInf => {fin = v.s ! Inf_Obl ; inf = v.s ! Root}; -- for V2V like sonE ky altja krna , check if it is being used anywhere else
|
||||
VPImp => {fin = v.s ! VF Subj Pers3_Near Pl Masc ; inf = v.s ! Root};
|
||||
_ => {fin = [] ; inf = v.s ! Root}
|
||||
};
|
||||
obj = {s = [] ; a = defaultAgr} ;
|
||||
subj = VIntrans ;
|
||||
inf = v.s ! Inf;
|
||||
ad = [];
|
||||
embComp = [];
|
||||
prog = False ;
|
||||
comp = \\_ => []
|
||||
} ;
|
||||
|
||||
defaultAgr : Agr = agrP3 Masc Sg ;
|
||||
agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ;
|
||||
toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g ->
|
||||
@@ -300,8 +179,9 @@ resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
giveGender : Agr -> Gender =\a -> case a of {
|
||||
Ag g _ _ => g
|
||||
};
|
||||
insertSubj : UPerson -> Str -> Str = \p,s ->
|
||||
case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"};
|
||||
|
||||
-- insertSubj : UPerson -> Str -> Str = \p,s ->
|
||||
-- case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"};
|
||||
|
||||
mkOrd : Str -> Str =
|
||||
\s -> case s of {
|
||||
@@ -311,6 +191,7 @@ resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
"car" => "cwth'a";
|
||||
"ch'" => "ch'Ta";
|
||||
_ => s ++ "waN"
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,35 @@
|
||||
interface DiffHindustani = open CommonHindustani, Prelude in {
|
||||
interface DiffHindustani = open Prelude in {
|
||||
oper
|
||||
|
||||
mkClause : NP -> VPH -> Clause ;
|
||||
mkSClause : Str -> Agr -> VPH -> Clause ;
|
||||
|
||||
np2pronCase : (Case => Str) -> NPCase -> Agr -> Str ;
|
||||
conjThat : Str ; -- = "kh" ;
|
||||
insertSubj : UPerson -> Str -> Str ;
|
||||
|
||||
kwd : Str ;
|
||||
ky : Str ;
|
||||
agr : Str ;
|
||||
awr : Str ;
|
||||
jn : Str ;
|
||||
js : Str ;
|
||||
jw : Str ;
|
||||
kw : Str ;
|
||||
mt : Str ;
|
||||
nE : Str ;
|
||||
nh : Str ;
|
||||
sE : Str ;
|
||||
waN : Str ;
|
||||
comma : Str ;
|
||||
indfArt : Str ;
|
||||
nE : Str ;
|
||||
hE : Str ;
|
||||
|
||||
copula : CTense -> Number -> UPerson -> Gender -> Str ;
|
||||
raha : Gender -> Number -> Str ;
|
||||
cka : Gender -> Number -> Str ;
|
||||
hw : UPerson -> Number -> Str ;
|
||||
hwa : Agr -> Str ;
|
||||
regAdjective : Str -> Adjective ;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in {
|
||||
incomplete concrete NounHindustani of Noun =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
@@ -19,7 +19,7 @@ incomplete concrete NounHindustani of Noun =
|
||||
} ;
|
||||
|
||||
PPartNP np v2 = {
|
||||
s = \\c => v2.s ! VF Perf (fromAgr np.a).p (fromAgr np.a).n (fromAgr np.a).g ++ np.s ! c ;
|
||||
s = \\c => v2.s ! VF Perf (fromAgr np.a).p (fromAgr np.a).n (fromAgr np.a).g ++ hwa np.a ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
@@ -133,7 +133,11 @@ incomplete concrete NounHindustani of Noun =
|
||||
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; -- changed during WebAlt adver comes before noun like phaRy pr gh-r (house on the hill)
|
||||
AdvCN cn ad = {s = \\n,c => ad.s ! cn.g ++ cn.s ! n ! c ; g = cn.g} ;
|
||||
|
||||
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ;
|
||||
SentCN cn sc = {s = \\n,c => case sc.fromVP of {
|
||||
True => sc.s ++ ky ++ cn.s ! n ! c ;
|
||||
False => cn.s ! n ! c ++ sc.s } ;
|
||||
g = cn.g ;
|
||||
} ;
|
||||
|
||||
ApposCN cn np = {s = \\n,c => cn.s ! n ! Dir ++ np.s ! NPC c ; g = cn.g} ;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--concrete QuestionUrd of Question = CatUrd ** open ResUrd, StringsHindustani, Prelude in {
|
||||
incomplete concrete QuestionHindustani of Question =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
coding = utf8;
|
||||
@@ -24,8 +24,11 @@ incomplete concrete QuestionHindustani of Question =
|
||||
}
|
||||
};
|
||||
QuestSlash ip slash =
|
||||
let ip1 = ip.s ! Dir;
|
||||
ip2 = ip.s ! Obl ++ nE
|
||||
let
|
||||
-- ip1 = ip.s ! Dir;
|
||||
-- ip2 = ip.s ! Obl ++ nE
|
||||
ip1 = ip.s ! Obl ++ kw;
|
||||
ip2 = ip.s ! Obl ++ kw
|
||||
in {
|
||||
s = \\t,p,o => case t of {
|
||||
VPImpPast => ip2 ++ slash.s ! t ! p ! ODir;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--concrete RelativeUrd of Relative = CatUrd ** open ResUrd, StringsHindustani in {
|
||||
incomplete concrete RelativeHindustani of Relative =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
coding = utf8;
|
||||
@@ -11,7 +11,7 @@ incomplete concrete RelativeHindustani of Relative =
|
||||
s = \\t,p,o,agr => case <t,giveNumber agr> of {
|
||||
<VPImpPast,Sg> => js ++ cl.s ! t ! p ! o ;
|
||||
<VPImpPast,Pl> => jn ++ cl.s ! t ! p ! o ;
|
||||
<_,_> => "jw" ++ cl.s ! t ! p ! o
|
||||
<_,_> => jw ++ cl.s ! t ! p ! o
|
||||
};
|
||||
c = Dir
|
||||
} ;
|
||||
|
||||
@@ -50,7 +50,7 @@ param
|
||||
eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ;
|
||||
|
||||
RefPron : Str;
|
||||
RefPron = "Kwd";
|
||||
RefPron = kwd ;
|
||||
|
||||
----------------------------------------------------------
|
||||
-- Grammar part
|
||||
@@ -60,47 +60,23 @@ param
|
||||
toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of {
|
||||
NPC c => pn ! c ;
|
||||
NPObj => pn ! Dir ;
|
||||
NPErg => pn ! Obl ++ "nE"
|
||||
NPErg => pn ! Obl ++ nE
|
||||
} ;
|
||||
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 ;
|
||||
NPErg => dt.s ! nn ! cn.g ! Obl ++ cn.s ! nn ! Obl ++ "nE"
|
||||
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 ;
|
||||
NPErg => dt.s ! Sg ! Masc ! Obl ++ "nE"
|
||||
NPErg => dt.s ! Sg ! Masc ! Obl ++ nE
|
||||
} ;
|
||||
|
||||
------------------------------------------
|
||||
-- Agreement transformations
|
||||
-----------------------------------------
|
||||
{- toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g ->
|
||||
Ag g n p;
|
||||
|
||||
|
||||
fromAgr : Agr -> {n : Number ; p : UPerson ; g : Gender} = \a -> case a of {
|
||||
Ag g n p => {n = n ; p = p ; g = g}
|
||||
} ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
||||
let a = fromAgr a0 ; b = fromAgr b0
|
||||
in
|
||||
toAgr
|
||||
(conjNumber a.n b.n)
|
||||
b.p a.g;
|
||||
|
||||
giveNumber : Agr -> Number =\a -> case a of {
|
||||
Ag _ n _ => n
|
||||
};
|
||||
giveGender : Agr -> Gender =\a -> case a of {
|
||||
Ag g _ _ => g
|
||||
};
|
||||
-}
|
||||
-- defaultAgr : Agr = agrP3 Masc Sg ;
|
||||
-- agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ;
|
||||
personalAgr : Agr = agrP1 Masc Sg ;
|
||||
agrP1 : Gender -> Number -> Agr = \g,n -> Ag g n Pers1 ;
|
||||
|
||||
@@ -121,6 +97,7 @@ param
|
||||
|
||||
objVType : VType -> NPCase = \vt -> case vt of {
|
||||
VTrans => NPObj ;
|
||||
VTransPost => NPC Dir ;
|
||||
_ => NPC Obl
|
||||
} ;
|
||||
|
||||
@@ -131,14 +108,28 @@ param
|
||||
|
||||
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
|
||||
predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ;
|
||||
{-
|
||||
-------------------------
|
||||
-- added for cauitives
|
||||
predVcc : (Verb **{c2:Compl}) -> VPHSlash = \verb ->
|
||||
predV verb ** {c2 = {s = "" ; c = VTrans} } ;
|
||||
------------------------
|
||||
-}
|
||||
predAux : Aux -> VPH = \verb -> {
|
||||
predV : Verb -> VPH ;
|
||||
predV v = {
|
||||
s = \\vh =>
|
||||
case vh of {
|
||||
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = v.s ! VF Imperf p n g } ;
|
||||
VPTense VPPast (Ag g n p) => {fin = [] ; inf =v.s ! VF Perf p n g} ;
|
||||
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = v.s ! VF Subj p n g } ;
|
||||
VPTense VPPerf (Ag g n p) => { fin = [] ; inf = v.s ! Root ++ cka g n } ;
|
||||
VPStem => {fin = [] ; inf = v.s ! Root};
|
||||
VPInf => {fin = v.s ! Inf_Obl ; inf = v.s ! Root}; -- for V2V like sonE ky altja krna , check if it is being used anywhere else
|
||||
VPImp => {fin = v.s ! VF Subj Pers3_Near Pl Masc ; inf = v.s ! Root};
|
||||
_ => {fin = [] ; inf = v.s ! Root}
|
||||
};
|
||||
obj = {s = [] ; a = defaultAgr} ;
|
||||
subj = VIntrans ;
|
||||
inf = v.s ! Inf;
|
||||
ad = [];
|
||||
embComp = [];
|
||||
prog = False ;
|
||||
comp = \\_ => []
|
||||
} ;
|
||||
predAux : Aux -> VPH = \verb -> {
|
||||
s = \\vh =>
|
||||
let
|
||||
|
||||
@@ -191,107 +182,6 @@ param
|
||||
comp = verb.comp
|
||||
} ;
|
||||
|
||||
{- Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
|
||||
mkClause : NP -> VPH -> Clause = \np,vp -> {
|
||||
s = \\vt,b,ord =>
|
||||
let
|
||||
subjagr : NPCase * Agr = case vt of {
|
||||
VPImpPast => case vp.subj of {
|
||||
VTrans => <NPErg, vp.obj.a> ;
|
||||
VTransPost => <NPErg, defaultAgr> ;
|
||||
_ => <NPC Dir, np.a>
|
||||
} ;
|
||||
_ => <NPC Dir, np.a>
|
||||
} ;
|
||||
subj = subjagr.p1 ;
|
||||
agr = subjagr.p2 ;
|
||||
n = (fromAgr agr).n;
|
||||
p = (fromAgr agr).p;
|
||||
g = (fromAgr agr).g;
|
||||
vps = case vt of {
|
||||
|
||||
VPGenPres => vp.s ! VPTense VPPres agr ;
|
||||
VPImpPast => vp.s ! VPTense VPPast agr ;
|
||||
VPFut => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).fin ; inf = (vp.s ! VPTense VPFutr agr).inf ++ hw p n} ;
|
||||
_ => vp.s ! VPTense VPFutr agr } ;
|
||||
VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n} ;
|
||||
VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ;
|
||||
VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ;
|
||||
VPPerfFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPerf agr).inf ++ hw p 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 } ;
|
||||
VPPerfFutCont => {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n } ;
|
||||
VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "Xayd" } ;
|
||||
_ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "Xayd" } }
|
||||
|
||||
};
|
||||
|
||||
|
||||
quest =
|
||||
case ord of
|
||||
{ ODir => [];
|
||||
OQuest => "kya" };
|
||||
na =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "na" };
|
||||
nahim =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "nhyN" };
|
||||
in
|
||||
case vt of {
|
||||
VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ 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};
|
||||
|
||||
} ;
|
||||
|
||||
mkSClause : Str -> Agr -> VPH -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
s = \\t,b,ord =>
|
||||
let
|
||||
n = (fromAgr agr).n;
|
||||
p = (fromAgr agr).p;
|
||||
g = (fromAgr agr).g;
|
||||
vps = case t of {
|
||||
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 ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ;
|
||||
VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ;
|
||||
VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ;
|
||||
VPPerfFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p 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 } ;
|
||||
VPPerfFutCont => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ;
|
||||
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "Xayd" }
|
||||
|
||||
};
|
||||
|
||||
quest =
|
||||
case ord of
|
||||
{ ODir => [];
|
||||
OQuest => "kya" };
|
||||
na =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "na" };
|
||||
nahim =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "nhyN" };
|
||||
in
|
||||
case t of {
|
||||
VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp;
|
||||
_ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
|
||||
} ;
|
||||
-}
|
||||
-- insertSubj : UPerson -> Str -> Str = \p,s ->
|
||||
-- case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"};
|
||||
|
||||
insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> {
|
||||
s = vp.s ;
|
||||
@@ -326,19 +216,18 @@ param
|
||||
|
||||
} ;
|
||||
|
||||
insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp ->
|
||||
insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp ->
|
||||
insertObj obj vp ** {c2 = vp.c2} ;
|
||||
insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp ->
|
||||
insertObj2 obj vp ** {c2 = vp.c2} ;
|
||||
|
||||
infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a ->
|
||||
vp.obj.s ++ vp.inf ++ vp.comp ! a ;
|
||||
-- infVV : Bool -> VPH -> Str = \isAux,vp ->
|
||||
-- case isAux of {False => vp.obj.s ++ vp.inf ; True => vp.obj.s ++ (vp.s ! VPImp).fin };
|
||||
vp.obj.s ++ vp.comp ! a ++ vp.inf ;
|
||||
|
||||
infVV : Bool -> VPH -> Str = \isAux,vp ->
|
||||
case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin } ;
|
||||
case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => (vp.s ! VPImp).inf ++ vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) } ;
|
||||
infV2V : Bool -> VPH -> Str = \isAux,vp ->
|
||||
case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPInf).fin ++ "ky" ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ "ky"};
|
||||
case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPInf).fin ++ ky ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ ky};
|
||||
|
||||
|
||||
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||
@@ -374,7 +263,7 @@ param
|
||||
comp = vp.comp
|
||||
} ;
|
||||
|
||||
conjThat : Str = "kh" ;
|
||||
-- conjThat : Str = "kh" ;
|
||||
|
||||
insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> {
|
||||
s = vp.s ;
|
||||
@@ -395,7 +284,12 @@ param
|
||||
embComp = vp.embComp ;
|
||||
prog = vp.prog ;
|
||||
comp = vp.comp
|
||||
} ;
|
||||
} ;
|
||||
|
||||
compoundAdj : Str -> Str -> Adjective = \s1,s2 -> mkCompoundAdj (regAdjective s1) (regAdjective s2) ;
|
||||
mkCompoundAdj : Adjective -> Adjective -> Adjective ;
|
||||
mkCompoundAdj adj1 adj2 = {s = \\n,g,c,d => adj1.s ! n ! g ! c ! d ++ adj2.s ! n ! g ! c ! d} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--concrete SentenceUrd of Sentence = CatUrd ** open Prelude, StringsHindustani, ResUrd in {
|
||||
incomplete concrete SentenceHindustani of Sentence =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude, StringsHindustani in {
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
coding = utf8;
|
||||
@@ -40,9 +40,10 @@ incomplete concrete SentenceHindustani of Sentence =
|
||||
(insertObj2 (conjThat ++ slash.s) (predV vs)) **
|
||||
{c2 = slash.c2} ;
|
||||
|
||||
EmbedS s = {s = conjThat ++ s.s} ;
|
||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
EmbedVP vp = {s = infVP False vp defaultAgr} ; --- agr
|
||||
EmbedS s = {s = conjThat ++ s.s ; fromVP = False} ;
|
||||
EmbedQS qs = {s = conjThat ++ qs.s ! QIndir ; fromVP = False} ;
|
||||
-- EmbedVP vp = {s = infVP False vp defaultAgr ; fromVP = True} ; --- agr
|
||||
EmbedVP vp = {s = (vp.s ! VPInf).fin ; fromVP = True} ;
|
||||
|
||||
UseCl temp p cl =
|
||||
{ s = case <temp.t,temp.a> of {
|
||||
@@ -98,7 +99,6 @@ incomplete concrete SentenceHindustani of Sentence =
|
||||
} ;
|
||||
|
||||
AdvS a s = {s = a.s ! Masc ++ s.s} ;
|
||||
ExtAdvS a s = {s = a.s ! Masc ++ "," ++ s.s} ;
|
||||
|
||||
RelS s r = {s = s.s ++ r.s ! agrP3 Masc Sg} ;
|
||||
SSubjS s sj s = { s = s.s ++ sj.s ++ s.s};
|
||||
|
||||
@@ -10,7 +10,7 @@ oper
|
||||
jw = "jw" ;
|
||||
kw = "kw" ;
|
||||
mt = "mt" ;
|
||||
nE = "nE" ;
|
||||
-- nE = "nE" ;
|
||||
nh = "nh" ;
|
||||
sE = "sE" ;
|
||||
waN = "waN" ;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
--concrete SymbolUrd of Symbol = CatUrd ** open Prelude, ResUrd, StringsHindustani in {
|
||||
incomplete concrete SymbolHindustani of Symbol =
|
||||
CatHindustani ** open Prelude, ResHindustani, StringsHindustani, CommonHindustani in {
|
||||
CatHindustani ** open Prelude, ResHindustani, CommonHindustani in {
|
||||
|
||||
lin
|
||||
-- SymbPN i = {s = \\_ => i.s ; g = Masc} ;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
--concrete VerbUrd of Verb = CatUrd ** open ResUrd in {
|
||||
incomplete concrete VerbHindustani of Verb = CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani in {
|
||||
incomplete concrete VerbHindustani of Verb = CatHindustani ** open CommonHindustani, ResHindustani in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV v = predV v ;
|
||||
SlashV2a v = predV v ** {c2 = {s = v.c2.s ; c = VTrans}} ;
|
||||
SlashV2a v = predV v ** {c2 = {s = v.c2.s ; c = VTrans}} ;
|
||||
Slash2V3 v np =
|
||||
insertObjc (\\_ => np.s ! NPObj ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ;
|
||||
insertObjc (\\_ => np.s ! NPC Dir ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTransPost}}) ; -- changed form NPObj
|
||||
Slash3V3 v np =
|
||||
insertObjc (\\_ => np.s ! NPC Obl ++ v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ;
|
||||
ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp) (predV v) vp.embComp ) VTransPost;
|
||||
ComplVS v s = insertTrans (insertObj2 (conjThat ++ s.s) (predV v)) VTransPost ;
|
||||
insertObjc (\\_ => np.s ! NPC Obl ++ v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTransPost}}) ;
|
||||
ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp) (predV v) vp.embComp ) VTrans; -- changed from VTransPost
|
||||
ComplVS v s = insertTrans (insertObj2 (conjThat ++ s.s) (predV v)) VTrans ; -- changed from VTransPost
|
||||
ComplVQ v q = insertObj2 (conjThat ++ q.s ! QIndir) (predV v) ;
|
||||
ComplVA v ap = insertObj (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v) ;
|
||||
SlashV2V v vp = insertVV (infV2V v.isAux vp) (predV v) vp.embComp **{c2 = {s = sE ; c = VTransPost}} ;
|
||||
SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = kw ; c = VTransPost}}) ;
|
||||
SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = sE ; c = VTransPost}}) ;
|
||||
SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v ** {c2 = {s = kw ; c = VTransPost}}) ; ----
|
||||
SlashV2V v vp = insertVV (infV2V v.isAux vp) (predV v) vp.embComp **{c2 = {s = sE ; c = VTrans}} ; -- changed from VTransPost
|
||||
SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = kw ; c = VTrans}}) ; -- changed from VTransPost
|
||||
SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = sE ; c = VTrans}}) ; -- changed from VTransPost
|
||||
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 =
|
||||
insertEmbCompl (insertObj (\\a => infVP vv.isAux vp a) (predV vv)) vp.embComp **
|
||||
|
||||
Reference in New Issue
Block a user