refinementsUrdPhrbook-2011-05-12

This commit is contained in:
virk.shafqat
2011-05-12 16:24:00 +00:00
parent 9a31b52556
commit 17d5a3ffbb
17 changed files with 112 additions and 74 deletions

View File

@@ -1,29 +1,29 @@
concrete GreetingsUrd of Greetings = SentencesUrd [mkGreeting] ** open Prelude in {
concrete GreetingsUrd of Greetings = SentencesUrd [mkGreeting] ** open (P=Prelude) in {
-- lincat
-- Greeting = {s : Str; lock_Text : {}} ;
flags coding = utf8 ;
lin
GBye = ss "خدا حافظ" ;
GCheers = ss "چیرز" ;
GDamn = ss "اف" ;
GExcuse, GExcusePol = ss "معاف كیجیے گا" ;
GGoodDay = ss "دن بخیر" ; ----
GGoodEvening = ss "شام بخیر" ;
GGoodMorning = ss "صبح بخیر" ;
GGoodNight = ss "رات بخیر" ;
GGoodbye = ss "خدا حافظ" ;
GHello = ss "اسلام علیكم" ;
GHelp = ss "مدد" ;
GHowAreYou = ss "آپ كیسی ہو" ;
GLookOut = ss "دیكھ كر" ;
GNiceToMeetYou, GNiceToMeetYouPol = ss "آپ سے مل كر اچھا لگا" ;
GPleaseGive, GPleaseGivePol = ss "مہربانی كر كے" ;
GSeeYouSoon = ss "ملتے ہیں" ;
GSorry, GSorryPol = ss "معاف كیجیے گا" ;
GThanks = ss "شكریہ" ;
GTheCheck = ss "بل" ;
GCongratulations = ss "مبارك ہو";
GHappyBirthday = ss "سالگرہ مبارك" ;
GGoodLuck = ss "گڈ لك" ;
GBye = P.ss "خدا حافظ" ;
GCheers = P.ss "چیرز" ;
GDamn = P.ss "اف" ;
GExcuse, GExcusePol = P.ss "معاف كیجیے گا" ;
GGoodDay = P.ss "دن بخیر" ; ----
GGoodEvening = P.ss "شام بخیر" ;
GGoodMorning = P.ss "صبح بخیر" ;
GGoodNight = P.ss "رات بخیر" ;
GGoodbye = P.ss "خدا حافظ" ;
GHello = P.ss "اسلام علیكم" ;
GHelp = P.ss "مدد" ;
GHowAreYou = P.ss "آپ كیسی ہو" ;
GLookOut = P.ss "دیكھ كر" ;
GNiceToMeetYou, GNiceToMeetYouPol = P.ss "آپ سے مل كر اچھا لگا" ;
GPleaseGive, GPleaseGivePol = P.ss "مہربانی كر كے" ;
GSeeYouSoon = P.ss "ملتے ہیں" ;
GSorry, GSorryPol = P.ss "معاف كیجیے گا" ;
GThanks = P.ss "شكریہ" ;
GTheCheck = P.ss "بل" ;
GCongratulations = P.ss "مبارك ہو";
GHappyBirthday = P.ss "سالگرہ مبارك" ;
GGoodLuck = P.ss "گڈ لك" ;
}

View File

@@ -1,4 +1,14 @@
concrete SentencesUrd of Sentences = NumeralUrd ** SentencesI - [sing] with
concrete SentencesUrd of Sentences = NumeralUrd ** SentencesI - [sing,IFemale,YouFamFemale,YouPolFemale] with
(Syntax = SyntaxUrd),
(Symbolic = SymbolicUrd),
(Lexicon = LexiconUrd)
(Lexicon = LexiconUrd) **
open
(P=ParadigmsUrd),
ParamX,
StringsUrdu,
CommonHindustani in {
lin IFemale = mkPerson (P.personalPN myN mjh "" myra myry myrE myry Sg Fem Pers1) ;
YouFamFemale = mkPerson (P.personalPN tw tw tw tyra tyry tyrE tyry Sg Fem Pers2_Casual) ;
YouPolFemale = mkPerson (P.personalPN ap ap ap apka apky apkE apky Pl Fem Pers2_Respect);
} ;

View File

@@ -2,7 +2,8 @@
concrete WordsUrd of Words = SentencesUrd **
open
SyntaxUrd,
SyntaxUrd,
CommonHindustani,
ParadigmsUrd,
(L = LexiconUrd),
(P = ParadigmsUrd),
@@ -65,12 +66,12 @@ flags coding = utf8 ;
Pub = mkPlace "پب" "میں" ;
Restaurant = mkPlace "ہوٹل" "میں" ;
School = mkPlace "سكول" "میں" ;
Shop = mkPlace "دوكان" "میں" ;
Shop = mkPlaceFem "دوكان" "میں" Fem;
Station = mkPlace "سٹیشن" "پر" ;
Supermarket = mkPlace "سپر ماركیٹ" "میں" ;
Theatre = mkPlace "تھیٹر" "پر" ;
Toilet = mkPlace "غسل خانہ" "میں" ;
University = mkPlace "یونیورسٹی" "میں" ;
University = mkPlaceFem "یونیورسٹی" "میں" Fem;
Zoo = mkPlace "چڑیا گھر" "میں" ;
CitRestaurant cit = mkCNPlace (mkCN cit (mkN "ہوٹل")) in_Prep to_Prep ;
@@ -142,10 +143,10 @@ flags coding = utf8 ;
ALove p q = mkCl p.name (L.love_V2) q.name ;
AMarried p = mkCl p.name (mkA "شادی شدہ") ;
AReady p = mkCl p.name (mkA "تیار") ;
AScared p = mkCl p.name (mkA "ڈرا ہوا") ;
AScared p = mkCl p.name (P.mkCompoundA "ڈرا" "ہوا") ;
ASpeak p lang = mkCl p.name L.speak_V2 lang ;
AThirsty p = mkCl p.name (mkA "پیاسا") ;
ATired p = mkCl p.name (mkA "تھكا ہوا") ;
ATired p = mkCl p.name (P.mkCompoundA "تھكا" "ہوا") ;
AUnderstand p = mkCl p.name (mkV "سمجھنا") ;
AWant p obj = mkCl p.name (mkV2 (mkV "چاہنا")) obj ;
-- AWantGo p place = mkCl p.name want_VV (mkVP (mkVP L.go_V) place.name) ;
@@ -154,7 +155,7 @@ flags coding = utf8 ;
-- miscellaneous
QWhatName p = mkQS (mkQCl whatSg_IP (mkVP (nameOf p))) ;
---- QWhatAge p = mkQS (mkQCl (ICompAP (mkAP L.old_A)) p.name) ;
-- QWhatAge p = mkQS (mkQCl (ICompAP (mkAP L.old_A)) p.name) ;
-- HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item IrregUrd.cost_V)) ;
-- ItCost item price = mkCl item (mkV2 IrregUrd.cost_V) price ;
@@ -168,10 +169,10 @@ flags coding = utf8 ;
-- Building phrases from strings is complicated: the solution is to use
-- mkText : Text -> Text -> Text ;
PSeeYouDate d = mkText (lin Text (ss ("ملتے ہیں"))) (mkPhrase (mkUtt d)) ;
PSeeYouPlace p = mkText (lin Text (ss ("ملتے ہیں"))) (mkPhrase (mkUtt p.at)) ;
PSeeYouDate d = mkText (lin Text (Prelude.ss ("ملتے ہیں"))) (mkPhrase (mkUtt d)) ;
PSeeYouPlace p = mkText (lin Text (Prelude.ss ("ملتے ہیں"))) (mkPhrase (mkUtt p.at)) ;
PSeeYouPlaceDate p d =
mkText (lin Text (ss ("ملتے ہیں")))
mkText (lin Text (Prelude.ss ("ملتے ہیں")))
(mkText (mkPhrase (mkUtt p.at)) (mkPhrase (mkUtt d))) ;
-- Relations are expressed as "می وiفع" or "می سon'س وiفع", as defined by $xOf$
@@ -235,16 +236,18 @@ flags coding = utf8 ;
mkDay : Str -> {name : NP ; point : Adv ; habitual : Adv} = \d ->
let day = mkNP (mkPN d) in
mkNPDay day (SyntaxUrd.mkAdv to_Prep day)
(SyntaxUrd.mkAdv to_Prep (mkNP a_Quant plNum (mkCN (mkN d)))) ;
(SyntaxUrd.mkAdv to_Prep (mkNP a_Quant sgNum (mkCN (mkN d)))) ; --changed from plNum to sgNum
mkCompoundPlace : Str -> Str -> Str -> {name : CN ; at : Prep ; to : Prep; isPl : Bool} = \comp, p, i ->
-- mkCNPlace (mkCN (P.mkN comp (mkN p))) (P.mkPrep i) to_Prep ;
mkCNPlace (mkCN (mkN (comp++p))) (P.mkPrep i i) to_Prep ;
mkPlace : Str -> Str -> {name : CN ; at : Prep ; to : Prep; isPl : Bool} = \p,i ->
mkCNPlace (mkCN (mkN p)) (P.mkPrep i i) to_Prep ;
mkCNPlace (mkCN (mkN p)) (P.mkPrep i i) to_Prep ;
mkPlaceFem : Str -> Str -> Gender -> {name : CN ; at : Prep ; to : Prep; isPl : Bool} = \p,i,g ->
mkCNPlace (mkCN (P.mkN p g)) (P.mkPrep i i) to_Prep ;
open_Adv = P.mkAdv "كھلا" ;
open_Adv = P.mkAdv "كھلا" "كھلی";
closed_Adv = P.mkAdv "بند" ;
xOf : SentencesUrd.GNumber -> N -> NPPerson -> NPPerson = \n,x,p ->

