forked from GitHub/gf-core
Hindi and Urdu as refactored to Hindustani by Shafqat
This commit is contained in:
38
lib/src/hindustani/AdjectiveHindustani.gf
Normal file
38
lib/src/hindustani/AdjectiveHindustani.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
incomplete concrete AdjectiveHindustani of Adjective = CatHindustani ** open CommonHindustani,ResHindustani, StringsHindustani, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
PositA a = a ;
|
||||
UseComparA a = a;
|
||||
|
||||
ComparA a np = {
|
||||
s = \\n,g,c,d => np.s ! NPC Obl ++ sE ++ a.s ! n ! g ! c ! d ;
|
||||
} ;
|
||||
|
||||
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\n,g,c,d => np.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ! d ;
|
||||
} ;
|
||||
|
||||
ReflA2 a = {
|
||||
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 ;
|
||||
} ;
|
||||
|
||||
AdAP ada ap = {
|
||||
s = \\n,g,c,d => ada.s ++ ap.s ! n ! g ! c ! d ;
|
||||
} ;
|
||||
|
||||
UseA2 a = a ;
|
||||
|
||||
CAdvAP cadv ap np = {
|
||||
s = \\n,g,c,d => cadv.s ++ ap.s ! n ! g ! c ! d ++ cadv.p ++ np.s ! NPC Dir ;
|
||||
};
|
||||
|
||||
AdjOrd ord = { s = \\_,_,_,_ => ord.s ; };
|
||||
|
||||
}
|
||||
20
lib/src/hindustani/AdverbHindustani.gf
Normal file
20
lib/src/hindustani/AdverbHindustani.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
incomplete concrete AdverbHindustani of Adverb = CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = \\g => a.s ! Sg ! g ! Obl ! Posit} ;
|
||||
ComparAdvAdj cadv a np = {
|
||||
s = \\g => np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit;
|
||||
} ;
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = \\g => cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit ++ s.s;
|
||||
} ;
|
||||
|
||||
PrepNP prep np = {s = \\g => np.s ! NPObj ++ prep.s ! g } ;
|
||||
|
||||
AdAdv ada adv = { s = \\g => ada.s ++ adv.s ! g} ;
|
||||
|
||||
SubjS sub s = {s = \\_ => sub.s ++ s.s } ;
|
||||
|
||||
AdnCAdv cadv = {s = sE ++ cadv.s ; p = True} ;
|
||||
|
||||
}
|
||||
92
lib/src/hindustani/CatHindustani.gf
Normal file
92
lib/src/hindustani/CatHindustani.gf
Normal file
@@ -0,0 +1,92 @@
|
||||
--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 {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
------ Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
||||
SSlash = {s : Str ; c2 : ResHindustani.Compl} ;
|
||||
|
||||
---- Sentence
|
||||
|
||||
Cl = ResHindustani.Clause ;
|
||||
ClSlash = {
|
||||
s : CommonHindustani.VPHTense => Polarity => Order => Str ;
|
||||
c2 : ResHindustani.Compl
|
||||
} ;
|
||||
Imp = {s : CPolarity => ImpForm => Str} ;
|
||||
|
||||
---- Question
|
||||
QCl = {s : CommonHindustani.VPHTense => Polarity => QForm => Str} ;
|
||||
IP = {s: Case => Str ; g : Gender ; n : Number};
|
||||
IDet = {s :Gender => Str ; n : Number} ;
|
||||
IQuant = {s : Number => Str} ;
|
||||
|
||||
---- Relative
|
||||
|
||||
RCl = {
|
||||
s : CommonHindustani.VPHTense => Polarity => Order => Agr => Str ;
|
||||
c : Case
|
||||
} ;
|
||||
RP = {s: Number => Case => Str ; a:RAgr};
|
||||
|
||||
---- Verb
|
||||
|
||||
VP = VPH ;
|
||||
VPSlash = ResHindustani.VPHSlash ;
|
||||
Comp = {s : Agr => Str} ;
|
||||
---- Adverb
|
||||
Adv = {s : Gender => Str } ;
|
||||
|
||||
----- AdN
|
||||
AdN = {s : Str ; p : Bool} ;
|
||||
|
||||
---- Adjective
|
||||
|
||||
AP = CommonHindustani.Adjective ;
|
||||
|
||||
---- Noun
|
||||
|
||||
CN = ResHindustani.Noun ;
|
||||
NP = CommonHindustani.NP ;
|
||||
Pron = {s : Case => Str ; ps : Str ; a : Agr};
|
||||
Det = ResHindustani.Determiner ;
|
||||
Predet = {s : Str} ;
|
||||
Num = {s : Str ; n : Number} ;
|
||||
Card = {s : Str; n : Number} ;
|
||||
Ord = {s : Str; n : Number} ;
|
||||
Quant = {s:Number => Gender => Case => Str ; a:Agr};
|
||||
Art = {s : Str} ;
|
||||
|
||||
---- Numeral
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
Digits = {s : CardOrd => Str ; n : Number } ;
|
||||
|
||||
---- Structural
|
||||
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
-----b Conj = {s : Str ; n : Number} ;
|
||||
-----b DConj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = ResHindustani.Preposition;
|
||||
---- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A, V2Q, V2S = Verb ** {c2 : Compl} ;
|
||||
V3 = Verb ** {c2, c3 : Str} ;
|
||||
VV = Verb ** { isAux : Bool} ;
|
||||
V2V = Verb ** {c1 : Str ; c2 : Str ; isAux : Bool} ;
|
||||
A = CommonHindustani.Adjective ; --- {s : Gender => Number => Case => Str} ;
|
||||
A2 = {s : Number => Gender => Case => Degree => Str ; c2 : Str} ;
|
||||
N = {s : Number => Case => Str ; g : Gender} ;
|
||||
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str ; c3 : Str } ;
|
||||
N3 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str ; c3 : Str ; c4 : Str} ;
|
||||
PN = {s : Case => Str ; g : Gender} ;
|
||||
|
||||
}
|
||||
309
lib/src/hindustani/CommonHindustani.gf
Normal file
309
lib/src/hindustani/CommonHindustani.gf
Normal file
@@ -0,0 +1,309 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
--
|
||||
--1 Hindustaniu auxiliary operations.
|
||||
--
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work.
|
||||
resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
|
||||
flags coding = utf8 ;
|
||||
|
||||
oper
|
||||
|
||||
VPH = {
|
||||
s : VPHForm => {fin, inf : Str} ;
|
||||
obj : {s : Str ; a : Agr} ;
|
||||
subj : VType ;
|
||||
comp : Agr => Str;
|
||||
inf : Str;
|
||||
ad : Str;
|
||||
embComp : Str ;
|
||||
prog : Bool ;
|
||||
} ;
|
||||
NP : Type = {s : NPCase => Str ; a : Agr} ;
|
||||
param
|
||||
VPHForm =
|
||||
VPTense VPPTense Agr -- 9 * 12
|
||||
| VPReq
|
||||
| VPImp
|
||||
| VPReqFut
|
||||
| VPInf
|
||||
| VPStem
|
||||
;
|
||||
VPPTense =
|
||||
VPPres
|
||||
|VPPast
|
||||
|VPFutr
|
||||
|VPPerf;
|
||||
|
||||
VPHTense =
|
||||
VPGenPres -- impf hum nahim "I go"
|
||||
| VPImpPast -- impf Ta nahim "I went"
|
||||
| VPFut -- fut na/nahim "I shall go"
|
||||
| VPContPres -- stem raha hum nahim "I am going"
|
||||
| VPContPast -- stem raha Ta nahim "I was going"
|
||||
| VPContFut
|
||||
| VPPerfPres -- perf hum na/nahim "I have gone"
|
||||
| VPPerfPast -- perf Ta na/nahim "I had gone"
|
||||
| VPPerfFut
|
||||
| VPPerfPresCont
|
||||
| VPPerfPastCont
|
||||
| VPPerfFutCont
|
||||
| VPSubj -- subj na "I may go"
|
||||
;
|
||||
Agr = Ag Gender Number UPerson ;
|
||||
Gender = Masc | Fem ;
|
||||
Case = Dir | Obl | Voc ;
|
||||
UPerson = Pers1
|
||||
| Pers2_Casual
|
||||
| Pers2_Familiar
|
||||
| Pers2_Respect
|
||||
| Pers3_Near
|
||||
| Pers3_Distant;
|
||||
VType = VIntrans | VTrans | VTransPost ;
|
||||
VerbForm = VF VTense UPerson Number Gender
|
||||
| Inf
|
||||
| Root
|
||||
| Inf_Obl
|
||||
| Inf_Fem;
|
||||
VTense = Subj | Perf | Imperf;
|
||||
CTense = CPresent | CPast | CFuture ;
|
||||
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) ("sab sE" ++ x) (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E")
|
||||
(acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y")
|
||||
(acch +"E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E")
|
||||
(acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y");
|
||||
|
||||
_ => mkAdjective x x x x x x x x x
|
||||
x x x x x x x x x
|
||||
x x x x x x x x x
|
||||
x x x x x x x x x
|
||||
};
|
||||
|
||||
|
||||
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 -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => table {
|
||||
Dir => table {
|
||||
Posit => y1 ;
|
||||
Compar => y2 ;
|
||||
Superl => y3
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y4 ;
|
||||
Compar => y5 ;
|
||||
Superl => y6
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y7 ;
|
||||
Compar => y8 ;
|
||||
Superl => y9
|
||||
}
|
||||
};
|
||||
Fem => table {
|
||||
Dir => table {
|
||||
Posit => y10 ;
|
||||
Compar => y11 ;
|
||||
Superl => y12
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y13 ;
|
||||
Compar => y14 ;
|
||||
Superl => y15
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y16 ;
|
||||
Compar => y17 ;
|
||||
Superl => y18
|
||||
}
|
||||
}
|
||||
};
|
||||
Pl => table {
|
||||
Masc => table {
|
||||
Dir => table {
|
||||
Posit => y19 ;
|
||||
Compar => y20 ;
|
||||
Superl => y21
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y22 ;
|
||||
Compar => y23 ;
|
||||
Superl => y24
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y25 ;
|
||||
Compar => y26 ;
|
||||
Superl => y27
|
||||
}
|
||||
};
|
||||
Fem => table {
|
||||
Dir => table {
|
||||
Posit => y28 ;
|
||||
Compar => y29 ;
|
||||
Superl => y30
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y31 ;
|
||||
Compar => y32 ;
|
||||
Superl => y33
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y34 ;
|
||||
Compar => y35 ;
|
||||
Superl => y36
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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};
|
||||
_ => {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 ->
|
||||
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
|
||||
};
|
||||
insertSubj : UPerson -> Str -> Str = \p,s ->
|
||||
case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"};
|
||||
|
||||
mkOrd : Str -> Str =
|
||||
\s -> case s of {
|
||||
"ayk" => "phla";
|
||||
"dw" => "dwsra";
|
||||
"tyN" => "tesra";
|
||||
"car" => "cwth'a";
|
||||
"ch'" => "ch'Ta";
|
||||
_ => s ++ "waN"
|
||||
};
|
||||
}
|
||||
|
||||
44
lib/src/hindustani/ConjunctionHindustani.gf
Normal file
44
lib/src/hindustani/ConjunctionHindustani.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
incomplete concrete ConjunctionHindustani of Conjunction =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Coordination, Prelude in {
|
||||
|
||||
--concrete ConjunctionUrd of Conjunction =
|
||||
-- CatUrd ** open ResUrd, Coordination, Prelude in {
|
||||
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
ConjS = conjunctDistrSS ;
|
||||
|
||||
ConjAdv conj advs = conjunctDistrTable Gender conj advs ;
|
||||
|
||||
ConjNP conj ss = conjunctDistrTable NPCase conj ss ** {
|
||||
a = conjAgr (agrP3 Masc conj.n) ss.a
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctDistrTable4 Number Gender Case Degree conj ss ;
|
||||
ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c};
|
||||
|
||||
---- These fun's are generated from the list cat's.
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
BaseAdv x y = twoTable Gender x y ;
|
||||
ConsAdv xs x = consrTable Gender comma xs x ;
|
||||
BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ;
|
||||
BaseRS x y = twoTable Agr x y ** {c = x.c};
|
||||
ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c};
|
||||
BaseAP x y = twoTable4 Number Gender Case Degree x y ; -- ** {isPre = andB x.isPre y.isPre} ;
|
||||
ConsAP xs x = consrTable4 Number Gender Case Degree comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {s1,s2 : Gender => Str} ;
|
||||
[NP] = {s1,s2 : NPCase => Str ; a : Agr} ;
|
||||
[AP] = {s1,s2 : Number => Gender => Case => Degree => Str} ;
|
||||
[RS] = {s1,s2 : Agr => Str ; c : Case};
|
||||
|
||||
}
|
||||
8
lib/src/hindustani/DiffHindustani.gf
Normal file
8
lib/src/hindustani/DiffHindustani.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
interface DiffHindustani = open CommonHindustani, Prelude in {
|
||||
oper
|
||||
|
||||
mkClause : NP -> VPH -> Clause ;
|
||||
mkSClause : Str -> Agr -> VPH -> Clause ;
|
||||
|
||||
np2pronCase : (Case => Str) -> NPCase -> Agr -> Str ;
|
||||
}
|
||||
18
lib/src/hindustani/ExtraHindustani.gf
Normal file
18
lib/src/hindustani/ExtraHindustani.gf
Normal file
@@ -0,0 +1,18 @@
|
||||
--concrete ExtraUrd of ExtraUrdAbs = CatUrd **
|
||||
-- open ResUrd, Coordination, Prelude, MorphoUrd, ParadigmsUrd in {
|
||||
incomplete concrete ExtraHindustani of ExtraHindustaniAbs = CatHindustani **
|
||||
open CommonHindustani,Coordination,ResHindustani, ParamX in {
|
||||
lin
|
||||
GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "ka" ; a = np.a} ;
|
||||
|
||||
each_Det = mkDet "hr kwy" "hr kwy" "hr kwy" "hr kwy" Sg ;
|
||||
have_V = mkV "rakh-na";
|
||||
IAdvAdv adv = {s = "ktny" ++ adv.s} ;
|
||||
ICompAP ap = {s = "ktnE" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ;
|
||||
cost_V = mkV "qymt" ;
|
||||
|
||||
-- added for causitives
|
||||
make_CV = mkVerb "nothing" ** {c2 = "" };
|
||||
|
||||
-- for VP conjunction
|
||||
}
|
||||
9
lib/src/hindustani/ExtraHindustaniAbs.gf
Normal file
9
lib/src/hindustani/ExtraHindustaniAbs.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
abstract ExtraHindustaniAbs = Extra ** {
|
||||
|
||||
-- uncontracted negations; contracted are the default
|
||||
fun
|
||||
|
||||
each_Det : Det ;
|
||||
have_V : V;
|
||||
cost_V : V;
|
||||
}
|
||||
135
lib/src/hindustani/NounHindustani.gf
Normal file
135
lib/src/hindustani/NounHindustani.gf
Normal file
@@ -0,0 +1,135 @@
|
||||
--concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in {
|
||||
incomplete concrete NounHindustani of Noun =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
DetCN det cn = {
|
||||
s = \\c => detcn2NP det cn c det.n ;
|
||||
a = agrP3 cn.g det.n
|
||||
} ;
|
||||
|
||||
UsePN pn = {s = \\c => toNP pn.s c ; a = agrP3 pn.g Sg} ;
|
||||
UsePron p = {s = \\c => np2pronCase p.s c p.a ; a = p.a} ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
PPartNP np v2 = {
|
||||
s = \\c => v2.s ! VF Imperf Pers1 Sg Fem ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
RelNP np rs = {
|
||||
s = \\c => np.s ! c ++ comma ++ rs.s ! np.a ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
AdvNP np adv = {
|
||||
-- s = \\c => np.s ! c ++ adv.s ! (fromAgr np.a).g ; -- jan ka bh'ay so order is changed
|
||||
s = \\c => adv.s ! (fromAgr np.a).g ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
-- s = \\ c => detquant2det quant.s num.s c ++ ord.s ;
|
||||
s = \\n,g => quant.s!n!g!Dir ++ num.s ++ ord.s ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
DetQuant quant num = {
|
||||
-- s = \\c => detquant2det quant.s num.s c;
|
||||
s = \\n,g => quant.s!n!g!Dir ++ num.s;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
DetNP det = {
|
||||
s = \\c => det2NP det c ; ---- case
|
||||
a = agrP3 Masc Sg
|
||||
} ;
|
||||
|
||||
PossPron p = {s = \\_,_,_ => p.ps ; a = p.a} ;
|
||||
|
||||
NumSg = {s = []; n = Sg} ;
|
||||
NumPl = {s = []; n = Pl} ;
|
||||
|
||||
NumCard n = n ** {hasCard = True} ;
|
||||
|
||||
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
|
||||
OrdDigits n = {s = n.s ! NOrd; n = n.n} ;
|
||||
|
||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd ; n = numeral.n} ;
|
||||
|
||||
AdNum adn num = {s = case adn.p of {False => adn.s ++ num.s ; True => num.s ++ adn.s}; n = num.n} ;
|
||||
|
||||
OrdSuperl a = {s = a.s ! Sg ! Masc ! Dir ! Superl ; n = Sg} ;
|
||||
|
||||
|
||||
|
||||
DetArtSg art cn = {
|
||||
s = \\c => art.s ++ toNP (cn.s ! Sg) c ;
|
||||
a = agrP3 cn.g Sg
|
||||
} ;
|
||||
|
||||
DetArtPl art cn = {
|
||||
s = \\c => art.s ++ toNP (cn.s ! Pl) c ;
|
||||
a = agrP3 cn.g Pl
|
||||
} ;
|
||||
|
||||
DefArt = {s = \\_,_,_ => [] ; a = defaultAgr} ;
|
||||
IndefArt = {s = \\_,_,_ => [] ; a =defaultAgr } ;
|
||||
|
||||
MassNP cn = {s = \\c => toNP (cn.s ! Sg) c ; a = agrP3 cn.g Sg} ;
|
||||
|
||||
UseN n = n ;
|
||||
UseN2 n = { s = n.s ; g = n.g };
|
||||
|
||||
Use2N3 f = {
|
||||
s = f.s;
|
||||
g = f.g ;
|
||||
c2 = f.c2;
|
||||
c3 = f.c3
|
||||
} ;
|
||||
|
||||
Use3N3 f = {
|
||||
s = f.s ;
|
||||
g = f.g ;
|
||||
c2 = f.c2;
|
||||
c3 = f.c3
|
||||
} ;
|
||||
|
||||
ComplN2 f x = {s = \\n,c => case c of {
|
||||
Dir => x.s ! NPC c ++ f.c2 ++ f.s ! n ! c ;
|
||||
Obl => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c ;
|
||||
CommonHindustani.Voc => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c
|
||||
};
|
||||
g = f.g;
|
||||
};
|
||||
ComplN3 f x = {
|
||||
s = \\n,c => x.s ! NPObj ++ f.c4 ++ f.s ! n ! Dir ;
|
||||
g = f.g ;
|
||||
c2 = f.c2;
|
||||
c3 = f.c3
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\n,c => ap.s ! n ! cn.g ! c ! Posit ++ cn.s ! n ! c ;
|
||||
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} ; -- 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} ;
|
||||
|
||||
ApposCN cn np = {s = \\n,c => cn.s ! n ! Dir ++ np.s ! NPC c ; g = cn.g} ;
|
||||
|
||||
}
|
||||
29
lib/src/hindustani/PhraseHindustani.gf
Normal file
29
lib/src/hindustani/PhraseHindustani.gf
Normal file
@@ -0,0 +1,29 @@
|
||||
--concrete PhraseUrd of Phrase = CatUrd ** open Prelude, ResUrd in {
|
||||
incomplete concrete PhraseHindustani of Phrase =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = s ;
|
||||
UttQS qs = {s = qs.s ! QDir} ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ;
|
||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ;
|
||||
|
||||
UttIP ip = {s = ip.s ! Dir} ; --- Acc also
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = np.s ! NPC Dir} ;
|
||||
UttVP vp = {s = infVP False vp (agrP3 Masc Sg)} ;
|
||||
UttAdv adv = {s = adv.s ! Masc} ;
|
||||
UttCN cn = {s = cn.s ! Sg ! Dir};
|
||||
UttCard n = n ;
|
||||
UttAP ap = {s = ap.s ! Sg ! Masc ! Dir ! Posit} ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = {s = conj.s2} ; ---
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = np.s ! NPC Dir} ;
|
||||
|
||||
}
|
||||
78
lib/src/hindustani/QuestionHindustani.gf
Normal file
78
lib/src/hindustani/QuestionHindustani.gf
Normal file
@@ -0,0 +1,78 @@
|
||||
--concrete QuestionUrd of Question = CatUrd ** open ResUrd, StringsHindustani, Prelude in {
|
||||
incomplete concrete QuestionHindustani of Question =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
coding = utf8;
|
||||
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = \\t,p,qf => case qf of {
|
||||
QDir => cl.s ! t ! p ! OQuest;
|
||||
QIndir => agr ++ cl.s ! t! p ! ODir
|
||||
}
|
||||
};
|
||||
|
||||
QuestVP qp vp =
|
||||
let cl = mkSClause [] (Ag qp.g qp.n Pers3_Near) vp;
|
||||
qp1 = qp.s ! Dir;
|
||||
qp2 = qp.s ! Obl ++ nE
|
||||
in { s = \\t,p,o => case t of {
|
||||
VPImpPast => qp2 ++ cl.s ! t ! p ! ODir;
|
||||
_ => qp1 ++ cl.s ! t ! p ! ODir
|
||||
}
|
||||
};
|
||||
QuestSlash ip slash =
|
||||
let ip1 = ip.s ! Dir;
|
||||
ip2 = ip.s ! Obl ++ nE
|
||||
in {
|
||||
s = \\t,p,o => case t of {
|
||||
VPImpPast => ip2 ++ slash.s ! t ! p ! ODir;
|
||||
_ => ip1 ++ slash.s ! t ! p ! ODir
|
||||
}
|
||||
};
|
||||
|
||||
QuestIAdv iadv cl = {
|
||||
s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! ODir;
|
||||
};
|
||||
|
||||
QuestIComp icomp np =
|
||||
let cl = mkSClause (np.s ! NPC Dir ++ icomp.s) np.a (predAux auxBe);
|
||||
in {
|
||||
s = \\t,p,qf => case qf of {
|
||||
QDir => cl.s ! t ! p ! ODir;
|
||||
QIndir => cl.s ! t! p ! ODir
|
||||
}
|
||||
};
|
||||
|
||||
PrepIP p ip = {s = ip.s ! Voc ++ p.s ! ip.g} ;
|
||||
|
||||
AdvIP ip adv = {
|
||||
s = \\c => adv.s ! ip.g ++ ip.s ! c ;
|
||||
n = ip.n;
|
||||
g = ip.g;
|
||||
} ;
|
||||
|
||||
IdetCN idet cn = {
|
||||
s = \\c => idet.s ! cn.g ++ cn.s ! idet.n ! c ;
|
||||
g = cn.g;
|
||||
n = idet.n;
|
||||
} ;
|
||||
|
||||
IdetIP idet = {
|
||||
s = \\_ => idet.s ! Masc ;
|
||||
n = idet.n;
|
||||
g = Masc;
|
||||
} ;
|
||||
|
||||
IdetQuant iqant num = {
|
||||
s = \\g => iqant.s ! num.n ++ num.s ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
CompIAdv a = a ;
|
||||
CompIP p = ss (p.s ! CommonHindustani.Dir) ;
|
||||
AdvIAdv i a = {s = i.s ++ a.s ! Masc} ;
|
||||
|
||||
}
|
||||
67
lib/src/hindustani/RelativeHindustani.gf
Normal file
67
lib/src/hindustani/RelativeHindustani.gf
Normal file
@@ -0,0 +1,67 @@
|
||||
--concrete RelativeUrd of Relative = CatUrd ** open ResUrd, StringsHindustani in {
|
||||
incomplete concrete RelativeHindustani of Relative =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
coding = utf8;
|
||||
|
||||
lin
|
||||
|
||||
RelCl cl = {
|
||||
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
|
||||
};
|
||||
c = Dir
|
||||
} ;
|
||||
|
||||
{- RelVP rp vp = {
|
||||
s = \\t,p,o,ag =>
|
||||
let
|
||||
agr = case rp.a of {
|
||||
RNoAg => ag ;
|
||||
RAg a => a
|
||||
} ;
|
||||
cl = mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp;
|
||||
|
||||
-- cl = case t of {
|
||||
-- VPImpPast => mkSClause (rp.s ! (giveNumber agr) ! Obl) agr vp;
|
||||
-- _ => mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp
|
||||
-- };
|
||||
in
|
||||
cl.s ! t ! p ! ODir ;
|
||||
c = Dir
|
||||
} ;
|
||||
|
||||
RelSlash rp slash = {
|
||||
s = \\t,p,o,agr => rp.s ! (giveNumber agr) ! Dir ++ slash.c2.s ++ slash.s ! t ! p ! o ;--case t of {
|
||||
-- VPImpPast => rp.s ! (giveNumber agr) Obl ++ slash.c2.s ++ slash.s ! t ! p ! o ;
|
||||
-- _ => rp.s ! (giveNumber agr) Dir ++ slash.c2.s ++ slash.s ! t ! p ! o
|
||||
-- };
|
||||
c = Dir
|
||||
} ;
|
||||
-}
|
||||
FunRP p np rp = {
|
||||
s = \\n,c => rp.s ! n ! c ++ np.s ! NPC c ++ p.s ! Masc ;
|
||||
a = RAg np.a
|
||||
} ;
|
||||
|
||||
IdRP = {
|
||||
s = table {
|
||||
Sg => table {
|
||||
|
||||
CommonHindustani.Dir => jw ;
|
||||
CommonHindustani.Obl => js ;
|
||||
CommonHindustani.Voc => js
|
||||
};
|
||||
Pl => table {
|
||||
CommonHindustani.Dir => jw ;
|
||||
CommonHindustani.Obl => jn ;
|
||||
CommonHindustani.Voc => jn
|
||||
}
|
||||
};
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
}
|
||||
400
lib/src/hindustani/ResHindustani.gf
Normal file
400
lib/src/hindustani/ResHindustani.gf
Normal file
@@ -0,0 +1,400 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
--
|
||||
--1 Hindustaniu auxiliary operations.
|
||||
--
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work.
|
||||
|
||||
--resource ResHindustani = ParamX ** open Prelude,Predef in {
|
||||
interface ResHindustani = DiffHindustani ** open CommonHindustani, Prelude, Predef in {
|
||||
|
||||
|
||||
flags optimize=all ;
|
||||
coding = utf8;
|
||||
|
||||
param
|
||||
|
||||
|
||||
-- Order = ODir | OQuest ;
|
||||
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg Agr ;
|
||||
RCase = RC Number Case ;
|
||||
|
||||
-- for Numerial
|
||||
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
-----------------------------------------
|
||||
-- Hindustani Pronouns
|
||||
-----------------------------------------
|
||||
|
||||
Pronoun = P Number Gender Case UPerson;
|
||||
PersPronForm = PPF Number UPerson Case;
|
||||
|
||||
-------------------------------------------
|
||||
--Verbs
|
||||
-------------------------------------------
|
||||
|
||||
|
||||
oper
|
||||
Noun = {s : Number => Case => Str ; g : Gender} ;
|
||||
|
||||
Preposition = {s : Gender => Str};
|
||||
DemPronForm = {s : Number => Gender => Case => Str};
|
||||
PossPronForm = {s : Number => Gender => Case => Str};
|
||||
Determiner = {s : Number => Gender => Str ; n : Number};
|
||||
|
||||
-- a useful oper
|
||||
eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ;
|
||||
|
||||
RefPron : Str;
|
||||
RefPron = "Kwd";
|
||||
|
||||
----------------------------------------------------------
|
||||
-- Grammar part
|
||||
----------------------------------------------------------
|
||||
|
||||
|
||||
toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of {
|
||||
NPC c => pn ! c ;
|
||||
NPObj => pn ! Dir ;
|
||||
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 ;
|
||||
NPObj => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ;
|
||||
NPErg => dt.s ! Sg ! Masc ++ cn.s ! nn ! Obl ++ "nE"
|
||||
} ;
|
||||
det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of {
|
||||
NPC c => dt.s ! Sg ! Masc ;
|
||||
NPObj => dt.s ! Sg ! Masc ;
|
||||
NPErg => dt.s ! Sg ! Masc ++ "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 ;
|
||||
|
||||
param
|
||||
CPolarity =
|
||||
CPos
|
||||
| CNeg Bool ; -- contracted or not
|
||||
|
||||
oper
|
||||
contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of {
|
||||
Pos => CPos ;
|
||||
Neg => CNeg b
|
||||
} ;
|
||||
|
||||
-- NP : Type = {s : NPCase => Str ; a : Agr} ;
|
||||
|
||||
oper
|
||||
|
||||
objVType : VType -> NPCase = \vt -> case vt of {
|
||||
VTrans => NPObj ;
|
||||
_ => NPC Obl
|
||||
} ;
|
||||
|
||||
VPHSlash = VPH ** {c2 : Compl} ;
|
||||
|
||||
Compl : Type = {s : Str ; c : VType} ;
|
||||
|
||||
|
||||
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 -> {
|
||||
s = \\vh =>
|
||||
let
|
||||
|
||||
inf = verb.inf ;
|
||||
part = verb.ppart ;
|
||||
|
||||
in
|
||||
case vh of {
|
||||
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = part } ;
|
||||
VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = part } ;
|
||||
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = part ++ hw p n } ;
|
||||
VPStem => {fin = [] ; inf = "rh" };
|
||||
_ => {fin = part ; inf = [] }
|
||||
};
|
||||
obj = {s = [] ; a = defaultAgr} ;
|
||||
subj = VIntrans ;
|
||||
inf = verb.inf;
|
||||
ad = [];
|
||||
embComp = [];
|
||||
prog = False ;
|
||||
comp = \\_ => []
|
||||
} ;
|
||||
|
||||
Aux = {
|
||||
inf,ppart,prpart : Str
|
||||
} ;
|
||||
|
||||
auxBe : Aux = {
|
||||
inf = "" ;
|
||||
ppart = "" ;
|
||||
prpart = ""
|
||||
} ;
|
||||
|
||||
predProg : VPH -> VPH = \verb -> {
|
||||
s = \\vh =>
|
||||
case vh of {
|
||||
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = (verb.s!VPStem).inf ++ raha g n} ;
|
||||
VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = (verb.s!VPStem).inf ++ raha g n} ;
|
||||
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = (verb.s!VPStem).inf ++ raha g n } ;
|
||||
VPTense VPPerf (Ag g n p) => {fin = copula CPast n p g ; inf = (verb.s!VPTense VPPres (Ag g n p)).inf ++ raha g n } ;
|
||||
VPStem => {fin = [] ; inf = (verb.s!VPStem).inf };
|
||||
_ => {fin = [] ; inf = [] }
|
||||
};
|
||||
obj = verb.obj ;
|
||||
subj = VIntrans ;
|
||||
inf = verb.inf;
|
||||
ad = verb.ad;
|
||||
embComp = verb.embComp;
|
||||
prog = True ;
|
||||
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 ;
|
||||
obj = vp.obj ;
|
||||
subj = vp.subj ;
|
||||
inf = vp.inf;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp;
|
||||
prog = vp.prog ;
|
||||
comp = \\a => vp.comp ! a ++ obj1 ! a
|
||||
} ;
|
||||
insertVV : Str -> VPH -> Str -> VPH = \obj1,vp,emb -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
subj = vp.subj ;
|
||||
inf = vp.inf;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp ++ emb ;
|
||||
prog = vp.prog ;
|
||||
comp = \\a => vp.comp ! a ++ obj1
|
||||
} ;
|
||||
|
||||
insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> {
|
||||
s = vp.s;
|
||||
obj = vp.obj ;
|
||||
subj = vp.subj ;
|
||||
inf = vp.inf;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp ++ obj1;
|
||||
prog = vp.prog ;
|
||||
comp = vp.comp
|
||||
|
||||
} ;
|
||||
|
||||
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 };
|
||||
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 } ;
|
||||
infV2V : Bool -> VPH -> Str = \isAux,vp ->
|
||||
case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ++ "ky" ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ "ky"};
|
||||
|
||||
|
||||
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||
s = vps.s ;
|
||||
obj = {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ;
|
||||
subj = vps.c2.c ;
|
||||
inf = vps.inf;
|
||||
ad = vps.ad;
|
||||
embComp = vps.embComp;
|
||||
prog = vps.prog ;
|
||||
comp = vps.comp
|
||||
} ;
|
||||
|
||||
insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
inf = vp.inf ;
|
||||
subj = vp.subj ;
|
||||
ad = vp.ad ;
|
||||
embComp = vp.embComp;
|
||||
prog = vp.prog ;
|
||||
comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a
|
||||
} ;
|
||||
|
||||
insertAdV : Str -> VPH -> VPH = \ad,vp -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
inf = vp.inf ;
|
||||
subj = vp.subj;
|
||||
ad = vp.ad ++ ad ;
|
||||
embComp = vp.embComp;
|
||||
prog = vp.prog ;
|
||||
comp = vp.comp
|
||||
} ;
|
||||
|
||||
conjThat : Str = "kh" ;
|
||||
|
||||
insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
inf = vp.inf ;
|
||||
subj = vp.subj;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp ++ emb;
|
||||
prog = vp.prog ;
|
||||
comp = vp.comp
|
||||
} ;
|
||||
insertTrans : VPH -> VType -> VPH = \vp,vtype -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
inf = vp.inf ;
|
||||
subj = vtype;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp ;
|
||||
prog = vp.prog ;
|
||||
comp = vp.comp
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
105
lib/src/hindustani/SentenceHindustani.gf
Normal file
105
lib/src/hindustani/SentenceHindustani.gf
Normal file
@@ -0,0 +1,105 @@
|
||||
--concrete SentenceUrd of Sentence = CatUrd ** open Prelude, StringsHindustani, ResUrd in {
|
||||
incomplete concrete SentenceHindustani of Sentence =
|
||||
CatHindustani ** open CommonHindustani, ResHindustani, Prelude, StringsHindustani in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
coding = utf8;
|
||||
|
||||
lin
|
||||
|
||||
PredVP np vp = mkClause np vp ;
|
||||
|
||||
PredSCVP sc vp = mkSClause sc.s (defaultAgr) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\pol,n =>
|
||||
let
|
||||
agr = Ag Masc (numImp n) Pers2_Casual ;
|
||||
verb = infVP True vp agr ;
|
||||
dont = case pol of {
|
||||
CNeg True => mt ;
|
||||
CNeg False => nh ;
|
||||
_ => []
|
||||
}
|
||||
in
|
||||
dont ++ verb
|
||||
} ;
|
||||
|
||||
SlashVP np vp =
|
||||
mkClause np vp ** {c2 = vp.c2} ;
|
||||
|
||||
AdvSlash slash adv = {
|
||||
s = \\t,p,o => adv.s ! Masc ++ slash.s ! t ! p ! o ;
|
||||
c2 = slash.c2
|
||||
} ;
|
||||
|
||||
SlashPrep cl prep = cl ** {c2 = { s = prep.s ! Masc ; c = VIntrans}} ;
|
||||
|
||||
SlashVS np vs slash =
|
||||
mkClause np
|
||||
(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
|
||||
|
||||
UseCl temp p cl =
|
||||
{ s = case <temp.t,temp.a> of {
|
||||
<Pres,Simul> => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! ODir;
|
||||
<Pres,Anter> => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! ODir;
|
||||
<Past,Simul> => temp.s ++ p.s ++ cl.s ! VPImpPast ! p.p ! ODir;
|
||||
<Past,Anter> => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! ODir;
|
||||
<Fut,Simul> => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! ODir;
|
||||
<Fut,Anter> => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! ODir;
|
||||
<Cond,Simul> => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! ODir;
|
||||
<Cond,Anter> => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! ODir -- this needs to be fixed by making SubjPerf in ResUrd
|
||||
|
||||
};
|
||||
} ;
|
||||
UseQCl temp p cl = {
|
||||
s = \\q => case <temp.t,temp.a> of {
|
||||
<Pres,Simul> => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! q;
|
||||
<Pres,Anter> => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! q;
|
||||
<Past,Simul> => temp.s ++ p.s ++ cl.s ! VPImpPast ! p.p ! q;
|
||||
<Past,Anter> => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! q;
|
||||
<Fut,Simul> => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! q;
|
||||
<Fut,Anter> => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! q;
|
||||
<Cond,Simul> => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! q;
|
||||
<Cond,Anter> => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! q
|
||||
|
||||
};
|
||||
} ;
|
||||
UseRCl temp p rcl = {
|
||||
s = \\q => case <temp.t,temp.a> of {
|
||||
<Pres,Simul> => temp.s ++ p.s ++ rcl.s ! VPGenPres ! p.p ! ODir ! q;
|
||||
<Pres,Anter> => temp.s ++ p.s ++ rcl.s ! VPPerfPres ! p.p ! ODir ! q;
|
||||
<Past,Simul> => temp.s ++ p.s ++ rcl.s ! VPImpPast ! p.p ! ODir ! q;
|
||||
<Past,Anter> => temp.s ++ p.s ++ rcl.s ! VPPerfPast ! p.p ! ODir ! q;
|
||||
<Fut,Simul> => temp.s ++ p.s ++ rcl.s ! VPFut ! p.p ! ODir ! q;
|
||||
<Fut,Anter> => temp.s ++ p.s ++ rcl.s ! VPPerfFut ! p.p ! ODir ! q;
|
||||
<Cond,Simul> => temp.s ++ p.s ++ rcl.s ! VPSubj ! p.p ! ODir ! q;
|
||||
<Cond,Anter> => temp.s ++ p.s ++ rcl.s ! VPSubj ! p.p ! ODir ! q
|
||||
};
|
||||
c = rcl.c
|
||||
} ;
|
||||
UseSlash temp p clslash = {
|
||||
s = case <temp.t,temp.a> of {
|
||||
<Pres,Simul> => temp.s ++ p.s ++ clslash.s ! VPGenPres ! p.p ! ODir;
|
||||
<Pres,Anter> => temp.s ++ p.s ++ clslash.s ! VPPerfPres ! p.p ! ODir;
|
||||
<Past,Simul> => temp.s ++ p.s ++ clslash.s ! VPImpPast ! p.p ! ODir ;
|
||||
<Past,Anter> => temp.s ++ p.s ++ clslash.s ! VPPerfPast ! p.p ! ODir;
|
||||
<Fut,Simul> => temp.s ++ p.s ++ clslash.s ! VPFut ! p.p ! ODir;
|
||||
<Fut,Anter> => temp.s ++ p.s ++ clslash.s ! VPPerfFut ! p.p ! ODir;
|
||||
<Cond,Simul> => temp.s ++ p.s ++ clslash.s ! VPSubj ! p.p ! ODir;
|
||||
<Cond,Anter> => temp.s ++ p.s ++ clslash.s ! VPSubj ! p.p ! ODir
|
||||
};
|
||||
c2 = clslash.c2
|
||||
} ;
|
||||
|
||||
AdvS 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};
|
||||
|
||||
}
|
||||
20
lib/src/hindustani/StringsHindustani.gf
Normal file
20
lib/src/hindustani/StringsHindustani.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
resource StringsHindustani = {
|
||||
|
||||
flags coding = utf8 ;
|
||||
|
||||
oper
|
||||
agr = "agr" ;
|
||||
awr = "awr" ;
|
||||
jn = "jn" ;
|
||||
js = "js" ;
|
||||
jw = "jw" ;
|
||||
kw = "kw" ;
|
||||
mt = "mt" ;
|
||||
nE = "nE" ;
|
||||
nh = "nh" ;
|
||||
sE = "sE" ;
|
||||
waN = "waN" ;
|
||||
|
||||
comma = "," ;
|
||||
|
||||
}
|
||||
47
lib/src/hindustani/SymbolHindustani.gf
Normal file
47
lib/src/hindustani/SymbolHindustani.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
--concrete SymbolUrd of Symbol = CatUrd ** open Prelude, ResUrd, StringsHindustani in {
|
||||
incomplete concrete SymbolHindustani of Symbol =
|
||||
CatHindustani ** open Prelude, ResHindustani, CommonHindustani in {
|
||||
|
||||
lin
|
||||
-- SymbPN i = {s = \\_ => i.s ; g = Masc} ;
|
||||
SymbPN i = {s = addGenitiveS i.s ; g = Masc} ;
|
||||
IntPN i = {s = addGenitiveS i.s ; g = Masc} ;
|
||||
FloatPN i = {s = addGenitiveS i.s ; g = Masc} ;
|
||||
NumPN i = {s = \\_ =>i.s ; g = Masc} ;
|
||||
CNIntNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Dir ++ i.s ;
|
||||
a = agrP3 cn.g Sg
|
||||
} ;
|
||||
CNSymbNP det cn xs = {
|
||||
s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Dir ++ xs.s ;
|
||||
a = agrP3 cn.g det.n
|
||||
} ;
|
||||
CNNumNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Dir ++ i.s ;
|
||||
a = agrP3 cn.g Sg
|
||||
} ;
|
||||
|
||||
SymbS sy = sy ;
|
||||
SymbNum sy = { s = sy.s ; n = Pl } ;
|
||||
SymbOrd sy = { s = sy.s ++ waN ; n = Pl} ;
|
||||
|
||||
lincat
|
||||
|
||||
Symb, [Symb] = SS ;
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS awr ;
|
||||
ConsSymb = infixSS [] ;
|
||||
|
||||
oper
|
||||
-- Note: this results in a space before 's, but there's
|
||||
-- not mauch we can do about that.
|
||||
addGenitiveS : Str -> Case => Str = \s ->
|
||||
-- table {_ => s ++ "ka" } ;
|
||||
table {_ => s } ; -- testing for webalt but i think should bring back to its origional form as 'ka' is needed for making genitive, in webalt it gives unnecessary 'ka'
|
||||
|
||||
}
|
||||
41
lib/src/hindustani/VerbHindustani.gf
Normal file
41
lib/src/hindustani/VerbHindustani.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
--concrete VerbUrd of Verb = CatUrd ** open ResUrd in {
|
||||
incomplete concrete VerbHindustani of Verb = CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV v = predV v ;
|
||||
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}}) ;
|
||||
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 ;
|
||||
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}}) ; ----
|
||||
ComplSlash vp np = insertObject np vp ;
|
||||
SlashVV vv vp =
|
||||
insertEmbCompl (insertObj (\\a => infVP vv.isAux vp a) (predV vv)) vp.embComp **
|
||||
{c2 = vp.c2} ;
|
||||
SlashV2VNP vv np vp =
|
||||
insertObjPre (\\_ => np.s ! NPObj )
|
||||
(insertObjc (\\a => infVP vv.isAux vp a) (predVc vv)) **
|
||||
{c2 = vp.c2} ;
|
||||
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
||||
|
||||
AdvVP vp adv = insertObj (\\a => adv.s ! giveGender a) vp ;
|
||||
|
||||
AdVVP adv vp = insertAdV adv.s vp ;
|
||||
ReflVP v = insertObjPre (\\_ => RefPron) v ;
|
||||
PassV2 v = predV v ; -- need to be fixed
|
||||
CompAP ap ={s = \\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit } ;
|
||||
CompNP np = {s = \\_ => np.s ! NPObj} ;
|
||||
CompAdv adv = {s = \\a => adv.s ! giveGender a} ;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user