mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-08 18:52:50 -06:00
hindi-resource-grammar
This commit is contained in:
@@ -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,_ > => "ہوں" ;
|
||||
<CPresent,Sg,Pers2_Casual,_ > => "ہے" ;
|
||||
<CPresent,Sg,Pers2_Familiar,_ > => "ہو" ;
|
||||
<CPresent,Sg,Pers2_Respect,_ > => "ہیں" ;
|
||||
<CPresent,Sg,Pers3_Near,_ > => "ہے" ;
|
||||
<CPresent,Sg,Pers3_Distant,_ > => "ہے" ;
|
||||
<CPresent,Pl,Pers1,_ > => "ہیں" ;
|
||||
<CPresent,Pl,Pers2_Casual,_ > => "ہو" ;
|
||||
<CPresent,Pl,Pers2_Familiar,_ > => "ہو" ;
|
||||
<CPresent,Pl,Pers2_Respect,_ > => "ہیں" ;
|
||||
<CPresent,Pl,Pers3_Near,_ > => "ہیں" ;
|
||||
<CPresent,Pl,Pers3_Distant,_ > => "ہیں" ;
|
||||
<CPast,Sg,Pers1,Masc > => "تھا" ;
|
||||
<CPast,Sg,Pers1,Fem > => "تھی" ;
|
||||
<CPast,Sg,Pers2_Casual,Masc > => "تھا" ;
|
||||
<CPast,Sg,Pers2_Casual,Fem > => "تھی" ;
|
||||
<CPast,Sg,Pers2_Familiar,Masc > => "تh-ا" ;
|
||||
<CPast,Sg,Pers2_Familiar,Fem > => "تھی" ;
|
||||
<CPast,Sg,Pers2_Respect,Masc > => "تھے" ;
|
||||
<CPast,Sg,Pers2_Respect,Fem > => "تھیں" ;
|
||||
<CPast,Sg,Pers3_Near,Masc > => "تh-ا" ;
|
||||
<CPast,Sg,Pers3_Near,Fem > => "تھی" ;
|
||||
<CPast,Sg,Pers3_Distant,Masc > => "تh-ا" ;
|
||||
<CPast,Sg,Pers3_Distant,Fem > => "تھی" ;
|
||||
<CPast,Pl,Pers1,Masc > => "تھے" ;
|
||||
<CPast,Pl,Pers1,Fem > => "تھیں" ;
|
||||
<CPast,Pl,Pers2_Casual,Masc > => "تھے" ;
|
||||
<CPast,Pl,Pers2_Casual,Fem > => "تھیں" ;
|
||||
<CPast,Pl,Pers2_Familiar,Masc > => "تھے" ;
|
||||
<CPast,Pl,Pers2_Familiar,Fem > => "تھیں" ;
|
||||
<CPast,Pl,Pers2_Respect,Masc > => "تھے" ;
|
||||
<CPast,Pl,Pers2_Respect,Fem > => "تھیں" ;
|
||||
<CPast,Pl,Pers3_Near,Masc > => "تھے" ;
|
||||
<CPast,Pl,Pers3_Near,Fem > => "تھیں" ;
|
||||
<CPast,Pl,Pers3_Distant,Masc > => "تھے" ;
|
||||
<CPast,Pl,Pers3_Distant,Fem > => "تھیں" ;
|
||||
<CFuture,Sg,Pers1,Masc > => "گا" ;
|
||||
<CFuture,Sg,Pers1,Fem > => "گی" ;
|
||||
<CFuture,Sg,Pers2_Casual,Masc > => "گا" ;
|
||||
<CFuture,Sg,Pers2_Casual,Fem > => "گی" ;
|
||||
<CFuture,Sg,Pers2_Familiar,Masc > => "گے" ;
|
||||
<CFuture,Sg,Pers2_Familiar,Fem > => "گی" ;
|
||||
<CFuture,Sg,Pers2_Respect,Masc > => "گے" ;
|
||||
<CFuture,Sg,Pers2_Respect,Fem > => "گی" ;
|
||||
<CFuture,Sg,Pers3_Near,Masc > => "گا" ;
|
||||
<CFuture,Sg,Pers3_Near,Fem > => "گی" ;
|
||||
<CFuture,Sg,Pers3_Distant,Masc > => "گا" ;
|
||||
<CFuture,Sg,Pers3_Distant,Fem > => "گی" ;
|
||||
<CFuture,Pl,Pers1,Masc > => "گے" ;
|
||||
<CFuture,Pl,Pers1,Fem > => "گی" ;
|
||||
<CFuture,Pl,Pers2_Casual,Masc > => "گے" ;
|
||||
<CFuture,Pl,Pers2_Casual,Fem > => "گی" ;
|
||||
<CFuture,Pl,Pers2_Familiar,Masc > => "گے" ;
|
||||
<CFuture,Pl,Pers2_Familiar,Fem > => "گی" ;
|
||||
<CFuture,Pl,Pers2_Respect,Masc > => "گے" ;
|
||||
<CFuture,Pl,Pers2_Respect,Fem > => "گی" ;
|
||||
<CFuture,Pl,Pers3_Near,Masc > => "گے" ;
|
||||
<CFuture,Pl,Pers3_Near,Fem > => "گے" ;
|
||||
<CFuture,Pl,Pers3_Distant,Masc > => "گے" ;
|
||||
<CFuture,Pl,Pers3_Distant,Fem > => "گی"
|
||||
|
||||
|
||||
} ;
|
||||
raha : Gender -> Number -> Str = \g,n ->
|
||||
(regAdjective "رہا").s ! n ! g ! Dir ! Posit ;
|
||||
|
||||
cka : Gender -> Number -> Str = \g,n ->
|
||||
(regAdjective "چكا").s ! n ! g ! Dir ! Posit ;
|
||||
|
||||
hw : UPerson -> Number -> Str = \pp,n ->
|
||||
case <pp,n> of {
|
||||
<Pers1,_> => "ہوں";
|
||||
<_,Pl> => "ہوں";
|
||||
<_,_> => "ہو"
|
||||
};
|
||||
|
||||
-----------------------------------------------
|
||||
-- Hindustani Adjectives
|
||||
-----------------------------------------------
|
||||
|
||||
Adjective = { s: Number => Gender => Case => Degree => Str };
|
||||
regAdjective : Str -> Adjective;
|
||||
regAdjective x = case x of {
|
||||
acch + ("ا"|"اں") => mkAdjective x ("بہت" ++ x) ("سب سے" ++ x) (acch + "ے") ("بہت" ++ acch + "ے") ("سب سے" ++ acch + "ے") (acch + "ے") ("بہت" ++ acch + "ے") ("سب سے" ++ acch + "ے")
|
||||
(acch + "ی") ("بہت" ++ acch + "ی") ("سب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("سب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("سب سے" ++ acch + "ی")
|
||||
(acch +"ے") ("بہت" ++ acch + "ے") ("سب سے" ++ acch + "ے") (acch + "ے") ("بہت" ++ acch + "ے") ("سب سے" ++ acch + "ے") (acch + "ے") ("بہت" ++ acch + "ے") ("سب سے" ++ acch + "ے")
|
||||
(acch + "ی") ("بہت" ++ acch + "ی") ("سب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("سب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("سب سے" ++ acch + "ی");
|
||||
|
||||
_ => 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)
|
||||
|
||||
};
|
||||
|
||||
|
||||
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 ++ "وں" ; _ => s ++ "ے"};
|
||||
|
||||
-- insertSubj : UPerson -> Str -> Str = \p,s ->
|
||||
-- case p of { Pers1 => s ++ "وں" ; _ => s ++ "ے"};
|
||||
|
||||
mkOrd : Str -> Str =
|
||||
\s -> case s of {
|
||||
@@ -311,6 +191,7 @@ resource CommonHindustani = ParamX ** open Prelude,Predef in {
|
||||
"چار" => "چوتھا";
|
||||
"چھ" => "چھٹا";
|
||||
_ => s ++ "واں"
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user