View File

@@ -247,6 +247,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} ;
Verb : Type = {s : VerbForm => Str} ;

View File

@@ -36,13 +36,13 @@ incomplete concrete NounHindustani of Noun =
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 ;
s = \\n,g,c => quant.s!n!g!c ++ 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;
s = \\n,g,c => quant.s!n!g!c ++ num.s;
n = num.n
} ;
@@ -51,7 +51,12 @@ incomplete concrete NounHindustani of Noun =
a = agrP3 Masc Sg
} ;
PossPron p = {s = \\n,g,_ => p.ps ! n ! g ; a = p.a} ;
-- PossPron p = {s = \\n,g,_ => p.ps ! n ! g ; a = p.a} ;
PossPron p = {s = \\n,g,c => case c of {
Obl => p.ps ! Pl ! g ;
_ => p.ps ! n ! g
};
a = p.a} ;
NumSg = {s = []; n = Sg} ;
NumPl = {s = []; n = Pl} ;

View File

@@ -44,7 +44,7 @@ param
Preposition = {s : Gender => Str};
DemPronForm = {s : Number => Gender => Case => Str};
PossPronForm = {s : Number => Gender => Case => Str};
Determiner = {s : Number => Gender => Str ; n : Number};
Determiner = {s : Number => Gender => Case => Str ; n : Number};
-- a useful oper
eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ;
@@ -64,14 +64,14 @@ param
} ;
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 ++ cn.s ! nn ! c ;
NPObj => dt.s ! nn ! cn.g ++ cn.s ! nn ! Dir ;
NPErg => dt.s ! nn ! cn.g ++ cn.s ! nn ! Obl ++ "nE"
NPC c => dt.s ! nn ! cn.g ! c ++ cn.s ! nn ! c ;
NPObj => dt.s ! nn ! cn.g ! Dir ++ cn.s ! nn ! Dir ;
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 ;
NPObj => dt.s ! Sg ! Masc ;
NPErg => dt.s ! Sg ! Masc ++ "nE"
NPC c => dt.s ! Sg ! Masc ! c ;
NPObj => dt.s ! Sg ! Masc ! Dir ;
NPErg => dt.s ! Sg ! Masc ! Obl ++ "nE"
} ;
------------------------------------------

