mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
Punjabi resource by Shafqat and Humayoun.
This commit is contained in:
39
lib/src/punjabi/AdjectivePnb.gf
Normal file
39
lib/src/punjabi/AdjectivePnb.gf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
concrete AdjectivePnb of Adjective = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
lin
|
||||||
|
|
||||||
|
PositA a = a ;
|
||||||
|
UseComparA a = a;
|
||||||
|
|
||||||
|
ComparA a np = {
|
||||||
|
s = \\n,g,c => np.s ! NPC Obl ++ "توں" ++ a.s ! n ! g ! c ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
|
ComplA2 a np = {
|
||||||
|
s = \\n,g,c => np.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflA2 a = {
|
||||||
|
s = \\n,g,c => a.s ! n ! g ! c ++ RefPron ++ "نال" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SentAP ap sc = {
|
||||||
|
s = \\n,g,c => ap.s ! n ! g ! c ++ sc.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdAP ada ap = {
|
||||||
|
s = \\n,g,c => ada.s ++ ap.s ! n ! g ! c ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseA2 a = a ;
|
||||||
|
|
||||||
|
CAdvAP cadv ap np = {
|
||||||
|
s = \\n,g,c => cadv.s ++ ap.s ! n ! g ! c ++ cadv.p ++ np.s ! NPC Dir ;
|
||||||
|
};
|
||||||
|
|
||||||
|
AdjOrd ord = { s = \\_,_,_ => ord.s ; };
|
||||||
|
|
||||||
|
}
|
||||||
21
lib/src/punjabi/AdverbPnb.gf
Normal file
21
lib/src/punjabi/AdverbPnb.gf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
concrete AdverbPnb of Adverb = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
lin
|
||||||
|
PositAdvAdj a = {s = \\g => a.s ! Sg ! g ! Obl } ;
|
||||||
|
ComparAdvAdj cadv a np = {
|
||||||
|
s = \\g => np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ;
|
||||||
|
} ;
|
||||||
|
ComparAdvAdjS cadv a s = {
|
||||||
|
s = \\g => cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ++ s.s;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PrepNP prep np = {s = \\_ => np.s ! NPObj ++ prep.s } ;
|
||||||
|
|
||||||
|
AdAdv ada adv = { s = \\g => ada.s ++ adv.s ! g} ;
|
||||||
|
|
||||||
|
-- SubjS = cc2 ;
|
||||||
|
SubjS sub snt = {s = \\_ => sub.s ++ snt.s } ;
|
||||||
|
AdnCAdv cadv = {s = "نالوں" ++ cadv.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
6
lib/src/punjabi/AllPnb.gf
Normal file
6
lib/src/punjabi/AllPnb.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
|
concrete AllPnb of AllPnbAbs =
|
||||||
|
LangPnb,
|
||||||
|
ExtraPnb
|
||||||
|
** {} ;
|
||||||
4
lib/src/punjabi/AllPnbAbs.gf
Normal file
4
lib/src/punjabi/AllPnbAbs.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
abstract AllPnbAbs =
|
||||||
|
Lang,
|
||||||
|
ExtraPnbAbs
|
||||||
|
** {} ;
|
||||||
87
lib/src/punjabi/CatPnb.gf
Normal file
87
lib/src/punjabi/CatPnb.gf
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
concrete CatPnb of Cat = CommonX - [Adv] ** open ResPnb, Prelude 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 : ResPnb.Compl} ;
|
||||||
|
|
||||||
|
---- Sentence
|
||||||
|
|
||||||
|
Cl = ResPnb.Clause ;
|
||||||
|
ClSlash = {
|
||||||
|
s : ResPnb.VPHTense => Polarity => Order => Str ;
|
||||||
|
c2 : ResPnb.Compl
|
||||||
|
} ;
|
||||||
|
Imp = {s : CPolarity => ImpForm => Str} ;
|
||||||
|
|
||||||
|
---- Question
|
||||||
|
QCl = {s : ResPnb.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 : ResPnb.VPHTense => Polarity => Order => Agr => Str ;
|
||||||
|
c : Case
|
||||||
|
} ;
|
||||||
|
RP = {s: Number => Case => Str ; a:RAgr};
|
||||||
|
|
||||||
|
---- Verb
|
||||||
|
|
||||||
|
VP = ResPnb.VPH ;
|
||||||
|
VPSlash = ResPnb.VPHSlash ;
|
||||||
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
|
---- Adv
|
||||||
|
Adv = {s : Gender => Str} ;
|
||||||
|
---- Adjective
|
||||||
|
|
||||||
|
AP = ResPnb.Adjective1 ;
|
||||||
|
|
||||||
|
---- Noun
|
||||||
|
|
||||||
|
CN = ResPnb.Noun ;
|
||||||
|
NP = ResPnb.NP ;
|
||||||
|
Pron = {s : Case => Str ; ps : Str ; a : Agr};
|
||||||
|
Det = ResPnb.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 = ResPnb.Preposition;
|
||||||
|
---- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
|
V, VS, VQ, VA = ResPnb.Verb ; -- = {s : VForm => Str} ;
|
||||||
|
V2, V2A, V2Q, V2S = ResPnb.Verb ** {c2 : Compl} ;
|
||||||
|
V3 = ResPnb.Verb ** {c2, c3 : Str} ;
|
||||||
|
VV = ResPnb.Verb ** { isAux : Bool} ;
|
||||||
|
V2V = ResPnb.Verb ** {c1 : Str ; c2 : Str ; isAux : Bool} ;
|
||||||
|
A = ResPnb.Adjective1 ; --- {s : Gender => Number => Case => Str} ;
|
||||||
|
A2 = ResPnb.Adjective1 ** { 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} ;
|
||||||
|
|
||||||
|
}
|
||||||
47
lib/src/punjabi/ConjunctionPnb.gf
Normal file
47
lib/src/punjabi/ConjunctionPnb.gf
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
--concrete ConjunctionPnb of Conjunction =
|
||||||
|
-- CatPnbu ** open ResPnb, Coordination, Prelude in {
|
||||||
|
|
||||||
|
concrete ConjunctionPnb of Conjunction =
|
||||||
|
CatPnb ** open ResPnb, Coordination, Prelude in {
|
||||||
|
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
ConjS = conjunctDistrSS ;
|
||||||
|
|
||||||
|
-- ConjAdv = conjunctDistrSS ;
|
||||||
|
ConjAdv conj advs = conjunctDistrTable Gender conj advs ;
|
||||||
|
|
||||||
|
ConjNP conj ss = conjunctDistrTable NPCase conj ss ** {
|
||||||
|
a = conjAgr (agrP3 Masc conj.n) ss.a ;
|
||||||
|
isPron = ss.isPron ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjAP conj ss = conjunctDistrTable3 Number Gender Case 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 = twoSS ;
|
||||||
|
BaseAdv x y = twoTable Gender x y ;
|
||||||
|
-- ConsAdv = consrSS comma ;
|
||||||
|
ConsAdv xs x = consrTable Gender comma xs x ;
|
||||||
|
BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a ; isPron = andB x.isPron y.isPron} ;
|
||||||
|
BaseRS x y = twoTable Agr x y ** {c = x.c};
|
||||||
|
ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a ; isPron = andB xs.isPron x.isPron} ;
|
||||||
|
ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c};
|
||||||
|
BaseAP x y = twoTable3 Number Gender Case x y ; -- ** {isPre = andB x.isPre y.isPre} ;
|
||||||
|
ConsAP xs x = consrTable3 Number Gender Case 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 ; isPron : Bool} ;
|
||||||
|
[AP] = {s1,s2 : Number => Gender => Case => Str} ;
|
||||||
|
[RS] = {s1,s2 : Agr => Str ; c : Case};
|
||||||
|
|
||||||
|
}
|
||||||
170
lib/src/punjabi/Coordination.gf
Normal file
170
lib/src/punjabi/Coordination.gf
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
resource Coordination = open Prelude in {
|
||||||
|
|
||||||
|
param
|
||||||
|
ListSize = TwoElem | ManyElem ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
ListX = {s1,s2 : Str} ;
|
||||||
|
|
||||||
|
twoStr : (x,y : Str) -> ListX = \x,y ->
|
||||||
|
{s1 = x ; s2 = y} ;
|
||||||
|
consStr : Str -> ListX -> Str -> ListX = \comma,xs,x ->
|
||||||
|
{s1 = xs.s1 ++ comma ++ xs.s2 ; s2 = x } ;
|
||||||
|
|
||||||
|
twoSS : (_,_ : SS) -> ListX = \x,y ->
|
||||||
|
twoStr x.s y.s ;
|
||||||
|
consSS : Str -> ListX -> SS -> ListX = \comma,xs,x ->
|
||||||
|
consStr comma xs x.s ;
|
||||||
|
|
||||||
|
Conjunction : Type = SS ;
|
||||||
|
ConjunctionDistr : Type = {s1 : Str ; s2 : Str} ;
|
||||||
|
|
||||||
|
conjunctX : Conjunction -> ListX -> Str = \or,xs ->
|
||||||
|
xs.s1 ++ or.s ++ xs.s2 ;
|
||||||
|
|
||||||
|
conjunctDistrX : ConjunctionDistr -> ListX -> Str = \or,xs ->
|
||||||
|
or.s1 ++ xs.s1 ++ or.s2 ++ xs.s2 ;
|
||||||
|
|
||||||
|
conjunctSS : Conjunction -> ListX -> SS = \or,xs ->
|
||||||
|
ss (xs.s1 ++ or.s ++ xs.s2) ;
|
||||||
|
|
||||||
|
conjunctDistrSS : ConjunctionDistr -> ListX -> SS = \or,xs ->
|
||||||
|
ss (or.s1 ++ xs.s1 ++ or.s2 ++ xs.s2) ;
|
||||||
|
|
||||||
|
-- all this lifted to tables
|
||||||
|
|
||||||
|
ListTable : Type -> Type = \P -> {s1,s2 : P => Str} ;
|
||||||
|
|
||||||
|
twoTable : (P : Type) -> (_,_ : {s : P => Str}) -> ListTable P = \_,x,y ->
|
||||||
|
{s1 = x.s ; s2 = y.s} ;
|
||||||
|
|
||||||
|
consTable : (P : Type) -> Str -> ListTable P -> {s : P => Str} -> ListTable P =
|
||||||
|
\P,c,xs,x ->
|
||||||
|
{s1 = table P {o => xs.s1 ! o ++ c ++ xs.s2 ! o} ; s2 = x.s} ;
|
||||||
|
|
||||||
|
conjunctTable : (P : Type) -> Conjunction -> ListTable P -> {s : P => Str} =
|
||||||
|
\P,or,xs ->
|
||||||
|
{s = table P {p => xs.s1 ! p ++ or.s ++ xs.s2 ! p}} ;
|
||||||
|
|
||||||
|
conjunctDistrTable :
|
||||||
|
(P : Type) -> ConjunctionDistr -> ListTable P -> {s : P => Str} = \P,or,xs ->
|
||||||
|
{s = table P {p => or.s1++ xs.s1 ! p ++ or.s2 ++ xs.s2 ! p}} ;
|
||||||
|
|
||||||
|
-- ... and to two- and three-argument tables: how clumsy! ---
|
||||||
|
|
||||||
|
ListTable2 : Type -> Type -> Type = \P,Q ->
|
||||||
|
{s1,s2 : P => Q => Str} ;
|
||||||
|
|
||||||
|
twoTable2 : (P,Q : Type) -> (_,_ : {s : P => Q => Str}) -> ListTable2 P Q =
|
||||||
|
\_,_,x,y ->
|
||||||
|
{s1 = x.s ; s2 = y.s} ;
|
||||||
|
|
||||||
|
consTable2 :
|
||||||
|
(P,Q : Type) -> Str -> ListTable2 P Q -> {s : P => Q => Str} -> ListTable2 P Q =
|
||||||
|
\P,Q,c,xs,x ->
|
||||||
|
{s1 = table P {p => table Q {q => xs.s1 ! p ! q ++ c ++ xs.s2 ! p! q}} ;
|
||||||
|
s2 = x.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
conjunctTable2 :
|
||||||
|
(P,Q : Type) -> Conjunction -> ListTable2 P Q -> {s : P => Q => Str} =
|
||||||
|
\P,Q,or,xs ->
|
||||||
|
{s = table P {p => table Q {q => xs.s1 ! p ! q ++ or.s ++ xs.s2 ! p ! q}}} ;
|
||||||
|
|
||||||
|
conjunctDistrTable2 :
|
||||||
|
(P,Q : Type) -> ConjunctionDistr -> ListTable2 P Q -> {s : P => Q => Str} =
|
||||||
|
\P,Q,or,xs ->
|
||||||
|
{s =
|
||||||
|
table P {p => table Q {q => or.s1++ xs.s1 ! p ! q ++ or.s2 ++ xs.s2 ! p ! q}}} ;
|
||||||
|
|
||||||
|
ListTable3 : Type -> Type -> Type -> Type = \P,Q,R ->
|
||||||
|
{s1,s2 : P => Q => R => Str} ;
|
||||||
|
|
||||||
|
twoTable3 : (P,Q,R : Type) -> (_,_ : {s : P => Q => R => Str}) ->
|
||||||
|
ListTable3 P Q R =
|
||||||
|
\_,_,_,x,y ->
|
||||||
|
{s1 = x.s ; s2 = y.s} ;
|
||||||
|
|
||||||
|
consTable3 :
|
||||||
|
(P,Q,R : Type) -> Str -> ListTable3 P Q R -> {s : P => Q => R => Str} ->
|
||||||
|
ListTable3 P Q R =
|
||||||
|
\P,Q,R,c,xs,x ->
|
||||||
|
{s1 = \\p,q,r => xs.s1 ! p ! q ! r ++ c ++ xs.s2 ! p ! q ! r ;
|
||||||
|
s2 = x.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
conjunctTable3 :
|
||||||
|
(P,Q,R : Type) -> Conjunction -> ListTable3 P Q R -> {s : P => Q => R => Str} =
|
||||||
|
\P,Q,R,or,xs ->
|
||||||
|
{s = \\p,q,r => xs.s1 ! p ! q ! r ++ or.s ++ xs.s2 ! p ! q ! r} ;
|
||||||
|
|
||||||
|
conjunctDistrTable3 :
|
||||||
|
(P,Q,R : Type) -> ConjunctionDistr -> ListTable3 P Q R ->
|
||||||
|
{s : P => Q => R => Str} =
|
||||||
|
\P,Q,R,or,xs ->
|
||||||
|
{s = \\p,q,r => or.s1++ xs.s1 ! p ! q ! r ++ or.s2 ++ xs.s2 ! p ! q ! r} ;
|
||||||
|
|
||||||
|
---------
|
||||||
|
ListTable4 : Type -> Type -> Type -> Type -> Type = \P,Q,R,T ->
|
||||||
|
{s1,s2 : P => Q => R => T => Str} ;
|
||||||
|
|
||||||
|
twoTable4 : (P,Q,R,T : Type) -> (_,_ : {s : P => Q => R => T => Str}) ->
|
||||||
|
ListTable4 P Q R T =
|
||||||
|
\_,_,_,_,x,y ->
|
||||||
|
{s1 = x.s ; s2 = y.s} ;
|
||||||
|
|
||||||
|
consTable4 :
|
||||||
|
(P,Q,R,T : Type) -> Str -> ListTable4 P Q R T -> {s : P => Q => R => T => Str} ->
|
||||||
|
ListTable4 P Q R T =
|
||||||
|
\P,Q,R,T,c,xs,x ->
|
||||||
|
{s1 = \\p,q,r,t => xs.s1 ! p ! q ! r ! t ++ c ++ xs.s2 ! p ! q ! r ! t ;
|
||||||
|
s2 = x.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
conjunctTable4 :
|
||||||
|
(P,Q,R,T : Type) -> Conjunction -> ListTable4 P Q R T -> {s : P => Q => R => T => Str} =
|
||||||
|
\P,Q,R,T,or,xs ->
|
||||||
|
{s = \\p,q,r,t => xs.s1 ! p ! q ! r ! t ++ or.s ++ xs.s2 ! p ! q ! r ! t} ;
|
||||||
|
|
||||||
|
conjunctDistrTable4 :
|
||||||
|
(P,Q,R,T : Type) -> ConjunctionDistr -> ListTable4 P Q R T ->
|
||||||
|
{s : P => Q => R => T => Str} =
|
||||||
|
\P,Q,R,T,or,xs ->
|
||||||
|
{s = \\p,q,r,t => or.s1++ xs.s1 ! p ! q ! r ! t ++ or.s2 ++ xs.s2 ! p ! q ! r ! t} ;
|
||||||
|
--------------
|
||||||
|
|
||||||
|
comma = "," ;
|
||||||
|
|
||||||
|
-- you can also do this to right-associative lists:
|
||||||
|
|
||||||
|
consrStr : Str -> Str -> ListX -> ListX = \comma,x,xs ->
|
||||||
|
{s1 = x ++ comma ++ xs.s1 ; s2 = xs.s2 } ;
|
||||||
|
|
||||||
|
consrSS : Str -> SS -> ListX -> ListX = \comma,x,xs ->
|
||||||
|
consrStr comma x.s xs ;
|
||||||
|
|
||||||
|
consrTable : (P : Type) -> Str -> {s : P => Str} -> ListTable P -> ListTable P =
|
||||||
|
\P,c,x,xs ->
|
||||||
|
{s1 = table P {o => x.s ! o ++ c ++ xs.s1 ! o} ; s2 = xs.s2} ;
|
||||||
|
|
||||||
|
consrTable2 : (P,Q : Type) -> Str -> {s : P => Q => Str} ->
|
||||||
|
ListTable2 P Q -> ListTable2 P Q =
|
||||||
|
\P,Q,c,x,xs ->
|
||||||
|
{s1 = table P {p => table Q {q => x.s ! p ! q ++ c ++ xs.s1 ! p ! q}} ;
|
||||||
|
s2 = xs.s2
|
||||||
|
} ;
|
||||||
|
consrTable4 : (P,Q,R,T : Type) -> Str -> {s : P => Q => R => T => Str} ->
|
||||||
|
ListTable4 P Q R T -> ListTable4 P Q R T =
|
||||||
|
\P,Q,R,T,c,x,xs ->
|
||||||
|
{s1 = table P {p => table Q {q => table R { r => table T {t => x.s ! p ! q ! r ! t ++ c ++ xs.s1 ! p ! q ! r ! t}}}} ;
|
||||||
|
s2 = xs.s2
|
||||||
|
} ;
|
||||||
|
consrTable3 : (P,Q,R : Type) -> Str -> {s : P => Q => R => Str} ->
|
||||||
|
ListTable3 P Q R -> ListTable3 P Q R =
|
||||||
|
\P,Q,R,c,x,xs ->
|
||||||
|
{s1 = table P {p => table Q {q => table R {t => x.s ! p ! q ! t ++ c ++ xs.s1 ! p ! q ! t }}} ;
|
||||||
|
s2 = xs.s2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
19
lib/src/punjabi/ExtraPnb.gf
Normal file
19
lib/src/punjabi/ExtraPnb.gf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
concrete ExtraPnb of ExtraPnbAbs = CatPnb **
|
||||||
|
open ResPnb, Coordination, Prelude, MorphoPnb, ParadigmsPnb in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "كا" ; a = np.a} ;
|
||||||
|
|
||||||
|
each_Det = mkDet "ہر كوی" "ہر كوی" "ہر كوی" "ہر كوی" Sg ;
|
||||||
|
have_V = mkV "راكh-نا";
|
||||||
|
IAdvAdv adv = {s = "كتنی" ++ adv.s} ;
|
||||||
|
ICompAP ap = {s = "كتنے" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ;
|
||||||
|
cost_V = mkV "قیمت" ;
|
||||||
|
|
||||||
|
-- added for causitives
|
||||||
|
make_CV = mkVerb "نoتہiنگ" ** {c2 = "" };
|
||||||
|
|
||||||
|
-- for VP conjunction
|
||||||
|
}
|
||||||
9
lib/src/punjabi/ExtraPnbAbs.gf
Normal file
9
lib/src/punjabi/ExtraPnbAbs.gf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
abstract ExtraPnbAbs = Extra ** {
|
||||||
|
|
||||||
|
-- uncontracted negations; contracted are the default
|
||||||
|
fun
|
||||||
|
|
||||||
|
each_Det : Det ;
|
||||||
|
have_V : V;
|
||||||
|
cost_V : V;
|
||||||
|
}
|
||||||
24
lib/src/punjabi/GrammarPnb.gf
Normal file
24
lib/src/punjabi/GrammarPnb.gf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
|
concrete GrammarPnb of Grammar =
|
||||||
|
NounPnb,
|
||||||
|
VerbPnb,
|
||||||
|
AdjectivePnb,
|
||||||
|
AdverbPnb,
|
||||||
|
NumeralPnb,
|
||||||
|
SentencePnb,
|
||||||
|
QuestionPnb,
|
||||||
|
RelativePnb,
|
||||||
|
ConjunctionPnb,
|
||||||
|
PhrasePnb,
|
||||||
|
TextX - [Adv],
|
||||||
|
StructuralPnb,
|
||||||
|
TenseX - [Adv],
|
||||||
|
IdiomPnb
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
39
lib/src/punjabi/IdiomPnb.gf
Normal file
39
lib/src/punjabi/IdiomPnb.gf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
concrete IdiomPnb of Idiom = CatPnb ** open Prelude,Predef, ResPnb in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ;
|
||||||
|
GenericCl vp = mkSClause "كوی" (agrP3 Masc Sg) vp ;
|
||||||
|
|
||||||
|
CleftNP np rs =
|
||||||
|
let cl = mkSClause (np.s ! NPC rs.c) (np.a) (predAux auxBe);
|
||||||
|
in
|
||||||
|
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
||||||
|
|
||||||
|
CleftAdv ad ss = { s = \\t,b,o => ad.s ! Masc ++ ss.s};
|
||||||
|
|
||||||
|
ExistNP np =
|
||||||
|
mkSClause "اوتھے" (agrP3 (fromAgr np.a).g (fromAgr np.a).n)
|
||||||
|
(insertObj (\\_ => np.s ! NPC Obl) (predAux auxBe)) ;
|
||||||
|
|
||||||
|
ExistIP ip =
|
||||||
|
let cl = mkSClause ("اوتھے" ++ ip.s ! Dir) (agrP3 ip.g ip.n) (predAux auxBe);
|
||||||
|
in {
|
||||||
|
s = \\t,p,qf => case qf of {
|
||||||
|
QDir => cl.s ! t ! p ! ODir;
|
||||||
|
QIndir => cl.s ! t! p ! ODir
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ;
|
||||||
|
ProgrVP vp = (predProg vp) ;
|
||||||
|
|
||||||
|
|
||||||
|
ImpPl1 vp = {s = "آو" ++ infVP True vp (agrP1 Masc Pl)} ;
|
||||||
|
ImpP3 np vp = {s = np.s!NPC Dir ++ "نوں" ++ (vp.s ! VPImp ).inf ++ "دیو"};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
10
lib/src/punjabi/LangPnb.gf
Normal file
10
lib/src/punjabi/LangPnb.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--# -path=.:../abstract:../common:../hindustani
|
||||||
|
|
||||||
|
concrete LangPnb of Lang =
|
||||||
|
GrammarPnb,
|
||||||
|
LexiconPnb
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer=unwords ; lexer=words ;
|
||||||
|
|
||||||
|
}
|
||||||
371
lib/src/punjabi/LexiconPnb.gf
Normal file
371
lib/src/punjabi/LexiconPnb.gf
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
--# -path=.:prelude:alltenses
|
||||||
|
|
||||||
|
concrete LexiconPnb of Lexicon = CatPnb **
|
||||||
|
--open ResPnb, Prelude in {
|
||||||
|
open ParadigmsPnb,MorphoPnb, Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
optimize=values ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
airplane_N = mkN07 "جہاج" ;
|
||||||
|
|
||||||
|
answer_V2S = mkV2 (compoundV "جواب" (mkV "دینا")) ;
|
||||||
|
apartment_N = mkN01 "كمرہ" ;
|
||||||
|
apple_N = mkN02 "سیب" ;
|
||||||
|
-- art_N = mkN "فن" ;
|
||||||
|
ask_V2Q = mkV2 (mkV "پچھنا") ;
|
||||||
|
baby_N = mkN01 "بچہ" ;
|
||||||
|
bad_A = mkAdj1 "برا" ;
|
||||||
|
-- bank_N = mkN "بانك" ;
|
||||||
|
beautiful_A = mkAdj1 "سونی" ;
|
||||||
|
become_VA = mkV "بننا";
|
||||||
|
beer_N = mkN04 "شراب" ;
|
||||||
|
beg_V2V = mkV2V (mkV "مانگنا") "سے" "كہ" False;
|
||||||
|
big_A = mkAdj1 "وڈا" ;
|
||||||
|
bike_N = mkN03 "سایچل" ;
|
||||||
|
bird_N = mkN01 "پرندہ" ;
|
||||||
|
black_A = mkAdj1 "كالا" ;
|
||||||
|
blue_A = mkAdj1 "نیلا" ;
|
||||||
|
boat_N = mkN03 "كشتی" ;
|
||||||
|
book_N = mkN04 "كتاب" ;
|
||||||
|
boot_N = mkN03 "جوتا" ;
|
||||||
|
-- boss_N = mkN "صاہب" ;
|
||||||
|
boy_N = mkN01 "منڈا" ;
|
||||||
|
bread_N = mkN03 "روتی" ;
|
||||||
|
break_V2 = mkV2 (mkV "توڑنا") ;
|
||||||
|
broad_A = mkAdj1 "كھلا" ;
|
||||||
|
brother_N2 = mkN2 (mkN01 "پرا") (mkPrep "كا") "كے" ; --not correct
|
||||||
|
brown_A = mkAdj1 "نسواری" ;
|
||||||
|
-- butter_N = mkN "مكھن" ;
|
||||||
|
buy_V2 = mkV2 (mkV "خریدنا");
|
||||||
|
camera_N = mkN01 "كیمرہ" ;
|
||||||
|
cap_N = mkN03 "توپی" ;
|
||||||
|
car_N = mkN03 "گڈی" ;
|
||||||
|
carpet_N = mkN03 "تپائی" ;
|
||||||
|
cat_N = mkN03 "بلی" ;
|
||||||
|
ceiling_N = mkN01 "كوٹھا" ;
|
||||||
|
chair_N = mkN03 "كرسی" ;
|
||||||
|
-- cheese_N = mkN "پنیر" feminine ;
|
||||||
|
child_N = mkN01 "بچہ" ;
|
||||||
|
-- church_N = mkCmpdNoun "گرجا" (mkN "گھر") ;
|
||||||
|
city_N = mkN02 "شہر" ;
|
||||||
|
clean_A = mkAdj1 "صاف" ;
|
||||||
|
clever_A = mkAdj1 "ہوشیار" ;
|
||||||
|
close_V2 = mkV2 (compoundV "بند" do_V2);
|
||||||
|
coat_N = mkN04 "كوٹ" ;
|
||||||
|
cold_A = mkAdj1 "ٹھنڈا" ;
|
||||||
|
come_V = mkV "آنا" ;
|
||||||
|
-- computer_N = mkN "كمپیوٹر" ;
|
||||||
|
-- country_N = mkN "ملك" ;
|
||||||
|
-- cousin_N = mkCmpdNoun "چچا" (mkN "زاد") ; -- a compund noun made of two nouns
|
||||||
|
cow_N = mkN05 "گاے" ;
|
||||||
|
die_V = mkV "مرنا" ;
|
||||||
|
dirty_A = mkAdj1 "گندا" ;
|
||||||
|
-- distance_N3 = mkN3 (mkN "پینڈا") (mkPrep "دا") "دے" "توں" ;
|
||||||
|
-- doctor_N = mkN "معالج" ;
|
||||||
|
dog_N = mkN01 "كتا" ;
|
||||||
|
door_N = mkN01 "دروزہ" ;
|
||||||
|
drink_V2 = mkV2 (mkV "پینا");
|
||||||
|
easy_A2V = mkA "سوكھا" "" ;
|
||||||
|
eat_V2 = mkV2 (mkV "كھانا") "" ;
|
||||||
|
empty_A = mkAdj1 "خالی" ;
|
||||||
|
-- enemy_N = mkN "دشمن" ;
|
||||||
|
-- factory_N = mkN "كارخانہ" ;
|
||||||
|
father_N2 = mkN2 (mkN01 "ابا") (mkPrep "دا") "دے" ;
|
||||||
|
fear_VS = mkV "ڈرنا";
|
||||||
|
find_V2 = mkV2 (mkV "پانا") ;
|
||||||
|
fish_N = mkN03 "مچھلی" ;
|
||||||
|
floor_N = mkN02 "فرش" ;
|
||||||
|
forget_V2 = mkV2 (mkV "بھولنا") "نوں" ;
|
||||||
|
-- fridge_N = mkN "فریگ" ;
|
||||||
|
friend_N = mkN04 "دوست" ;
|
||||||
|
fruit_N = mkN02 "پھل" ;
|
||||||
|
-- fun_AV = mkAdj1V (regA "f?ن") ;
|
||||||
|
garden_N = mkN04 "باغ" ;
|
||||||
|
girl_N = mkN03 "كڑی" ;
|
||||||
|
-- glove_N = mkN "دستانہ" ;
|
||||||
|
gold_N = mkN01 "سونا" ;
|
||||||
|
good_A = mkAdj1 "اچھا" ;
|
||||||
|
go_V = mkV "جانا" ;
|
||||||
|
green_A = mkAdj1 "سبز" ;
|
||||||
|
-- harbour_N = mkCmpdNoun "بندر" (mkN "گاہ") ;
|
||||||
|
hate_V2 = mkV2 (compoundV "نفرت" do_V2) ;
|
||||||
|
hat_N = mkN03 "توپی" ;
|
||||||
|
-- have_V2 = dirV2 (mk5V "ہa?ع" "ہاس" "ہاد" "ہاد" "ہa??نگ") ;
|
||||||
|
hear_V2 = mkV2 (mkV "سننا") ;
|
||||||
|
hill_N = mkN03 "پاڑی" ;
|
||||||
|
hope_VS = (compoundV "آس" do_V2);
|
||||||
|
horse_N = mkN01 "كوڑا" ;
|
||||||
|
hot_A = mkAdj1 "گرم" ;
|
||||||
|
house_N = mkN02 "گھر" ;
|
||||||
|
important_A = mkAdj1 "اہم" ;
|
||||||
|
-- industry_N = mkN "صنعت" feminine ;
|
||||||
|
-- iron_N = mkN "لوہا" ;
|
||||||
|
-- king_N = mkN "بادشاہ" ;
|
||||||
|
know_V2 = mkV2 (mkV "جاننا") ;
|
||||||
|
know_VS = (mkV "جاننا") ;
|
||||||
|
know_VQ = (mkV "جاننا") ;
|
||||||
|
lake_N = mkN04 "جھیل" ;
|
||||||
|
-- lamp_N = mkN "لیمپ" ;
|
||||||
|
learn_V2 = mkV2 (mkV "سكھنا") ;
|
||||||
|
-- leather_N = mkN "چمڑا" ;
|
||||||
|
leave_V2 = mkV2 (mkV "جانا") ;
|
||||||
|
like_V2 = mkV2 (compoundV "پسند" do_V2);
|
||||||
|
listen_V2 = mkV2 (mkV "سننا") ;
|
||||||
|
live_V = mkV "رہنا" ; ---- touch
|
||||||
|
long_A = mkAdj1 "لمبا" ;
|
||||||
|
lose_V2 = mkV2 (compoundV "كھو" (mkV "دینا")) ;
|
||||||
|
love_N = mkN02 "محبت" ;
|
||||||
|
love_V2 = mkV2 (compoundV "پیار" do_V2) "نوں";
|
||||||
|
man_N = mkN03 "آدمی" ; -- not correct according to rules should be discussed
|
||||||
|
-- married_A2 = mkAdj1 "شادy?كرنا" "سے" ;
|
||||||
|
meat_N = mkN02 "گوشت" ;
|
||||||
|
-- milk_N = mkN "دودھ" ;
|
||||||
|
moon_N = mkN02 "چن" ;
|
||||||
|
mother_N2 = mkN2 (mkN05 "ماں") (mkPrep "دی") "ڈے"; -- not covered need to be discussed
|
||||||
|
mountain_N = mkN03 "پاڑی" ;
|
||||||
|
-- music_N = mkN "موسیقی" ;
|
||||||
|
narrow_A = mkAdj1 "باریك" ;
|
||||||
|
new_A = mkAdj1 "نوا" ;
|
||||||
|
newspaper_N = mkN04 "اخبار" ;
|
||||||
|
oil_N = mkN02 "تیل" ;
|
||||||
|
old_A = mkAdj1 "بوڈا" ;
|
||||||
|
open_V2 = mkV2 (mkV "كھولنا") ;
|
||||||
|
paint_V2A = mkV2 (compoundV "رنگ" do_V2) ;
|
||||||
|
-- paper_N = mkN "كاغز" ;
|
||||||
|
-- paris_PN = mkPN "پیرس" ;
|
||||||
|
-- peace_N = mkN "امن" ;
|
||||||
|
pen_N = mkN04 "پنسل" ;
|
||||||
|
planet_N = mkN01 "سیارہ" ;
|
||||||
|
-- plastic_N = mkN "پلاسٹك" ;
|
||||||
|
play_V2 = mkV2 (mkV "كھیڈنا") ;
|
||||||
|
-- policeman_N = mkCmpdNoun "پولیس" (mkN "والا") ;
|
||||||
|
-- priest_N = (mkN "پیغمبر") ;
|
||||||
|
-- probable_AS = mkAdj1S (regA "پr?بابلع") ;
|
||||||
|
queen_N = mkN03 "شہزادی" ;
|
||||||
|
-- radio_N = mkN "ریڈیو" ;
|
||||||
|
rain_V0 = compoundV "بارش" (mkV "ہونا" ) ;
|
||||||
|
read_V2 = mkV2 (mkV "پڑھنا");
|
||||||
|
red_A = mkAdj1 "لال" ;
|
||||||
|
-- religion_N = mkN "مزہب" ;
|
||||||
|
-- restaurant_N = mkN "ہوٹل" ;
|
||||||
|
-- river_N = mkN "دریا" masculine ;
|
||||||
|
rock_N = mkN04 "چٹان" ;
|
||||||
|
-- roof_N = mkN "چھت" masculine ;
|
||||||
|
rubber_N = mkN04 "ربڑ" ;
|
||||||
|
run_V = mkV "دوڑنا" ;
|
||||||
|
say_VS = mkV "كہنا" ;
|
||||||
|
-- school_N = mkN "سكول" ;
|
||||||
|
-- science_N = mkN "سانس" ;
|
||||||
|
sea_N = mkN02 "سمندر" ;
|
||||||
|
seek_V2 = mkV2 (mkV "لبھنا" ) "نوں" ;
|
||||||
|
see_V2 = mkV2 (mkV "ویكھنا") "نوں" ;
|
||||||
|
sell_V3 = mkV3 (mkV "ویچنا") "كو" "";
|
||||||
|
send_V3 = mkV3 (mkV "پیجنا") "كو" "";
|
||||||
|
-- sheep_N = mkN "بھیڑ" feminine ;
|
||||||
|
-- ship_N = mkN "جہاز" ;
|
||||||
|
shirt_N = mkN04 "قمیض";
|
||||||
|
shoe_N = mkN01 "جوتا" ;
|
||||||
|
-- shop_N = mkN "دوكان" feminine ;
|
||||||
|
short_A = mkAdj1 "چھوٹا" ;
|
||||||
|
silver_N = mkN03 "چاندی" ;
|
||||||
|
sister_N = mkN04 "بہن" ;
|
||||||
|
sleep_V = mkV "سونا" ;
|
||||||
|
small_A = mkAdj1 "چھوٹا" ;
|
||||||
|
-- snake_N = mkN "سانپ" ;
|
||||||
|
sock_N = mkN04 "جراب" ;
|
||||||
|
-- speak_V2 = mkV2 (mkV "بولنا") ;
|
||||||
|
star_N = mkN01 "ستارا" ;
|
||||||
|
-- steel_N = mkN "ستیل" ;
|
||||||
|
-- stone_N = mkN "پتھر" ;
|
||||||
|
stove_N = mkN01 "چولہا" ;
|
||||||
|
-- student_N = mkCmpdNoun "طالب" (mkN "علم") ;
|
||||||
|
-- stupid_A = mkAdj1 "احمق" ;
|
||||||
|
sun_N = mkN02 "سورج" ;
|
||||||
|
switch8off_V2 = mkV2 (mkV "چلانا") ;
|
||||||
|
switch8on_V2 = mkV2 (compoundV "بند" do_V2) ;
|
||||||
|
table_N = mkN04 "میز" ;
|
||||||
|
talk_V3 = mkV3 (mkV "بولنا") "سے" "";
|
||||||
|
teacher_N = mkN02 "استاد" ;
|
||||||
|
teach_V2 = mkV2 (mkV "پڑھنا") ;
|
||||||
|
-- television_N = mkN "تعلیویزن" ;
|
||||||
|
thick_A = mkAdj1 "موٹا" ;
|
||||||
|
thin_A = mkAdj1 "پتلا" ;
|
||||||
|
train_N = mkN03 "گڈی" ;
|
||||||
|
travel_V = (compoundV "پینڈا" do_V2) ;
|
||||||
|
-- tree_N = mkN "درخت" masculine ;
|
||||||
|
-- ---- trousers_N = mkN "تr??سعرس" ;
|
||||||
|
ugly_A = mkAdj1 "كوجا" ;
|
||||||
|
understand_V2 = mkV2 (mkV "سمجھنا") ;
|
||||||
|
-- university_N = mkN "یونیورسٹی" ;
|
||||||
|
-- village_N = mkN "گاوں" ;
|
||||||
|
wait_V2 = mkV2 (compoundV "راہ" (mkV "ویكھنا")) ;
|
||||||
|
walk_V = mkV "چلنا" ;
|
||||||
|
warm_A = mkAdj1 "تتا" ;
|
||||||
|
war_N = mkN02 "جنگ" ;
|
||||||
|
watch_V2 = mkV2 (mkV "ویكھنا") ;
|
||||||
|
water_N = mkN03 "پانی" ; -- not covered masculine ending with y
|
||||||
|
white_A = mkAdj1 "چٹا" ;
|
||||||
|
-- window_N = mkN "كھڑكی" ;
|
||||||
|
wine_N = mkN04 "شراب";
|
||||||
|
win_V2 = mkV2 (mkV "جیتنا") ;
|
||||||
|
woman_N = mkN04 "عورت" ;
|
||||||
|
wonder_VQ = compoundV "حعران" (mkV "ہونا") ;
|
||||||
|
wood_N = mkN04 "لكڑی" ;
|
||||||
|
write_V2 = mkV2 (mkV "لكھنا") ;
|
||||||
|
yellow_A = mkAdj1 "كھٹا" ;
|
||||||
|
young_A = mkAdj1 "جوان" ;
|
||||||
|
do_V2 = mkV2 (mkV "كرنا") ;
|
||||||
|
-- now_Adv = mkAdj1dv "اب" ;
|
||||||
|
-- already_Adv = mkAdj1dv "پہلE?ہی" ;
|
||||||
|
song_N = mkN01 "گانا" ;
|
||||||
|
add_V3 = mkV3 (compoundV "وادھا" do_V2) "" "" ;
|
||||||
|
number_N = mkN01 "ہندسہ" ;
|
||||||
|
put_V2 = mkV2 (mkV "ڈالنا") ;
|
||||||
|
stop_V = mkV "روكنا" ;
|
||||||
|
jump_V = compoundV "چھال" (mkV "مارنا") ;
|
||||||
|
|
||||||
|
left_Ord = {s = "سجا" ; n = singular};
|
||||||
|
right_Ord = {s= "كھبا" ; n = singular};
|
||||||
|
-- far_Adv = mkAdj1dv "دور" ;
|
||||||
|
correct_A = mkAdj1 "صیہ" ;
|
||||||
|
dry_A = mkAdj1 "سوكا" ;
|
||||||
|
dull_A = mkAdj1 "نكھٹو" ;
|
||||||
|
full_A = mkAdj1 "پورا" ;
|
||||||
|
heavy_A = mkAdj1 "پاری" ;
|
||||||
|
near_A = mkAdj1 "نیڑے" ;
|
||||||
|
rotten_A = mkAdj1 "خراب" ;
|
||||||
|
round_A = mkAdj1 "گول" ;
|
||||||
|
sharp_A = mkAdj1 "تیز" ;
|
||||||
|
smooth_A = mkAdj1 "پدرا" ;
|
||||||
|
straight_A = mkAdj1 "سدا" ;
|
||||||
|
wet_A = mkAdj1 "گلا" ; ----
|
||||||
|
wide_A = mkAdj1 "چوڑا" ;
|
||||||
|
animal_N = mkN02 "جانور" ;
|
||||||
|
-- ashes_N = mkN "راكھ" feminine; -- FIXME: plural only?
|
||||||
|
-- back_N = mkN "قمر" feminine ;
|
||||||
|
-- bark_N = mkN "بارك" ;
|
||||||
|
-- belly_N = mkN "دھنی" ;
|
||||||
|
blood_N = mkN02 "لہو" ;
|
||||||
|
bone_N = mkN03 "ہڈی" ;
|
||||||
|
-- breast_N = mkN "چھاتی" ;
|
||||||
|
-- cloud_N = mkN "بادل" ;
|
||||||
|
day_N = mkN04 "دن" ;
|
||||||
|
-- dust_N = mkN "دھول" ;
|
||||||
|
-- ear_N = mkN "كان" ;
|
||||||
|
-- earth_N = mkN "زمین" feminine ;
|
||||||
|
egg_N = mkN01 "انڈہ" ;
|
||||||
|
-- eye_N = mkN "آنكھ" feminine ;
|
||||||
|
fat_N = mkN01 "موتا" ;
|
||||||
|
-- feather_N = mkN "پر" ;
|
||||||
|
-- fingernail_N = mkN "ناخن" ;
|
||||||
|
-- fire_N = mkN "آگ" feminine ;
|
||||||
|
flower_N = mkN02 "پھول" ;
|
||||||
|
-- fog_N = mkN "دھند" feminine ;
|
||||||
|
-- foot_N = mkN "پاوں" ; -- not properly covered need to be discussed
|
||||||
|
forest_N = mkN02 "نجگل" ;
|
||||||
|
-- grass_N = mkN "گھس" feminine ;
|
||||||
|
-- guts_N = mkN "g?ت" ; -- FIXME: no singular
|
||||||
|
-- hair_N = mkN "بال" ;
|
||||||
|
hand_N = mkN02 "ہتھ" ;
|
||||||
|
head_N = mkN02 "سر" ;
|
||||||
|
heart_N = mkN02 "دل" ;
|
||||||
|
-- horn_N = mkN "گھنتی" ;
|
||||||
|
husband_N = mkN01 "بندا" ;
|
||||||
|
ice_N = mkN04 "برف" ;
|
||||||
|
-- knee_N = mkN "كہنی" ;
|
||||||
|
leaf_N = mkN01 "پتہ" ;
|
||||||
|
-- leg_N = mkN "تانگ" ;
|
||||||
|
-- liver_N = mkN "جگر" ;
|
||||||
|
-- louse_N = mkN "گھر" ;
|
||||||
|
-- mouth_N = mkN "منہ" ;
|
||||||
|
-- name_N = mkN "نام" ;
|
||||||
|
-- neck_N = mkN "گردن" feminine ;
|
||||||
|
night_N = mkN02 "رات" ;
|
||||||
|
-- nose_N = mkN "ناك" ;
|
||||||
|
-- person_N = mkN "شخص" ;
|
||||||
|
-- rain_N = mkN "بارش" feminine ;
|
||||||
|
-- road_N = mkN "سڑك" ;
|
||||||
|
root_N = mkN02 "گڑ" ;
|
||||||
|
rope_N = mkN03 "رسی" ;
|
||||||
|
-- salt_N = mkN "نمك" feminine ;
|
||||||
|
-- sand_N = mkN "ریت" feminine ;
|
||||||
|
-- seed_N = mkN "بیج" ;
|
||||||
|
skin_N = mkN04 "جلد" ;
|
||||||
|
sky_N = mkN02 "آسمان" ;
|
||||||
|
-- smoke_N = mkN "دھواں"; -- singular masc nouns ending with aN,wN yet to be implemented
|
||||||
|
snow_N = mkN04 "برف" ;
|
||||||
|
stick_N = mkN03 "سوٹی" ;
|
||||||
|
tail_N = mkN02 "پوشل" ;
|
||||||
|
tongue_N = mkN04 "جیب" ;
|
||||||
|
-- tooth_N = mkN "دانت" masculine;
|
||||||
|
wife_N = mkN03 "جنانی" ;
|
||||||
|
-- wind_N = mkN "آندھی" ;
|
||||||
|
-- wing_N = mkN "پر" ;
|
||||||
|
worm_N = mkN01 "تتا" ;
|
||||||
|
year_N = mkN02 "سال" ;
|
||||||
|
blow_V = mkV "چلنا" ;
|
||||||
|
breathe_V = compoundV "ساہ" (mkV "لینا" ) ;
|
||||||
|
burn_V = mkV "جلنا" ;
|
||||||
|
dig_V = mkV "كھودنا" ;
|
||||||
|
fall_V = mkV "گرنا" ;
|
||||||
|
float_V = mkV "تیرنا" ;
|
||||||
|
flow_V = mkV "بہنا" ;
|
||||||
|
fly_V = mkV "اڈنا" ;
|
||||||
|
freeze_V = mkV "جمنا" ;
|
||||||
|
give_V3 = mkV3 (mkV "دینا") "نوں" "";
|
||||||
|
laugh_V = mkV "ہسنا" ;
|
||||||
|
-- lie_N = mkN "جھوت" masculine ;
|
||||||
|
lie_V = compoundV "چھوٹھ" (mkV "بولنا" );
|
||||||
|
play_V = mkV "كھیلنا" ;
|
||||||
|
sew_V = mkV "سینا" ;
|
||||||
|
sing_V = mkV "گانا" ;
|
||||||
|
sit_V = mkV "بیٹھنا" ;
|
||||||
|
smell_V = mkV "سونگنا" ;
|
||||||
|
spit_V = mkV "تھوكنا" ;
|
||||||
|
stand_V = mkV "كھلونا";
|
||||||
|
swell_V = mkV "سوجنا" ;
|
||||||
|
swim_V = mkV "ترنا" ;
|
||||||
|
think_V = mkV "سوچنا" ;
|
||||||
|
turn_V = mkV "مڑنا" ;
|
||||||
|
vomit_V = compoundV "التی" (mkV "كرنا") ;
|
||||||
|
bite_V2 = mkV2 (mkV "كٹنا") ;
|
||||||
|
count_V2 = mkV2 (mkV "گننا") ;
|
||||||
|
cut_V2 = mkV2 (mkV "كٹنا") ;
|
||||||
|
fear_V2 = mkV2 (mkV "ڈرنا") ;
|
||||||
|
fight_V2 = mkV2 (mkV "لڑنا") ;
|
||||||
|
hit_V2 = mkV2 (compoundV "ٹھوڈا" (mkV "مارنا" ));
|
||||||
|
hold_V2 = mkV2 (mkV "پھڑنا") ;
|
||||||
|
-- hunt_V2 = mkV2 (compoundV "شكار" do_V2);
|
||||||
|
kill_V2 = mkV2 (compoundV "مار" (mkV "دینا" )) ;
|
||||||
|
pull_V2 = mkV2 (mkV "كھچنا");
|
||||||
|
push_V2 = mkV2 (compoundV "تكا" (mkV "دینا")) "كو" ;
|
||||||
|
rub_V2 = mkV2 (mkV "رگڑنا") ;
|
||||||
|
-- scratch_V2 = mkV2 (mkV "كھرچنا") "كو" ;
|
||||||
|
-- split_V2 = mkV2 (mkV "بانتا") "كو" ;
|
||||||
|
-- squeeze_V2 = dirV2 (regV "سq?ععزع") ;
|
||||||
|
-- stab_V2 = dirV2 (regDuplV "ستاب") ;
|
||||||
|
suck_V2 = mkV2 (mkV "چونڈنا") ;
|
||||||
|
throw_V2 = mkV2 (mkV "سوٹنا") ;
|
||||||
|
tie_V2 = mkV2 (mkV "بننا") ;
|
||||||
|
wash_V2 = mkV2 (mkV "تونا") ;
|
||||||
|
wipe_V2 = mkV2 (mkV "پونجھنا");
|
||||||
|
|
||||||
|
---- other_A = regA "?تہعر" ;
|
||||||
|
|
||||||
|
-- grammar_N = mkN "گردان" ;
|
||||||
|
language_N = mkN04 "بولی" ;
|
||||||
|
-- rule_N = mkN "اصول" ;
|
||||||
|
|
||||||
|
---- added 4/6/2007
|
||||||
|
john_PN = mkPN "جان" ;
|
||||||
|
-- question_N = mkN "سوال" ;
|
||||||
|
-- ready_A = regA "رعادی" ;
|
||||||
|
-- reason_N = mkN "وجہ" feminine ;
|
||||||
|
-- today_Adv = mkAdj1dv "اج" ;
|
||||||
|
-- uncertain_A = mkAdj1 ["غیr?یقینی"] ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
14
lib/src/punjabi/MakeStructuralPnb.gf
Normal file
14
lib/src/punjabi/MakeStructuralPnb.gf
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
--# -path=.:../common:../abstract
|
||||||
|
|
||||||
|
resource MakeStructuralPnb = open CatPnb, ParadigmsPnb, ResPnb, MorphoPnb, NounPnb, Prelude in {
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkSubj : Str -> CatPnb.Subj = \x ->
|
||||||
|
lin Subj {s = x} ;
|
||||||
|
mkNP : Str -> Number -> ResPnb.NP = \s,n ->
|
||||||
|
MassNP (UseN (ParadigmsPnb.mkN s));
|
||||||
|
-- lin NP (regNP s n) ;
|
||||||
|
mkIDet : Str -> Number -> IDet = \s,n ->
|
||||||
|
lin IDet {s = \\_ => s ; n = n} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,23 +1,20 @@
|
|||||||
--# -path=.:prelude
|
--# -path=.:../../prelude
|
||||||
--
|
--
|
||||||
----1 A Simple Punjabi Resource Morphology
|
----1 A Simple Punjabi Resource Morphology
|
||||||
----
|
----
|
||||||
---- Muhammad Humayoun 2010
|
---- Shafqat Virk, Aarne Ranta,2010
|
||||||
----
|
----
|
||||||
---- This resource morphology contains definitions needed in the resource
|
---- This resource morphology contains definitions needed in the resource
|
||||||
---- syntax. To build a lexicon, it is better to use $ParadigmsPnb$, which
|
---- syntax. To build a lexicon, it is better to use $ParadigmsPnb$, which
|
||||||
---- gives a higher-level access to this module.
|
---- gives a higher-level access to this module.
|
||||||
--
|
--
|
||||||
resource MorphoPnb = Cat ** open ResPnb, Prelude, Predef in {
|
resource MorphoPnb = ResPnb ** open Prelude,Predef in {
|
||||||
|
|
||||||
flags optimize=noexpand ;
|
flags optimize=all ;
|
||||||
coding = utf8;
|
coding = utf8;
|
||||||
|
|
||||||
oper
|
----2 Nouns
|
||||||
|
oper
|
||||||
------------------------------------------------------------------
|
|
||||||
----Nouns
|
|
||||||
------------------------------------------------------------------
|
|
||||||
|
|
||||||
mkN : (x1,_,_,_,_,_,_,x8 : Str) -> Gender -> Noun =
|
mkN : (x1,_,_,_,_,_,_,x8 : Str) -> Gender -> Noun =
|
||||||
\sd,so,sv,sa, pd,po,pv,pa, g -> {
|
\sd,so,sv,sa, pd,po,pv,pa, g -> {
|
||||||
@@ -39,14 +36,10 @@ resource MorphoPnb = Cat ** open ResPnb, Prelude, Predef in {
|
|||||||
g = g
|
g = g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
|
||||||
1. masculine nouns end with alif, choTi_hay, ain
|
|
||||||
Arabic nouns ends with h. also taken as Masc
|
|
||||||
e.g.
|
|
||||||
koRa, munda, wela, bistra, braamda
|
|
||||||
brqa',
|
|
||||||
-}
|
|
||||||
|
|
||||||
|
|
||||||
|
-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e)
|
||||||
|
-- Arabic nouns ends with h. also taken as Masc
|
||||||
mkN01 : Str -> Noun ;
|
mkN01 : Str -> Noun ;
|
||||||
mkN01 koRa = let end = last (koRa) ;
|
mkN01 koRa = let end = last (koRa) ;
|
||||||
koR = if_then_else Str (eq end "ع") koRa (tk 1 koRa)
|
koR = if_then_else Str (eq end "ع") koRa (tk 1 koRa)
|
||||||
@@ -118,6 +111,181 @@ resource MorphoPnb = Cat ** open ResPnb, Prelude, Predef in {
|
|||||||
x x x ""
|
x x x ""
|
||||||
Fem ;
|
Fem ;
|
||||||
|
|
||||||
|
----2 Determiners
|
||||||
|
|
||||||
|
IDeterminer = {s:Gender => Str ; n : Number};
|
||||||
|
makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => s1 ;
|
||||||
|
Fem => s2
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Masc => s3 ;
|
||||||
|
Fem => s4
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
n = n
|
||||||
|
};
|
||||||
|
|
||||||
|
makeIDet : Str -> Str -> Number -> IDeterminer = \s1,s2,n -> {
|
||||||
|
s = table {
|
||||||
|
Masc => s1;
|
||||||
|
Fem => s2
|
||||||
|
};
|
||||||
|
n = n
|
||||||
|
};
|
||||||
|
|
||||||
|
-- Proposition
|
||||||
|
|
||||||
|
makePrep : Str -> Preposition = \str -> {s = str } ** { lock_Prep = <>};
|
||||||
|
|
||||||
|
----2 Pronouns
|
||||||
|
PronForm = {s:Pronoun => Str};
|
||||||
|
{- makeDemPron : (x1,x2,x3,x4,x5,x6:Str) -> PronForm =
|
||||||
|
\y1,y2,y3,y4,y5,y6 -> {
|
||||||
|
s = table {
|
||||||
|
P Sg _ Dir _ => y1;
|
||||||
|
P Sg _ Obl _ => y2;
|
||||||
|
P Sg _ Voc _ => y3;
|
||||||
|
P Pl _ Dir _ => y4;
|
||||||
|
P Pl _ Obl _ => y5;
|
||||||
|
P Pl _ Voc _ => y6
|
||||||
|
};
|
||||||
|
};
|
||||||
|
-}
|
||||||
|
-- DemonPronForm = {s:DemPronForm => Str};
|
||||||
|
mkDemonPronForm : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16:Str) -> DemPronForm =
|
||||||
|
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16 -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => table {
|
||||||
|
Dir => y1 ;
|
||||||
|
Obl => y2 ;
|
||||||
|
Voc => y3 ;
|
||||||
|
Abl => y4
|
||||||
|
};
|
||||||
|
Fem => table {
|
||||||
|
Dir => y5 ;
|
||||||
|
Obl => y6 ;
|
||||||
|
Voc => y7 ;
|
||||||
|
Abl => y8
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Pl => table {
|
||||||
|
Masc => table {
|
||||||
|
Dir => y9 ;
|
||||||
|
Obl => y10 ;
|
||||||
|
Voc => y11 ;
|
||||||
|
Abl => y12
|
||||||
|
};
|
||||||
|
Fem => table {
|
||||||
|
Dir => y13 ;
|
||||||
|
Obl => y14 ;
|
||||||
|
Voc => y15 ;
|
||||||
|
Abl => y16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
makeDemonPronForm : Str -> Str -> Str -> DemPronForm ;
|
||||||
|
makeDemonPronForm yeh is inn = mkDemonPronForm yeh is "" yeh is "" yeh inn "" yeh inn "" "" "" "" "";
|
||||||
|
-- makePossPronForm myra myry hmara hmary = mkDemonPronForm myra myra myra myry myry myry hmara hmara hmara hmary hmary hmary;
|
||||||
|
{-
|
||||||
|
|
||||||
|
PersPron = {s: PersPronForm => Str};
|
||||||
|
|
||||||
|
mkPersPron:(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,x37,x38,x39,x40:Str) -> PersPron =
|
||||||
|
\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,y37,y38,y39,y40 -> {
|
||||||
|
s =
|
||||||
|
table {
|
||||||
|
PPF Sg Pers1 Dir => y1;
|
||||||
|
PPF Sg Pers1 Obl => y2;
|
||||||
|
PPF Sg Pers1 Voc => y3;
|
||||||
|
PPF Sg Pers1 Abl => y4;
|
||||||
|
PPF Sg Pers2_Casual Dir => y5;
|
||||||
|
PPF Sg Pers2_Casual Obl => y6;
|
||||||
|
PPF Sg Pers2_Casual Voc => y7;
|
||||||
|
PPF Sg Pers2_Casual Abl => y8;
|
||||||
|
PPF Sg Pers2_Respect Dir => y9;
|
||||||
|
PPF Sg Pers2_Respect Obl => y10;
|
||||||
|
PPF Sg Pers2_Respect Voc => y11;
|
||||||
|
PPF Sg Pers2_Respect Abl => y12;
|
||||||
|
PPF Sg Pers3_Near Dir => y13;
|
||||||
|
PPF Sg Pers3_Near Obl => y14;
|
||||||
|
PPF Sg Pers3_Near Voc => y15;
|
||||||
|
PPF Sg Pers3_Near Abl => y16;
|
||||||
|
PPF Sg Pers3_Distant Dir => y17;
|
||||||
|
PPF Sg Pers3_Distant Obl => y18;
|
||||||
|
PPF Sg Pers3_Distant Voc => y19;
|
||||||
|
PPF Sg Pers3_Distant Abl => y20;
|
||||||
|
PPF Pl Pers1 Dir => y21;
|
||||||
|
PPF Pl Pers1 Obl => y22;
|
||||||
|
PPF Pl Pers1 Voc => y23;
|
||||||
|
PPF Pl Pers1 Abl => y24;
|
||||||
|
PPF Pl Pers2_Casual Dir => y25;
|
||||||
|
PPF Pl Pers2_Casual Obl => y26;
|
||||||
|
PPF Pl Pers2_Casual Voc => y27;
|
||||||
|
PPF Pl Pers2_Casual Abl => y28;
|
||||||
|
PPF Pl Pers2_Respect Dir => y29;
|
||||||
|
PPF Pl Pers2_Respect Obl => y30;
|
||||||
|
PPF Pl Pers2_Respect Voc => y31;
|
||||||
|
PPF Pl Pers2_Respect Abl => y32;
|
||||||
|
PPF Pl Pers3_Near Dir => y33;
|
||||||
|
PPF Pl Pers3_Near Obl => y34;
|
||||||
|
PPF Pl Pers3_Near Voc => y35;
|
||||||
|
PPF Pl Pers3_Near Abl => y36;
|
||||||
|
PPF Pl Pers3_Distant Dir => y37;
|
||||||
|
PPF Pl Pers3_Distant Obl => y38;
|
||||||
|
PPF Pl Pers3_Distant Voc => y39;
|
||||||
|
PPF Pl Pers3_Distant Abl => y40
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
makePersPron : PersPron;
|
||||||
|
makePersPron = mkPersPron "میں" "" "" "میتوں"
|
||||||
|
"توں" "" "" "تیتوں"
|
||||||
|
"تسی" "" "" "تواتوں"
|
||||||
|
"او" "" "" "او"
|
||||||
|
"او" "" "" "او"
|
||||||
|
"اسی" "" "" "ساتوں"
|
||||||
|
"تسی" "" "" "تواتوں"
|
||||||
|
"تسی" "" "" "تواتوں"
|
||||||
|
"او" "" "" "او"
|
||||||
|
"او" "" "" "او";
|
||||||
|
-}
|
||||||
|
|
||||||
|
mkPron : (x1,x2,x3,x4:Str) -> {s:Case => Str} =
|
||||||
|
\y1,y2,y3,y4 -> { s =
|
||||||
|
table {
|
||||||
|
Dir => y1;
|
||||||
|
Obl => y2;
|
||||||
|
Voc => y3;
|
||||||
|
Abl => y4
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
------- PossPronForm yet to be implemented
|
||||||
|
|
||||||
|
|
||||||
|
-- IntPronForm = {s:InterrPronForm => Str};
|
||||||
|
IntPronForm = {s: Case => Str};
|
||||||
|
mkIntPronForm : (x1,x2,x3,x4:Str) -> IntPronForm =
|
||||||
|
\y1,y2,y3,y4 -> {
|
||||||
|
s =
|
||||||
|
table {
|
||||||
|
Dir => y1;
|
||||||
|
Obl => y2;
|
||||||
|
Voc => y3;
|
||||||
|
Abl => y4
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
----2 Adjectives
|
||||||
|
-- defined in ResPnb
|
||||||
|
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
----Verbs
|
----Verbs
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
@@ -125,10 +293,10 @@ resource MorphoPnb = Cat ** open ResPnb, Prelude, Predef in {
|
|||||||
--1. Basic stem form, direct & indirect causatives exists
|
--1. Basic stem form, direct & indirect causatives exists
|
||||||
-- v1 nechna nechaana nechwana
|
-- v1 nechna nechaana nechwana
|
||||||
|
|
||||||
mkV1 : (_,_,_: Str) -> Verb1 = \inf, c1, c2 ->
|
mkVerb : (_: Str) -> Verb = \inf ->
|
||||||
let root = (tk 2 inf) ;
|
let root = (tk 2 inf) ;
|
||||||
root1 = (tk 2 c1) ;
|
-- root1 = (tk 2 c1) ;
|
||||||
root2 = (tk 2 c2) ;
|
-- root2 = (tk 2 c2) ;
|
||||||
in {
|
in {
|
||||||
s = table {
|
s = table {
|
||||||
|
|
||||||
@@ -139,7 +307,7 @@ resource MorphoPnb = Cat ** open ResPnb, Prelude, Predef in {
|
|||||||
Inf_Obl => (tk 1 inf) ;
|
Inf_Obl => (tk 1 inf) ;
|
||||||
Ablative => ((tk 1 inf) + "وں") ;
|
Ablative => ((tk 1 inf) + "وں") ;
|
||||||
|
|
||||||
Caus1_Inf => c1 ;
|
{- Caus1_Inf => c1 ;
|
||||||
Caus1_Fem => ((tk 1 c1) + "ی") ;
|
Caus1_Fem => ((tk 1 c1) + "ی") ;
|
||||||
Caus1_Obl => (tk 1 c1) ;
|
Caus1_Obl => (tk 1 c1) ;
|
||||||
Caus1_Ablative => ((tk 1 c1) + "وں") ;
|
Caus1_Ablative => ((tk 1 c1) + "وں") ;
|
||||||
@@ -148,22 +316,22 @@ resource MorphoPnb = Cat ** open ResPnb, Prelude, Predef in {
|
|||||||
Caus2_Fem => ((tk 1 c2) + "ی") ;
|
Caus2_Fem => ((tk 1 c2) + "ی") ;
|
||||||
Caus2_Obl => (tk 1 c2) ;
|
Caus2_Obl => (tk 1 c2) ;
|
||||||
Caus2_Ablative => ((tk 1 c2) + "وں") ;
|
Caus2_Ablative => ((tk 1 c2) + "وں") ;
|
||||||
|
-}
|
||||||
MVF1 tense person number gender => (mkCmnVF root tense person number gender).s ;
|
VF tense person number gender => (mkCmnVF root tense person number gender).s
|
||||||
Caus1 tense person number gender => (mkCmnVF root1 tense person number gender).s ;
|
-- Caus1 tense person number gender => (mkCmnVF root1 tense person number gender).s ;
|
||||||
Caus2 tense person number gender => (mkCmnVF root2 tense person number gender).s
|
-- Caus2 tense person number gender => (mkCmnVF root2 tense person number gender).s
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
mkCmnVF : Str -> Tense -> Person -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
mkCmnVF : Str -> VTense -> PPerson -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
||||||
{s = case (last root) of {
|
{s = case (last root) of {
|
||||||
("ا"|"آ"|"و"|"ی") => (mkCmnVF1 root t p n g).s ;
|
("ا"|"آ"|"و"|"ی") => (mkCmnVF1 root t p n g).s ;
|
||||||
_ => (mkCmnVF2 root t p n g).s
|
_ => (mkCmnVF2 root t p n g).s
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
mkCmnVF1 : Str -> Tense -> Person -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
mkCmnVF1 : Str -> VTense -> PPerson -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
||||||
{s = let nadaa = root + "ندا" ; --root + variants{"ندا";"وندا"};
|
{s = let nadaa = root + "ندا" ; --root + variants{"ندا";"وندا"};
|
||||||
nadii = root + "ندی" ; --root + variants{"ندی";"وندی"} ;
|
nadii = root + "ندی" ; --root + variants{"ندی";"وندی"} ;
|
||||||
nade = root + "ندے" ; --root + variants{"ندے";"وندے"} ;
|
nade = root + "ندے" ; --root + variants{"ندے";"وندے"} ;
|
||||||
@@ -214,7 +382,7 @@ mkCmnVF : Str -> Tense -> Person -> Number -> Gender -> {s:Str}= \root,t,p,n,g -
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
mkCmnVF2 : Str -> Tense -> Person -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
mkCmnVF2 : Str -> VTense -> PPerson -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
||||||
{s = let daa = root + "دا" ;
|
{s = let daa = root + "دا" ;
|
||||||
dii = root + "دی" ;
|
dii = root + "دی" ;
|
||||||
de = root + "دے" ;
|
de = root + "دے" ;
|
||||||
@@ -266,10 +434,10 @@ mkCmnVF : Str -> Tense -> Person -> Number -> Gender -> {s:Str}= \root,t,p,n,g -
|
|||||||
|
|
||||||
|
|
||||||
--v4
|
--v4
|
||||||
mkV4 : Str -> Verb4 = \inf ->
|
{- mkV4 : Str -> Verb4 = \inf ->
|
||||||
let root = (tk 2 inf);
|
let root = (tk 2 inf);
|
||||||
in { s = table {
|
in { s = table {
|
||||||
Root4 => root ;
|
Root => root ;
|
||||||
|
|
||||||
Inf4 => inf ;
|
Inf4 => inf ;
|
||||||
Inf_Fem4 => ((tk 1 inf) + "ی") ;
|
Inf_Fem4 => ((tk 1 inf) + "ی") ;
|
||||||
@@ -279,206 +447,5 @@ mkCmnVF : Str -> Tense -> Person -> Number -> Gender -> {s:Str}= \root,t,p,n,g -
|
|||||||
MVF4 tense person number gender => (mkCmnVF root tense person number gender).s
|
MVF4 tense person number gender => (mkCmnVF root tense person number gender).s
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
mkPN : Str -> {s:Str} = \x -> {s = x};
|
|
||||||
mkAdj3 : Str -> {s:Str} = \x -> {s = x};
|
|
||||||
mkAdv : Str -> {s:Str} = \x -> {s = x};
|
|
||||||
|
|
||||||
mkAdj1 : Str -> Adjective1 ;
|
|
||||||
mkAdj1 piilaa = let end = last (piilaa) ;
|
|
||||||
piil = if_then_else Str (eq end "ع") piilaa (tk 1 piilaa)
|
|
||||||
in adj1 (piilaa) (piil+"ے") (variants{piil+"یا"; piil+"ے"}) (piil+"یوں") (piil+"ے") (piil+"یاں") (piil+"یو") ""
|
|
||||||
(piil++"ی") (piil++"ی") (variants{piil+"ی" ; piil+"یے"}) (piil+"یوں") (piil++"ی") (piil++"یاں") (piil++"یو") "" ;
|
|
||||||
|
|
||||||
adj1 :(x1,_,_,_,_,_,_, _,_,_,_,_,_,_,_, x16 : Str) -> {s : Gender => Number => Case => Str} =
|
|
||||||
\msd,mso,msv,msa, mpd,mpo,mpv,mpa, fsd,fso,fsv,fsa, fpd,fpo,fpv,fpa -> {
|
|
||||||
s = table {
|
|
||||||
Masc => (cmnAdj msd mso msv msa mpd mpo mpv mpa).s ;
|
|
||||||
Fem => (cmnAdj fsd fso fsv fsa fpd fpo fpv fpa).s
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
mkAdj2 : Str -> Adjective2 ;
|
|
||||||
mkAdj2 romii = cmnAdj romii romii (romii+"ا") (romii+"یوں")
|
|
||||||
romii (romii++"اں") (romii++"و") "" ;
|
|
||||||
|
|
||||||
cmnAdj : (x1,_,_,_,_,_,_,x8 : Str) -> {s : Number => Case => Str} =
|
|
||||||
\sd,so,sv,sa, pd,po,pv,pa -> {
|
|
||||||
s = table {
|
|
||||||
Sg => table {
|
|
||||||
Dir => sd ;
|
|
||||||
Obl => so ;
|
|
||||||
Voc => sv ;
|
|
||||||
Abl => sa
|
|
||||||
} ;
|
|
||||||
Pl => table {
|
|
||||||
Dir => pd ;
|
|
||||||
Obl => po ;
|
|
||||||
Voc => pv ;
|
|
||||||
Abl => pa
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{-
|
|
||||||
|
|
||||||
|
|
||||||
----2 Determiners
|
|
||||||
IDeterminer = {s:Gender => Str ; n : Number};
|
|
||||||
makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> {
|
|
||||||
s = table {
|
|
||||||
Sg => table {
|
|
||||||
Masc => s1 ;
|
|
||||||
Fem => s2
|
|
||||||
} ;
|
|
||||||
Pl => table {
|
|
||||||
Masc => s3 ;
|
|
||||||
Fem => s4
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
n = n
|
|
||||||
};
|
|
||||||
|
|
||||||
makeIDet : Str -> Str -> Number -> IDeterminer = \s1,s2,n -> {
|
|
||||||
s = table {
|
|
||||||
Masc => s1;
|
|
||||||
Fem => s2
|
|
||||||
};
|
|
||||||
n = n
|
|
||||||
};
|
|
||||||
|
|
||||||
-- Proposition
|
|
||||||
|
|
||||||
makePrep : Str -> Preposition = \str -> {s = str};
|
|
||||||
|
|
||||||
----2 Pronouns
|
|
||||||
PronForm = {s:Pronoun => Str};
|
|
||||||
makeDemPron : (x1,x2,x3,x4,x5,x6:Str) -> PronForm =
|
|
||||||
\y1,y2,y3,y4,y5,y6 -> {
|
|
||||||
s = table {
|
|
||||||
P Sg _ Dir _ => y1;
|
|
||||||
P Sg _ Obl _ => y2;
|
|
||||||
P Sg _ Voc _ => y3;
|
|
||||||
P Pl _ Dir _ => y4;
|
|
||||||
P Pl _ Obl _ => y5;
|
|
||||||
P Pl _ Voc _ => y6
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
-- DemonPronForm = {s:DemPronForm => Str};
|
|
||||||
mkDemonPronForm : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12:Str) -> DemPronForm =
|
|
||||||
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12 -> {
|
|
||||||
s = table {
|
|
||||||
Sg => table {
|
|
||||||
Masc => table {
|
|
||||||
Dir => y1 ;
|
|
||||||
Obl => y2 ;
|
|
||||||
Voc => y3
|
|
||||||
};
|
|
||||||
Fem => table {
|
|
||||||
Dir => y4 ;
|
|
||||||
Obl => y5 ;
|
|
||||||
Voc => y6
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Pl => table {
|
|
||||||
Masc => table {
|
|
||||||
Dir => y7 ;
|
|
||||||
Obl => y8 ;
|
|
||||||
Voc => y9
|
|
||||||
};
|
|
||||||
Fem => table {
|
|
||||||
Dir => y10 ;
|
|
||||||
Obl => y11 ;
|
|
||||||
Voc => y12
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
makeDemonPronForm : Str -> Str -> Str -> DemPronForm ;
|
|
||||||
makeDemonPronForm yeh is inn = mkDemonPronForm yeh is "" yeh is "" yeh inn "" yeh inn "";
|
|
||||||
-- makePossPronForm myra myry hmara hmary = mkDemonPronForm myra myra myra myry myry myry hmara hmara hmara hmary hmary hmary;
|
|
||||||
|
|
||||||
PersPron = {s: PersPronForm => Str};
|
|
||||||
|
|
||||||
mkPersPron:(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) -> PersPron =
|
|
||||||
\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 {
|
|
||||||
PPF Sg Pers1 Dir => y1;
|
|
||||||
PPF Sg Pers1 Obl => y2;
|
|
||||||
PPF Sg Pers1 Voc => y3;
|
|
||||||
PPF Sg Pers2_Casual Dir => y4;
|
|
||||||
PPF Sg Pers2_Casual Obl => y5;
|
|
||||||
PPF Sg Pers2_Casual Voc => y6;
|
|
||||||
PPF Sg Pers2_Familiar Dir => y7;
|
|
||||||
PPF Sg Pers2_Familiar Obl => y8;
|
|
||||||
PPF Sg Pers2_Familiar Voc => y9;
|
|
||||||
PPF Sg Pers2_Respect Dir => y10;
|
|
||||||
PPF Sg Pers2_Respect Obl => y11;
|
|
||||||
PPF Sg Pers2_Respect Voc => y12;
|
|
||||||
PPF Sg Pers3_Near Dir => y13;
|
|
||||||
PPF Sg Pers3_Near Obl => y14;
|
|
||||||
PPF Sg Pers3_Near Voc => y15;
|
|
||||||
PPF Sg Pers3_Distant Dir => y16;
|
|
||||||
PPF Sg Pers3_Distant Obl => y17;
|
|
||||||
PPF Sg Pers3_Distant Voc => y18;
|
|
||||||
PPF Pl Pers1 Dir => y19;
|
|
||||||
PPF Pl Pers1 Obl => y20;
|
|
||||||
PPF Pl Pers1 Voc => y21;
|
|
||||||
PPF Pl Pers2_Casual Dir => y22;
|
|
||||||
PPF Pl Pers2_Casual Obl => y23;
|
|
||||||
PPF Pl Pers2_Casual Voc => y24;
|
|
||||||
PPF Pl Pers2_Familiar Dir => y25;
|
|
||||||
PPF Pl Pers2_Familiar Obl => y26;
|
|
||||||
PPF Pl Pers2_Familiar Voc => y27;
|
|
||||||
PPF Pl Pers2_Respect Dir => y28;
|
|
||||||
PPF Pl Pers2_Respect Obl => y29;
|
|
||||||
PPF Pl Pers2_Respect Voc => y30;
|
|
||||||
PPF Pl Pers3_Near Dir => y31;
|
|
||||||
PPF Pl Pers3_Near Obl => y32;
|
|
||||||
PPF Pl Pers3_Near Voc => y33;
|
|
||||||
PPF Pl Pers3_Distant Dir => y34;
|
|
||||||
PPF Pl Pers3_Distant Obl => y35;
|
|
||||||
PPF Pl Pers3_Distant Voc => y36
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
makePersPron : PersPron;
|
|
||||||
makePersPron = mkPersPron "m(a)yN" "m(o)j'|h" "" "t(o)w " "t(o)j|h" "t(o)w " "t(o)m" "t(o)m" "t(o)m" "Ap" "Ap" "Ap" "y(i)h" "a(i)s" "" "w(o)h" "a(o)s" ""
|
|
||||||
"h(a)m" "h(a)m" "" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "Ap" "Ap" "Ap" "y(i)h" "a(i)n" "" "w(o)h" "a(o)n" "" ;
|
|
||||||
|
|
||||||
mkPron : (x1,x2,x3:Str) -> {s:Case => Str} =
|
|
||||||
\y1,y2,y3 -> { s =
|
|
||||||
table {
|
|
||||||
Dir => y1;
|
|
||||||
Obl => y2;
|
|
||||||
Voc => y3
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
------- PossPronForm yet to be implemented
|
|
||||||
|
|
||||||
-- IntPronForm = {s:InterrPronForm => Str};
|
|
||||||
IntPronForm = {s: Case => Str};
|
|
||||||
mkIntPronForm : (x1,x2,x3:Str) -> IntPronForm =
|
|
||||||
\y1,y2,y3 -> {
|
|
||||||
s =
|
|
||||||
|
|
||||||
|
|
||||||
table {
|
|
||||||
Dir => y1;
|
|
||||||
Obl => y2;
|
|
||||||
Voc => y3
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
}
|
||||||
138
lib/src/punjabi/NounPnb.gf
Normal file
138
lib/src/punjabi/NounPnb.gf
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
concrete NounPnb of Noun = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
DetCN det cn = {
|
||||||
|
s = \\c => detcn2NP det cn c det.n ;
|
||||||
|
a = agrP3 cn.g det.n ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UsePN pn = {s = \\c => toNP pn.s c ; a = agrP3 pn.g Sg ; isPron = False} ;
|
||||||
|
UsePron p = {s = \\c => np2pronCase p.s c p.a ; a = p.a ; isPron = True} ;
|
||||||
|
|
||||||
|
PredetNP pred np = {
|
||||||
|
s = \\c => pred.s ++ np.s ! c ;
|
||||||
|
a = np.a;
|
||||||
|
isPron = np.isPron
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PPartNP np v2 = {
|
||||||
|
s = \\c => v2.s ! VF Imperf Pers1 Sg Fem ++ np.s ! c ;
|
||||||
|
a = np.a ;
|
||||||
|
isPron = np.isPron
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelNP np rs = {
|
||||||
|
s = \\c => np.s ! c ++ rs.s ! np.a ;
|
||||||
|
a = np.a ;
|
||||||
|
isPron = np.isPron
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvNP np adv = {
|
||||||
|
s = \\c => np.s ! c ++ adv.s ! (fromAgr np.a).g ;
|
||||||
|
a = np.a ;
|
||||||
|
isPron = np.isPron
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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 ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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 = adn.s ++ num.s ; n = num.n} ;
|
||||||
|
|
||||||
|
OrdSuperl a = {s = a.s ! Sg ! Masc ! Dir ; 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 ; isPron = False} ;
|
||||||
|
|
||||||
|
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 ;
|
||||||
|
Abl => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c ;
|
||||||
|
ResPnb.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 ++ 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 ! cn.g ; 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} ;
|
||||||
|
|
||||||
|
}
|
||||||
126
lib/src/punjabi/NumeralPnb.gf
Normal file
126
lib/src/punjabi/NumeralPnb.gf
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
concrete NumeralPnb of Numeral = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
-- By Harald Hammarstroem
|
||||||
|
-- Modification for Punjabi by Shafqat Virk
|
||||||
|
flags coding=utf8 ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
param DForm = unit | ten ;
|
||||||
|
param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ;
|
||||||
|
param Size = singl | less100 | more100 ;
|
||||||
|
|
||||||
|
oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat Dig = { s:Str ; n : Number};
|
||||||
|
lincat Digit = LinDigit ;
|
||||||
|
lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ;
|
||||||
|
lincat Sub100 = {s : Str ; size : Size ; n : Number} ;
|
||||||
|
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ;
|
||||||
|
lincat Sub1000000 = { s : Str ; n : Number } ;
|
||||||
|
|
||||||
|
lin num x0 =
|
||||||
|
{s = table {
|
||||||
|
NCard => x0.s ;
|
||||||
|
NOrd => x0.s ++ "واں" -- (mkOrd x0.s) need to use mkOrd which will make irregular ordinals but it gives path error
|
||||||
|
};
|
||||||
|
n = x0.n
|
||||||
|
} ;
|
||||||
|
oper mkOrd : Str -> Str =
|
||||||
|
\s -> case s of {
|
||||||
|
"عك" => "پیلا";
|
||||||
|
"دو" => "دوجا";
|
||||||
|
"تن" => "دوجا";
|
||||||
|
"چار" => "چوتھا";
|
||||||
|
_ => s ++ "واں"
|
||||||
|
};
|
||||||
|
-- {s = \\_ => x0.s ; n = x0.n} ;
|
||||||
|
|
||||||
|
|
||||||
|
oper mkNum : Str -> Str -> DSize -> LinDigit =
|
||||||
|
\do -> \bis -> \sz ->
|
||||||
|
{s = table {unit => do ; ten => bis } ;
|
||||||
|
size = sz ; n = Pl} ;
|
||||||
|
|
||||||
|
lin n2 = mkNum "دو" "vی" r2 ;
|
||||||
|
lin n3 = mkNum "تن" "تری" r3 ;
|
||||||
|
lin n4 = mkNum "چار" "چالی" r4 ;
|
||||||
|
lin n5 = mkNum "پنج" "پنجاہ" r5 ;
|
||||||
|
lin n6 = mkNum "چh-" "سٹh-" r6 ;
|
||||||
|
lin n7 = mkNum "ست" "ستر" r7;
|
||||||
|
lin n8 = mkNum "اٹh-" "اسی" r8;
|
||||||
|
lin n9 = mkNum "نو" "نبے" r9 ;
|
||||||
|
|
||||||
|
oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table {
|
||||||
|
sg => a1 + "اں" ;
|
||||||
|
r2 => a2 + "ی" ;
|
||||||
|
r3 => a3 + "ی" ;
|
||||||
|
r4 => a4 + "الی" ;
|
||||||
|
r5 => a5 + "نجا" ;
|
||||||
|
r6 => a6 + "ٹھ" ;
|
||||||
|
r7 => a7 + "تر" ;
|
||||||
|
r8 => a8 + "اسی" ;
|
||||||
|
r9 => a9 + "انوے"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper rows : DSize => DSize => Str = table {
|
||||||
|
sg => mkR "گیار" "iكك" "iكت" "عكتا" "iكو" "iكا" "iكہ" "iك" "iكی" ;
|
||||||
|
r2 => mkR "بار" "با" "بت" "بای" "بی" "بو" "بہ" "بی" "ب" ;
|
||||||
|
r3 => mkR "تیر" "تی" "تیت" "تنت" "ترت" "ترو" "تیہ" "تیر" "تر" ;
|
||||||
|
r4 => mkR "چود" "چوب" "چوت" "چوا" "چوت" "چور" "چوہ" "چور" "چور" ;
|
||||||
|
r5 => mkR "پندر" "پنج" "پینت" "پنتا" "پچو" "پین" "پنج" "پنج" "پچ" ;
|
||||||
|
r6 => mkR "سول" "چھب" "چھت" "چh-ی" "چھو" "چھیا" "چھہ" "چھی" "چھی" ;
|
||||||
|
r7 => mkR "ستار" "ستا" "سینت" "سنت" "سنت" "ستو" "ست" "ست" "ست" ;
|
||||||
|
r8 => mkR "اٹھار" "اٹھا" "اٹھت" "اڑت" "اٹھو" "اٹھا" "اٹھ" "اٹھ" "اٹھ" ;
|
||||||
|
r9 => table {sg => "انی" ; r2 => "انتی" ; r3 => "انتالی" ;
|
||||||
|
r4 => "اناجا" ; r5 => "اناٹھ" ; r6 => "انہتر" ;
|
||||||
|
r7 => "اناسی" ;
|
||||||
|
r8 => "انانوے" ; r9 => "نڑینوے" }
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||||
|
|
||||||
|
lin pot01 = {s = table {unit => "اك" ; _ => "دuممی" } ; size = sg ; n = Sg} ;
|
||||||
|
lin pot0 d = d ;
|
||||||
|
lin pot110 = {s = "داس" ; size = less100 ; n = Pl} ;
|
||||||
|
lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ;
|
||||||
|
lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ;
|
||||||
|
lin pot0as1 n = {s = n.s ! unit ; size = table {sg => singl ; _ => less100} ! n.size ; n = n.n } ;
|
||||||
|
|
||||||
|
lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ;
|
||||||
|
lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ;
|
||||||
|
|
||||||
|
lin pot1as2 n = {s = n.s ; s2 = "دuممی" ; size = n.size ; n = n.n} ;
|
||||||
|
lin pot2 d = {s = (mksau (d.s ! unit) d.size) ;
|
||||||
|
s2 = d.s ! unit ++ "لكھ" ; size = more100 ; n = d.n} ;
|
||||||
|
lin pot2plus d e =
|
||||||
|
{s = (mksau (d.s ! unit) d.size) ++ e.s ;
|
||||||
|
s2 = (d.s ! unit) ++ "لكھ" ++ (mkhazar e.s e.size) ;
|
||||||
|
size = more100 ; n = d.n} ;
|
||||||
|
|
||||||
|
lin pot2as3 n = {s = n.s ; n = n.n} ;
|
||||||
|
lin pot3 n = {s = table { singl => ekhazar ;
|
||||||
|
less100 => n.s ++ "ہزار" ;
|
||||||
|
more100 => n.s2 } ! n.size ; n = n.n} ;
|
||||||
|
lin pot3plus n m =
|
||||||
|
{s = table {singl => ekhazar ;
|
||||||
|
less100 => n.s ++ "ہزار" ;
|
||||||
|
more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ;
|
||||||
|
|
||||||
|
lin D_0 = { s = "۰" ; n = Sg};
|
||||||
|
lin D_1 = { s = "۱" ; n = Sg};
|
||||||
|
lin D_2 = { s = "۲" ; n = Pl};
|
||||||
|
lin D_3 = { s = "۳" ; n = Pl};
|
||||||
|
lin D_4 = { s = "۴" ; n = Pl};
|
||||||
|
lin D_5 = { s = "۵" ; n = Pl};
|
||||||
|
lin D_6 = { s = "۶" ; n = Pl};
|
||||||
|
lin D_7 = { s = "۷" ; n = Pl};
|
||||||
|
lin D_8 = { s = "۸" ; n = Pl};
|
||||||
|
lin D_9 = { s = "۹" ; n = Pl};
|
||||||
|
lin IDig d = { s = \\_ => d.s ; n = d.n} ;
|
||||||
|
lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl };
|
||||||
|
|
||||||
|
oper ekhazar : Str = variants {"ہزار" ; "اك" ++ "ہزار"} ;
|
||||||
|
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "ہزار"} ! sz ;
|
||||||
|
oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "سو" ; _ => s ++ "سو"} ! sz ;
|
||||||
|
}
|
||||||
173
lib/src/punjabi/ParadigmsPnb.gf
Normal file
173
lib/src/punjabi/ParadigmsPnb.gf
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude:../common
|
||||||
|
--
|
||||||
|
----1 Pnbu Lexical Paradigms
|
||||||
|
|
||||||
|
resource ParadigmsPnb = open
|
||||||
|
Predef,
|
||||||
|
Prelude,
|
||||||
|
MorphoPnb,
|
||||||
|
CatPnb
|
||||||
|
in {
|
||||||
|
|
||||||
|
--2 Parameters
|
||||||
|
|
||||||
|
oper
|
||||||
|
masculine : Gender ;
|
||||||
|
feminine : Gender ;
|
||||||
|
singular : Number;
|
||||||
|
plural : Number;
|
||||||
|
|
||||||
|
singular = Sg ; plural = Pl;
|
||||||
|
|
||||||
|
masculine = Masc ; feminine = Fem ; --i
|
||||||
|
|
||||||
|
|
||||||
|
--2 Nouns
|
||||||
|
|
||||||
|
|
||||||
|
mkN2 : N -> Prep -> Str -> N2;
|
||||||
|
mkN2 = \n,p,c -> n ** {lock_N2 = <> ; c2 = p.s ; c3 = c } ;
|
||||||
|
|
||||||
|
mkN3 : N -> Prep -> Str -> Str-> N3 ;
|
||||||
|
mkN3 = \n,p,q,r -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q ; c4 = r} ;
|
||||||
|
|
||||||
|
-- Compound Nouns
|
||||||
|
|
||||||
|
mkCmpdNoun : Str -> N -> N
|
||||||
|
= \s,noun -> {s =\\n,c => s ++ noun.s ! n ! c ; g = noun.g ; lock_N = <>};
|
||||||
|
|
||||||
|
|
||||||
|
-- Proper names
|
||||||
|
mkPN : Str -> PN =
|
||||||
|
\s -> let n = mkN11 s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||||
|
-- Personal Pronouns
|
||||||
|
personalPN : Str -> Str -> Str -> Str -> Str -> Number -> Gender -> PPerson -> Pron =
|
||||||
|
\s1,s2,s3,s4,sp,nn,g,p -> let n = mkPron s1 s2 s3 s4 in {s = n.s ; a = toAgr nn p g ; ps = sp ; lock_Pron = <>};
|
||||||
|
-- Demonstration Pronouns
|
||||||
|
demoPN : Str -> Str -> Str -> Quant =
|
||||||
|
\s1,s2,s3 -> let n = makeDemonPronForm s1 s2 s3 in {s = n.s ; a = defaultAgr ; lock_Quant = <>};
|
||||||
|
-- Determiner
|
||||||
|
mkDet : Str -> Str -> Str -> Str -> Number -> Det =
|
||||||
|
\s1,s2,s3,s4,nb -> let dt = makeDet s1 s2 s3 s4 nb in {s = dt.s ; n = nb ; lock_Det = <>};
|
||||||
|
-- Intergative pronouns
|
||||||
|
mkIP : (x1,x2,x3,x4:Str) -> Number -> Gender -> IP =
|
||||||
|
\s1,s2,s3,s4,n,g -> let p = mkIntPronForm s1 s2 s3 s4 in { s = p.s ; n = n ; g = g ; lock_IP = <>};
|
||||||
|
|
||||||
|
-- AdN
|
||||||
|
mkAdN : Str -> AdN = \s -> ss s ;
|
||||||
|
|
||||||
|
--2 Adjectives
|
||||||
|
|
||||||
|
mkA = overload {
|
||||||
|
mkA : Str-> A
|
||||||
|
= \s -> mkAdj1 s ** {lock_A = <>} ;
|
||||||
|
mkA : Str -> Str -> A2
|
||||||
|
= \a,c -> let n = mkAdj1 a in {s = n.s; c2 = c} ** {lock_A2 = <>} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--2 Verbs
|
||||||
|
|
||||||
|
mkV : Str -> V
|
||||||
|
= \s -> mkVerb s ** {lock_V = <>} ;
|
||||||
|
|
||||||
|
mkV2 = overload {
|
||||||
|
mkV2 : Str -> V2
|
||||||
|
= \s -> mkVerb s ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ;
|
||||||
|
mkV2 : V -> V2
|
||||||
|
= \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ;
|
||||||
|
mkV2 : V -> Str -> V2
|
||||||
|
= \v,p -> v ** {c2 = {s = p ; c = VTrans} ; lock_V2 = <>} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkV3 : V -> Str -> Str -> V3;
|
||||||
|
mkV3 v p q = v ** { c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||||
|
mkV2V : V -> Str -> Str -> Bool -> V2V ;
|
||||||
|
mkV2V v s1 s2 b = v ** {isAux = b ; c1 = s1 ; c2 = s2 ; lock_V2V = <>} ;
|
||||||
|
|
||||||
|
-- compund verbs
|
||||||
|
compoundV = overload {
|
||||||
|
compoundV : Str -> V -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ;
|
||||||
|
compoundV : Str -> V2 -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
----2 Adverbs
|
||||||
|
mkAdv : Str -> Adv = \str -> {s =\\ _ => str ; lock_Adv = <>};
|
||||||
|
|
||||||
|
----2 Prepositions
|
||||||
|
|
||||||
|
mkPrep : Str -> Prep ;
|
||||||
|
mkPrep str = makePrep str ** {lock_Prep = <>};
|
||||||
|
|
||||||
|
--3 Determiners and quantifiers
|
||||||
|
|
||||||
|
-- mkQuant : overload {
|
||||||
|
mkQuant : Pron -> Quant ;
|
||||||
|
-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ;
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
-- mkQuant = overload {
|
||||||
|
mkQuant : Pron -> Quant = \p -> {s = \\_,_,c => p.s!c ;a = p.a ; lock_Quant = <>};
|
||||||
|
-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier;
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
--2 Conjunctions
|
||||||
|
mkConj : overload {
|
||||||
|
mkConj : Str -> Conj ; -- and (plural agreement)
|
||||||
|
mkConj : Str -> Number -> Conj ; -- or (agrement number given as argument)
|
||||||
|
mkConj : Str -> Str -> Conj ; -- both ... and (plural)
|
||||||
|
mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument)
|
||||||
|
} ;
|
||||||
|
mkConj = overload {
|
||||||
|
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ;
|
||||||
|
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ;
|
||||||
|
mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ;
|
||||||
|
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||||
|
lin Conj (sd2 x y ** {n = n}) ;
|
||||||
|
|
||||||
|
-- mkV0 : V -> V0 ;
|
||||||
|
-- mkVS : V -> VS ;
|
||||||
|
-- mkV2S : V -> Prep -> V2S ;
|
||||||
|
mkVV : V -> VV = \v -> lin VV (v ** {isAux = False});
|
||||||
|
|
||||||
|
|
||||||
|
-- mkV2V : V -> Prep -> Prep -> V2V ;
|
||||||
|
-- mkVA : V -> VA ;
|
||||||
|
-- mkV2A : V -> Prep -> V2A ;
|
||||||
|
-- mkVQ : V -> VQ ;
|
||||||
|
-- mkV2Q : V -> Prep -> V2Q ;
|
||||||
|
--
|
||||||
|
-- mkAS : A -> AS ;
|
||||||
|
-- mkA2S : A -> Prep -> A2S ;
|
||||||
|
-- mkAV : A -> AV ;
|
||||||
|
-- mkA2V : A -> Prep -> A2V ;
|
||||||
|
-- mkA2V a p = a ** {c2 = p.s } ;
|
||||||
|
--
|
||||||
|
---- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$.
|
||||||
|
---- $V0$ is just $V$; the second argument is treated as adverb.
|
||||||
|
--
|
||||||
|
-- V0 : Type ;
|
||||||
|
-- AS, A2S, AV, A2V : Type ;
|
||||||
|
--
|
||||||
|
----.
|
||||||
|
----2 Definitions of paradigms
|
||||||
|
----
|
||||||
|
---- The definitions should not bother the user of the API. So they are
|
||||||
|
---- hidden from the document.
|
||||||
|
--
|
||||||
|
-- Gender = MorphoHin.Gender ;
|
||||||
|
-- Number = MorphoHin.Number ;
|
||||||
|
-- Case = MorphoHin.Case ;
|
||||||
|
-- human = Masc ;
|
||||||
|
-- nonhuman = Neutr ;
|
||||||
|
-- masculine = Masc ;
|
||||||
|
-- feminine = Fem ;
|
||||||
|
-- singular = Sg ;
|
||||||
|
-- plural = Pl ;
|
||||||
|
-- nominative = Nom ;
|
||||||
|
-- genitive = Gen ;
|
||||||
|
|
||||||
|
}
|
||||||
27
lib/src/punjabi/PhrasePnb.gf
Normal file
27
lib/src/punjabi/PhrasePnb.gf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
concrete PhrasePnb of Phrase = CatPnb ** open Prelude, ResPnb 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} ;
|
||||||
|
|
||||||
|
NoPConj = {s = []} ;
|
||||||
|
PConjConj conj = {s = conj.s2} ; ---
|
||||||
|
|
||||||
|
NoVoc = {s = []} ;
|
||||||
|
VocNP np = {s = np.s ! NPC Dir} ;
|
||||||
|
|
||||||
|
}
|
||||||
75
lib/src/punjabi/QuestionPnb.gf
Normal file
75
lib/src/punjabi/QuestionPnb.gf
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
concrete QuestionPnb of Question = CatPnb ** open ResPnb, 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 => "اگر" ++ 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 ++ "نے"
|
||||||
|
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 ++ "نے"
|
||||||
|
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 ! ResPnb. Voc ++ p.s } ;
|
||||||
|
|
||||||
|
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 ! Dir) ;
|
||||||
|
AdvIAdv i a = {s = i.s ++ a.s ! Masc} ;
|
||||||
|
|
||||||
|
}
|
||||||
9
lib/src/punjabi/README
Normal file
9
lib/src/punjabi/README
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Some of the sources are transliterated, in
|
||||||
|
|
||||||
|
./src
|
||||||
|
|
||||||
|
Before compilation, do
|
||||||
|
|
||||||
|
gf -s <translit.gfs
|
||||||
|
|
||||||
|
to get unicode.
|
||||||
73
lib/src/punjabi/RelativePnb.gf
Normal file
73
lib/src/punjabi/RelativePnb.gf
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
concrete RelativePnb of Relative = CatPnb ** open ResPnb in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
RelCl cl = {
|
||||||
|
s = \\t,p,o,agr => case <t,giveNumber agr> of {
|
||||||
|
<VPImpPast,Sg> => "جس" ++ cl.s ! t ! p ! o ;
|
||||||
|
<VPImpPast,Pl> => "جن" ++ cl.s ! t ! p ! o ;
|
||||||
|
<_,_> => "جو" ++ cl.s ! t ! p ! o
|
||||||
|
};
|
||||||
|
c = Dir
|
||||||
|
} ;
|
||||||
|
-- RelVP and RelSlash slows the linking process a lot this is why it is commented for test purposes
|
||||||
|
|
||||||
|
{- 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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
---- Pied piping: "ات وہiچہ وع ارع لooكiنگ". Stranding and empty
|
||||||
|
---- relative are defined in $ExtraHin.gf$ ("تہات وع ارع لooكiنگ ات",
|
||||||
|
---- "وع ارع لooكiنگ ات").
|
||||||
|
--
|
||||||
|
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 ;
|
||||||
|
a = RAg np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdRP = {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
|
||||||
|
ResPnb.Dir => "جعڑا" ;
|
||||||
|
ResPnb.Obl => "جعڑے" ;
|
||||||
|
ResPnb.Voc => "جعڑے" ;
|
||||||
|
ResPnb.Abl => "جعڑے"
|
||||||
|
};
|
||||||
|
Pl => table {
|
||||||
|
ResPnb.Dir => "جعڑے" ;
|
||||||
|
ResPnb.Obl => "جعڑے" ;
|
||||||
|
ResPnb.Voc => "جعڑے" ;
|
||||||
|
ResPnb.Abl => "جعڑے"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
a = RNoAg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
634
lib/src/punjabi/ResPnb.gf
Normal file
634
lib/src/punjabi/ResPnb.gf
Normal file
@@ -0,0 +1,634 @@
|
|||||||
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
--
|
||||||
|
--1 Pnbu auxiliary operations.
|
||||||
|
--
|
||||||
|
-- This module contains operations that are needed to make the
|
||||||
|
-- resource syntax work.
|
||||||
|
|
||||||
|
resource ResPnb = ParamX ** open Prelude,Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
param
|
||||||
|
Case = Dir | Obl | Voc | Abl ;
|
||||||
|
Gender = Masc | Fem ;
|
||||||
|
VTense = Subj | Perf | Imperf;
|
||||||
|
PPerson = Pers1
|
||||||
|
| Pers2_Casual
|
||||||
|
| Pers2_Respect
|
||||||
|
| Pers3_Near
|
||||||
|
| Pers3_Distant;
|
||||||
|
|
||||||
|
Order = ODir | OQuest ;
|
||||||
|
|
||||||
|
--2 For $Relative$
|
||||||
|
|
||||||
|
RAgr = RNoAg | RAg Agr ;
|
||||||
|
RCase = RC Number Case ;
|
||||||
|
|
||||||
|
-- for Numerial
|
||||||
|
|
||||||
|
CardOrd = NCard | NOrd ;
|
||||||
|
|
||||||
|
-----------------------------------------
|
||||||
|
-- Punjabi Pronouns
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
Pronoun = P Number Gender Case PPerson;
|
||||||
|
PersPronForm = PPF Number PPerson Case;
|
||||||
|
|
||||||
|
-------------------------------------------
|
||||||
|
--Verbs
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
VerbForm4 =
|
||||||
|
VF VTense PPerson Number Gender
|
||||||
|
| Inf | Inf_Fem | Inf_Obl | Ablative
|
||||||
|
| Root ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
Noun = {s : Number => Case => Str ; g : Gender} ;
|
||||||
|
Verb = {s : VerbForm4 => Str} ;
|
||||||
|
Preposition = {s : 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)) ;
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
-- Pnb Adjectives
|
||||||
|
-----------------------------------------------
|
||||||
|
Adjective1 = {s : Number => Gender => Case => Str} ;
|
||||||
|
-- Adjective2 = {s : Number => Case => Str} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkAdj1 : Str -> Adjective1 ;
|
||||||
|
mkAdj1 piilaa = let end = last (piilaa) ;
|
||||||
|
piil = if_then_else Str (eq end "ع") piilaa (tk 1 piilaa)
|
||||||
|
in adj1 (piilaa) (piil+"ے") (variants{piil+"یا"; piil+"ے"}) (piil+"یوں") (piil+"ے") (piil+"یاں") (piil+"یو") ""
|
||||||
|
(piil+"ی") (piil+"ی") (variants{piil+"ی" ; piil+"یے"}) (piil+"یوں") (piil+"ی") (piil+"یاں") (piil+"یو") "" ;
|
||||||
|
|
||||||
|
adj1 :(x1,_,_,_,_,_,_, _,_,_,_,_,_,_,_, x16 : Str) -> {s : Number => Gender => Case => Str} =
|
||||||
|
\msd,mso,msv,msa, mpd,mpo,mpv,mpa, fsd,fso,fsv,fsa, fpd,fpo,fpv,fpa -> {
|
||||||
|
s = table {
|
||||||
|
Sg => (cmnAdj msd mso msv msa fsd fso fsv fsa).s ;
|
||||||
|
Pl => (cmnAdj mpd mpo mpv mpa fpd fpo fpv fpa).s
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- mkAdj2 : Str -> Adjective2 ;
|
||||||
|
-- mkAdj2 romii = cmnAdj romii romii (romii+"ا") (romii+"یوں")
|
||||||
|
-- romii (romii++"اں") (romii++"و") "" ;
|
||||||
|
|
||||||
|
cmnAdj : (x1,_,_,_,_,_,_,x8 : Str) -> {s : Gender => Case => Str} =
|
||||||
|
\sd,so,sv,sa, pd,po,pv,pa -> {
|
||||||
|
s = table {
|
||||||
|
Masc => table {
|
||||||
|
Dir => sd ;
|
||||||
|
Obl => so ;
|
||||||
|
Voc => sv ;
|
||||||
|
Abl => sa
|
||||||
|
} ;
|
||||||
|
Fem => table {
|
||||||
|
Dir => pd ;
|
||||||
|
Obl => po ;
|
||||||
|
Voc => pv ;
|
||||||
|
Abl => pa
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RefPron : Str;
|
||||||
|
RefPron = "خود";
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
-- Grammar part
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
param
|
||||||
|
Agr = Ag Gender Number PPerson ;
|
||||||
|
NPCase = NPC Case | NPObj | NPErg ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
np2pronCase : (Case => Str) -> NPCase -> Agr -> Str = \ppf,npc,a -> case npc of {
|
||||||
|
NPC c => ppf ! c;
|
||||||
|
NPObj => ppf ! Obl ;
|
||||||
|
NPErg => case (fromAgr a).p of {
|
||||||
|
(Pers3_Near|Pers3_Distant) => ppf ! Dir ++ "نے" ;
|
||||||
|
_ => ppf ! Dir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of {
|
||||||
|
NPC c => pn ! c ;
|
||||||
|
NPObj => pn ! Dir ;
|
||||||
|
NPErg => pn ! Obl ++ "نے"
|
||||||
|
} ;
|
||||||
|
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 ++ "نے"
|
||||||
|
} ;
|
||||||
|
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 ++ "نے"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
------------------------------------------
|
||||||
|
-- Agreement transformations
|
||||||
|
-----------------------------------------
|
||||||
|
toAgr : Number -> PPerson -> Gender -> Agr = \n,p,g ->
|
||||||
|
Ag g n p;
|
||||||
|
|
||||||
|
|
||||||
|
fromAgr : Agr -> {n : Number ; p : PPerson ; 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 ; isPron : Bool} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
CTense = CPresent | CPast | CFuture ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
copula : CTense -> Number -> PPerson -> Gender -> Str = \t,n,p,g ->
|
||||||
|
case <t,n,p,g> of {
|
||||||
|
<CPresent,Sg,Pers1,_ > => "واں" ;
|
||||||
|
<CPresent,Sg,Pers2_Casual,_ > => "ایں" ;
|
||||||
|
<CPresent,Sg,Pers2_Respect,_ > => "او" ;
|
||||||
|
<CPresent,Sg,_,_ > => "اے" ;
|
||||||
|
-- <CPresent,Sg,Pers3_Distant,_ > => "اے" ;
|
||||||
|
<CPresent,Pl,Pers1,_ > => "واں" ;
|
||||||
|
<CPresent,Pl,Pers2_Casual,_ > => "او" ;
|
||||||
|
<CPresent,Pl,Pers2_Respect,_ > => "او" ;
|
||||||
|
<CPresent,Pl,_,_ > => "نے" ;
|
||||||
|
-- <CPresent,Pl,Pers3_Distant,_ > => "نے" ;
|
||||||
|
<CPast,Sg,Pers1,_ > => "ساں" ;
|
||||||
|
-- <CPast,Sg,Pers2_Casual,Masc > => "سی" ;
|
||||||
|
<CPast,Sg,Pers2_Casual,_ > => "سیں" ;
|
||||||
|
<CPast,Sg,Pers2_Respect,_ > => "سو" ;
|
||||||
|
-- <CPast,Sg,Pers2_Respect,Fem > => "سیں" ;
|
||||||
|
<CPast,Sg,_,_ > => "سی" ;
|
||||||
|
-- <CPast,Sg,Pers3_Near,Fem > => "تh-ی" ;
|
||||||
|
-- <CPast,Sg,Pers3_Distant,_ > => "سی" ;
|
||||||
|
-- <CPast,Sg,Pers3_Distant,Fem > => "تh-ی" ;
|
||||||
|
<CPast,Pl,Pers1,_ > => "ساں" ;
|
||||||
|
<CPast,Pl,Pers2_Casual,_ > => "سو" ;
|
||||||
|
<CPast,Pl,Pers2_Respect,_ > => "سو" ;
|
||||||
|
<CPast,Pl,_,_ > => "سں" ;
|
||||||
|
-- <CPast,Pl,Pers3_Distant,_ > => "سن" ;
|
||||||
|
<CFuture,Sg,Pers1,Masc > => "گا" ;
|
||||||
|
<CFuture,Sg,Pers1,Fem > => "گی" ;
|
||||||
|
<CFuture,Sg,Pers2_Casual,Masc > => "گا" ;
|
||||||
|
<CFuture,Sg,Pers2_Casual,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_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 > => "گیاں"
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
VPPTense =
|
||||||
|
VPPres
|
||||||
|
|VPPast
|
||||||
|
|VPFutr
|
||||||
|
|VPPerf;
|
||||||
|
|
||||||
|
VPHTense =
|
||||||
|
VPGenPres -- impf hum nahim "I گo"
|
||||||
|
| VPImpPast -- impf Ta nahim "I وعنت"
|
||||||
|
| VPFut -- fut na/nahim "I سہالل گo"
|
||||||
|
| VPContPres -- stem raha hum nahim "I ام گoiنگ"
|
||||||
|
| VPContPast -- stem raha Ta nahim "I واس گoiنگ"
|
||||||
|
| VPContFut
|
||||||
|
| VPPerfPres -- perf hum na/nahim "I ہاvع گoنع"
|
||||||
|
| VPPerfPast -- perf Ta na/nahim "I ہاد گoنع"
|
||||||
|
| VPPerfFut
|
||||||
|
| VPPerfPresCont
|
||||||
|
| VPPerfPastCont
|
||||||
|
| VPPerfFutCont
|
||||||
|
| VPSubj -- subj na "I مای گo"
|
||||||
|
;
|
||||||
|
|
||||||
|
VPHForm =
|
||||||
|
VPTense VPPTense Agr -- 9 * 12
|
||||||
|
| VPReq
|
||||||
|
| VPImp
|
||||||
|
| VPReqFut
|
||||||
|
| VPInf
|
||||||
|
| VPStem
|
||||||
|
;
|
||||||
|
|
||||||
|
VType = VIntrans | VTrans | VTransPost ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
objVType : VType -> NPCase = \vt -> case vt of {
|
||||||
|
VTrans => NPObj ;
|
||||||
|
_ => NPC Obl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPH : Type = {
|
||||||
|
s : VPHForm => {fin, inf : Str} ;
|
||||||
|
obj : {s : Str ; a : Agr} ;
|
||||||
|
subj : VType ;
|
||||||
|
comp : Agr => Str;
|
||||||
|
inf : Str;
|
||||||
|
ad : Str;
|
||||||
|
embComp : Str ;
|
||||||
|
prog : Bool ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPHSlash = VPH ** {c2 : Compl} ;
|
||||||
|
|
||||||
|
Compl : Type = {s : Str ; c : VType} ;
|
||||||
|
|
||||||
|
predV : Verb -> VPH = \verb -> {
|
||||||
|
s = \\vh =>
|
||||||
|
case vh of {
|
||||||
|
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = verb.s ! VF Imperf p n g } ;
|
||||||
|
VPTense VPPast (Ag g n p) => {fin = [] ; inf =verb.s ! VF Perf p n g} ;
|
||||||
|
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = verb.s ! VF Subj p n g } ;
|
||||||
|
VPTense VPPerf (Ag g n p) => { fin = [] ; inf = verb.s ! Root ++ cka g n } ;
|
||||||
|
VPStem => {fin = [] ; inf = verb.s ! Root};
|
||||||
|
_ => {fin = [] ; inf = verb.s ! Root}
|
||||||
|
};
|
||||||
|
obj = {s = [] ; a = defaultAgr} ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.s ! Inf;
|
||||||
|
ad = [];
|
||||||
|
embComp = [];
|
||||||
|
prog = False ;
|
||||||
|
comp = \\_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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} } ;
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
raha : Gender -> Number -> Str = \g,n ->
|
||||||
|
(mkAdj1 "ریا").s ! n ! g ! Dir ;
|
||||||
|
pya : Gender -> Number -> Str = \g,n ->
|
||||||
|
(mkAdj1 "پیا").s ! n ! g ! Dir ;
|
||||||
|
|
||||||
|
cka : Gender -> Number -> Str = \g,n ->
|
||||||
|
(mkAdj1 "چكا").s ! n ! g ! Dir ;
|
||||||
|
|
||||||
|
hw : PPerson -> Number -> Str = \pp,n ->
|
||||||
|
case <pp,n> of {
|
||||||
|
<Pers1,_> => "ہوواں";
|
||||||
|
<Pers2_Casual,Sg> => "ہوویں";
|
||||||
|
<Pers2_Casual,Pl> => "ہوو";
|
||||||
|
<Pers2_Respect,_> => "ہوو";
|
||||||
|
<Pers3_Distant,Sg> => "ہووے";
|
||||||
|
<Pers3_Distant,Pl> => "ہون";
|
||||||
|
<Pers3_Near,Sg> => "ہووے";
|
||||||
|
<Pers3_Near,Pl> => "ہون"
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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 = "رہ" };
|
||||||
|
_ => {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!VPTense VPPres (Ag g n p)).inf ++ pya g n} ;
|
||||||
|
VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = (verb.s!VPTense VPPres (Ag g n p)).inf ++ pya g n} ;
|
||||||
|
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = (verb.s!VPTense VPPres (Ag g n p)).inf } ;
|
||||||
|
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 } ;
|
||||||
|
-- {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 } ;
|
||||||
|
{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 = "شاید" } ;
|
||||||
|
_ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "شاید" } }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "كی" };
|
||||||
|
na =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "نا" };
|
||||||
|
nahim =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "نیں" };
|
||||||
|
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 ++ pya g n } ;
|
||||||
|
VPContPast =>
|
||||||
|
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ pya g n } ;
|
||||||
|
VPContFut =>
|
||||||
|
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ pya 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 ++ pya g n } ;
|
||||||
|
VPPerfPastCont =>
|
||||||
|
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ pya g n } ;
|
||||||
|
VPPerfFutCont =>
|
||||||
|
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ pya g n ++ hw p n } ;
|
||||||
|
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "ژاید" }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "كی" };
|
||||||
|
na =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "نا" };
|
||||||
|
nahim =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "نیں" };
|
||||||
|
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 : PPerson -> Str -> Str = \p,s ->
|
||||||
|
case p of { Pers1 => s ++ "وں" ; _ => s ++ "ے"};
|
||||||
|
|
||||||
|
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 -> VPH = \obj1,vp,emb,vp2 -> {
|
||||||
|
s = vp.s ;
|
||||||
|
-- obj = vp.obj ;
|
||||||
|
obj = vp2.obj ;
|
||||||
|
subj = vp.subj ;
|
||||||
|
inf = vp.inf;
|
||||||
|
ad = vp.ad;
|
||||||
|
embComp = vp.embComp ++ emb; -- this should be covered in urdu as well
|
||||||
|
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.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin }; -- need to be checked and should be covered in urdu as well
|
||||||
|
case isAux of {False => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin }; -- need to be checked and should be covered in urdu as well
|
||||||
|
infV2V : 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 ++ "دی"}; -- need to be checked and should be covered in urdu as well
|
||||||
|
case isAux of {False => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ++ "دی" ; True => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ "دی"}; -- need to be checked and should be covered in urdu as well
|
||||||
|
|
||||||
|
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||||
|
s = vps.s ;
|
||||||
|
obj = case np.isPron of {
|
||||||
|
False => {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ;
|
||||||
|
_ => {s = vps.obj.s ++ np.s ! objVType vps.c2.c ; 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 = "كہ" ;
|
||||||
|
checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of {
|
||||||
|
True => np.s ! NPC Obl;
|
||||||
|
False => np.s ! NPC Obl ++ str} ;
|
||||||
|
|
||||||
|
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 = case vtype of {VIntrans => VTransPost ; VTrans => VTrans ; _ => vtype} ; -- still some problem not working properly
|
||||||
|
ad = vp.ad;
|
||||||
|
embComp = vp.embComp ;
|
||||||
|
prog = vp.prog ;
|
||||||
|
comp = vp.comp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
103
lib/src/punjabi/SentencePnb.gf
Normal file
103
lib/src/punjabi/SentencePnb.gf
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
concrete SentencePnb of Sentence = CatPnb ** open Prelude, ResPnb 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 => "مت" ;
|
||||||
|
CNeg False => "نہ" ;
|
||||||
|
_ => []
|
||||||
|
}
|
||||||
|
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 ; 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 ResPnb
|
||||||
|
|
||||||
|
};
|
||||||
|
} ;
|
||||||
|
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};
|
||||||
|
|
||||||
|
}
|
||||||
130
lib/src/punjabi/StructuralPnb.gf
Normal file
130
lib/src/punjabi/StructuralPnb.gf
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
concrete StructuralPnb of Structural = CatPnb **
|
||||||
|
open MorphoPnb, ParadigmsPnb, Prelude, NounPnb in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
above_Prep = ss "اتے" ;
|
||||||
|
after_Prep = ss "توں بعد" ;
|
||||||
|
all_Predet = ss "سارے" ;
|
||||||
|
almost_AdA, almost_AdN = ss "تقریبا" ;
|
||||||
|
although_Subj = ss "پاویں" ;
|
||||||
|
always_AdV = ss "ہمیشہ" ;
|
||||||
|
and_Conj = sd2 [] "تے" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "كیونكھ" ;
|
||||||
|
before_Prep = ss "پلے" ;
|
||||||
|
behind_Prep = ss "پیچھے" ;
|
||||||
|
between_Prep = ss "وچكار" ;
|
||||||
|
both7and_DConj = sd2 "دوویں" "تے" ** {n = Pl} ;
|
||||||
|
but_PConj = ss "لیكن" ;
|
||||||
|
by8agent_Prep = ss "" ;
|
||||||
|
by8means_Prep = ss "" ;
|
||||||
|
can8know_VV,can_VV = mkV "سكنا" ** { isAux = True} ;
|
||||||
|
during_Prep = ss ["دے وچ"] ;
|
||||||
|
either7or_DConj = sd2 "كوی اك" "یا" ** {n = Sg} ;
|
||||||
|
everybody_NP = MassNP (UseN (MorphoPnb.mkN11 "ہر كوی")); -- not a good way coz need to include NounPnb
|
||||||
|
every_Det = mkDet "ہر" "ہر" "ہر" "ہر" Sg;
|
||||||
|
everything_NP = MassNP (UseN (MorphoPnb.mkN11 "ہر شے"));
|
||||||
|
everywhere_Adv = mkAdv "ہر تھاں" ;
|
||||||
|
few_Det = mkDet "كچھ" "كچھ" "كچھ" "كچھ" Pl ;
|
||||||
|
first_Ord = {s = "پعہلا" ; n = Sg} ; --DEPRECATED
|
||||||
|
for_Prep = ss "[دے واسطE]" ;
|
||||||
|
from_Prep = ss "توں" ;
|
||||||
|
he_Pron = personalPN "او" "اینوں" "او" "" "اورا" Sg Masc Pers3_Distant ;
|
||||||
|
here_Adv = mkAdv "ایتھے" ;
|
||||||
|
here7to_Adv = mkAdv "ایتھے" ;
|
||||||
|
here7from_Adv = mkAdv "ایتھوں" ;
|
||||||
|
how_IAdv = ss "كسراں" ;
|
||||||
|
how8many_IDet = makeIDet "كینے" "كینی" Pl ;
|
||||||
|
how8much_IAdv = ss "كینا" ;
|
||||||
|
if_Subj = ss "اگر" ;
|
||||||
|
in8front_Prep = ss ["دے سامنے"] ;
|
||||||
|
i_Pron = personalPN "میں" "مینوں" "مینوں" "میتوں" "میرا" Sg Masc Pers1;
|
||||||
|
in_Prep = ss "وچ" ;
|
||||||
|
it_Pron = personalPN "اے" "اینوں" "اینوں" "" "ایرا" Sg Masc Pers3_Near;
|
||||||
|
less_CAdv = {s = "كٹ" ; p = ""} ;
|
||||||
|
many_Det = mkDet "بہت زیادہ" "بہت زیادہ" "بہت زیادہ" "بہت زیادہ" Pl ;
|
||||||
|
more_CAdv = {s = "ہور" ; p = "" } ;
|
||||||
|
most_Predet = ss "زیادہ تر" ;
|
||||||
|
much_Det = mkDet "بہت" "بہت" "بہت" "بہت" Sg ;
|
||||||
|
-- must_VV = {
|
||||||
|
-- s = table {
|
||||||
|
-- VVF VInf => ["ہاvع تo"] ;
|
||||||
|
-- VVF VPres => "مuست" ;
|
||||||
|
-- VVF VPPart => ["ہاد تo"] ;
|
||||||
|
-- VVF VPresPart => ["ہاviنگ تo"] ;
|
||||||
|
-- VVF VPast => ["ہاد تo"] ; --# notpresent
|
||||||
|
-- VVPastNeg => ["ہادn'ت تo"] ; --# notpresent
|
||||||
|
-- VVPresNeg => "مuستn'ت"
|
||||||
|
-- } ;
|
||||||
|
-- isAux = True
|
||||||
|
-- } ;
|
||||||
|
-----b no_Phr = ss "نo" ;
|
||||||
|
no_Utt = ss "نیں" ;
|
||||||
|
on_Prep = ss "اتے" ;
|
||||||
|
one_Quant = demoPN "اك" "اك" "اك" ; -- DEPRECATED
|
||||||
|
only_Predet = ss "سرف" ;
|
||||||
|
or_Conj = sd2 [] "یا" ** {n = Sg} ;
|
||||||
|
otherwise_PConj = ss "یا فیر" ;
|
||||||
|
part_Prep = ss "ہصہ" ;
|
||||||
|
please_Voc = ss "مہربانi" ;
|
||||||
|
possess_Prep = ss "دا" ;
|
||||||
|
quite_Adv = ss "كہامoسہ" ;
|
||||||
|
she_Pron = personalPN "او" "اونوں" "اونو" "" "اورا" Sg Fem Pers3_Distant ;
|
||||||
|
so_AdA = ss "سo" ;
|
||||||
|
somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "كوی" ));
|
||||||
|
someSg_Det = mkDet "كچھ" "كچھ" "كچھ" "كچھ" Sg ;
|
||||||
|
somePl_Det = mkDet "كچھ" "كچھ" "كچھ" "كچھ" Pl ;
|
||||||
|
something_NP = MassNP (UseN (MorphoPnb.mkN11 "كوی شے"));
|
||||||
|
somewhere_Adv = mkAdv "كتلے" ;
|
||||||
|
that_Quant = demoPN "وہ" "اس" "ان" ;
|
||||||
|
that_Subj = ss "كہ";
|
||||||
|
there_Adv = mkAdv "اوتھے" ;
|
||||||
|
there7to_Adv = mkAdv "اوتھے" ;
|
||||||
|
there7from_Adv = mkAdv "اوتھوں" ;
|
||||||
|
therefore_PConj = ss "اس لی" ;
|
||||||
|
they_Pron = personalPN "او" "[اوناں نوN]" "او" "" "اوناں دا" Pl Masc Pers3_Distant ; ----
|
||||||
|
this_Quant = demoPN "یہ" "اس" "ان";
|
||||||
|
through_Prep = ss "وچوں" ;
|
||||||
|
too_AdA = ss "بہت" ;
|
||||||
|
to_Prep = ss "اونوں" ** {lock_Prep = <>};
|
||||||
|
under_Prep = ss "تھلے" ** {lock_Prep = <>};
|
||||||
|
very_AdA = ss "بہت" ;
|
||||||
|
want_VV = mkV "چانا" ** { isAux = False} ;
|
||||||
|
we_Pron = personalPN "اسی" "سانوں" "سانوں" "ساتوں" "ساڈا" Pl Masc Pers1 ;
|
||||||
|
-- whatSg_IP = mkIP "كیا" "كiس" "كiس" Sg Masc ;
|
||||||
|
-- whatPl_IP = mkIP "كیا" "كiن" "كiن" Pl Masc ;
|
||||||
|
when_IAdv = ss "كدوں" ;
|
||||||
|
when_Subj = ss "كدوں" ;
|
||||||
|
where_IAdv = ss "كتھے" ;
|
||||||
|
which_IQuant = {s = \\_ => "كیڑی"} ;
|
||||||
|
-- whichPl_IDet = makeDet "كون سا" "كون سی" "كون سے" "كون سی" ;
|
||||||
|
-- whichSg_IDet = makeDet "كون سا" "كون سی" "كون سے" "كون سی" ;
|
||||||
|
-- whoSg_IP = mkIP "كون" "كiس" "كiس" Sg Masc ;
|
||||||
|
-- whoPl_IP = mkIP "كون" "كن" "كنہوں" Pl Masc ;
|
||||||
|
why_IAdv = ss "كیوں" ;
|
||||||
|
without_Prep = ss ["توں بغیر"] ;
|
||||||
|
with_Prep = ss ["دے نال"] ;
|
||||||
|
-- yes_Phr = ss "ہاں" ;
|
||||||
|
yes_Utt = ss "ہاں" ;
|
||||||
|
youSg_Pron = personalPN "توں" "تینوں" "تینوں" "تیتوں" "توواڈا" Sg Masc Pers2_Casual ;
|
||||||
|
youPl_Pron = personalPN "تسی" "توانوں" "توانوں" "تواتوں" "توواڈا" Pl Masc Pers2_Casual ;
|
||||||
|
youPol_Pron = personalPN "تسی" "توانوں" "توانوں" "تواتوں" "توواڈا" Sg Masc Pers2_Respect ;
|
||||||
|
no_Quant = demoPN " كوی نہیں" "كوی نہیں" "كوی نہیں" ;
|
||||||
|
not_Predet = {s="نہیں"} ;
|
||||||
|
if_then_Conj = sd2 "اگر" "تے" ** {n = Sg} ;
|
||||||
|
at_least_AdN = ss ["كم توں كم"] ;
|
||||||
|
at_most_AdN = ss ["زیادہ توں زیادہ"];
|
||||||
|
nothing_NP = MassNP (UseN (MorphoPnb.mkN11 "كچھ نیں" ));
|
||||||
|
except_Prep = ss "سواے" ;
|
||||||
|
nobody_NP = MassNP (UseN (MorphoPnb.mkN11 "كوی نہیں"));
|
||||||
|
|
||||||
|
as_CAdv = {s = "ایناں" ; p = "جناں"} ;
|
||||||
|
|
||||||
|
have_V2 = mkV2 (mkV "راكھنا") "" ;
|
||||||
|
|
||||||
|
language_title_Utt = ss "پنجابی" ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
47
lib/src/punjabi/SymbolPnb.gf
Normal file
47
lib/src/punjabi/SymbolPnb.gf
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
concrete SymbolPnb of Symbol = CatPnb ** open Prelude, ResPnb in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
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 ++ "واں" ; n = Pl} ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
|
||||||
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
MkSymb s = s ;
|
||||||
|
|
||||||
|
BaseSymb = infixSS "تے" ;
|
||||||
|
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 ++ "دا" } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
45
lib/src/punjabi/VerbPnb.gf
Normal file
45
lib/src/punjabi/VerbPnb.gf
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
concrete VerbPnb of Verb = CatPnb ** open ResPnb in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
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 (\\_ => checkPron np v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ;
|
||||||
|
|
||||||
|
-- ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp ) (predV v) vp.embComp) VTransPost;
|
||||||
|
-- ComplVV v vp = insertVV (infVV v.isAux vp ) (predV v) vp.embComp;
|
||||||
|
ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp) (predV v) vp.embComp vp) vp.subj;
|
||||||
|
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 ) (predV v) ;
|
||||||
|
SlashV2V v vp = insertVV (infV2V v.isAux vp) (predV v) vp.embComp vp **{c2 = {s = "توں" ; c = VTransPost}} ; -- should creat a form at VP level which can be used in VP like 'swn da kyna' also check the c=VTransPost it is correct in case if second v is intrasitive, but not if trans like begged me to ead bread
|
||||||
|
SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = "توں" ; c = VTransPost}}) ;
|
||||||
|
SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = "نوں" ; c = VTransPost}}) ; -- chek for VTransPost, as in this case , case should be ergative but agrement should be default
|
||||||
|
SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ) (predV v ** {c2 = {s = "نوں" ; 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 ! (fromAgr a).g) 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 } ;
|
||||||
|
CompNP np = {s = \\_ => np.s ! NPObj} ;
|
||||||
|
CompAdv adv = {s = \\a => adv.s ! (fromAgr a).g } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,217 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
||||||
<HTML>
|
|
||||||
<HEAD>
|
|
||||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
|
||||||
<LINK REL="stylesheet" TYPE="text/css" HREF="css/modernL.css">
|
|
||||||
<TITLE>Punjabi Resources in Shahmukhi script</TITLE>
|
|
||||||
</HEAD>
|
|
||||||
<BODY>
|
|
||||||
|
|
||||||
<DIV CLASS="header" ID="header">
|
|
||||||
<H1>Punjabi Resources in Shahmukhi script</H1>
|
|
||||||
<H2>2010</H2>
|
|
||||||
<H3>Muhammad Humayoun <humayoun{@}gmail.com></H3>
|
|
||||||
</DIV>
|
|
||||||
|
|
||||||
<DIV CLASS="toc" ID="toc">
|
|
||||||
<UL>
|
|
||||||
<LI><A HREF="#toc1">Introduction</A>
|
|
||||||
<LI><A HREF="#toc2">Resources</A>
|
|
||||||
<LI><A HREF="#toc3">Running Morphology</A>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
</DIV>
|
|
||||||
<DIV CLASS="body" ID="body">
|
|
||||||
<A NAME="toc1"></A>
|
|
||||||
<H1>Introduction</H1>
|
|
||||||
<P>
|
|
||||||
Welcome to the homepage of Punjabi resources in Shahmukhi script. These resources are reported in the following publication and made available under <A HREF="downloads/gpl.txt">GNU General Public License</A>.
|
|
||||||
</P>
|
|
||||||
<UL>
|
|
||||||
<LI>M. Humayoun and A. Ranta. <B>Developing Punjabi Morphology, Corpus and Lexicon.</B> <I>The 24th Pacific Asia conference on Language, Information and Computation</I> (<A HREF="http://www.compling.jp/paclic24/">http://www.compling.jp/paclic24/</A>). <A HREF="downloads/Punjabi-paper-paclic24.pdf">draft</A>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<A NAME="toc2"></A>
|
|
||||||
<H1>Resources</H1>
|
|
||||||
<UL>
|
|
||||||
<LI>An implementation of inflectional morphology for Punjabi in <A HREF="http://www.grammaticalframework.org/">GF</A>. <A HREF="morphology">Online browsing</A> or <A HREF="downloads/morphology.zip">download zip</A>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI>A corpus containing 0.9 million words (941,284), which is collected partly from Wikipedia. <A HREF="downloads/literature-wikipedia.corpus.sentence.uniq.sorted">view text</A> or <A HREF="downloads/literature-wikipedia.corpus.sentence.uniq.sorted.zip">download zip</A>
|
|
||||||
<P></P>
|
|
||||||
<LI>A lexicon of 13,600 words (named entities:63%, lemmas of inflected words:37%; a lemma is also known as a dictionary form or a base form) <A HREF="downloads/punjabi.shahmukhi.lexicon">view text</A> or <A HREF="downloads/punjabi.shahmukhi.lexicon.zip">download zip</A>. The paradigms are defined in the paper, but a detailed version with examples can be found <A HREF="downloads/Paradigms.pdf">here</A>.
|
|
||||||
<P></P>
|
|
||||||
<LI>Frequency list for Punjabi. <A HREF="downloads/literature-wikipedia.corpus.fqlist">view text</A> or <A HREF="downloads/literature-wikipedia.corpus.fqlist.zip">download zip</A>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<A NAME="toc3"></A>
|
|
||||||
<H1>Running Morphology</H1>
|
|
||||||
<P>
|
|
||||||
First you need to install <A HREF="http://www.grammaticalframework.org/download/index.html">Grammatical Framework (GF)</A> first.
|
|
||||||
Instructions to install could be found <A HREF="http://www.grammaticalframework.org/download/index.html">here</A>.
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
Now to run morphology, after unzipping <CODE>morphology.zip</CODE>, run following commands in console:
|
|
||||||
</P>
|
|
||||||
<PRE>
|
|
||||||
cd morphology
|
|
||||||
gf MainPnb.gf
|
|
||||||
ma "پینا"
|
|
||||||
</PRE>
|
|
||||||
<P></P>
|
|
||||||
<P>
|
|
||||||
where ma stands for morphological analysis and <CODE>MainPnb.gf</CODE> is the main file.
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
To see a complete paradigm do following:
|
|
||||||
</P>
|
|
||||||
<PRE>
|
|
||||||
gf MainPnb.gf
|
|
||||||
i -retain MorphoPnb.gf
|
|
||||||
cc mkAdj1 "بَھیڑا"
|
|
||||||
</PRE>
|
|
||||||
<P></P>
|
|
||||||
<P>
|
|
||||||
The result will be as followed:
|
|
||||||
</P>
|
|
||||||
<PRE>
|
|
||||||
variants {variants {{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑیا";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑی";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}};
|
|
||||||
{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑی";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}};
|
|
||||||
variants {{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑیا";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑیے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}};
|
|
||||||
{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑیے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}}}
|
|
||||||
</PRE>
|
|
||||||
<P></P>
|
|
||||||
<P>
|
|
||||||
Please send your feedback and suggestions at <I>humayoun{@}gmail.com</I>
|
|
||||||
</P>
|
|
||||||
<HR NOSHADE SIZE=1>
|
|
||||||
<P>
|
|
||||||
Last update: Tue Nov 2 19:01:42 2010
|
|
||||||
</P>
|
|
||||||
</DIV>
|
|
||||||
|
|
||||||
<!-- html code generated by txt2tags 2.5 (http://txt2tags.sf.net) -->
|
|
||||||
<!-- cmdline: txt2tags -t html -\-toc index.txt -->
|
|
||||||
</BODY></HTML>
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
Punjabi Resources in Shahmukhi script
|
|
||||||
2010
|
|
||||||
Muhammad Humayoun <humayoun{@}gmail.com>
|
|
||||||
|
|
||||||
%!target:html
|
|
||||||
%!options(html): --toc
|
|
||||||
%!options(html): --css-sugar --style css/modernL.css
|
|
||||||
%!encoding:utf-8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%%%%txt2tags -t html --toc index.txt
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
= Introduction =
|
|
||||||
|
|
||||||
Welcome to the homepage of Punjabi resources in Shahmukhi script. These resources are reported in the following publication and made available under [GNU General Public License downloads/gpl.txt].
|
|
||||||
|
|
||||||
- M. Humayoun and A. Ranta. **Developing Punjabi Morphology, Corpus and Lexicon.** //The 24th Pacific Asia conference on Language, Information and Computation// (http://www.compling.jp/paclic24/). [draft downloads/Punjabi-paper-paclic24.pdf]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
= Resources =
|
|
||||||
|
|
||||||
|
|
||||||
- An implementation of inflectional morphology for Punjabi in [GF http://www.grammaticalframework.org/]. [Online browsing morphology] or [download zip downloads/morphology.zip]
|
|
||||||
|
|
||||||
|
|
||||||
- A corpus containing 0.9 million words (941,284), which is collected partly from Wikipedia. [view text downloads/literature-wikipedia.corpus.sentence.uniq.sorted] or [download zip downloads/literature-wikipedia.corpus.sentence.uniq.sorted.zip]
|
|
||||||
|
|
||||||
- A lexicon of 13,600 words (named entities:63%, lemmas of inflected words:37%; a lemma is also known as a dictionary form or a base form) [view text downloads/punjabi.shahmukhi.lexicon] or [download zip downloads/punjabi.shahmukhi.lexicon.zip]. The paradigms are defined in the paper, but a detailed version with examples can be found [here downloads/Paradigms.pdf].
|
|
||||||
|
|
||||||
- Frequency list for Punjabi. [view text downloads/literature-wikipedia.corpus.fqlist] or [download zip downloads/literature-wikipedia.corpus.fqlist.zip]
|
|
||||||
|
|
||||||
|
|
||||||
= Running Morphology =
|
|
||||||
|
|
||||||
First you need to install [Grammatical Framework (GF) http://www.grammaticalframework.org/download/index.html] first.
|
|
||||||
Instructions to install could be found [here http://www.grammaticalframework.org/download/index.html].
|
|
||||||
|
|
||||||
Now to run morphology, after unzipping ``morphology.zip``, run following commands in console:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd morphology
|
|
||||||
gf MainPnb.gf
|
|
||||||
ma "پینا"
|
|
||||||
```
|
|
||||||
|
|
||||||
where ma stands for morphological analysis and ``MainPnb.gf`` is the main file.
|
|
||||||
|
|
||||||
|
|
||||||
To see a complete paradigm do following:
|
|
||||||
|
|
||||||
```
|
|
||||||
gf MainPnb.gf
|
|
||||||
i -retain MorphoPnb.gf
|
|
||||||
cc mkAdj1 "بَھیڑا"
|
|
||||||
```
|
|
||||||
|
|
||||||
The result will be as followed:
|
|
||||||
|
|
||||||
```
|
|
||||||
variants {variants {{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑیا";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑی";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}};
|
|
||||||
{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑی";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}};
|
|
||||||
variants {{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑیا";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑیے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}};
|
|
||||||
{s : ResPnb.Gender => ResPnb.Number => ResPnb.Case => Str
|
|
||||||
= table ResPnb.Gender {
|
|
||||||
ResPnb.Masc => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑا";
|
|
||||||
ResPnb.Obl => "بَھیڑے";
|
|
||||||
ResPnb.Voc => "بَھیڑے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑے";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ResPnb.Fem => table ResPnb.Number {
|
|
||||||
ResPnb.Sg => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑی";
|
|
||||||
ResPnb.Voc => "بَھیڑیے";
|
|
||||||
ResPnb.Abl => "بَھیڑیوں"
|
|
||||||
};
|
|
||||||
ResPnb.Pl => table ResPnb.Case {
|
|
||||||
ResPnb.Dir => "بَھیڑی";
|
|
||||||
ResPnb.Obl => "بَھیڑیاں";
|
|
||||||
ResPnb.Voc => "بَھیڑیو";
|
|
||||||
ResPnb.Abl => []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}}}
|
|
||||||
```
|
|
||||||
|
|
||||||
Please send your feedback and suggestions at //humayoun{@}gmail.com//
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------
|
|
||||||
Last update: %%date(%c)
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
abstract Cat = {
|
|
||||||
|
|
||||||
cat
|
|
||||||
N ;
|
|
||||||
PN ;
|
|
||||||
V1 ;
|
|
||||||
V4 ;
|
|
||||||
Adj1 ;
|
|
||||||
Adj2 ;
|
|
||||||
Adj3 ;
|
|
||||||
Adv ;
|
|
||||||
SMonth ;
|
|
||||||
|
|
||||||
} ;
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
--# -path=.:prelude
|
|
||||||
concrete CatPnb of Cat = open ResPnb, Prelude in {
|
|
||||||
flags coding=utf8 ; optimize=all_subs;
|
|
||||||
|
|
||||||
lincat
|
|
||||||
N = Noun ;
|
|
||||||
PN = {s:Str} ;
|
|
||||||
V1 = Verb1 ;
|
|
||||||
V4 = Verb4 ;
|
|
||||||
Adj1 = Adjective1 ;
|
|
||||||
Adj2 = Adjective2 ;
|
|
||||||
Adj3 = {s:Str} ;
|
|
||||||
Adv = {s:Str} ;
|
|
||||||
SMonth = {s:Str} ;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
|||||||
abstract Main =
|
|
||||||
Cat,
|
|
||||||
Lexicon
|
|
||||||
**{ } ;
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
--# -path=.:prelude
|
|
||||||
concrete MainPnb of Main =
|
|
||||||
LexiconPnb
|
|
||||||
** {
|
|
||||||
flags coding=utf8 ; optimize=all;
|
|
||||||
} ;
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
--# -path=.:prelude
|
|
||||||
--
|
|
||||||
--1 Punjabi auxiliary operations.
|
|
||||||
--
|
|
||||||
-- This module contains operations that are needed to make the
|
|
||||||
-- morphology work.
|
|
||||||
|
|
||||||
resource ResPnb = open Prelude, Predef in {
|
|
||||||
|
|
||||||
flags optimize = noexpand ;
|
|
||||||
coding = utf8;
|
|
||||||
|
|
||||||
param
|
|
||||||
Number = Sg | Pl ;
|
|
||||||
Case = Dir | Obl | Voc | Abl ;
|
|
||||||
Gender = Masc | Fem ;
|
|
||||||
Tense = Subj | Perf | Imperf;
|
|
||||||
Person = Pers1
|
|
||||||
| Pers2_Casual
|
|
||||||
| Pers2_Respect
|
|
||||||
| Pers3_Near
|
|
||||||
| Pers3_Distant;
|
|
||||||
|
|
||||||
|
|
||||||
VerbForm1 =
|
|
||||||
MVF1 Tense Person Number Gender -- 3*5*2*2=60
|
|
||||||
| Caus1 Tense Person Number Gender -- 60
|
|
||||||
| Caus2 Tense Person Number Gender -- 60
|
|
||||||
| Inf | Inf_Fem | Inf_Obl | Ablative -- 13
|
|
||||||
| Caus1_Inf | Caus1_Fem | Caus1_Obl | Caus1_Ablative
|
|
||||||
| Caus2_Inf | Caus2_Fem | Caus2_Obl | Caus2_Ablative
|
|
||||||
| Root ;
|
|
||||||
|
|
||||||
VerbForm4 =
|
|
||||||
MVF4 Tense Person Number Gender
|
|
||||||
| Inf4 | Inf_Fem4 | Inf_Obl4 | Ablative4
|
|
||||||
| Root4 ;
|
|
||||||
|
|
||||||
oper
|
|
||||||
CommonVF = {s : Tense => Person => Number => Gender => Str} ;
|
|
||||||
Noun = {s : Number => Case => Str ; g : Gender} ;
|
|
||||||
Verb1 = {s : VerbForm1 => Str} ;
|
|
||||||
Verb4 = {s : VerbForm4 => Str} ;
|
|
||||||
|
|
||||||
Adjective1 = {s : Gender => Number => Case => Str} ;
|
|
||||||
Adjective2 = {s : Number => Case => Str} ;
|
|
||||||
|
|
||||||
--Preposition = {s : 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)) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
39
lib/src/punjabi/src/AdjectivePnb.gf
Normal file
39
lib/src/punjabi/src/AdjectivePnb.gf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
concrete AdjectivePnb of Adjective = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
lin
|
||||||
|
|
||||||
|
PositA a = a ;
|
||||||
|
UseComparA a = a;
|
||||||
|
|
||||||
|
ComparA a np = {
|
||||||
|
s = \\n,g,c => np.s ! NPC Obl ++ "twN" ++ a.s ! n ! g ! c ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
|
ComplA2 a np = {
|
||||||
|
s = \\n,g,c => np.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflA2 a = {
|
||||||
|
s = \\n,g,c => a.s ! n ! g ! c ++ RefPron ++ "nal" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SentAP ap sc = {
|
||||||
|
s = \\n,g,c => ap.s ! n ! g ! c ++ sc.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdAP ada ap = {
|
||||||
|
s = \\n,g,c => ada.s ++ ap.s ! n ! g ! c ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseA2 a = a ;
|
||||||
|
|
||||||
|
CAdvAP cadv ap np = {
|
||||||
|
s = \\n,g,c => cadv.s ++ ap.s ! n ! g ! c ++ cadv.p ++ np.s ! NPC Dir ;
|
||||||
|
};
|
||||||
|
|
||||||
|
AdjOrd ord = { s = \\_,_,_ => ord.s ; };
|
||||||
|
|
||||||
|
}
|
||||||
21
lib/src/punjabi/src/AdverbPnb.gf
Normal file
21
lib/src/punjabi/src/AdverbPnb.gf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
concrete AdverbPnb of Adverb = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
lin
|
||||||
|
PositAdvAdj a = {s = \\g => a.s ! Sg ! g ! Obl } ;
|
||||||
|
ComparAdvAdj cadv a np = {
|
||||||
|
s = \\g => np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ;
|
||||||
|
} ;
|
||||||
|
ComparAdvAdjS cadv a s = {
|
||||||
|
s = \\g => cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ++ s.s;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PrepNP prep np = {s = \\_ => np.s ! NPObj ++ prep.s } ;
|
||||||
|
|
||||||
|
AdAdv ada adv = { s = \\g => ada.s ++ adv.s ! g} ;
|
||||||
|
|
||||||
|
-- SubjS = cc2 ;
|
||||||
|
SubjS sub snt = {s = \\_ => sub.s ++ snt.s } ;
|
||||||
|
AdnCAdv cadv = {s = "nalwN" ++ cadv.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
19
lib/src/punjabi/src/ExtraPnb.gf
Normal file
19
lib/src/punjabi/src/ExtraPnb.gf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
concrete ExtraPnb of ExtraPnbAbs = CatPnb **
|
||||||
|
open ResPnb, Coordination, Prelude, MorphoPnb, ParadigmsPnb in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
39
lib/src/punjabi/src/IdiomPnb.gf
Normal file
39
lib/src/punjabi/src/IdiomPnb.gf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
concrete IdiomPnb of Idiom = CatPnb ** open Prelude,Predef, ResPnb in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ;
|
||||||
|
GenericCl vp = mkSClause "kwy" (agrP3 Masc Sg) vp ;
|
||||||
|
|
||||||
|
CleftNP np rs =
|
||||||
|
let cl = mkSClause (np.s ! NPC rs.c) (np.a) (predAux auxBe);
|
||||||
|
in
|
||||||
|
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
||||||
|
|
||||||
|
CleftAdv ad ss = { s = \\t,b,o => ad.s ! Masc ++ ss.s};
|
||||||
|
|
||||||
|
ExistNP np =
|
||||||
|
mkSClause "awth'E" (agrP3 (fromAgr np.a).g (fromAgr np.a).n)
|
||||||
|
(insertObj (\\_ => np.s ! NPC Obl) (predAux auxBe)) ;
|
||||||
|
|
||||||
|
ExistIP ip =
|
||||||
|
let cl = mkSClause ("awth'E" ++ ip.s ! Dir) (agrP3 ip.g ip.n) (predAux auxBe);
|
||||||
|
in {
|
||||||
|
s = \\t,p,qf => case qf of {
|
||||||
|
QDir => cl.s ! t ! p ! ODir;
|
||||||
|
QIndir => cl.s ! t! p ! ODir
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ;
|
||||||
|
ProgrVP vp = (predProg vp) ;
|
||||||
|
|
||||||
|
|
||||||
|
ImpPl1 vp = {s = "Aw" ++ infVP True vp (agrP1 Masc Pl)} ;
|
||||||
|
ImpP3 np vp = {s = np.s!NPC Dir ++ "nwN" ++ (vp.s ! VPImp ).inf ++ "dyw"};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
371
lib/src/punjabi/src/LexiconPnb.gf
Normal file
371
lib/src/punjabi/src/LexiconPnb.gf
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
--# -path=.:prelude:alltenses
|
||||||
|
|
||||||
|
concrete LexiconPnb of Lexicon = CatPnb **
|
||||||
|
--open ResPnb, Prelude in {
|
||||||
|
open ParadigmsPnb,MorphoPnb, Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
optimize=values ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
airplane_N = mkN07 "jhaj" ;
|
||||||
|
|
||||||
|
answer_V2S = mkV2 (compoundV "jwab" (mkV "dyna")) ;
|
||||||
|
apartment_N = mkN01 "kmrh" ;
|
||||||
|
apple_N = mkN02 "syb" ;
|
||||||
|
-- art_N = mkN "fn" ;
|
||||||
|
ask_V2Q = mkV2 (mkV "pch'na") ;
|
||||||
|
baby_N = mkN01 "bch" ;
|
||||||
|
bad_A = mkAdj1 "bra" ;
|
||||||
|
-- bank_N = mkN "bank" ;
|
||||||
|
beautiful_A = mkAdj1 "swny" ;
|
||||||
|
become_VA = mkV "bnna";
|
||||||
|
beer_N = mkN04 "Xrab" ;
|
||||||
|
beg_V2V = mkV2V (mkV "mangna") "sE" "kh" False;
|
||||||
|
big_A = mkAdj1 "wDa" ;
|
||||||
|
bike_N = mkN03 "saycl" ;
|
||||||
|
bird_N = mkN01 "prndh" ;
|
||||||
|
black_A = mkAdj1 "kala" ;
|
||||||
|
blue_A = mkAdj1 "nyla" ;
|
||||||
|
boat_N = mkN03 "kXty" ;
|
||||||
|
book_N = mkN04 "ktab" ;
|
||||||
|
boot_N = mkN03 "jwta" ;
|
||||||
|
-- boss_N = mkN "Sahb" ;
|
||||||
|
boy_N = mkN01 "mnDa" ;
|
||||||
|
bread_N = mkN03 "rwty" ;
|
||||||
|
break_V2 = mkV2 (mkV "twRna") ;
|
||||||
|
broad_A = mkAdj1 "kh'la" ;
|
||||||
|
brother_N2 = mkN2 (mkN01 "pra") (mkPrep "ka") "kE" ; --not correct
|
||||||
|
brown_A = mkAdj1 "nswary" ;
|
||||||
|
-- butter_N = mkN "mkh'n" ;
|
||||||
|
buy_V2 = mkV2 (mkV "Krydna");
|
||||||
|
camera_N = mkN01 "kymrh" ;
|
||||||
|
cap_N = mkN03 "twpy" ;
|
||||||
|
car_N = mkN03 "gDy" ;
|
||||||
|
carpet_N = mkN03 "tpay^y" ;
|
||||||
|
cat_N = mkN03 "bly" ;
|
||||||
|
ceiling_N = mkN01 "kwTh'a" ;
|
||||||
|
chair_N = mkN03 "krsy" ;
|
||||||
|
-- cheese_N = mkN "pnyr" feminine ;
|
||||||
|
child_N = mkN01 "bch" ;
|
||||||
|
-- church_N = mkCmpdNoun "grja" (mkN "gh'r") ;
|
||||||
|
city_N = mkN02 "Xhr" ;
|
||||||
|
clean_A = mkAdj1 "Saf" ;
|
||||||
|
clever_A = mkAdj1 "hwXyar" ;
|
||||||
|
close_V2 = mkV2 (compoundV "bnd" do_V2);
|
||||||
|
coat_N = mkN04 "kwT" ;
|
||||||
|
cold_A = mkAdj1 "Th'nDa" ;
|
||||||
|
come_V = mkV "Ana" ;
|
||||||
|
-- computer_N = mkN "kmpywTr" ;
|
||||||
|
-- country_N = mkN "mlk" ;
|
||||||
|
-- cousin_N = mkCmpdNoun "cca" (mkN "zad") ; -- a compund noun made of two nouns
|
||||||
|
cow_N = mkN05 "gaE" ;
|
||||||
|
die_V = mkV "mrna" ;
|
||||||
|
dirty_A = mkAdj1 "gnda" ;
|
||||||
|
-- distance_N3 = mkN3 (mkN "pynDa") (mkPrep "da") "dE" "twN" ;
|
||||||
|
-- doctor_N = mkN "mealj" ;
|
||||||
|
dog_N = mkN01 "kta" ;
|
||||||
|
door_N = mkN01 "drwzh" ;
|
||||||
|
drink_V2 = mkV2 (mkV "pyna");
|
||||||
|
easy_A2V = mkA "swkh'a" "" ;
|
||||||
|
eat_V2 = mkV2 (mkV "kh'ana") "" ;
|
||||||
|
empty_A = mkAdj1 "Kaly" ;
|
||||||
|
-- enemy_N = mkN "dXmn" ;
|
||||||
|
-- factory_N = mkN "karKanh" ;
|
||||||
|
father_N2 = mkN2 (mkN01 "aba") (mkPrep "da") "dE" ;
|
||||||
|
fear_VS = mkV "Drna";
|
||||||
|
find_V2 = mkV2 (mkV "pana") ;
|
||||||
|
fish_N = mkN03 "mch'ly" ;
|
||||||
|
floor_N = mkN02 "frX" ;
|
||||||
|
forget_V2 = mkV2 (mkV "bh'wlna") "nwN" ;
|
||||||
|
-- fridge_N = mkN "fryg" ;
|
||||||
|
friend_N = mkN04 "dwst" ;
|
||||||
|
fruit_N = mkN02 "ph'l" ;
|
||||||
|
-- fun_AV = mkAdj1V (regA "f?n") ;
|
||||||
|
garden_N = mkN04 "baG" ;
|
||||||
|
girl_N = mkN03 "kRy" ;
|
||||||
|
-- glove_N = mkN "dstanh" ;
|
||||||
|
gold_N = mkN01 "swna" ;
|
||||||
|
good_A = mkAdj1 "ach'a" ;
|
||||||
|
go_V = mkV "jana" ;
|
||||||
|
green_A = mkAdj1 "sbz" ;
|
||||||
|
-- harbour_N = mkCmpdNoun "bndr" (mkN "gah") ;
|
||||||
|
hate_V2 = mkV2 (compoundV "nfrt" do_V2) ;
|
||||||
|
hat_N = mkN03 "twpy" ;
|
||||||
|
-- have_V2 = dirV2 (mk5V "ha?e" "has" "had" "had" "ha??ng") ;
|
||||||
|
hear_V2 = mkV2 (mkV "snna") ;
|
||||||
|
hill_N = mkN03 "paRy" ;
|
||||||
|
hope_VS = (compoundV "As" do_V2);
|
||||||
|
horse_N = mkN01 "kwRa" ;
|
||||||
|
hot_A = mkAdj1 "grm" ;
|
||||||
|
house_N = mkN02 "gh'r" ;
|
||||||
|
important_A = mkAdj1 "ahm" ;
|
||||||
|
-- industry_N = mkN "Snet" feminine ;
|
||||||
|
-- iron_N = mkN "lwha" ;
|
||||||
|
-- king_N = mkN "badXah" ;
|
||||||
|
know_V2 = mkV2 (mkV "janna") ;
|
||||||
|
know_VS = (mkV "janna") ;
|
||||||
|
know_VQ = (mkV "janna") ;
|
||||||
|
lake_N = mkN04 "jh'yl" ;
|
||||||
|
-- lamp_N = mkN "lymp" ;
|
||||||
|
learn_V2 = mkV2 (mkV "skh'na") ;
|
||||||
|
-- leather_N = mkN "cmRa" ;
|
||||||
|
leave_V2 = mkV2 (mkV "jana") ;
|
||||||
|
like_V2 = mkV2 (compoundV "psnd" do_V2);
|
||||||
|
listen_V2 = mkV2 (mkV "snna") ;
|
||||||
|
live_V = mkV "rhna" ; ---- touch
|
||||||
|
long_A = mkAdj1 "lmba" ;
|
||||||
|
lose_V2 = mkV2 (compoundV "kh'w" (mkV "dyna")) ;
|
||||||
|
love_N = mkN02 "mHbt" ;
|
||||||
|
love_V2 = mkV2 (compoundV "pyar" do_V2) "nwN";
|
||||||
|
man_N = mkN03 "Admy" ; -- not correct according to rules should be discussed
|
||||||
|
-- married_A2 = mkAdj1 "Xady?krna" "sE" ;
|
||||||
|
meat_N = mkN02 "gwXt" ;
|
||||||
|
-- milk_N = mkN "dwdh'" ;
|
||||||
|
moon_N = mkN02 "cn" ;
|
||||||
|
mother_N2 = mkN2 (mkN05 "maN") (mkPrep "dy") "DE"; -- not covered need to be discussed
|
||||||
|
mountain_N = mkN03 "paRy" ;
|
||||||
|
-- music_N = mkN "mwsyqy" ;
|
||||||
|
narrow_A = mkAdj1 "baryk" ;
|
||||||
|
new_A = mkAdj1 "nwa" ;
|
||||||
|
newspaper_N = mkN04 "aKbar" ;
|
||||||
|
oil_N = mkN02 "tyl" ;
|
||||||
|
old_A = mkAdj1 "bwDa" ;
|
||||||
|
open_V2 = mkV2 (mkV "kh'wlna") ;
|
||||||
|
paint_V2A = mkV2 (compoundV "rng" do_V2) ;
|
||||||
|
-- paper_N = mkN "kaGz" ;
|
||||||
|
-- paris_PN = mkPN "pyrs" ;
|
||||||
|
-- peace_N = mkN "amn" ;
|
||||||
|
pen_N = mkN04 "pnsl" ;
|
||||||
|
planet_N = mkN01 "syarh" ;
|
||||||
|
-- plastic_N = mkN "plasTk" ;
|
||||||
|
play_V2 = mkV2 (mkV "kh'yDna") ;
|
||||||
|
-- policeman_N = mkCmpdNoun "pwlys" (mkN "wala") ;
|
||||||
|
-- priest_N = (mkN "pyGmbr") ;
|
||||||
|
-- probable_AS = mkAdj1S (regA "pr?bable") ;
|
||||||
|
queen_N = mkN03 "Xhzady" ;
|
||||||
|
-- radio_N = mkN "ryDyw" ;
|
||||||
|
rain_V0 = compoundV "barX" (mkV "hwna" ) ;
|
||||||
|
read_V2 = mkV2 (mkV "pRh'na");
|
||||||
|
red_A = mkAdj1 "lal" ;
|
||||||
|
-- religion_N = mkN "mzhb" ;
|
||||||
|
-- restaurant_N = mkN "hwTl" ;
|
||||||
|
-- river_N = mkN "drya" masculine ;
|
||||||
|
rock_N = mkN04 "cTan" ;
|
||||||
|
-- roof_N = mkN "ch't" masculine ;
|
||||||
|
rubber_N = mkN04 "rbR" ;
|
||||||
|
run_V = mkV "dwRna" ;
|
||||||
|
say_VS = mkV "khna" ;
|
||||||
|
-- school_N = mkN "skwl" ;
|
||||||
|
-- science_N = mkN "sans" ;
|
||||||
|
sea_N = mkN02 "smndr" ;
|
||||||
|
seek_V2 = mkV2 (mkV "lbh'na" ) "nwN" ;
|
||||||
|
see_V2 = mkV2 (mkV "wykh'na") "nwN" ;
|
||||||
|
sell_V3 = mkV3 (mkV "wycna") "kw" "";
|
||||||
|
send_V3 = mkV3 (mkV "pyjna") "kw" "";
|
||||||
|
-- sheep_N = mkN "bh'yR" feminine ;
|
||||||
|
-- ship_N = mkN "jhaz" ;
|
||||||
|
shirt_N = mkN04 "qmyZ-";
|
||||||
|
shoe_N = mkN01 "jwta" ;
|
||||||
|
-- shop_N = mkN "dwkan" feminine ;
|
||||||
|
short_A = mkAdj1 "ch'wTa" ;
|
||||||
|
silver_N = mkN03 "candy" ;
|
||||||
|
sister_N = mkN04 "bhn" ;
|
||||||
|
sleep_V = mkV "swna" ;
|
||||||
|
small_A = mkAdj1 "ch'wTa" ;
|
||||||
|
-- snake_N = mkN "sanp" ;
|
||||||
|
sock_N = mkN04 "jrab" ;
|
||||||
|
-- speak_V2 = mkV2 (mkV "bwlna") ;
|
||||||
|
star_N = mkN01 "stara" ;
|
||||||
|
-- steel_N = mkN "styl" ;
|
||||||
|
-- stone_N = mkN "pth'r" ;
|
||||||
|
stove_N = mkN01 "cwlha" ;
|
||||||
|
-- student_N = mkCmpdNoun "t-alb" (mkN "elm") ;
|
||||||
|
-- stupid_A = mkAdj1 "aHmq" ;
|
||||||
|
sun_N = mkN02 "swrj" ;
|
||||||
|
switch8off_V2 = mkV2 (mkV "clana") ;
|
||||||
|
switch8on_V2 = mkV2 (compoundV "bnd" do_V2) ;
|
||||||
|
table_N = mkN04 "myz" ;
|
||||||
|
talk_V3 = mkV3 (mkV "bwlna") "sE" "";
|
||||||
|
teacher_N = mkN02 "astad" ;
|
||||||
|
teach_V2 = mkV2 (mkV "pRh'na") ;
|
||||||
|
-- television_N = mkN "telywyzn" ;
|
||||||
|
thick_A = mkAdj1 "mwTa" ;
|
||||||
|
thin_A = mkAdj1 "ptla" ;
|
||||||
|
train_N = mkN03 "gDy" ;
|
||||||
|
travel_V = (compoundV "pynDa" do_V2) ;
|
||||||
|
-- tree_N = mkN "drKt" masculine ;
|
||||||
|
-- ---- trousers_N = mkN "tr??sers" ;
|
||||||
|
ugly_A = mkAdj1 "kwja" ;
|
||||||
|
understand_V2 = mkV2 (mkV "smjh'na") ;
|
||||||
|
-- university_N = mkN "ywnywrsTy" ;
|
||||||
|
-- village_N = mkN "gawN" ;
|
||||||
|
wait_V2 = mkV2 (compoundV "rah" (mkV "wykh'na")) ;
|
||||||
|
walk_V = mkV "clna" ;
|
||||||
|
warm_A = mkAdj1 "tta" ;
|
||||||
|
war_N = mkN02 "jng" ;
|
||||||
|
watch_V2 = mkV2 (mkV "wykh'na") ;
|
||||||
|
water_N = mkN03 "pany" ; -- not covered masculine ending with y
|
||||||
|
white_A = mkAdj1 "cTa" ;
|
||||||
|
-- window_N = mkN "kh'Rky" ;
|
||||||
|
wine_N = mkN04 "Xrab";
|
||||||
|
win_V2 = mkV2 (mkV "jytna") ;
|
||||||
|
woman_N = mkN04 "ewrt" ;
|
||||||
|
wonder_VQ = compoundV "Heran" (mkV "hwna") ;
|
||||||
|
wood_N = mkN04 "lkRy" ;
|
||||||
|
write_V2 = mkV2 (mkV "lkh'na") ;
|
||||||
|
yellow_A = mkAdj1 "kh'Ta" ;
|
||||||
|
young_A = mkAdj1 "jwan" ;
|
||||||
|
do_V2 = mkV2 (mkV "krna") ;
|
||||||
|
-- now_Adv = mkAdj1dv "ab" ;
|
||||||
|
-- already_Adv = mkAdj1dv "phlE?hy" ;
|
||||||
|
song_N = mkN01 "gana" ;
|
||||||
|
add_V3 = mkV3 (compoundV "wadh'a" do_V2) "" "" ;
|
||||||
|
number_N = mkN01 "hndsh" ;
|
||||||
|
put_V2 = mkV2 (mkV "Dalna") ;
|
||||||
|
stop_V = mkV "rwkna" ;
|
||||||
|
jump_V = compoundV "ch'al" (mkV "marna") ;
|
||||||
|
|
||||||
|
left_Ord = {s = "sja" ; n = singular};
|
||||||
|
right_Ord = {s= "kh'ba" ; n = singular};
|
||||||
|
-- far_Adv = mkAdj1dv "dwr" ;
|
||||||
|
correct_A = mkAdj1 "Syh" ;
|
||||||
|
dry_A = mkAdj1 "swka" ;
|
||||||
|
dull_A = mkAdj1 "nkh'Tw" ;
|
||||||
|
full_A = mkAdj1 "pwra" ;
|
||||||
|
heavy_A = mkAdj1 "pary" ;
|
||||||
|
near_A = mkAdj1 "nyRE" ;
|
||||||
|
rotten_A = mkAdj1 "Krab" ;
|
||||||
|
round_A = mkAdj1 "gwl" ;
|
||||||
|
sharp_A = mkAdj1 "tyz" ;
|
||||||
|
smooth_A = mkAdj1 "pdra" ;
|
||||||
|
straight_A = mkAdj1 "sda" ;
|
||||||
|
wet_A = mkAdj1 "gla" ; ----
|
||||||
|
wide_A = mkAdj1 "cwRa" ;
|
||||||
|
animal_N = mkN02 "janwr" ;
|
||||||
|
-- ashes_N = mkN "rakh'" feminine; -- FIXME: plural only?
|
||||||
|
-- back_N = mkN "qmr" feminine ;
|
||||||
|
-- bark_N = mkN "bark" ;
|
||||||
|
-- belly_N = mkN "dh'ny" ;
|
||||||
|
blood_N = mkN02 "lhw" ;
|
||||||
|
bone_N = mkN03 "hDy" ;
|
||||||
|
-- breast_N = mkN "ch'aty" ;
|
||||||
|
-- cloud_N = mkN "badl" ;
|
||||||
|
day_N = mkN04 "dn" ;
|
||||||
|
-- dust_N = mkN "dh'wl" ;
|
||||||
|
-- ear_N = mkN "kan" ;
|
||||||
|
-- earth_N = mkN "zmyn" feminine ;
|
||||||
|
egg_N = mkN01 "anDh" ;
|
||||||
|
-- eye_N = mkN "Ankh'" feminine ;
|
||||||
|
fat_N = mkN01 "mwta" ;
|
||||||
|
-- feather_N = mkN "pr" ;
|
||||||
|
-- fingernail_N = mkN "naKn" ;
|
||||||
|
-- fire_N = mkN "Ag" feminine ;
|
||||||
|
flower_N = mkN02 "ph'wl" ;
|
||||||
|
-- fog_N = mkN "dh'nd" feminine ;
|
||||||
|
-- foot_N = mkN "pawN" ; -- not properly covered need to be discussed
|
||||||
|
forest_N = mkN02 "njgl" ;
|
||||||
|
-- grass_N = mkN "gh's" feminine ;
|
||||||
|
-- guts_N = mkN "g?t" ; -- FIXME: no singular
|
||||||
|
-- hair_N = mkN "bal" ;
|
||||||
|
hand_N = mkN02 "hth'" ;
|
||||||
|
head_N = mkN02 "sr" ;
|
||||||
|
heart_N = mkN02 "dl" ;
|
||||||
|
-- horn_N = mkN "gh'nty" ;
|
||||||
|
husband_N = mkN01 "bnda" ;
|
||||||
|
ice_N = mkN04 "brf" ;
|
||||||
|
-- knee_N = mkN "khny" ;
|
||||||
|
leaf_N = mkN01 "pth" ;
|
||||||
|
-- leg_N = mkN "tang" ;
|
||||||
|
-- liver_N = mkN "jgr" ;
|
||||||
|
-- louse_N = mkN "gh'r" ;
|
||||||
|
-- mouth_N = mkN "mnh" ;
|
||||||
|
-- name_N = mkN "nam" ;
|
||||||
|
-- neck_N = mkN "grdn" feminine ;
|
||||||
|
night_N = mkN02 "rat" ;
|
||||||
|
-- nose_N = mkN "nak" ;
|
||||||
|
-- person_N = mkN "XKS" ;
|
||||||
|
-- rain_N = mkN "barX" feminine ;
|
||||||
|
-- road_N = mkN "sRk" ;
|
||||||
|
root_N = mkN02 "gR" ;
|
||||||
|
rope_N = mkN03 "rsy" ;
|
||||||
|
-- salt_N = mkN "nmk" feminine ;
|
||||||
|
-- sand_N = mkN "ryt" feminine ;
|
||||||
|
-- seed_N = mkN "byj" ;
|
||||||
|
skin_N = mkN04 "jld" ;
|
||||||
|
sky_N = mkN02 "Asman" ;
|
||||||
|
-- smoke_N = mkN "dh'waN"; -- singular masc nouns ending with aN,wN yet to be implemented
|
||||||
|
snow_N = mkN04 "brf" ;
|
||||||
|
stick_N = mkN03 "swTy" ;
|
||||||
|
tail_N = mkN02 "pwXl" ;
|
||||||
|
tongue_N = mkN04 "jyb" ;
|
||||||
|
-- tooth_N = mkN "dant" masculine;
|
||||||
|
wife_N = mkN03 "jnany" ;
|
||||||
|
-- wind_N = mkN "Andh'y" ;
|
||||||
|
-- wing_N = mkN "pr" ;
|
||||||
|
worm_N = mkN01 "tta" ;
|
||||||
|
year_N = mkN02 "sal" ;
|
||||||
|
blow_V = mkV "clna" ;
|
||||||
|
breathe_V = compoundV "sah" (mkV "lyna" ) ;
|
||||||
|
burn_V = mkV "jlna" ;
|
||||||
|
dig_V = mkV "kh'wdna" ;
|
||||||
|
fall_V = mkV "grna" ;
|
||||||
|
float_V = mkV "tyrna" ;
|
||||||
|
flow_V = mkV "bhna" ;
|
||||||
|
fly_V = mkV "aDna" ;
|
||||||
|
freeze_V = mkV "jmna" ;
|
||||||
|
give_V3 = mkV3 (mkV "dyna") "nwN" "";
|
||||||
|
laugh_V = mkV "hsna" ;
|
||||||
|
-- lie_N = mkN "jh'wt" masculine ;
|
||||||
|
lie_V = compoundV "ch'wTh'" (mkV "bwlna" );
|
||||||
|
play_V = mkV "kh'ylna" ;
|
||||||
|
sew_V = mkV "syna" ;
|
||||||
|
sing_V = mkV "gana" ;
|
||||||
|
sit_V = mkV "byTh'na" ;
|
||||||
|
smell_V = mkV "swngna" ;
|
||||||
|
spit_V = mkV "th'wkna" ;
|
||||||
|
stand_V = mkV "kh'lwna";
|
||||||
|
swell_V = mkV "swjna" ;
|
||||||
|
swim_V = mkV "trna" ;
|
||||||
|
think_V = mkV "swcna" ;
|
||||||
|
turn_V = mkV "mRna" ;
|
||||||
|
vomit_V = compoundV "alty" (mkV "krna") ;
|
||||||
|
bite_V2 = mkV2 (mkV "kTna") ;
|
||||||
|
count_V2 = mkV2 (mkV "gnna") ;
|
||||||
|
cut_V2 = mkV2 (mkV "kTna") ;
|
||||||
|
fear_V2 = mkV2 (mkV "Drna") ;
|
||||||
|
fight_V2 = mkV2 (mkV "lRna") ;
|
||||||
|
hit_V2 = mkV2 (compoundV "Th'wDa" (mkV "marna" ));
|
||||||
|
hold_V2 = mkV2 (mkV "ph'Rna") ;
|
||||||
|
-- hunt_V2 = mkV2 (compoundV "Xkar" do_V2);
|
||||||
|
kill_V2 = mkV2 (compoundV "mar" (mkV "dyna" )) ;
|
||||||
|
pull_V2 = mkV2 (mkV "kh'cna");
|
||||||
|
push_V2 = mkV2 (compoundV "tka" (mkV "dyna")) "kw" ;
|
||||||
|
rub_V2 = mkV2 (mkV "rgRna") ;
|
||||||
|
-- scratch_V2 = mkV2 (mkV "kh'rcna") "kw" ;
|
||||||
|
-- split_V2 = mkV2 (mkV "banta") "kw" ;
|
||||||
|
-- squeeze_V2 = dirV2 (regV "sq?eeze") ;
|
||||||
|
-- stab_V2 = dirV2 (regDuplV "stab") ;
|
||||||
|
suck_V2 = mkV2 (mkV "cwnDna") ;
|
||||||
|
throw_V2 = mkV2 (mkV "swTna") ;
|
||||||
|
tie_V2 = mkV2 (mkV "bnna") ;
|
||||||
|
wash_V2 = mkV2 (mkV "twna") ;
|
||||||
|
wipe_V2 = mkV2 (mkV "pwnjh'na");
|
||||||
|
|
||||||
|
---- other_A = regA "?ther" ;
|
||||||
|
|
||||||
|
-- grammar_N = mkN "grdan" ;
|
||||||
|
language_N = mkN04 "bwly" ;
|
||||||
|
-- rule_N = mkN "aSwl" ;
|
||||||
|
|
||||||
|
---- added 4/6/2007
|
||||||
|
john_PN = mkPN "jan" ;
|
||||||
|
-- question_N = mkN "swal" ;
|
||||||
|
-- ready_A = regA "ready" ;
|
||||||
|
-- reason_N = mkN "wjh" feminine ;
|
||||||
|
-- today_Adv = mkAdj1dv "aj" ;
|
||||||
|
-- uncertain_A = mkAdj1 ["Gyr?yqyny"] ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
451
lib/src/punjabi/src/MorphoPnb.gf
Normal file
451
lib/src/punjabi/src/MorphoPnb.gf
Normal file
@@ -0,0 +1,451 @@
|
|||||||
|
--# -path=.:../../prelude
|
||||||
|
--
|
||||||
|
----1 A Simple Punjabi Resource Morphology
|
||||||
|
----
|
||||||
|
---- Shafqat Virk, Aarne Ranta,2010
|
||||||
|
----
|
||||||
|
---- This resource morphology contains definitions needed in the resource
|
||||||
|
---- syntax. To build a lexicon, it is better to use $ParadigmsPnb$, which
|
||||||
|
---- gives a higher-level access to this module.
|
||||||
|
--
|
||||||
|
resource MorphoPnb = ResPnb ** open Prelude,Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
----2 Nouns
|
||||||
|
oper
|
||||||
|
|
||||||
|
mkN : (x1,_,_,_,_,_,_,x8 : Str) -> Gender -> Noun =
|
||||||
|
\sd,so,sv,sa, pd,po,pv,pa, g -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Dir => sd ;
|
||||||
|
Obl => so ;
|
||||||
|
Voc => sv ;
|
||||||
|
Abl => sa
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Dir => pd ;
|
||||||
|
Obl => po ;
|
||||||
|
Voc => pv ;
|
||||||
|
Abl => pa
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
g = g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e)
|
||||||
|
-- Arabic nouns ends with h. also taken as Masc
|
||||||
|
mkN01 : Str -> Noun ;
|
||||||
|
mkN01 koRa = let end = last (koRa) ;
|
||||||
|
koR = if_then_else Str (eq end "e") koRa (tk 1 koRa)
|
||||||
|
in mkN (koRa) (koR+"E") (koR+"ya") (koR+"ywN")
|
||||||
|
(koR+"E") (koR+"yaN") (koR+"yw") ""
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
|
||||||
|
-- 2. msculine: gher, shehar, din, des, huth
|
||||||
|
mkN02 : Str -> Noun ;
|
||||||
|
mkN02 gher = mkN (gher) (gher) (variants{gher; gher+"a"}) (gher+"wN")
|
||||||
|
(gher) (gher+"aN") (gher+"w") ""
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
-- 3. sekhi, kuRi, boli
|
||||||
|
mkN03 : Str -> Noun ;
|
||||||
|
mkN03 kuRi = mkN (kuRi) (kuRi) (kuRi+"E") ""
|
||||||
|
(kuRi+"aN") (kuRi+"aN") (kuRi+"wN") ""
|
||||||
|
Fem ;
|
||||||
|
|
||||||
|
-- 4. gal, saltanat, tareekh, shaksiat, kitab
|
||||||
|
mkN04 : Str -> Noun ;
|
||||||
|
mkN04 gal = mkN (gal) (gal) (variants{gal; gal+"E"}) (gal+"wN")
|
||||||
|
(gal+"aN") (gal+"aN") (gal+"w") ""
|
||||||
|
Fem ;
|
||||||
|
|
||||||
|
|
||||||
|
-- 5. maaN
|
||||||
|
mkN05 : Str -> Noun ;
|
||||||
|
mkN05 maaN = let maa = tk 1 maaN
|
||||||
|
in mkN (maaN) (maaN) (variants{(maa+"y^E");(maa+"wE")}) (maa+"waN")
|
||||||
|
(maa+"waN") (maa+"waN") (maa+"ww") ""
|
||||||
|
Fem ;
|
||||||
|
|
||||||
|
-- 6. kunwaN
|
||||||
|
mkN06 : Str -> Noun ;
|
||||||
|
mkN06 kunwaN = let kunw = tk 2 kunwaN
|
||||||
|
in mkN (kunwaN) (kunw+"yN") (kunw+"yN") (kunw+"wN")
|
||||||
|
(kunw+"yN") (kunw+"yaN") (kunw+"bw") ""
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
-- 7. merd
|
||||||
|
mkN07 : Str -> Noun ;
|
||||||
|
mkN07 merd = mkN (merd) (merd) (merd) ""
|
||||||
|
(merd) (merd+"aN") (merd+"w") ""
|
||||||
|
Masc ;
|
||||||
|
-- 8. aaTa,
|
||||||
|
mkN08 : Str -> Noun ;
|
||||||
|
mkN08 aaTa = let aaT = tk 1 aaTa
|
||||||
|
in mkN (aaTa) (aaT+"E") (variants{aaT+"E"; aaT+"ya"}) (aaT+"ywN")
|
||||||
|
(aaTa) (aaT+"E") (variants{aaT+"E"; aaT+"ya"}) ""
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
--9. lok
|
||||||
|
mkN09 : Str -> Noun ;
|
||||||
|
mkN09 lok = mkN "" "" "" ""
|
||||||
|
(lok) (lok+"a") (lok+"w") ""
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
--10. Masc. no inflection
|
||||||
|
mkN10 : Str -> Noun ;
|
||||||
|
mkN10 x = mkN x x x x
|
||||||
|
x x x ""
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
--11. Fem. no inflection
|
||||||
|
mkN11 : Str -> Noun ;
|
||||||
|
mkN11 x = mkN x x x x
|
||||||
|
x x x ""
|
||||||
|
Fem ;
|
||||||
|
|
||||||
|
----2 Determiners
|
||||||
|
|
||||||
|
IDeterminer = {s:Gender => Str ; n : Number};
|
||||||
|
makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => s1 ;
|
||||||
|
Fem => s2
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Masc => s3 ;
|
||||||
|
Fem => s4
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
n = n
|
||||||
|
};
|
||||||
|
|
||||||
|
makeIDet : Str -> Str -> Number -> IDeterminer = \s1,s2,n -> {
|
||||||
|
s = table {
|
||||||
|
Masc => s1;
|
||||||
|
Fem => s2
|
||||||
|
};
|
||||||
|
n = n
|
||||||
|
};
|
||||||
|
|
||||||
|
-- Proposition
|
||||||
|
|
||||||
|
makePrep : Str -> Preposition = \str -> {s = str } ** { lock_Prep = <>};
|
||||||
|
|
||||||
|
----2 Pronouns
|
||||||
|
PronForm = {s:Pronoun => Str};
|
||||||
|
{- makeDemPron : (x1,x2,x3,x4,x5,x6:Str) -> PronForm =
|
||||||
|
\y1,y2,y3,y4,y5,y6 -> {
|
||||||
|
s = table {
|
||||||
|
P Sg _ Dir _ => y1;
|
||||||
|
P Sg _ Obl _ => y2;
|
||||||
|
P Sg _ Voc _ => y3;
|
||||||
|
P Pl _ Dir _ => y4;
|
||||||
|
P Pl _ Obl _ => y5;
|
||||||
|
P Pl _ Voc _ => y6
|
||||||
|
};
|
||||||
|
};
|
||||||
|
-}
|
||||||
|
-- DemonPronForm = {s:DemPronForm => Str};
|
||||||
|
mkDemonPronForm : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16:Str) -> DemPronForm =
|
||||||
|
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16 -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => table {
|
||||||
|
Dir => y1 ;
|
||||||
|
Obl => y2 ;
|
||||||
|
Voc => y3 ;
|
||||||
|
Abl => y4
|
||||||
|
};
|
||||||
|
Fem => table {
|
||||||
|
Dir => y5 ;
|
||||||
|
Obl => y6 ;
|
||||||
|
Voc => y7 ;
|
||||||
|
Abl => y8
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Pl => table {
|
||||||
|
Masc => table {
|
||||||
|
Dir => y9 ;
|
||||||
|
Obl => y10 ;
|
||||||
|
Voc => y11 ;
|
||||||
|
Abl => y12
|
||||||
|
};
|
||||||
|
Fem => table {
|
||||||
|
Dir => y13 ;
|
||||||
|
Obl => y14 ;
|
||||||
|
Voc => y15 ;
|
||||||
|
Abl => y16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
makeDemonPronForm : Str -> Str -> Str -> DemPronForm ;
|
||||||
|
makeDemonPronForm yeh is inn = mkDemonPronForm yeh is "" yeh is "" yeh inn "" yeh inn "" "" "" "" "";
|
||||||
|
-- makePossPronForm myra myry hmara hmary = mkDemonPronForm myra myra myra myry myry myry hmara hmara hmara hmary hmary hmary;
|
||||||
|
{-
|
||||||
|
|
||||||
|
PersPron = {s: PersPronForm => Str};
|
||||||
|
|
||||||
|
mkPersPron:(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,x37,x38,x39,x40:Str) -> PersPron =
|
||||||
|
\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,y37,y38,y39,y40 -> {
|
||||||
|
s =
|
||||||
|
table {
|
||||||
|
PPF Sg Pers1 Dir => y1;
|
||||||
|
PPF Sg Pers1 Obl => y2;
|
||||||
|
PPF Sg Pers1 Voc => y3;
|
||||||
|
PPF Sg Pers1 Abl => y4;
|
||||||
|
PPF Sg Pers2_Casual Dir => y5;
|
||||||
|
PPF Sg Pers2_Casual Obl => y6;
|
||||||
|
PPF Sg Pers2_Casual Voc => y7;
|
||||||
|
PPF Sg Pers2_Casual Abl => y8;
|
||||||
|
PPF Sg Pers2_Respect Dir => y9;
|
||||||
|
PPF Sg Pers2_Respect Obl => y10;
|
||||||
|
PPF Sg Pers2_Respect Voc => y11;
|
||||||
|
PPF Sg Pers2_Respect Abl => y12;
|
||||||
|
PPF Sg Pers3_Near Dir => y13;
|
||||||
|
PPF Sg Pers3_Near Obl => y14;
|
||||||
|
PPF Sg Pers3_Near Voc => y15;
|
||||||
|
PPF Sg Pers3_Near Abl => y16;
|
||||||
|
PPF Sg Pers3_Distant Dir => y17;
|
||||||
|
PPF Sg Pers3_Distant Obl => y18;
|
||||||
|
PPF Sg Pers3_Distant Voc => y19;
|
||||||
|
PPF Sg Pers3_Distant Abl => y20;
|
||||||
|
PPF Pl Pers1 Dir => y21;
|
||||||
|
PPF Pl Pers1 Obl => y22;
|
||||||
|
PPF Pl Pers1 Voc => y23;
|
||||||
|
PPF Pl Pers1 Abl => y24;
|
||||||
|
PPF Pl Pers2_Casual Dir => y25;
|
||||||
|
PPF Pl Pers2_Casual Obl => y26;
|
||||||
|
PPF Pl Pers2_Casual Voc => y27;
|
||||||
|
PPF Pl Pers2_Casual Abl => y28;
|
||||||
|
PPF Pl Pers2_Respect Dir => y29;
|
||||||
|
PPF Pl Pers2_Respect Obl => y30;
|
||||||
|
PPF Pl Pers2_Respect Voc => y31;
|
||||||
|
PPF Pl Pers2_Respect Abl => y32;
|
||||||
|
PPF Pl Pers3_Near Dir => y33;
|
||||||
|
PPF Pl Pers3_Near Obl => y34;
|
||||||
|
PPF Pl Pers3_Near Voc => y35;
|
||||||
|
PPF Pl Pers3_Near Abl => y36;
|
||||||
|
PPF Pl Pers3_Distant Dir => y37;
|
||||||
|
PPF Pl Pers3_Distant Obl => y38;
|
||||||
|
PPF Pl Pers3_Distant Voc => y39;
|
||||||
|
PPF Pl Pers3_Distant Abl => y40
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
makePersPron : PersPron;
|
||||||
|
makePersPron = mkPersPron "myN" "" "" "mytwN"
|
||||||
|
"twN" "" "" "tytwN"
|
||||||
|
"tsy" "" "" "twatwN"
|
||||||
|
"aw" "" "" "aw"
|
||||||
|
"aw" "" "" "aw"
|
||||||
|
"asy" "" "" "satwN"
|
||||||
|
"tsy" "" "" "twatwN"
|
||||||
|
"tsy" "" "" "twatwN"
|
||||||
|
"aw" "" "" "aw"
|
||||||
|
"aw" "" "" "aw";
|
||||||
|
-}
|
||||||
|
|
||||||
|
mkPron : (x1,x2,x3,x4:Str) -> {s:Case => Str} =
|
||||||
|
\y1,y2,y3,y4 -> { s =
|
||||||
|
table {
|
||||||
|
Dir => y1;
|
||||||
|
Obl => y2;
|
||||||
|
Voc => y3;
|
||||||
|
Abl => y4
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
------- PossPronForm yet to be implemented
|
||||||
|
|
||||||
|
|
||||||
|
-- IntPronForm = {s:InterrPronForm => Str};
|
||||||
|
IntPronForm = {s: Case => Str};
|
||||||
|
mkIntPronForm : (x1,x2,x3,x4:Str) -> IntPronForm =
|
||||||
|
\y1,y2,y3,y4 -> {
|
||||||
|
s =
|
||||||
|
table {
|
||||||
|
Dir => y1;
|
||||||
|
Obl => y2;
|
||||||
|
Voc => y3;
|
||||||
|
Abl => y4
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
----2 Adjectives
|
||||||
|
-- defined in ResPnb
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
|
----Verbs
|
||||||
|
------------------------------------------------------------------
|
||||||
|
|
||||||
|
--1. Basic stem form, direct & indirect causatives exists
|
||||||
|
-- v1 nechna nechaana nechwana
|
||||||
|
|
||||||
|
mkVerb : (_: Str) -> Verb = \inf ->
|
||||||
|
let root = (tk 2 inf) ;
|
||||||
|
-- root1 = (tk 2 c1) ;
|
||||||
|
-- root2 = (tk 2 c2) ;
|
||||||
|
in {
|
||||||
|
s = table {
|
||||||
|
|
||||||
|
Root => root ;
|
||||||
|
|
||||||
|
Inf => inf ;
|
||||||
|
Inf_Fem => ((tk 1 inf) + "y") ;
|
||||||
|
Inf_Obl => (tk 1 inf) ;
|
||||||
|
Ablative => ((tk 1 inf) + "wN") ;
|
||||||
|
|
||||||
|
{- Caus1_Inf => c1 ;
|
||||||
|
Caus1_Fem => ((tk 1 c1) + "y") ;
|
||||||
|
Caus1_Obl => (tk 1 c1) ;
|
||||||
|
Caus1_Ablative => ((tk 1 c1) + "wN") ;
|
||||||
|
|
||||||
|
Caus2_Inf => c2 ;
|
||||||
|
Caus2_Fem => ((tk 1 c2) + "y") ;
|
||||||
|
Caus2_Obl => (tk 1 c2) ;
|
||||||
|
Caus2_Ablative => ((tk 1 c2) + "wN") ;
|
||||||
|
-}
|
||||||
|
VF tense person number gender => (mkCmnVF root tense person number gender).s
|
||||||
|
-- Caus1 tense person number gender => (mkCmnVF root1 tense person number gender).s ;
|
||||||
|
-- Caus2 tense person number gender => (mkCmnVF root2 tense person number gender).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkCmnVF : Str -> VTense -> PPerson -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
||||||
|
{s = case (last root) of {
|
||||||
|
("a"|"A"|"w"|"y") => (mkCmnVF1 root t p n g).s ;
|
||||||
|
_ => (mkCmnVF2 root t p n g).s
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mkCmnVF1 : Str -> VTense -> PPerson -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
||||||
|
{s = let nadaa = root + "nda" ; --root + variants{"nda";"wnda"};
|
||||||
|
nadii = root + "ndy" ; --root + variants{"ndy";"wndy"} ;
|
||||||
|
nade = root + "ndE" ; --root + variants{"ndE";"wndE"} ;
|
||||||
|
nadiiaaN = root + "ndyaN" --root + variants{"ndyaN";"wndyaN"}
|
||||||
|
in
|
||||||
|
case <t,p,n,g> of {
|
||||||
|
<Subj,Pers1, Sg,_> => root + "waN" ;
|
||||||
|
<Subj,Pers1, Pl,_> => root + "y^E" ;
|
||||||
|
<Subj,Pers2_Casual, Sg,_> => root ;
|
||||||
|
<Subj,Pers2_Casual, Pl,_> => root + "w^" ;
|
||||||
|
<Subj,Pers2_Respect, _, _> => root + "w^" ;
|
||||||
|
|
||||||
|
<Subj,_, Sg,_> => root + "y^E" ;
|
||||||
|
<Subj,_, Pl,_> => root+"n" ;
|
||||||
|
|
||||||
|
<Perf, Pers1, Sg,Masc> => root + "ya" ;
|
||||||
|
<Perf, Pers1, Sg,Fem> => root + "y^y" ;
|
||||||
|
<Perf, Pers1, Pl,Masc> => root + "y^E" ;
|
||||||
|
<Perf, Pers1, Pl,Fem> => root + "y^yaN" ;
|
||||||
|
<Perf, Pers2_Casual, Sg,Masc> => root + "ya" ;
|
||||||
|
<Perf, Pers2_Casual, Sg,Fem> => root + "y^y" ;
|
||||||
|
<Perf, Pers2_Casual, Pl,Masc> => root + "y^E" ;
|
||||||
|
<Perf, Pers2_Casual, Pl,Fem> => root + "y^yaN" ;
|
||||||
|
<Perf, Pers2_Respect,_,_> => root + "y^E" ;
|
||||||
|
|
||||||
|
<Perf, _, Sg,Masc> => root + "ya" ;
|
||||||
|
<Perf, _, Sg,Fem> => root + "y^y" ;
|
||||||
|
<Perf, _, Pl,Masc> => root + "y^E" ;
|
||||||
|
<Perf, _, Pl,Fem> => root + "y^yaN" ;
|
||||||
|
|
||||||
|
<Imperf, Pers1, Sg, Masc> => nadaa ;
|
||||||
|
<Imperf, Pers1, Sg, Fem> => nadii ;
|
||||||
|
<Imperf, Pers1, Pl, Masc> => nade ;
|
||||||
|
<Imperf, Pers1, Pl, Fem> => nadiiaaN ;
|
||||||
|
|
||||||
|
<Imperf, Pers2_Casual, Sg, Masc> => nadaa ;
|
||||||
|
<Imperf, Pers2_Casual, Sg, Fem> => nadii ;
|
||||||
|
<Imperf, Pers2_Casual, Pl, Masc> => nade ;
|
||||||
|
<Imperf, Pers2_Casual, Pl, Fem> => nadiiaaN ;
|
||||||
|
<Imperf, Pers2_Respect, Sg, _> => nade ;
|
||||||
|
<Imperf, Pers2_Respect, Pl, Masc> => nade ;
|
||||||
|
<Imperf, Pers2_Respect, Pl, Fem> => variants {nade;nadiiaaN} ;
|
||||||
|
<Imperf, _, Sg, Masc> => nadaa ;
|
||||||
|
<Imperf, _, Sg, Fem> => nadii ;
|
||||||
|
<Imperf, _, Pl, Masc> => nade ;
|
||||||
|
<Imperf, _, Pl, Fem> => nadiiaaN
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkCmnVF2 : Str -> VTense -> PPerson -> Number -> Gender -> {s:Str}= \root,t,p,n,g ->
|
||||||
|
{s = let daa = root + "da" ;
|
||||||
|
dii = root + "dy" ;
|
||||||
|
de = root + "dE" ;
|
||||||
|
diiaaN = root + "dyaN"
|
||||||
|
in
|
||||||
|
case <t,p,n,g> of {
|
||||||
|
<Subj,Pers1, Sg,_> => root + "aN" ;
|
||||||
|
<Subj,Pers1, Pl,_> => root+"y^E" ;
|
||||||
|
<Subj,Pers2_Casual, Sg,_> => root ;
|
||||||
|
<Subj,Pers2_Casual, Pl,_> => root + "w" ;
|
||||||
|
<Subj,Pers2_Respect, _, _> => root + "w" ;
|
||||||
|
|
||||||
|
<Subj,_, Sg,_> => root + "E" ;
|
||||||
|
<Subj,_, Pl,_> => root+"n" ;
|
||||||
|
|
||||||
|
<Perf, Pers1, Sg,Masc> => root+"ya";
|
||||||
|
<Perf, Pers1, Sg,Fem> => root + "y" ;
|
||||||
|
<Perf, Pers1, Pl,Masc> => root + "E" ;
|
||||||
|
<Perf, Pers1, Pl,Fem> => root + "yaN" ;
|
||||||
|
<Perf, Pers2_Casual, Sg,Masc> => root+"ya";
|
||||||
|
<Perf, Pers2_Casual, Sg,Fem> => root + "y" ;
|
||||||
|
<Perf, Pers2_Casual, Pl,Masc> => root + "E" ;
|
||||||
|
<Perf, Pers2_Casual, Pl,Fem> => root + "yaN" ;
|
||||||
|
<Perf, Pers2_Respect,_,_> => root + "E" ;
|
||||||
|
|
||||||
|
<Perf, _, Sg,Masc> => root+"ya" ;
|
||||||
|
<Perf, _, Sg,Fem> => root + "y" ;
|
||||||
|
<Perf, _, Pl,Masc> => root + "E" ;
|
||||||
|
<Perf, _, Pl,Fem> => root + "yaN" ;
|
||||||
|
|
||||||
|
<Imperf, Pers1, Sg, Masc> => daa ;
|
||||||
|
<Imperf, Pers1, Sg, Fem> => dii ;
|
||||||
|
<Imperf, Pers1, Pl, Masc> => de ;
|
||||||
|
<Imperf, Pers1, Pl, Fem> => diiaaN ;
|
||||||
|
|
||||||
|
<Imperf, Pers2_Casual, Sg, Masc> => daa ;
|
||||||
|
<Imperf, Pers2_Casual, Sg, Fem> => dii ;
|
||||||
|
<Imperf, Pers2_Casual, Pl, Masc> => de ;
|
||||||
|
<Imperf, Pers2_Casual, Pl, Fem> => diiaaN ;
|
||||||
|
<Imperf, Pers2_Respect, Sg, _> => de ;
|
||||||
|
<Imperf, Pers2_Respect, Pl, Masc> => de ;
|
||||||
|
<Imperf, Pers2_Respect, Pl, Fem> => variants {de;diiaaN} ;
|
||||||
|
<Imperf, _, Sg, Masc> => daa ;
|
||||||
|
<Imperf, _, Sg, Fem> => dii ;
|
||||||
|
<Imperf, _, Pl, Masc> => de ;
|
||||||
|
<Imperf, _, Pl, Fem> => diiaaN
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--v4
|
||||||
|
{- mkV4 : Str -> Verb4 = \inf ->
|
||||||
|
let root = (tk 2 inf);
|
||||||
|
in { s = table {
|
||||||
|
Root => root ;
|
||||||
|
|
||||||
|
Inf4 => inf ;
|
||||||
|
Inf_Fem4 => ((tk 1 inf) + "y") ;
|
||||||
|
Inf_Obl4 => (tk 1 inf) ;
|
||||||
|
Ablative4 => ((tk 1 inf) + "wN") ;
|
||||||
|
|
||||||
|
MVF4 tense person number gender => (mkCmnVF root tense person number gender).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
-}
|
||||||
|
}
|
||||||
126
lib/src/punjabi/src/NumeralPnb.gf
Normal file
126
lib/src/punjabi/src/NumeralPnb.gf
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
concrete NumeralPnb of Numeral = CatPnb ** open ResPnb, Prelude in {
|
||||||
|
-- By Harald Hammarstroem
|
||||||
|
-- Modification for Punjabi by Shafqat Virk
|
||||||
|
flags coding=utf8 ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
param DForm = unit | ten ;
|
||||||
|
param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ;
|
||||||
|
param Size = singl | less100 | more100 ;
|
||||||
|
|
||||||
|
oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat Dig = { s:Str ; n : Number};
|
||||||
|
lincat Digit = LinDigit ;
|
||||||
|
lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ;
|
||||||
|
lincat Sub100 = {s : Str ; size : Size ; n : Number} ;
|
||||||
|
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ;
|
||||||
|
lincat Sub1000000 = { s : Str ; n : Number } ;
|
||||||
|
|
||||||
|
lin num x0 =
|
||||||
|
{s = table {
|
||||||
|
NCard => x0.s ;
|
||||||
|
NOrd => x0.s ++ "waN" -- (mkOrd x0.s) need to use mkOrd which will make irregular ordinals but it gives path error
|
||||||
|
};
|
||||||
|
n = x0.n
|
||||||
|
} ;
|
||||||
|
oper mkOrd : Str -> Str =
|
||||||
|
\s -> case s of {
|
||||||
|
"ek" => "pyla";
|
||||||
|
"dw" => "dwja";
|
||||||
|
"tn" => "dwja";
|
||||||
|
"car" => "cwth'a";
|
||||||
|
_ => s ++ "waN"
|
||||||
|
};
|
||||||
|
-- {s = \\_ => x0.s ; n = x0.n} ;
|
||||||
|
|
||||||
|
|
||||||
|
oper mkNum : Str -> Str -> DSize -> LinDigit =
|
||||||
|
\do -> \bis -> \sz ->
|
||||||
|
{s = table {unit => do ; ten => bis } ;
|
||||||
|
size = sz ; n = Pl} ;
|
||||||
|
|
||||||
|
lin n2 = mkNum "dw" "vy" r2 ;
|
||||||
|
lin n3 = mkNum "tn" "try" r3 ;
|
||||||
|
lin n4 = mkNum "car" "caly" r4 ;
|
||||||
|
lin n5 = mkNum "pnj" "pnjah" r5 ;
|
||||||
|
lin n6 = mkNum "ch-" "sTh-" r6 ;
|
||||||
|
lin n7 = mkNum "st" "str" r7;
|
||||||
|
lin n8 = mkNum "aTh-" "asy" r8;
|
||||||
|
lin n9 = mkNum "nw" "nbE" r9 ;
|
||||||
|
|
||||||
|
oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table {
|
||||||
|
sg => a1 + "aN" ;
|
||||||
|
r2 => a2 + "y" ;
|
||||||
|
r3 => a3 + "y" ;
|
||||||
|
r4 => a4 + "aly" ;
|
||||||
|
r5 => a5 + "nja" ;
|
||||||
|
r6 => a6 + "Th'" ;
|
||||||
|
r7 => a7 + "tr" ;
|
||||||
|
r8 => a8 + "asy" ;
|
||||||
|
r9 => a9 + "anwE"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper rows : DSize => DSize => Str = table {
|
||||||
|
sg => mkR "gyar" "ikk" "ikt" "ekta" "ikw" "ika" "ikh" "ik" "iky" ;
|
||||||
|
r2 => mkR "bar" "ba" "bt" "bay" "by" "bw" "bh" "by" "b" ;
|
||||||
|
r3 => mkR "tyr" "ty" "tyt" "tnt" "trt" "trw" "tyh" "tyr" "tr" ;
|
||||||
|
r4 => mkR "cwd" "cwb" "cwt" "cwa" "cwt" "cwr" "cwh" "cwr" "cwr" ;
|
||||||
|
r5 => mkR "pndr" "pnj" "pynt" "pnta" "pcw" "pyn" "pnj" "pnj" "pc" ;
|
||||||
|
r6 => mkR "swl" "ch'b" "ch't" "ch-y" "ch'w" "ch'ya" "ch'h" "ch'y" "ch'y" ;
|
||||||
|
r7 => mkR "star" "sta" "synt" "snt" "snt" "stw" "st" "st" "st" ;
|
||||||
|
r8 => mkR "aTh'ar" "aTh'a" "aTh't" "aRt" "aTh'w" "aTh'a" "aTh'" "aTh'" "aTh'" ;
|
||||||
|
r9 => table {sg => "any" ; r2 => "anty" ; r3 => "antaly" ;
|
||||||
|
r4 => "anaja" ; r5 => "anaTh'" ; r6 => "anhtr" ;
|
||||||
|
r7 => "anasy" ;
|
||||||
|
r8 => "ananwE" ; r9 => "nRynwE" }
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||||
|
|
||||||
|
lin pot01 = {s = table {unit => "ak" ; _ => "dummy" } ; size = sg ; n = Sg} ;
|
||||||
|
lin pot0 d = d ;
|
||||||
|
lin pot110 = {s = "das" ; size = less100 ; n = Pl} ;
|
||||||
|
lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ;
|
||||||
|
lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ;
|
||||||
|
lin pot0as1 n = {s = n.s ! unit ; size = table {sg => singl ; _ => less100} ! n.size ; n = n.n } ;
|
||||||
|
|
||||||
|
lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ;
|
||||||
|
lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ;
|
||||||
|
|
||||||
|
lin pot1as2 n = {s = n.s ; s2 = "dummy" ; size = n.size ; n = n.n} ;
|
||||||
|
lin pot2 d = {s = (mksau (d.s ! unit) d.size) ;
|
||||||
|
s2 = d.s ! unit ++ "lkh'" ; size = more100 ; n = d.n} ;
|
||||||
|
lin pot2plus d e =
|
||||||
|
{s = (mksau (d.s ! unit) d.size) ++ e.s ;
|
||||||
|
s2 = (d.s ! unit) ++ "lkh'" ++ (mkhazar e.s e.size) ;
|
||||||
|
size = more100 ; n = d.n} ;
|
||||||
|
|
||||||
|
lin pot2as3 n = {s = n.s ; n = n.n} ;
|
||||||
|
lin pot3 n = {s = table { singl => ekhazar ;
|
||||||
|
less100 => n.s ++ "hzar" ;
|
||||||
|
more100 => n.s2 } ! n.size ; n = n.n} ;
|
||||||
|
lin pot3plus n m =
|
||||||
|
{s = table {singl => ekhazar ;
|
||||||
|
less100 => n.s ++ "hzar" ;
|
||||||
|
more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ;
|
||||||
|
|
||||||
|
lin D_0 = { s = "N0" ; n = Sg};
|
||||||
|
lin D_1 = { s = "N1" ; n = Sg};
|
||||||
|
lin D_2 = { s = "N2" ; n = Pl};
|
||||||
|
lin D_3 = { s = "N3" ; n = Pl};
|
||||||
|
lin D_4 = { s = "N4" ; n = Pl};
|
||||||
|
lin D_5 = { s = "N5" ; n = Pl};
|
||||||
|
lin D_6 = { s = "N6" ; n = Pl};
|
||||||
|
lin D_7 = { s = "N7" ; n = Pl};
|
||||||
|
lin D_8 = { s = "N8" ; n = Pl};
|
||||||
|
lin D_9 = { s = "N9" ; n = Pl};
|
||||||
|
lin IDig d = { s = \\_ => d.s ; n = d.n} ;
|
||||||
|
lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl };
|
||||||
|
|
||||||
|
oper ekhazar : Str = variants {"hzar" ; "ak" ++ "hzar"} ;
|
||||||
|
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "hzar"} ! sz ;
|
||||||
|
oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "sw" ; _ => s ++ "sw"} ! sz ;
|
||||||
|
}
|
||||||
75
lib/src/punjabi/src/QuestionPnb.gf
Normal file
75
lib/src/punjabi/src/QuestionPnb.gf
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
concrete QuestionPnb of Question = CatPnb ** open ResPnb, 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 ! ResPnb. Voc ++ p.s } ;
|
||||||
|
|
||||||
|
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 ! Dir) ;
|
||||||
|
AdvIAdv i a = {s = i.s ++ a.s ! Masc} ;
|
||||||
|
|
||||||
|
}
|
||||||
73
lib/src/punjabi/src/RelativePnb.gf
Normal file
73
lib/src/punjabi/src/RelativePnb.gf
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
concrete RelativePnb of Relative = CatPnb ** open ResPnb 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 and RelSlash slows the linking process a lot this is why it is commented for test purposes
|
||||||
|
|
||||||
|
{- 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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
---- Pied piping: "at which we are looking". Stranding and empty
|
||||||
|
---- relative are defined in $ExtraHin.gf$ ("that we are looking at",
|
||||||
|
---- "we are looking at").
|
||||||
|
--
|
||||||
|
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 ;
|
||||||
|
a = RAg np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdRP = {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
|
||||||
|
ResPnb.Dir => "jeRa" ;
|
||||||
|
ResPnb.Obl => "jeRE" ;
|
||||||
|
ResPnb.Voc => "jeRE" ;
|
||||||
|
ResPnb.Abl => "jeRE"
|
||||||
|
};
|
||||||
|
Pl => table {
|
||||||
|
ResPnb.Dir => "jeRE" ;
|
||||||
|
ResPnb.Obl => "jeRE" ;
|
||||||
|
ResPnb.Voc => "jeRE" ;
|
||||||
|
ResPnb.Abl => "jeRE"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
a = RNoAg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
634
lib/src/punjabi/src/ResPnb.gf
Normal file
634
lib/src/punjabi/src/ResPnb.gf
Normal file
@@ -0,0 +1,634 @@
|
|||||||
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
--
|
||||||
|
--1 Pnbu auxiliary operations.
|
||||||
|
--
|
||||||
|
-- This module contains operations that are needed to make the
|
||||||
|
-- resource syntax work.
|
||||||
|
|
||||||
|
resource ResPnb = ParamX ** open Prelude,Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
param
|
||||||
|
Case = Dir | Obl | Voc | Abl ;
|
||||||
|
Gender = Masc | Fem ;
|
||||||
|
VTense = Subj | Perf | Imperf;
|
||||||
|
PPerson = Pers1
|
||||||
|
| Pers2_Casual
|
||||||
|
| Pers2_Respect
|
||||||
|
| Pers3_Near
|
||||||
|
| Pers3_Distant;
|
||||||
|
|
||||||
|
Order = ODir | OQuest ;
|
||||||
|
|
||||||
|
--2 For $Relative$
|
||||||
|
|
||||||
|
RAgr = RNoAg | RAg Agr ;
|
||||||
|
RCase = RC Number Case ;
|
||||||
|
|
||||||
|
-- for Numerial
|
||||||
|
|
||||||
|
CardOrd = NCard | NOrd ;
|
||||||
|
|
||||||
|
-----------------------------------------
|
||||||
|
-- Punjabi Pronouns
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
Pronoun = P Number Gender Case PPerson;
|
||||||
|
PersPronForm = PPF Number PPerson Case;
|
||||||
|
|
||||||
|
-------------------------------------------
|
||||||
|
--Verbs
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
VerbForm4 =
|
||||||
|
VF VTense PPerson Number Gender
|
||||||
|
| Inf | Inf_Fem | Inf_Obl | Ablative
|
||||||
|
| Root ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
Noun = {s : Number => Case => Str ; g : Gender} ;
|
||||||
|
Verb = {s : VerbForm4 => Str} ;
|
||||||
|
Preposition = {s : 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)) ;
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
-- Pnb Adjectives
|
||||||
|
-----------------------------------------------
|
||||||
|
Adjective1 = {s : Number => Gender => Case => Str} ;
|
||||||
|
-- Adjective2 = {s : Number => Case => Str} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkAdj1 : Str -> Adjective1 ;
|
||||||
|
mkAdj1 piilaa = let end = last (piilaa) ;
|
||||||
|
piil = if_then_else Str (eq end "e") piilaa (tk 1 piilaa)
|
||||||
|
in adj1 (piilaa) (piil+"E") (variants{piil+"ya"; piil+"E"}) (piil+"ywN") (piil+"E") (piil+"yaN") (piil+"yw") ""
|
||||||
|
(piil+"y") (piil+"y") (variants{piil+"y" ; piil+"yE"}) (piil+"ywN") (piil+"y") (piil+"yaN") (piil+"yw") "" ;
|
||||||
|
|
||||||
|
adj1 :(x1,_,_,_,_,_,_, _,_,_,_,_,_,_,_, x16 : Str) -> {s : Number => Gender => Case => Str} =
|
||||||
|
\msd,mso,msv,msa, mpd,mpo,mpv,mpa, fsd,fso,fsv,fsa, fpd,fpo,fpv,fpa -> {
|
||||||
|
s = table {
|
||||||
|
Sg => (cmnAdj msd mso msv msa fsd fso fsv fsa).s ;
|
||||||
|
Pl => (cmnAdj mpd mpo mpv mpa fpd fpo fpv fpa).s
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- mkAdj2 : Str -> Adjective2 ;
|
||||||
|
-- mkAdj2 romii = cmnAdj romii romii (romii+"a") (romii+"ywN")
|
||||||
|
-- romii (romii++"aN") (romii++"w") "" ;
|
||||||
|
|
||||||
|
cmnAdj : (x1,_,_,_,_,_,_,x8 : Str) -> {s : Gender => Case => Str} =
|
||||||
|
\sd,so,sv,sa, pd,po,pv,pa -> {
|
||||||
|
s = table {
|
||||||
|
Masc => table {
|
||||||
|
Dir => sd ;
|
||||||
|
Obl => so ;
|
||||||
|
Voc => sv ;
|
||||||
|
Abl => sa
|
||||||
|
} ;
|
||||||
|
Fem => table {
|
||||||
|
Dir => pd ;
|
||||||
|
Obl => po ;
|
||||||
|
Voc => pv ;
|
||||||
|
Abl => pa
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RefPron : Str;
|
||||||
|
RefPron = "Kwd";
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
-- Grammar part
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
param
|
||||||
|
Agr = Ag Gender Number PPerson ;
|
||||||
|
NPCase = NPC Case | NPObj | NPErg ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
np2pronCase : (Case => Str) -> NPCase -> Agr -> Str = \ppf,npc,a -> case npc of {
|
||||||
|
NPC c => ppf ! c;
|
||||||
|
NPObj => ppf ! Obl ;
|
||||||
|
NPErg => case (fromAgr a).p of {
|
||||||
|
(Pers3_Near|Pers3_Distant) => ppf ! Dir ++ "nE" ;
|
||||||
|
_ => ppf ! Dir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
------------------------------------------
|
||||||
|
-- Agreement transformations
|
||||||
|
-----------------------------------------
|
||||||
|
toAgr : Number -> PPerson -> Gender -> Agr = \n,p,g ->
|
||||||
|
Ag g n p;
|
||||||
|
|
||||||
|
|
||||||
|
fromAgr : Agr -> {n : Number ; p : PPerson ; 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 ; isPron : Bool} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
CTense = CPresent | CPast | CFuture ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
copula : CTense -> Number -> PPerson -> Gender -> Str = \t,n,p,g ->
|
||||||
|
case <t,n,p,g> of {
|
||||||
|
<CPresent,Sg,Pers1,_ > => "waN" ;
|
||||||
|
<CPresent,Sg,Pers2_Casual,_ > => "ayN" ;
|
||||||
|
<CPresent,Sg,Pers2_Respect,_ > => "aw" ;
|
||||||
|
<CPresent,Sg,_,_ > => "aE" ;
|
||||||
|
-- <CPresent,Sg,Pers3_Distant,_ > => "aE" ;
|
||||||
|
<CPresent,Pl,Pers1,_ > => "waN" ;
|
||||||
|
<CPresent,Pl,Pers2_Casual,_ > => "aw" ;
|
||||||
|
<CPresent,Pl,Pers2_Respect,_ > => "aw" ;
|
||||||
|
<CPresent,Pl,_,_ > => "nE" ;
|
||||||
|
-- <CPresent,Pl,Pers3_Distant,_ > => "nE" ;
|
||||||
|
<CPast,Sg,Pers1,_ > => "saN" ;
|
||||||
|
-- <CPast,Sg,Pers2_Casual,Masc > => "sy" ;
|
||||||
|
<CPast,Sg,Pers2_Casual,_ > => "syN" ;
|
||||||
|
<CPast,Sg,Pers2_Respect,_ > => "sw" ;
|
||||||
|
-- <CPast,Sg,Pers2_Respect,Fem > => "syN" ;
|
||||||
|
<CPast,Sg,_,_ > => "sy" ;
|
||||||
|
-- <CPast,Sg,Pers3_Near,Fem > => "th-y" ;
|
||||||
|
-- <CPast,Sg,Pers3_Distant,_ > => "sy" ;
|
||||||
|
-- <CPast,Sg,Pers3_Distant,Fem > => "th-y" ;
|
||||||
|
<CPast,Pl,Pers1,_ > => "saN" ;
|
||||||
|
<CPast,Pl,Pers2_Casual,_ > => "sw" ;
|
||||||
|
<CPast,Pl,Pers2_Respect,_ > => "sw" ;
|
||||||
|
<CPast,Pl,_,_ > => "sN" ;
|
||||||
|
-- <CPast,Pl,Pers3_Distant,_ > => "sn" ;
|
||||||
|
<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_Respect,Masc > => "gE" ;
|
||||||
|
<CFuture,Sg,Pers2_Respect,Fem > => "gE" ;
|
||||||
|
<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 > => "gyaN" ;
|
||||||
|
<CFuture,Pl,Pers2_Casual,Masc > => "gE" ;
|
||||||
|
<CFuture,Pl,Pers2_Casual,Fem > => "gyaN" ;
|
||||||
|
<CFuture,Pl,Pers2_Respect,Masc > => "gE" ;
|
||||||
|
<CFuture,Pl,Pers2_Respect,Fem > => "gyaN" ;
|
||||||
|
<CFuture,Pl,Pers3_Near,Masc > => "gE" ;
|
||||||
|
<CFuture,Pl,Pers3_Near,Fem > => "gyaN" ;
|
||||||
|
<CFuture,Pl,Pers3_Distant,Masc > => "gE" ;
|
||||||
|
<CFuture,Pl,Pers3_Distant,Fem > => "gyaN"
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
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"
|
||||||
|
;
|
||||||
|
|
||||||
|
VPHForm =
|
||||||
|
VPTense VPPTense Agr -- 9 * 12
|
||||||
|
| VPReq
|
||||||
|
| VPImp
|
||||||
|
| VPReqFut
|
||||||
|
| VPInf
|
||||||
|
| VPStem
|
||||||
|
;
|
||||||
|
|
||||||
|
VType = VIntrans | VTrans | VTransPost ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
objVType : VType -> NPCase = \vt -> case vt of {
|
||||||
|
VTrans => NPObj ;
|
||||||
|
_ => NPC Obl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPH : Type = {
|
||||||
|
s : VPHForm => {fin, inf : Str} ;
|
||||||
|
obj : {s : Str ; a : Agr} ;
|
||||||
|
subj : VType ;
|
||||||
|
comp : Agr => Str;
|
||||||
|
inf : Str;
|
||||||
|
ad : Str;
|
||||||
|
embComp : Str ;
|
||||||
|
prog : Bool ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPHSlash = VPH ** {c2 : Compl} ;
|
||||||
|
|
||||||
|
Compl : Type = {s : Str ; c : VType} ;
|
||||||
|
|
||||||
|
predV : Verb -> VPH = \verb -> {
|
||||||
|
s = \\vh =>
|
||||||
|
case vh of {
|
||||||
|
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = verb.s ! VF Imperf p n g } ;
|
||||||
|
VPTense VPPast (Ag g n p) => {fin = [] ; inf =verb.s ! VF Perf p n g} ;
|
||||||
|
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = verb.s ! VF Subj p n g } ;
|
||||||
|
VPTense VPPerf (Ag g n p) => { fin = [] ; inf = verb.s ! Root ++ cka g n } ;
|
||||||
|
VPStem => {fin = [] ; inf = verb.s ! Root};
|
||||||
|
_ => {fin = [] ; inf = verb.s ! Root}
|
||||||
|
};
|
||||||
|
obj = {s = [] ; a = defaultAgr} ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.s ! Inf;
|
||||||
|
ad = [];
|
||||||
|
embComp = [];
|
||||||
|
prog = False ;
|
||||||
|
comp = \\_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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} } ;
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
raha : Gender -> Number -> Str = \g,n ->
|
||||||
|
(mkAdj1 "rya").s ! n ! g ! Dir ;
|
||||||
|
pya : Gender -> Number -> Str = \g,n ->
|
||||||
|
(mkAdj1 "pya").s ! n ! g ! Dir ;
|
||||||
|
|
||||||
|
cka : Gender -> Number -> Str = \g,n ->
|
||||||
|
(mkAdj1 "cka").s ! n ! g ! Dir ;
|
||||||
|
|
||||||
|
hw : PPerson -> Number -> Str = \pp,n ->
|
||||||
|
case <pp,n> of {
|
||||||
|
<Pers1,_> => "hwwaN";
|
||||||
|
<Pers2_Casual,Sg> => "hwwyN";
|
||||||
|
<Pers2_Casual,Pl> => "hww";
|
||||||
|
<Pers2_Respect,_> => "hww";
|
||||||
|
<Pers3_Distant,Sg> => "hwwE";
|
||||||
|
<Pers3_Distant,Pl> => "hwn";
|
||||||
|
<Pers3_Near,Sg> => "hwwE";
|
||||||
|
<Pers3_Near,Pl> => "hwn"
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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!VPTense VPPres (Ag g n p)).inf ++ pya g n} ;
|
||||||
|
VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = (verb.s!VPTense VPPres (Ag g n p)).inf ++ pya g n} ;
|
||||||
|
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = (verb.s!VPTense VPPres (Ag g n p)).inf } ;
|
||||||
|
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 } ;
|
||||||
|
-- {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 } ;
|
||||||
|
{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 => "ky" };
|
||||||
|
na =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "na" };
|
||||||
|
nahim =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "nyN" };
|
||||||
|
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 ++ pya g n } ;
|
||||||
|
VPContPast =>
|
||||||
|
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ pya g n } ;
|
||||||
|
VPContFut =>
|
||||||
|
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ pya 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 ++ pya g n } ;
|
||||||
|
VPPerfPastCont =>
|
||||||
|
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ pya g n } ;
|
||||||
|
VPPerfFutCont =>
|
||||||
|
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ pya g n ++ hw p n } ;
|
||||||
|
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "ky" };
|
||||||
|
na =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "na" };
|
||||||
|
nahim =
|
||||||
|
case b of
|
||||||
|
{ Pos => [];
|
||||||
|
Neg => "nyN" };
|
||||||
|
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 : PPerson -> 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 -> VPH = \obj1,vp,emb,vp2 -> {
|
||||||
|
s = vp.s ;
|
||||||
|
-- obj = vp.obj ;
|
||||||
|
obj = vp2.obj ;
|
||||||
|
subj = vp.subj ;
|
||||||
|
inf = vp.inf;
|
||||||
|
ad = vp.ad;
|
||||||
|
embComp = vp.embComp ++ emb; -- this should be covered in urdu as well
|
||||||
|
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.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin }; -- need to be checked and should be covered in urdu as well
|
||||||
|
case isAux of {False => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin }; -- need to be checked and should be covered in urdu as well
|
||||||
|
infV2V : Bool -> VPH -> Str = \isAux,vp ->
|
||||||
|
-- case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ++ "dy" ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ "dy"}; -- need to be checked and should be covered in urdu as well
|
||||||
|
case isAux of {False => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ++ "dy" ; True => (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ "dy"}; -- need to be checked and should be covered in urdu as well
|
||||||
|
|
||||||
|
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||||
|
s = vps.s ;
|
||||||
|
obj = case np.isPron of {
|
||||||
|
False => {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ;
|
||||||
|
_ => {s = vps.obj.s ++ np.s ! objVType vps.c2.c ; 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" ;
|
||||||
|
checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of {
|
||||||
|
True => np.s ! NPC Obl;
|
||||||
|
False => np.s ! NPC Obl ++ str} ;
|
||||||
|
|
||||||
|
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 = case vtype of {VIntrans => VTransPost ; VTrans => VTrans ; _ => vtype} ; -- still some problem not working properly
|
||||||
|
ad = vp.ad;
|
||||||
|
embComp = vp.embComp ;
|
||||||
|
prog = vp.prog ;
|
||||||
|
comp = vp.comp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
103
lib/src/punjabi/src/SentencePnb.gf
Normal file
103
lib/src/punjabi/src/SentencePnb.gf
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
concrete SentencePnb of Sentence = CatPnb ** open Prelude, ResPnb 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 ; 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 ResPnb
|
||||||
|
|
||||||
|
};
|
||||||
|
} ;
|
||||||
|
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};
|
||||||
|
|
||||||
|
}
|
||||||
130
lib/src/punjabi/src/StructuralPnb.gf
Normal file
130
lib/src/punjabi/src/StructuralPnb.gf
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
concrete StructuralPnb of Structural = CatPnb **
|
||||||
|
open MorphoPnb, ParadigmsPnb, Prelude, NounPnb in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
above_Prep = ss "atE" ;
|
||||||
|
after_Prep = ss "twN bed" ;
|
||||||
|
all_Predet = ss "sarE" ;
|
||||||
|
almost_AdA, almost_AdN = ss "tqryba" ;
|
||||||
|
although_Subj = ss "pawyN" ;
|
||||||
|
always_AdV = ss "hmyXh" ;
|
||||||
|
and_Conj = sd2 [] "tE" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "kywnkh'" ;
|
||||||
|
before_Prep = ss "plE" ;
|
||||||
|
behind_Prep = ss "pych'E" ;
|
||||||
|
between_Prep = ss "wckar" ;
|
||||||
|
both7and_DConj = sd2 "dwwyN" "tE" ** {n = Pl} ;
|
||||||
|
but_PConj = ss "lykn" ;
|
||||||
|
by8agent_Prep = ss "" ;
|
||||||
|
by8means_Prep = ss "" ;
|
||||||
|
can8know_VV,can_VV = mkV "skna" ** { isAux = True} ;
|
||||||
|
during_Prep = ss ["dE wc"] ;
|
||||||
|
either7or_DConj = sd2 "kwy ak" "ya" ** {n = Sg} ;
|
||||||
|
everybody_NP = MassNP (UseN (MorphoPnb.mkN11 "hr kwy")); -- not a good way coz need to include NounPnb
|
||||||
|
every_Det = mkDet "hr" "hr" "hr" "hr" Sg;
|
||||||
|
everything_NP = MassNP (UseN (MorphoPnb.mkN11 "hr XE"));
|
||||||
|
everywhere_Adv = mkAdv "hr th'aN" ;
|
||||||
|
few_Det = mkDet "kch'" "kch'" "kch'" "kch'" Pl ;
|
||||||
|
first_Ord = {s = "pehla" ; n = Sg} ; --DEPRECATED
|
||||||
|
for_Prep = ss "[dE wast-E]" ;
|
||||||
|
from_Prep = ss "twN" ;
|
||||||
|
he_Pron = personalPN "aw" "aynwN" "aw" "" "awra" Sg Masc Pers3_Distant ;
|
||||||
|
here_Adv = mkAdv "ayth'E" ;
|
||||||
|
here7to_Adv = mkAdv "ayth'E" ;
|
||||||
|
here7from_Adv = mkAdv "ayth'wN" ;
|
||||||
|
how_IAdv = ss "ksraN" ;
|
||||||
|
how8many_IDet = makeIDet "kynE" "kyny" Pl ;
|
||||||
|
how8much_IAdv = ss "kyna" ;
|
||||||
|
if_Subj = ss "agr" ;
|
||||||
|
in8front_Prep = ss ["dE samnE"] ;
|
||||||
|
i_Pron = personalPN "myN" "mynwN" "mynwN" "mytwN" "myra" Sg Masc Pers1;
|
||||||
|
in_Prep = ss "wc" ;
|
||||||
|
it_Pron = personalPN "aE" "aynwN" "aynwN" "" "ayra" Sg Masc Pers3_Near;
|
||||||
|
less_CAdv = {s = "kT" ; p = ""} ;
|
||||||
|
many_Det = mkDet "bht zyadh" "bht zyadh" "bht zyadh" "bht zyadh" Pl ;
|
||||||
|
more_CAdv = {s = "hwr" ; p = "" } ;
|
||||||
|
most_Predet = ss "zyadh tr" ;
|
||||||
|
much_Det = mkDet "bht" "bht" "bht" "bht" Sg ;
|
||||||
|
-- must_VV = {
|
||||||
|
-- s = table {
|
||||||
|
-- VVF VInf => ["have to"] ;
|
||||||
|
-- VVF VPres => "must" ;
|
||||||
|
-- VVF VPPart => ["had to"] ;
|
||||||
|
-- VVF VPresPart => ["having to"] ;
|
||||||
|
-- VVF VPast => ["had to"] ; --# notpresent
|
||||||
|
-- VVPastNeg => ["hadn't to"] ; --# notpresent
|
||||||
|
-- VVPresNeg => "mustn't"
|
||||||
|
-- } ;
|
||||||
|
-- isAux = True
|
||||||
|
-- } ;
|
||||||
|
-----b no_Phr = ss "no" ;
|
||||||
|
no_Utt = ss "nyN" ;
|
||||||
|
on_Prep = ss "atE" ;
|
||||||
|
one_Quant = demoPN "ak" "ak" "ak" ; -- DEPRECATED
|
||||||
|
only_Predet = ss "srf" ;
|
||||||
|
or_Conj = sd2 [] "ya" ** {n = Sg} ;
|
||||||
|
otherwise_PConj = ss "ya fyr" ;
|
||||||
|
part_Prep = ss "hSh" ;
|
||||||
|
please_Voc = ss "mhrbani" ;
|
||||||
|
possess_Prep = ss "da" ;
|
||||||
|
quite_Adv = ss "khamosh" ;
|
||||||
|
she_Pron = personalPN "aw" "awnwN" "awnw" "" "awra" Sg Fem Pers3_Distant ;
|
||||||
|
so_AdA = ss "so" ;
|
||||||
|
somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "kwy" ));
|
||||||
|
someSg_Det = mkDet "kch'" "kch'" "kch'" "kch'" Sg ;
|
||||||
|
somePl_Det = mkDet "kch'" "kch'" "kch'" "kch'" Pl ;
|
||||||
|
something_NP = MassNP (UseN (MorphoPnb.mkN11 "kwy XE"));
|
||||||
|
somewhere_Adv = mkAdv "ktlE" ;
|
||||||
|
that_Quant = demoPN "wh" "as" "an" ;
|
||||||
|
that_Subj = ss "kh";
|
||||||
|
there_Adv = mkAdv "awth'E" ;
|
||||||
|
there7to_Adv = mkAdv "awth'E" ;
|
||||||
|
there7from_Adv = mkAdv "awth'wN" ;
|
||||||
|
therefore_PConj = ss "as ly" ;
|
||||||
|
they_Pron = personalPN "aw" "[awnaN nwN]" "aw" "" "awnaN da" Pl Masc Pers3_Distant ; ----
|
||||||
|
this_Quant = demoPN "yh" "as" "an";
|
||||||
|
through_Prep = ss "wcwN" ;
|
||||||
|
too_AdA = ss "bht" ;
|
||||||
|
to_Prep = ss "awnwN" ** {lock_Prep = <>};
|
||||||
|
under_Prep = ss "th'lE" ** {lock_Prep = <>};
|
||||||
|
very_AdA = ss "bht" ;
|
||||||
|
want_VV = mkV "cana" ** { isAux = False} ;
|
||||||
|
we_Pron = personalPN "asy" "sanwN" "sanwN" "satwN" "saDa" Pl Masc Pers1 ;
|
||||||
|
-- whatSg_IP = mkIP "kya" "kis" "kis" Sg Masc ;
|
||||||
|
-- whatPl_IP = mkIP "kya" "kin" "kin" Pl Masc ;
|
||||||
|
when_IAdv = ss "kdwN" ;
|
||||||
|
when_Subj = ss "kdwN" ;
|
||||||
|
where_IAdv = ss "kth'E" ;
|
||||||
|
which_IQuant = {s = \\_ => "kyRy"} ;
|
||||||
|
-- whichPl_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ;
|
||||||
|
-- whichSg_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ;
|
||||||
|
-- whoSg_IP = mkIP "kwn" "kis" "kis" Sg Masc ;
|
||||||
|
-- whoPl_IP = mkIP "kwn" "kn" "knhwN" Pl Masc ;
|
||||||
|
why_IAdv = ss "kywN" ;
|
||||||
|
without_Prep = ss ["twN bGyr"] ;
|
||||||
|
with_Prep = ss ["dE nal"] ;
|
||||||
|
-- yes_Phr = ss "haN" ;
|
||||||
|
yes_Utt = ss "haN" ;
|
||||||
|
youSg_Pron = personalPN "twN" "tynwN" "tynwN" "tytwN" "twwaDa" Sg Masc Pers2_Casual ;
|
||||||
|
youPl_Pron = personalPN "tsy" "twanwN" "twanwN" "twatwN" "twwaDa" Pl Masc Pers2_Casual ;
|
||||||
|
youPol_Pron = personalPN "tsy" "twanwN" "twanwN" "twatwN" "twwaDa" Sg Masc Pers2_Respect ;
|
||||||
|
no_Quant = demoPN " kwy nhyN" "kwy nhyN" "kwy nhyN" ;
|
||||||
|
not_Predet = {s="nhyN"} ;
|
||||||
|
if_then_Conj = sd2 "agr" "tE" ** {n = Sg} ;
|
||||||
|
at_least_AdN = ss ["km twN km"] ;
|
||||||
|
at_most_AdN = ss ["zyadh twN zyadh"];
|
||||||
|
nothing_NP = MassNP (UseN (MorphoPnb.mkN11 "kch' nyN" ));
|
||||||
|
except_Prep = ss "swaE" ;
|
||||||
|
nobody_NP = MassNP (UseN (MorphoPnb.mkN11 "kwy nhyN"));
|
||||||
|
|
||||||
|
as_CAdv = {s = "aynaN" ; p = "jnaN"} ;
|
||||||
|
|
||||||
|
have_V2 = mkV2 (mkV "rakh'na") "" ;
|
||||||
|
|
||||||
|
language_title_Utt = ss "pnjaby" ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
47
lib/src/punjabi/src/SymbolPnb.gf
Normal file
47
lib/src/punjabi/src/SymbolPnb.gf
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
concrete SymbolPnb of Symbol = CatPnb ** open Prelude, ResPnb in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
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 "tE" ;
|
||||||
|
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 ++ "da" } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
45
lib/src/punjabi/src/VerbPnb.gf
Normal file
45
lib/src/punjabi/src/VerbPnb.gf
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
concrete VerbPnb of Verb = CatPnb ** open ResPnb in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
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 (\\_ => checkPron np v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ;
|
||||||
|
|
||||||
|
-- ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp ) (predV v) vp.embComp) VTransPost;
|
||||||
|
-- ComplVV v vp = insertVV (infVV v.isAux vp ) (predV v) vp.embComp;
|
||||||
|
ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp) (predV v) vp.embComp vp) vp.subj;
|
||||||
|
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 ) (predV v) ;
|
||||||
|
SlashV2V v vp = insertVV (infV2V v.isAux vp) (predV v) vp.embComp vp **{c2 = {s = "twN" ; c = VTransPost}} ; -- should creat a form at VP level which can be used in VP like 'swn da kyna' also check the c=VTransPost it is correct in case if second v is intrasitive, but not if trans like begged me to ead bread
|
||||||
|
SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = "twN" ; c = VTransPost}}) ;
|
||||||
|
SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = "nwN" ; c = VTransPost}}) ; -- chek for VTransPost, as in this case , case should be ergative but agrement should be default
|
||||||
|
SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ) (predV v ** {c2 = {s = "nwN" ; 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 ! (fromAgr a).g) 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 } ;
|
||||||
|
CompNP np = {s = \\_ => np.s ! NPObj} ;
|
||||||
|
CompAdv adv = {s = \\a => adv.s ! (fromAgr a).g } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
15
lib/src/punjabi/translit.gfs
Normal file
15
lib/src/punjabi/translit.gfs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
rf -file=src/AdjectivePnb.gf | ps -env=quotes -to_urdu | wf -file=AdjectivePnb.gf
|
||||||
|
rf -file=src/AdverbPnb.gf | ps -env=quotes -to_urdu | wf -file=AdverbPnb.gf
|
||||||
|
rf -file=src/ExtraPnb.gf | ps -env=quotes -to_urdu | wf -file=ExtraPnb.gf
|
||||||
|
rf -file=src/IdiomPnb.gf | ps -env=quotes -to_urdu | wf -file=IdiomPnb.gf
|
||||||
|
rf -file=src/LexiconPnb.gf | ps -env=quotes -to_urdu | wf -file=LexiconPnb.gf
|
||||||
|
rf -file=src/MorphoPnb.gf | ps -env=quotes -to_urdu | wf -file=MorphoPnb.gf
|
||||||
|
rf -file=src/NumeralPnb.gf | ps -env=quotes -to_urdu | wf -file=NumeralPnb.gf
|
||||||
|
rf -file=src/QuestionPnb.gf | ps -env=quotes -to_urdu | wf -file=QuestionPnb.gf
|
||||||
|
rf -file=src/RelativePnb.gf | ps -env=quotes -to_urdu | wf -file=RelativePnb.gf
|
||||||
|
rf -file=src/ResPnb.gf | ps -env=quotes -to_urdu | wf -file=ResPnb.gf
|
||||||
|
rf -file=src/SentencePnb.gf | ps -env=quotes -to_urdu | wf -file=SentencePnb.gf
|
||||||
|
rf -file=src/StructuralPnb.gf | ps -env=quotes -to_urdu | wf -file=StructuralPnb.gf
|
||||||
|
rf -file=src/SymbolPnb.gf | ps -env=quotes -to_urdu | wf -file=SymbolPnb.gf
|
||||||
|
rf -file=src/VerbPnb.gf | ps -env=quotes -to_urdu | wf -file=VerbPnb.gf
|
||||||
|
|
||||||
Reference in New Issue
Block a user