View File

@@ -15,7 +15,7 @@ incomplete concrete SymbolHindustani of Symbol =
a = agrP3 cn.g Sg
} ;
CNSymbNP det cn xs = {
s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Dir ++ xs.s ;
s = \\c => det.s ! det.n ! Masc ! Dir ++ cn.s ! det.n ! Dir ++ xs.s ; -- may be need to refine it i.e instead of using \\c should use table and then corresponding forms from det
a = agrP3 cn.g det.n
} ;
CNNumNP cn i = {

View File

@@ -247,6 +247,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} ;
Verb : Type = {s : VerbForm => Str} ;

View File

@@ -4,12 +4,12 @@ incomplete concrete ExtraHindustani of ExtraHindustaniAbs = CatHindustani **
open CommonHindustani,Coordination,ResHindustani, ParamX in {
lin
-- GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "كا" ; a = np.a} ;
GenNP np = {s = table {
case <g,n,c> of {
<Masc,_,_> => np.s ! NPC Obl ++ "كا" ;
<Fem,_,_> => np.s ! NPC Obl ++ "كی"
};
GenNP np = {s = \\n,g,c =>
case <n,g,c> of {
<_,Masc,_> => np.s ! NPC Obl ++ "كا" ;
<_,Fem,_> => np.s ! NPC Obl ++ "كی"
};
a = np.a} ;
each_Det = mkDet "ہر كوی" "ہر كوی" "ہر كوی" "ہر كوی" Sg ;

View File

@@ -7,7 +7,9 @@ flags coding = utf8 ;
-- GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "كا" ; a = np.a} ;
GenNP np = {s = \\n,g,c =>
case <n,g,c> of {
<_,Masc,_> => np.s ! NPC Obl ++ "كا" ;
<Sg,Masc,Obl> => np.s ! NPC Obl ++ "كے" ;
<Sg,Masc,_> => np.s ! NPC Obl ++ "كا" ;
<Pl,Masc,_> => np.s ! NPC Obl ++ "كے" ;
<_,Fem,_> => np.s ! NPC Obl ++ "كی"
};

View File

@@ -173,13 +173,13 @@ oper
IDeterminer = {s:Gender => Case => Str ; n : Number};
makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> {
s = table {
Sg => table {
Masc => s1 ;
Fem => s2
Sg => table {
Masc => table {_ => s1} ;
Fem => table {_ => s2}
} ;
Pl => table {
Masc => s3 ;
Fem => s4
Masc => table { _ => s3} ;
Fem => table {_ => s4}
}
} ;

View File

@@ -75,6 +75,10 @@ oper
} ;
mkA2 : A -> Str -> A2 ;
mkA2 a str = a ** {c2=str ; lock_A2 = <>} ;
-- compound Adjectives
mkCompoundA : Str -> Str -> A ; -- e.g dra hwa
mkCompoundA s1 s2 = compoundAdj s1 s2 ;
--2 Verbs
@@ -108,8 +112,12 @@ oper
----2 Adverbs
mkAdv = overload {
mkAdv : Str -> Adv -- e.g yhaN
= \str -> {s = \\_ => str ; lock_Adv = <>};
mkAdv : Str -> Str -> Adv
= \m,f -> {s = table {Masc => m ; Fem => f} ; lock_Adv = <>};
};
----2 Prepositions

View File

@@ -44,7 +44,7 @@ param
Preposition = {s : Gender => Str};
DemPronForm = {s : Number => Gender => Case => Str};
PossPronForm = {s : Number => Gender => Case => Str};
Determiner = {s : Number => Gender => Str ; n : Number};
Determiner = {s : Number => Gender => Case => Str ; n : Number};
-- a useful oper
eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ;
@@ -64,14 +64,14 @@ param
} ;
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 ++ cn.s ! nn ! c ;
NPObj => dt.s ! nn ! cn.g ++ cn.s ! nn ! Dir ;
NPErg => dt.s ! nn ! cn.g ++ cn.s ! nn ! Obl ++ "نے"
NPC c => dt.s ! nn ! cn.g ! c ++ cn.s ! nn ! c ;
NPObj => dt.s ! nn ! cn.g ! Dir ++ cn.s ! nn ! Dir ;
NPErg => dt.s ! nn ! cn.g ! Obl ++ cn.s ! nn ! Obl ++ "نے"
} ;
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 ++ "نے"
NPC c => dt.s ! Sg ! Masc ! c ;
NPObj => dt.s ! Sg ! Masc ! Dir ;
NPErg => dt.s ! Sg ! Masc ! Obl ++ "نے"
} ;
------------------------------------------

View File

@@ -111,7 +111,7 @@ concrete StructuralUrd of Structural = CatUrd **
yes_Utt = ss "ہاں" ;
youSg_Pron = personalPN "تو" "تو" "تو" "تیرا" "تیری" "تیرے" "تیری" Sg Masc Pers2_Casual ;
youPl_Pron = personalPN "تم" "تم" "تم" "تمھارا" "تمھاری" "تمھارے" "تمھاری" Pl Masc Pers2_Casual ;
youPol_Pron = personalPN "آپ" "آپ" "آپ" ["آپ كا"] ["آپ كی"] ["آپ كے"] ["آپ كی"] Sg Masc Pers2_Respect ;
youPol_Pron = personalPN "آپ" "آپ" "آپ" ["آپ كا"] ["آپ كی"] ["آپ كے"] ["آپ كی"] Pl Masc Pers2_Respect ;
no_Quant = demoPN " كوی نہیں" "كوی نہیں" "كوی نہیں" ;
not_Predet = {s="نہیں"} ;
if_then_Conj = sd2 "اگر" "تو" ** {n = Sg} ;

View File

@@ -7,7 +7,9 @@ flags coding = utf8 ;
-- GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "ka" ; a = np.a} ;
GenNP np = {s = \\n,g,c =>
case <n,g,c> of {
<_,Masc,_> => np.s ! NPC Obl ++ "ka" ;
<Sg,Masc,Obl> => np.s ! NPC Obl ++ "kE" ;
<Sg,Masc,_> => np.s ! NPC Obl ++ "ka" ;
<Pl,Masc,_> => np.s ! NPC Obl ++ "kE" ;
<_,Fem,_> => np.s ! NPC Obl ++ "ky"
};

View File

@@ -173,13 +173,13 @@ oper
IDeterminer = {s:Gender => Case => Str ; n : Number};
makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> {
s = table {
Sg => table {
Masc => s1 ;
Fem => s2
Sg => table {
Masc => table {_ => s1} ;
Fem => table {_ => s2}
} ;
Pl => table {
Masc => s3 ;
Fem => s4
Masc => table { _ => s3} ;
Fem => table {_ => s4}
}
} ;

View File

@@ -111,7 +111,7 @@ concrete StructuralUrd of Structural = CatUrd **
yes_Utt = ss "haN" ;
youSg_Pron = personalPN "tw" "tw" "tw" "tyra" "tyry" "tyrE" "tyry" Sg Masc Pers2_Casual ;
youPl_Pron = personalPN "tm" "tm" "tm" "tmh'ara" "tmh'ary" "tmh'arE" "tmh'ary" Pl Masc Pers2_Casual ;
youPol_Pron = personalPN "Ap" "Ap" "Ap" ["Ap ka"] ["Ap ky"] ["Ap kE"] ["Ap ky"] Sg Masc Pers2_Respect ;
youPol_Pron = personalPN "Ap" "Ap" "Ap" ["Ap ka"] ["Ap ky"] ["Ap kE"] ["Ap ky"] Pl Masc Pers2_Respect ;
no_Quant = demoPN " kwy nhyN" "kwy nhyN" "kwy nhyN" ;
not_Predet = {s="nhyN"} ;
if_then_Conj = sd2 "agr" "tw" ** {n = Sg} ;