mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Nepali resource by Dinesh Simk - almost complete
This commit is contained in:
68
lib/src/nepali/AdjectiveNep.gf
Normal file
68
lib/src/nepali/AdjectiveNep.gf
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
concrete AdjectiveNep of Adjective = CatNep ** open ResNep, Prelude in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
lin
|
||||||
|
|
||||||
|
-- ALL THE RULES FROM BOOK ARE NOT COVERED
|
||||||
|
|
||||||
|
--PositA : A -> AP ; -- warm
|
||||||
|
PositA a = a ;
|
||||||
|
|
||||||
|
|
||||||
|
--ComparA : A -> NP -> AP ; -- warmer than I
|
||||||
|
ComparA a np = {
|
||||||
|
s = \\n, g => np.s ! NPC Nom ++ "भन्दा" ++ a.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--ComplA2 : A2 -> NP -> AP ; -- married to her
|
||||||
|
ComplA2 a np = {
|
||||||
|
s = \\n,g => np.s ! NPC Nom ++ a.c2 ++ a.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--ReflA2 : A2 -> AP ; -- married to itself
|
||||||
|
ReflA2 a = {
|
||||||
|
s = \\n, g => "आफै" ++ a.c2 ++ a.s ! n ! g ; -- आफै सँग
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--UseA2 : A2 -> AP ; -- married
|
||||||
|
UseA2 a = a ;
|
||||||
|
|
||||||
|
|
||||||
|
--UseComparA : A -> AP ; -- warmer
|
||||||
|
UseComparA a = {
|
||||||
|
s = \\n, g => "अली" ++ a.s ! n ! g ; -- अली
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--CAdvAP : CAdv -> AP -> NP -> AP ; -- as cool as John
|
||||||
|
CAdvAP cadv ap np = {
|
||||||
|
s = \\n,g => np.s ! NPC Nom ++ cadv.p ++ cadv.s ++ ap.s ! n ! g ;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
--AdjOrd : Ord -> AP ; -- warmest
|
||||||
|
AdjOrd ord = { s = \\_,_ => ord.s ; };
|
||||||
|
|
||||||
|
|
||||||
|
--SentAP : AP -> SC -> AP ; -- good that she is here
|
||||||
|
SentAP ap sc = {
|
||||||
|
s = \\n,g => sc.s ++ ap.s ! n ! g ;
|
||||||
|
--s = \\n,g => ap.s ! n ! g ++ sc.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--AdAP : AdA -> AP -> AP ; -- very warm
|
||||||
|
AdAP ada ap = {
|
||||||
|
s = \\n,g => ada.s ++ ap.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--AdvAP : AP -> Adv -> AP ; -- warm by nature
|
||||||
|
AdvAP ap adv = {
|
||||||
|
s = \\n,g => adv.s ++ ap.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
24
lib/src/nepali/AdverbNep.gf
Normal file
24
lib/src/nepali/AdverbNep.gf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
concrete AdverbNep of Adverb = CatNep ** open ResNep, Prelude, Predef in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
PositAdvAdj a = {s = a.s ! Sg ! Masc ++ "रि" } ;
|
||||||
|
|
||||||
|
ComparAdvAdj cadv a np = {
|
||||||
|
s = np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! Masc ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComparAdvAdjS cadv a s = {
|
||||||
|
s = cadv.p ++ cadv.s ++ a.s ! Sg ! Masc ++ s.s;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PrepNP prep np = {s = np.s ! NPObj ++ prep.s } ;
|
||||||
|
|
||||||
|
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
||||||
|
|
||||||
|
SubjS sub snt = {s = sub.s ++ snt.s } ;
|
||||||
|
|
||||||
|
AdnCAdv cadv = {s = cadv.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
6
lib/src/nepali/AllNep.gf
Normal file
6
lib/src/nepali/AllNep.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
|
concrete AllNep of AllNepAbs =
|
||||||
|
LangNep
|
||||||
|
-- ExtraNep
|
||||||
|
** {} ;
|
||||||
4
lib/src/nepali/AllNepAbs.gf
Normal file
4
lib/src/nepali/AllNepAbs.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
abstract AllNepAbs =
|
||||||
|
Lang
|
||||||
|
-- ExtraPnbAbs
|
||||||
|
** {} ;
|
||||||
99
lib/src/nepali/CatNep.gf
Normal file
99
lib/src/nepali/CatNep.gf
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
concrete CatNep of Cat = CommonX - [Adv] ** open ResNep, 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 : ResNep.Compl} ;
|
||||||
|
|
||||||
|
---- Sentence
|
||||||
|
|
||||||
|
Cl = ResNep.Clause ;
|
||||||
|
|
||||||
|
ClSlash = {
|
||||||
|
s : ResNep.VPHTense => Polarity => Order => Str ;
|
||||||
|
c2 : ResNep.Compl
|
||||||
|
} ;
|
||||||
|
Imp = {s : CPolarity => ImpForm => Str} ;
|
||||||
|
|
||||||
|
---- Question
|
||||||
|
|
||||||
|
QCl = {s : ResNep.VPHTense => Polarity => QForm => Str} ;
|
||||||
|
IP = {s: Case => Str ; n : Number};
|
||||||
|
IDet = {s : Gender => Str ; n : Number} ;
|
||||||
|
--IDet = {s : Str ; n : Number} ;
|
||||||
|
IQuant = {s : Number => Str} ;
|
||||||
|
|
||||||
|
---- Relative
|
||||||
|
|
||||||
|
RCl = {
|
||||||
|
s : ResNep.VPHTense => Polarity => Order => Agr => Str ;
|
||||||
|
c : Case
|
||||||
|
} ;
|
||||||
|
--RP = {s: Number => Case => Str ; a:RAgr};
|
||||||
|
RP = {s: Case => Str ; a:RAgr};
|
||||||
|
|
||||||
|
---- Verb
|
||||||
|
|
||||||
|
VP = ResNep.VPH ;
|
||||||
|
VPSlash = ResNep.VPHSlash ;
|
||||||
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
|
---- Adv
|
||||||
|
Adv = {s : Str} ;
|
||||||
|
|
||||||
|
---- Adjective
|
||||||
|
|
||||||
|
AP = ResNep.npAdjective ;
|
||||||
|
|
||||||
|
---- Noun
|
||||||
|
|
||||||
|
CN = ResNep.Noun ;
|
||||||
|
NP = ResNep.NP ;
|
||||||
|
Pron = {s : Case => Str ; ps : Str ; a : Agr} ; -- ps genetive case
|
||||||
|
Det = ResNep.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}; -- ?? Number
|
||||||
|
Quant = {s : Number => Gender => Str }; -- ?? Number
|
||||||
|
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 = {s : Str} ;
|
||||||
|
|
||||||
|
---- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
|
V, VS, VQ, VA = ResNep.Verb ; -- = {s : VForm => Str} ;
|
||||||
|
|
||||||
|
V2, V2A, V2Q, V2S = ResNep.Verb ** {c2 : Compl} ;
|
||||||
|
|
||||||
|
V3 = ResNep.Verb ** {c2, c3 : Str} ;
|
||||||
|
VV = ResNep.Verb ** {isAux : Bool} ;
|
||||||
|
V2V = ResNep.Verb ** {c1 : Str ; c2 : Str ; isAux : Bool} ;
|
||||||
|
|
||||||
|
A = ResNep.npAdjective ; --- {s : Gender => Number => Str} ;
|
||||||
|
A2 = ResNep.npAdjective ** {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} ;
|
||||||
|
}
|
||||||
6
lib/src/nepali/CombinatorsNep.gf
Normal file
6
lib/src/nepali/CombinatorsNep.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
resource CombinatorsNep = Combinators with
|
||||||
|
(Cat = CatNep),
|
||||||
|
(Structural = StructuralNep),
|
||||||
|
(Constructors = ConstructorsNep) ;
|
||||||
42
lib/src/nepali/ConjunctionNep.gf
Normal file
42
lib/src/nepali/ConjunctionNep.gf
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
concrete ConjunctionNep of Conjunction =
|
||||||
|
CatNep ** open ResNep, Coordination, Prelude in {
|
||||||
|
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
ConjS = conjunctDistrSS ;
|
||||||
|
|
||||||
|
ConjAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
|
ConjNP conj ss = conjunctDistrTable NPCase conj ss ** {
|
||||||
|
a = conjAgr (agrP3 Masc conj.n) ss.a ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjAP conj ss = conjunctDistrTable2 Number Gender 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 = twoSS 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 } ;
|
||||||
|
ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c};
|
||||||
|
BaseAP x y = twoTable2 Number Gender x y ;
|
||||||
|
ConsAP xs x = consrTable2 Number Gender comma xs x ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[S] = {s1,s2 : Str} ;
|
||||||
|
[Adv] = {s1,s2 : Str} ;
|
||||||
|
[NP] = {s1,s2 : NPCase => Str ; a : Agr } ;
|
||||||
|
[AP] = {s1,s2 : Number => Gender => Str} ;
|
||||||
|
[RS] = {s1,s2 : Agr => Str ; c : Case};
|
||||||
|
|
||||||
|
}
|
||||||
3
lib/src/nepali/ConstructorsNep.gf
Normal file
3
lib/src/nepali/ConstructorsNep.gf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
resource ConstructorsNep = Constructors with (Grammar = GrammarNep) ;
|
||||||
170
lib/src/nepali/Coordination.gf
Normal file
170
lib/src/nepali/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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
24
lib/src/nepali/GrammarNep.gf
Normal file
24
lib/src/nepali/GrammarNep.gf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
|
concrete GrammarNep of Grammar =
|
||||||
|
NounNep,
|
||||||
|
VerbNep,
|
||||||
|
AdjectiveNep,
|
||||||
|
AdverbNep,
|
||||||
|
NumeralNep,
|
||||||
|
SentenceNep,
|
||||||
|
QuestionNep,
|
||||||
|
RelativeNep,
|
||||||
|
ConjunctionNep,
|
||||||
|
PhraseNep,
|
||||||
|
TextX - [Adv],
|
||||||
|
StructuralNep,
|
||||||
|
TenseX - [Adv],
|
||||||
|
IdiomNep
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
39
lib/src/nepali/IdiomNep.gf
Normal file
39
lib/src/nepali/IdiomNep.gf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
concrete IdiomNep of Idiom = CatNep ** open Prelude,Predef, ResNep 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 ++ ss.s};
|
||||||
|
|
||||||
|
ExistNP np =
|
||||||
|
mkSClause "त्यहाँ" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) -- त्यहाँ
|
||||||
|
(insertObj (\\_ => np.s ! NPC Nom) (predAux auxBe)) ;
|
||||||
|
|
||||||
|
ExistIP ip =
|
||||||
|
let cl = mkSClause ("जुन्" ++ ip.s ! Nom) (agrP3 Masc 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 = (predProg vp) ;
|
||||||
|
|
||||||
|
|
||||||
|
ImpPl1 vp = {s = vp.obj.s ++ (vp.s ! ResNep.Imp).inf ++ vp.comp ! (agrP1 Masc Pl)} ;
|
||||||
|
|
||||||
|
ImpP3 np vp = {s = np.s!NPC Nom ++ "लाइ" ++ (vp.s ! PVForm ).inf ++ "देउ"} ;
|
||||||
|
}
|
||||||
|
|
||||||
10
lib/src/nepali/LangNep.gf
Normal file
10
lib/src/nepali/LangNep.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
concrete LangNep of Lang =
|
||||||
|
GrammarNep,
|
||||||
|
LexiconNep
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer=unwords ; lexer=words ;
|
||||||
|
|
||||||
|
}
|
||||||
371
lib/src/nepali/LexiconNep.gf
Normal file
371
lib/src/nepali/LexiconNep.gf
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
--# -path=.:prelude:alltenses
|
||||||
|
|
||||||
|
-- regN - Regular Nouns
|
||||||
|
-- mkNF - Femenine Nouns
|
||||||
|
-- mkNUN - Uncountable Nouns
|
||||||
|
|
||||||
|
concrete LexiconNep of Lexicon = CatNep **
|
||||||
|
open ParadigmsNep, MorphoNep, Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
-- optimize=values ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
airplane_N = regN "हवाईजहाज" ; -- हवाईजहाज
|
||||||
|
answer_V2S = mkV2 (compoundV "उत्तर" (mkV "दिनु")) ; -- उत्तर दिनु
|
||||||
|
apartment_N = regN "कोठा" ; -- कोठा
|
||||||
|
apple_N = regN "स्याऊ"; -- स्याऊ
|
||||||
|
art_N = regN "कला" ; -- कला
|
||||||
|
ask_V2Q = mkV2 (mkV "सोध्नु") ; -- सोध्नु
|
||||||
|
baby_N = regN "बच्चा" ; -- बच्चा
|
||||||
|
bad_A = mkA "खराब" ; -- खराब
|
||||||
|
bank_N = regN "ब्याङ्क" ; -- ब्याङ्क
|
||||||
|
beautiful_A = mkA "राम्रो" ; -- राम्रो
|
||||||
|
become_VA = mkV "हुनु" ; -- हुनु
|
||||||
|
beer_N = regN "बियर" ; -- बियर
|
||||||
|
beg_V2V = mkV2V (compoundV "आग्रह" do_V2) lai "" False ; -- आग्रह
|
||||||
|
big_A = mkA "ठुलो" ; -- ठुलो
|
||||||
|
bike_N = regN "साइकल" ; --साइकल
|
||||||
|
bird_N = regN "चरा" ; -- चरा
|
||||||
|
black_A = mkA "कालो" ; -- कालो
|
||||||
|
blue_A = mkA "निलो" ; -- निलो
|
||||||
|
boat_N = regN "डुङ्गा" ; -- डुङ्गा
|
||||||
|
book_N = regN "किताब" ; -- किताब
|
||||||
|
boot_N = regN "जुत्ता" ; -- जुत्ता
|
||||||
|
boss_N = regN "हाकिम" ; -- हाकिम
|
||||||
|
boy_N = regN "केटा" ; -- केटा
|
||||||
|
bread_N = regN "रोटी" ; -- रोटी
|
||||||
|
break_V2 = mkV2 (mkV "भाँच्नु") ; -- भाँच्नु
|
||||||
|
broad_A = mkA "फराकिलो" ; -- फराकिलो
|
||||||
|
brother_N2 = mkN2 (regN "दाजु") (mkPrep "को") "" ;
|
||||||
|
brown_A = mkA "खैरो" ; -- खैरो
|
||||||
|
butter_N = mkNUC "नौनी" feminine; -- नौनी
|
||||||
|
buy_V2 = mkV2 (mkV "किन्नु"); -- किन्नु
|
||||||
|
camera_N = regN "क्यामरा" ; -- क्यामरा
|
||||||
|
cap_N = regN "टोपि" ; -- टोपि
|
||||||
|
car_N = regN "कार" ; -- कार
|
||||||
|
carpet_N = regN "कार्रपेट" ; -- कार्रपेट
|
||||||
|
cat_N = regN "बिरालो" ; -- बिरालो
|
||||||
|
ceiling_N = regN "छत" ; -- छत
|
||||||
|
chair_N = regN "कुर्सी" ; -- कुर्सी
|
||||||
|
cheese_N = mkNF "चिज"; --चिज
|
||||||
|
child_N = regN "बच्चा" ; -- बच्चा
|
||||||
|
church_N = regN "गिर्जाघर" ; -- चर्च , गिर्जाघर
|
||||||
|
city_N = regN "शहर" ; -- शहर
|
||||||
|
clean_A = mkA "सफा" ; -- सफा
|
||||||
|
clever_A = mkA "बाठो" ; -- बाठो
|
||||||
|
close_V2 = mkV2 (compoundV "बन्द" do_V2) ; -- बन्द गर्नु
|
||||||
|
coat_N = regN "कोट" ; -- कोट
|
||||||
|
cold_A = mkA "चिसो" ; -- चिसो
|
||||||
|
come_V = mkV "आउनु" ; -- आउनु
|
||||||
|
computer_N = regN "कम्प्युटर" ; -- कम्प्युटर
|
||||||
|
country_N = regN "देश" ; -- देश
|
||||||
|
cousin_N = regN "काका" ; -- काका
|
||||||
|
cow_N = regN "गाई" ; -- गाई
|
||||||
|
die_V = mkV "मर्नु" ; -- मर्नु
|
||||||
|
dirty_A = mkA "फोहोर" ; -- फोहोर
|
||||||
|
distance_N3 = mkN3 (regN "दुरी") (mkPrep "देखि") (mkPrep "सम्म") "को" ; -- दुरी, देखी, सम्म, त्यहाँ
|
||||||
|
doctor_N = regN "डाक्टर" ; -- डाक्टर, | Cikitx:sk - चिकित्सक
|
||||||
|
dog_N = regN "कुकुर" ; -- कुकुर
|
||||||
|
door_N = regN "ढोका" ; -- ढोका
|
||||||
|
drink_V2 = mkV2 (mkV "पिउनु") ; -- पिउनु
|
||||||
|
--easy_A2V = mkA "सजीलो" ; -- सजीलो
|
||||||
|
eat_V2 = mkV2 (mkV "खानु") "" ; -- खानु
|
||||||
|
empty_A = mkA "खाली" ; -- खाली
|
||||||
|
enemy_N = regN "शत्रु" ; -- शत्रु
|
||||||
|
factory_N = regN "कारखाना" ; -- कारखाना
|
||||||
|
father_N2 = mkN2 (regN "बुबा") (mkPrep "को") "" ; -- बुबा, बाबु
|
||||||
|
fear_VS = mkV "डराउनु"; -- डराउनु
|
||||||
|
find_V2 = mkV2 (mkV "पाउनु") ; -- पाउनु
|
||||||
|
fish_N = regN "माछा" ; -- माछा
|
||||||
|
floor_N = regN "भुँई" ; -- भुँई
|
||||||
|
forget_V2 = mkV2 (mkV "बिर्सनु") ; -- बिर्सनु
|
||||||
|
fridge_N = regN "फ्रिज" ; -- फ्रिज
|
||||||
|
friend_N = regN "साथी" ; -- साथी
|
||||||
|
fruit_N = regN "फल" ; -- फल
|
||||||
|
--fun_AV = mkAdV "रमाइलो" ; -- रमाइलो
|
||||||
|
garden_N = regN "बगैँचा" ; -- बगैँचा
|
||||||
|
girl_N = mkNF "केटी" ; -- केटी
|
||||||
|
glove_N = regN "पञ्जा"; -- पञ्जा
|
||||||
|
gold_N = regN "सुन" ; -- सुन
|
||||||
|
good_A = mkA "राम्रो" ; -- राम्रो
|
||||||
|
go_V = mkV "जानु" ; -- जानु
|
||||||
|
green_A = mkA "हरियो" ; -- हरियो
|
||||||
|
harbour_N = regN "बन्दरगाह" ; -- बन्दरगाह
|
||||||
|
hate_V2 = mkV2 (compoundV "घृणा" do_V2) ; -- घृणा
|
||||||
|
hat_N = regN "टोपी" ; -- टोपी
|
||||||
|
-- have_V2 = dirV2 (mk5V "हa?े" "हास" "हाद" "हाद" "हa??नग") ; ????MAY BE NOT APPLICABLE
|
||||||
|
hear_V2 = mkV2 (mkV "सुन्नु") ; -- सुन्नु
|
||||||
|
hill_N = regN "पहाड" ; -- पहाड
|
||||||
|
hope_VS = (compoundV "आशा" do_V2); -- आशा
|
||||||
|
horse_N = regN "घोडा" ; -- घोडा
|
||||||
|
hot_A = mkA "तातो" ; -- तातो
|
||||||
|
house_N = regN "घर" ; -- घर
|
||||||
|
important_A = mkA "जरुरी" ; -- जरुरी
|
||||||
|
industry_N = regN "उधोग" ; -- उधोग
|
||||||
|
iron_N = regN "फलाम" ; -- फलाम
|
||||||
|
king_N = regN "राजा" ; -- राजा
|
||||||
|
know_V2 = mkV2 (mkV "चिन्नु") ; -- चिन्नु
|
||||||
|
know_VS = (mkV "थाहा पाउनु") ; -- थाहा पाउनु
|
||||||
|
know_VQ = (compoundV "थाहा" (mkV2 (mkV "पाउनु"))) ; -- थाहा पाउनु
|
||||||
|
lake_N = regN "ताल" ; -- ताल
|
||||||
|
lamp_N = regN "बत्ति" ; -- बत्ति
|
||||||
|
learn_V2 = mkV2 (mkV "सिक्नु") ; -- सिक्नु
|
||||||
|
leather_N = regN "छाला" ; -- छाला
|
||||||
|
leave_V2 = mkV2 (mkV "छोड्नु") ; -- छोड्नु
|
||||||
|
like_V2 = mkV2 (compoundV "मन" (mkV "पर्नु")); -- मन पर्नु ???? NOT COVERED BY RULE
|
||||||
|
listen_V2 = mkV2 (mkV "सुन्नु") ; -- सुन्नु
|
||||||
|
live_V = mkV "जिउनु" ; -- जिउनु -- px:rtkx:z प्रतक्ष
|
||||||
|
long_A = mkA "लामो" ; -- लामो
|
||||||
|
lose_V2 = mkV2 (mkV "हराउनु") ; -- हराउनु
|
||||||
|
love_N = regN "माया" ; -- माया
|
||||||
|
love_V2 = mkV2 (compoundV "माया" do_V2) "लाई" ; -- "नौण"; -- माया गर्नु
|
||||||
|
man_N = regN "मान्छे" ; -- मान्छे
|
||||||
|
married_A2 = mkA "विवाहित" "सँग" ; -- सँग विवाहित
|
||||||
|
meat_N = mkNUC "मासु" masculine ; -- मासु
|
||||||
|
milk_N = mkNUC "दुध" masculine ; -- दुध
|
||||||
|
moon_N = regN "चन्र्दमा" ; -- चन्र्दमा ??
|
||||||
|
mother_N2 = mkN2 (mkNF "आमा") (mkPrep "को") ""; -- need ko discuss
|
||||||
|
mountain_N = regN "हिमाल" ; -- हिमाल
|
||||||
|
music_N = regN "संगीत" ; -- संगीत
|
||||||
|
narrow_A = mkA "सांगुरो" ; -- सांगुरो
|
||||||
|
new_A = mkA "नायाँ" ; -- नायाँ
|
||||||
|
newspaper_N = regN "समाचारपत्र" ; -- समाचारपत्र
|
||||||
|
oil_N = mkNUC "तेल" masculine ; -- तेल
|
||||||
|
--old_A = mkA "पुरानो" ; -- पुरानो
|
||||||
|
old_A = mkA "बुढा" ; -- बुढा
|
||||||
|
open_V2 = mkV2 (mkV "खोल्नु") ; -- खोल्नु
|
||||||
|
paint_V2A = mkV2 (compoundV "रँग" (mkV2 (mkV "लागाउनु"))) "लाइ" ;
|
||||||
|
paper_N = regN "कागज" ; -- कागज
|
||||||
|
paris_PN = mkPN "पेरिस" ; -- ???? DEFAULT AS MALE (inflection) is this correct ????
|
||||||
|
peace_N = mkNUC "शान्ति" masculine ; -- शान्ति ???? Not sure
|
||||||
|
pen_N = regN "कलम" ; -- कलम
|
||||||
|
planet_N = regN "ग्रह" ; -- ग्रह
|
||||||
|
plastic_N = regN "पाल्स्टिक" ; -- पाल्स्टिक
|
||||||
|
play_V2 = mkV2 (mkV "खेल्नु") ; -- खेल्नु
|
||||||
|
policeman_N = regN "प्रहरी" ; -- प्रहरी
|
||||||
|
priest_N = regN "पुरोहित" ; -- पुरोहित
|
||||||
|
-- probable_AS = mkAdj1S (regA "पr?बाबले") ;
|
||||||
|
queen_N = mkNF "रानी" ; -- रानी
|
||||||
|
radio_N = regN "रेडियो"; -- रेडियो
|
||||||
|
rain_V0 = compoundV "बर्षा" (mkV "हुनु" ) ; -- बर्षा ???? hunu/bhayo irregular case need to be added
|
||||||
|
read_V2 = mkV2 (mkV "पढ्नु"); -- पढ्नु
|
||||||
|
red_A = mkA "रातो" ; -- रातो
|
||||||
|
religion_N = regN "धर्म" ; -- धर्म
|
||||||
|
restaurant_N = regN "रेस्टुरेन्ट" ; -- रेस्टुरेन्ट
|
||||||
|
river_N = regN "खोला" ; --खोला
|
||||||
|
rock_N = regN "ढुङ्गा" ; -- ढुङ्गा
|
||||||
|
roof_N = regN "छाना" ; -- छाना
|
||||||
|
rubber_N = regN "रबर" ; -- रबर
|
||||||
|
run_V = mkV "कुद्नु" ; -- कुद्नु
|
||||||
|
say_VS = mkV "भन्नु" ; -- भन्नु
|
||||||
|
school_N = regN "विधालय" ; -- विधालय
|
||||||
|
science_N = regN "विज्ञन" ; -- विज्ञन
|
||||||
|
sea_N = regN "समुन्द्र" ; -- समुन्द्र
|
||||||
|
seek_V2 = mkV2 (mkV "खोज्नु" ) ;
|
||||||
|
sell_V3 = mkV3 (mkV "बेच्नु") "" "लाई" ; -- बेच्नु ???? ram(le) sita (lai) kitab bachyo
|
||||||
|
send_V3 = mkV3 (mkV "पठाउनु") "" "लाई"; -- पठाउनु ????
|
||||||
|
sheep_N = regN "भेडा" ; -- भेडा
|
||||||
|
ship_N = regN "जहाज" ; -- जहाज
|
||||||
|
shirt_N = regN "सर्" ; -- सर्ट
|
||||||
|
shoe_N = regN "जुत्ता" ; -- जुत्ता
|
||||||
|
shop_N = regN "पसल" ; -- पसल
|
||||||
|
short_A = mkA "छोटो" ; --छोटो
|
||||||
|
silver_N = regN "चाँदि" ; -- चाँदि
|
||||||
|
sister_N = mkNF "दीदी" ; -- दीदी
|
||||||
|
sleep_V = mkV "सुत्नु" ; -- सुत्नु
|
||||||
|
small_A = mkA "सानो" ; -- सानो
|
||||||
|
snake_N = regN "र्षप" ; -- र्षप
|
||||||
|
sock_N = regN "मोजा" ; -- मोजा
|
||||||
|
speak_V2 = mkV2 (mkV "बोल्नु") ; -- बोल्नु
|
||||||
|
star_N = regN "तारा" ; -- तारा
|
||||||
|
steel_N = regN "स्टिल" ; -- स्टिल
|
||||||
|
stone_N = regN "ढुङ्गा" ; -- ढुङ्गा
|
||||||
|
stove_N = regN "चुलो" ; -- चुलो
|
||||||
|
student_N = regN "बिध्यार्थि" ; --बिध्यार्थि
|
||||||
|
stupid_A = mkA "मुर्ख" ; -- मुर्ख
|
||||||
|
sun_N = regN "सुर्य"; -- सुर्य
|
||||||
|
switch8off_V2 = mkV2 (compoundV "स्विच अफ" do_V2) ; -- स्विच अन्
|
||||||
|
switch8on_V2 = mkV2 (compoundV "स्विच अन्" do_V2) ; -- स्विच अफ
|
||||||
|
table_N = regN "टेबल" ; -- टेबल
|
||||||
|
talk_V3 = mkV3 (compoundV "कुरा" (mkV2 (mkV "गर्नु"))) "सँग" ""; -- कुरा गर्नु सँग
|
||||||
|
teacher_N = regN "शिक्षक" ; -- शिक्षक
|
||||||
|
teach_V2 = mkV2 (mkV "पढाउनु") ; -- पढाउनु
|
||||||
|
television_N = regN "टेलिभिजन्" ; -- टेलिभिजन्
|
||||||
|
thick_A = mkA "बाक्लो" ; -- बाक्लो
|
||||||
|
thin_A = mkA "पातलो" ; -- पातलो
|
||||||
|
train_N = regN "रेल" ; -- रेल
|
||||||
|
travel_V = (compoundV "यात्रा" do_V2) ; -- Gumx:nu -- घुम्नु / यात्रा
|
||||||
|
tree_N = regN "रुख" ; -- रुख
|
||||||
|
ugly_A = mkA "नराम्रो" ; -- नराम्रो
|
||||||
|
understand_V2 = mkV2 (mkV "बुझ्नु") ; -- बुझ्नु
|
||||||
|
university_N = regN "बिश्वबिध्यालय" ; -- बिश्वबिध्यालय
|
||||||
|
village_N = regN "गाऊँ" ; -- गाऊँ
|
||||||
|
wait_V2 = mkV2 (mkV "पर्खनु") ; -- पर्खनु
|
||||||
|
walk_V = mkV "हिड्नु" ; -- हिड्नु
|
||||||
|
warm_A = mkA "तातो" ; -- तातो
|
||||||
|
war_N = regN "लडाई" ; -- लडाई
|
||||||
|
watch_V2 = mkV2 (mkV "हेर्नु") ; -- हेर्नु
|
||||||
|
water_N = mkNUC "पानी" feminine ;
|
||||||
|
white_A = mkA "सेतो" ; -- सेतो
|
||||||
|
window_N = regN "झ्याल" ; -- झ्याल
|
||||||
|
wine_N = regN "वाईन" ; -- वाईन
|
||||||
|
win_V2 = mkV2 (mkV "जित्नु") ; -- जित्नु
|
||||||
|
woman_N = mkNF "आईमाई" ; -- आईमाई
|
||||||
|
wonder_VQ = compoundV "अचम्म" (mkV "हुनु") ; -- अचम्म हुनु
|
||||||
|
wood_N = regN "काठ" ; -- काठ
|
||||||
|
write_V2 = mkV2 (mkV "लेख्नु") ; -- लेख्नु
|
||||||
|
yellow_A = mkA "पहेलो" ; --पहेलो
|
||||||
|
young_A = mkA "जवान" ; -- जवान
|
||||||
|
do_V2 = mkV2 (mkV "गर्नु") ; -- गर्नु
|
||||||
|
now_Adv = mkAdv "अहीले" ; -- अहीले
|
||||||
|
already_Adv = mkAdv "अघिनै" ; -- अघिनै
|
||||||
|
song_N = regN "गीत" ; -- गित
|
||||||
|
add_V3 = mkV3 (mkV "जोड्नु") "सँग" "" ; -- जोड्नु
|
||||||
|
number_N = regN "संख्या" ; -- संख्या
|
||||||
|
put_V2 = mkV2 (mkV "राख्नु") ; -- राख्नु
|
||||||
|
stop_V = mkV "रोक्नु" ; -- रोक्नु
|
||||||
|
jump_V = mkV "उफ्रनु" ; -- उफ्रनु
|
||||||
|
left_Ord = {s = "बायाँ" ; n = singular}; -- ????
|
||||||
|
right_Ord = {s = "दायाँ" ; n = singular}; -- ????
|
||||||
|
far_Adv = mkAdv "टाढा" ; -- टाढा
|
||||||
|
correct_A = mkA "ठिक" ; -- ठिक
|
||||||
|
dry_A = mkA "सुख्खा" ; -- सुख्खा
|
||||||
|
dull_A = mkA "मन्ध" ; -- मन्ध
|
||||||
|
full_A = mkA "भरि" ; -- भरि
|
||||||
|
heavy_A = mkA "भारी" ; -- भारी
|
||||||
|
near_A = mkA "नजिक" ; -- नजिक
|
||||||
|
rotten_A = mkA "कुहिa:को" ; -- कुहिएको
|
||||||
|
round_A = mkA "गोलो" ; -- गोलो
|
||||||
|
sharp_A = mkA "तीखो" ; -- तीखो
|
||||||
|
smooth_A = mkA "समतल" ; -- समतल
|
||||||
|
straight_A = mkA "सिधा" ; -- सिधा
|
||||||
|
wet_A = mkA "चिसो" ; -- चिसो
|
||||||
|
wide_A = mkA "फराकिलो" ; -- फराकिलो
|
||||||
|
animal_N = regN "जनावार" ; -- जनावार
|
||||||
|
ashes_N = mkNUC "खरानी" masculine ; -- खरानी
|
||||||
|
back_N = regN "आङ" ; -- आङ
|
||||||
|
bark_N = regN "बोक्रा" ; -- बोक्रा
|
||||||
|
belly_N = regN "पेट" ; -- पेट
|
||||||
|
blood_N = mkNUC "रगत" feminine ; -- रगत
|
||||||
|
bone_N = regN "हड्डी" ; -- हड्डी
|
||||||
|
breast_N = regN "स्तन" ; -- स्तन
|
||||||
|
cloud_N = regN "बादल" ; -- बादल
|
||||||
|
day_N = regN "दिन" ; -- दिन
|
||||||
|
dust_N = regN "धुलो" ; -- धुलो
|
||||||
|
ear_N = regN "कान" ; -- कान
|
||||||
|
earth_N = regN "पृथ्वि" ; -- पृथ्वि
|
||||||
|
egg_N = regN "अण्डा" ; -- अण्डा
|
||||||
|
eye_N = regN "आँखा" ; -- आँखा
|
||||||
|
fat_N = regN "मोटो" ; -- मोटो
|
||||||
|
feather_N = regN "प्वाँख" ; -- प्वाँख
|
||||||
|
fingernail_N = regN "नङ" ; -- नङ
|
||||||
|
fire_N = regN "आगो" ; -- आगो
|
||||||
|
flower_N = regN "फुल" ; -- फुल
|
||||||
|
fog_N = mkNUC "कुईरो" feminine ; -- कुईरो
|
||||||
|
foot_N = regN "खुट्टा" ; -- खुट्टा
|
||||||
|
forest_N = regN "जँगल" ; -- जँगल
|
||||||
|
grass_N = mkNUC "घाँस" masculine ; -- घाँस
|
||||||
|
guts_N = regN "गत" ; -- FIXME: no singular
|
||||||
|
hair_N = mkNUC "कपाल" masculine ; -- कपाल
|
||||||
|
hand_N = regN "हात" ; -- हात
|
||||||
|
head_N = regN "टाउकोस" ; -- टाउको
|
||||||
|
heart_N = regN "मुटु" ; -- मुटु
|
||||||
|
horn_N = regN "हर्न" ; -- हर्न
|
||||||
|
husband_N = regN "पति" ; -- पति
|
||||||
|
ice_N = mkNUC "हिऊँ" masculine ; -- हिऊँ
|
||||||
|
knee_N = regN "घुँडा" ; -- घुँडा
|
||||||
|
leaf_N = regN "पात" ; -- पात
|
||||||
|
leg_N = regN "खुट्टा" ; -- खुट्टा
|
||||||
|
liver_N = regN "कलेजो" ; -- कलेजो
|
||||||
|
louse_N = regN "जुम्रा" ; -- जुम्रा
|
||||||
|
mouth_N = regN "मुख" ; -- मुख
|
||||||
|
name_N = regN "नाम" ; -- नाम
|
||||||
|
neck_N = regN "घाँटी" ; -- घाँटी
|
||||||
|
night_N = regN "रात" ; -- रात
|
||||||
|
nose_N = regN "नाक" ; -- नाक
|
||||||
|
person_N = regN "मानिस" ; -- मानिस
|
||||||
|
rain_N = mkNUC "बर्षा" feminine ; -- बर्षा
|
||||||
|
road_N = regN "सषक" ; -- सडक
|
||||||
|
root_N = regN "जड" ; -- जड
|
||||||
|
rope_N = regN "डोरी" ; -- डोरी
|
||||||
|
salt_N = mkNUC "नुन" masculine ; -- नुन
|
||||||
|
sand_N = mkNUC "बालुवा" masculine ; -- बालुवा
|
||||||
|
seed_N = regN "बिउ" ; -- बिउ
|
||||||
|
see_V2 = mkV2 (mkV "हेरर्नु" ) "लाई" ; -- हेरर्नु
|
||||||
|
skin_N = regN "छाला" ; -- छाला
|
||||||
|
sky_N = regN "आकाश" ; -- आकाश
|
||||||
|
smoke_N = mkNUC "धुवाँ" masculine ; -- धुवाँ
|
||||||
|
snow_N = regN "हिउँ" ; -- हिउँ
|
||||||
|
stick_N = regN "लठ्ठि" ; -- लठ्ठि
|
||||||
|
tail_N = regN "पुच्छर" ; -- पुच्छर
|
||||||
|
tongue_N = regN "जिब्रो" ; -- जिब्रो
|
||||||
|
tooth_N = regN "दाँत" ; -- दाँत
|
||||||
|
wife_N = mkNF "पत्नी" ; -- पत्नी
|
||||||
|
wind_N = regN "हुरी" ; -- हुरी
|
||||||
|
wing_N = regN "पंखा" ; -- पंखा
|
||||||
|
worm_N = regN "जुगा" ; -- जुगा
|
||||||
|
year_N = regN "बर्ष" ; -- बर्ष
|
||||||
|
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 "दिनु") lai "" ; -- दिनु
|
||||||
|
laugh_V = mkV "हास्नु" ; -- हास्नु
|
||||||
|
lie_V = compoundV "झुटो" (mkV "बोल्नु"); -- झुटो बोल्नु
|
||||||
|
play_V = mkV "खेल्नु" ; -- खेल्नु
|
||||||
|
sit_V = mkV "बस्नु" ; -- बस्नु
|
||||||
|
sew_V = mkV "सिउनु" ; -- सिउनु
|
||||||
|
sing_V = mkV "गाउनु" ; -- गाउनु
|
||||||
|
smell_V = mkV "सुगन्ध" ; -- सुगन्ध
|
||||||
|
spit_V = mkV "थुक्नु" ; -- थुक्नु
|
||||||
|
stand_V = mkV "उठ्नु" ; -- उठ्नु
|
||||||
|
swell_V = mkV "सुनिनु" ; -- सुनिनु
|
||||||
|
swim_V = compoundV "पौडी" (mkV "खेल्नु" ) ;
|
||||||
|
think_V = mkV "सोच्नु" ; -- सोच्नु
|
||||||
|
turn_V = mkV "पल्टिनु" ; -- पल्टिनु
|
||||||
|
vomit_V = mkV "छादनु" ; -- छादनु
|
||||||
|
bite_V2 = mkV2 (mkV "टोक्नु") ; -- टोक्नु
|
||||||
|
count_V2 = mkV2 (mkV "गन्नु") ; -- गन्नु
|
||||||
|
cut_V2 = mkV2 (mkV "काटनु") ; -- काटनु
|
||||||
|
fear_V2 = mkV2 (mkV "डराउनु") ; -- डराउनु
|
||||||
|
fight_V2 = mkV2 (mkV "लड्नु") ; -- लड्नु
|
||||||
|
hit_V2 = mkV2 (mkV "हान्नु" ) "लाई" ; -- हान्नु
|
||||||
|
hold_V2 = mkV2 (mkV "समात्नु") ; -- समात्नु
|
||||||
|
hunt_V2 = mkV2 (compoundV "शिकार" do_V2) ; -- शिकार
|
||||||
|
kill_V2 = mkV2 (mkV "मार्नु") ; -- मार्नु
|
||||||
|
pull_V2 = mkV2 (mkV "तान्नु"); -- तान्नु
|
||||||
|
push_V2 = mkV2 (compoundV "धक्का" (mkV "दिनु")) lai ;
|
||||||
|
rub_V2 = mkV2 (mkV "माडनु") ; -- माडनु
|
||||||
|
scratch_V2 = mkV2 (mkV "कोर्नु") lai ; -- कोर्नु
|
||||||
|
split_V2 = mkV2 (mkV "चिर्नु") lai ; -- चिर्नु
|
||||||
|
squeeze_V2 = mkV2 (mkV "थिच्नु") lai ; -- थिच्नु
|
||||||
|
stab_V2 = mkV2 (compoundV "छुरा" hit_V2) ; -- छुरा हान्नु
|
||||||
|
suck_V2 = mkV2 (mkV "चुस्नु") ; -- चुस्नु
|
||||||
|
throw_V2 = mkV2 (mkV "फाल्नु") ; -- फाल्नु
|
||||||
|
tie_V2 = mkV2 (mkV "बाँधनु") ; -- बाँधनु
|
||||||
|
wash_V2 = mkV2 (mkV "धुनु") ; -- धुनु
|
||||||
|
wipe_V2 = mkV2 (mkV "पुछ्नु"); -- पुछ्नु
|
||||||
|
--b other_A = mkA "अरु" ; -- अरु NOT IN ABSTRACT
|
||||||
|
grammar_N = regN "व्याकरण" ; -- व्याकरण
|
||||||
|
language_N = regN "भाषा" ; -- भाषा
|
||||||
|
rule_N = regN "नियम" ; -- नियम
|
||||||
|
|
||||||
|
-- added 4/6/2007
|
||||||
|
john_PN = mkPN "जोन" ;
|
||||||
|
question_N = regN "प्रश्न" ; -- प्रश्न
|
||||||
|
ready_A = mkA "तयार" ; -- तयार
|
||||||
|
reason_N = regN "कारण" ; -- कारण
|
||||||
|
today_Adv = mkAdv "आज" ; -- आज
|
||||||
|
uncertain_A = mkA "अनिश्चित" ; -- अनिश्चित
|
||||||
|
|
||||||
|
oper
|
||||||
|
lai = "लाई" ;
|
||||||
|
|
||||||
|
} ;
|
||||||
894
lib/src/nepali/MorphoNep.gf
Normal file
894
lib/src/nepali/MorphoNep.gf
Normal file
@@ -0,0 +1,894 @@
|
|||||||
|
--# -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 MorphoNep = ResNep ** open Prelude,Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
param
|
||||||
|
{-
|
||||||
|
For distinguishing root ending in -a- and rest of other.
|
||||||
|
Root ending in -a/अ- is regarded as reg and rest ireg
|
||||||
|
-}
|
||||||
|
VCase = VReg | VIReg ;
|
||||||
|
|
||||||
|
|
||||||
|
--1 Nouns
|
||||||
|
oper
|
||||||
|
|
||||||
|
-- mkN : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Gender -> Bool -> Noun =
|
||||||
|
mkN : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Gender -> Noun =
|
||||||
|
\sn,sa,si,sd,sab,sl,pn,pa,pi,pd,pab,pl, g -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Nom => sn ;
|
||||||
|
Acc => sa ;
|
||||||
|
Ins => si ;
|
||||||
|
Dat => sd ;
|
||||||
|
Abl => sab ;
|
||||||
|
Loc => sl
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Nom => pn ;
|
||||||
|
Acc => pa ;
|
||||||
|
Ins => pi ;
|
||||||
|
Dat => pd ;
|
||||||
|
Abl => pab ;
|
||||||
|
Loc => pl
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
g = g
|
||||||
|
-- isHum = h
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- TODO
|
||||||
|
-- ?? NEED TO ADD CASE IF ENDS WITH O (PG. 99 Jaya)
|
||||||
|
|
||||||
|
-- Regular nouns
|
||||||
|
mkNMF : Str -> Gender -> Noun ;
|
||||||
|
mkNMF str g = mkN str (str + "लाई") (str + "ले") (str + "लाई") (str + "बाट") (str + "मा")
|
||||||
|
(str + "हरु") (str + "हरुलाई") (str + "हरुले") (str + "हरुलाई") (str + "हरुबाट") (str + "हरुमा") g ;
|
||||||
|
|
||||||
|
-- Regular Nouns
|
||||||
|
mkNReg : Str -> Noun ;
|
||||||
|
mkNReg str = mkNMF str Masc ;
|
||||||
|
|
||||||
|
-- Faminine nouns
|
||||||
|
mkNFem : Str -> Noun ;
|
||||||
|
mkNFem str = mkNMF str Fem ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Uncountable nouns, which have same singular and plular form
|
||||||
|
-- eg water
|
||||||
|
mkNUnc : Str -> Gender -> Noun ;
|
||||||
|
mkNUnc str g = mkN str (str + "लाई") (str + "ले") (str + "लाई") (str + "बाट") (str + "मा")
|
||||||
|
str (str + "लाई") (str + "ले") (str + "लाई") (str + "बाट") (str + "मा") g ;
|
||||||
|
|
||||||
|
-- Proper Names
|
||||||
|
regN1 : Str -> Gender -> Noun ;
|
||||||
|
regN1 str g = mkN str (str + "लाई") (str + "ले") (str + "लाई") (str + "बाट") (str + "मा")
|
||||||
|
str str str str str str g ;
|
||||||
|
|
||||||
|
|
||||||
|
-- pronouns
|
||||||
|
makePron : (x1,_,_,_,_,x6 : Str) -> {s : Case => Str} =
|
||||||
|
\n,ac,i,d,ab,l-> {
|
||||||
|
s = table {
|
||||||
|
Nom => n ;
|
||||||
|
Acc => ac ;
|
||||||
|
Ins => i ;
|
||||||
|
Dat => d ;
|
||||||
|
Abl => ab ;
|
||||||
|
Loc => l
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
makePronReg : Str -> {s : Case => Str} ;
|
||||||
|
makePronReg str = makePron str (str + "लाई") (str + "ले") (str + "लाई") (str + "बाट") (str + "मा") ;
|
||||||
|
|
||||||
|
--2. Derminers
|
||||||
|
|
||||||
|
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
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
IDeterminer = {s : Gender => Str ; n : Number};
|
||||||
|
makeIDet : Str -> Str -> Number -> IDeterminer =
|
||||||
|
\s1,s2,n -> {
|
||||||
|
s = table {
|
||||||
|
Masc => s1;
|
||||||
|
Fem => s2
|
||||||
|
} ;
|
||||||
|
n = n
|
||||||
|
};
|
||||||
|
{-
|
||||||
|
makeIQuant : Str -> Str -> Str -> Str -> {s:Number => Gender => Str} = \s1,s2,s3,s4 -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => s1 ;
|
||||||
|
Fem => s2
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Masc => s3 ;
|
||||||
|
Fem => s4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-}
|
||||||
|
|
||||||
|
-- Quantifiers
|
||||||
|
makeQuant : Str -> Str -> Str -> Str -> {s : Number => Gender => Str } =
|
||||||
|
\sm,sf,pm,pf -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table { Masc => sm ;
|
||||||
|
Fem => sf } ;
|
||||||
|
Pl => table { Masc => pm ;
|
||||||
|
Fem => pf }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- Proposition
|
||||||
|
makePrep : Str -> Preposition = \str -> {s = str } ** { lock_Prep = <>};
|
||||||
|
|
||||||
|
|
||||||
|
--3. Verbs
|
||||||
|
mkVerb : (_: Str) -> Verb = \inf ->
|
||||||
|
let root = (tk 2 inf) ;
|
||||||
|
|
||||||
|
in {
|
||||||
|
s = table {
|
||||||
|
Root => root ;
|
||||||
|
Inf => inf ;
|
||||||
|
PVForm => (tk 1 inf) ;
|
||||||
|
Imp => (mkImpForm root).s ;
|
||||||
|
ProgRoot aspect number gender => (mkProgRoot root aspect number gender).s ;
|
||||||
|
|
||||||
|
VF tense aspect polarity person number gender =>
|
||||||
|
case aspect of {
|
||||||
|
Imperf => (mkVImperf root tense polarity person number gender).s ;
|
||||||
|
Perf => (mkVPerf root tense polarity person number gender).s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--For the case of lets (lets sleep)
|
||||||
|
mkImpForm : Str -> {s:Str} ;
|
||||||
|
mkImpForm str =
|
||||||
|
let vcase = (rootCheck str).vcase;
|
||||||
|
root2 = (rootCheck str).root2
|
||||||
|
in {
|
||||||
|
s = case vcase of {
|
||||||
|
VReg => root2 + "ौँ" ;
|
||||||
|
_ => root2 + "आँ"
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
--For the progressive root case
|
||||||
|
mkProgRoot : Str -> Aspect -> Number -> Gender -> {s : Str } =
|
||||||
|
\root,aspect,number,gender ->
|
||||||
|
let root1 = (rootCheck root).root1 ;
|
||||||
|
root2 = (rootCheck root).root2 ;
|
||||||
|
vcase = (rootCheck root).vcase
|
||||||
|
in {
|
||||||
|
s= case <vcase,root> of {
|
||||||
|
<VReg,_> => (mkProg root2 aspect number gender).s ;
|
||||||
|
<_,"जा"> => (mkProg1 root aspect number gender).s ;
|
||||||
|
<_,"हा"> => (mkProg1 root aspect number gender).s ;
|
||||||
|
<_,_> => (mkProg1 root2 aspect number gender).s
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mkProg : Str -> Aspect -> Number -> Gender -> {s : Str } =
|
||||||
|
\root2,aspect,number,gender -> {
|
||||||
|
s = case <aspect,number,gender> of {
|
||||||
|
<Imperf, _, _> => root2 + "दै" ;
|
||||||
|
|
||||||
|
<Perf, Sg, Masc> => root2 + "िरहेको" ;
|
||||||
|
<Perf, Sg, Fem> => root2 + "िरहेकि" ;
|
||||||
|
<Perf, Pl, _> => root2 + "िरहेका"
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mkProg1 : Str -> Aspect -> Number -> Gender -> {s : Str } =
|
||||||
|
\root,aspect,number,gender -> {
|
||||||
|
s = case <aspect,number,gender> of {
|
||||||
|
<Imperf, _, _> => root + "दै" ;
|
||||||
|
|
||||||
|
<Perf, Sg, Masc> => root + "इरहेको" ;
|
||||||
|
<Perf, Sg, Fem> => root + "इरहेकि" ;
|
||||||
|
<Perf, Pl, _> => root + "इरहेका"
|
||||||
|
};
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--need to check for want_VV <- Not inflected correctle
|
||||||
|
--
|
||||||
|
rootCheck : Str -> {root1:Str; root2:Str; vcase: VCase} =
|
||||||
|
\root -> {
|
||||||
|
{-
|
||||||
|
Root inflection case
|
||||||
|
1. irregular case of Janu/जानु/go
|
||||||
|
root = जा root1 = जान् root2 = ग
|
||||||
|
|
||||||
|
2. irregular case of Hunu/हुनु/Become
|
||||||
|
root = हु root1 = हुन् root2 = भ
|
||||||
|
|
||||||
|
3. reg Verbs ending in Consonants - पढनु/to study
|
||||||
|
root = पढ्, root1 = पढ root2 = पढ् <- original
|
||||||
|
root = पढ्, root1 = पढ्, root2 = पढ <- changed to this
|
||||||
|
make sure it doesn't break
|
||||||
|
|
||||||
|
4. Khanu/खानु/to eat, Dinu/दिनु /to Give
|
||||||
|
root = खा root1 = खान् root2 = खा
|
||||||
|
|
||||||
|
5. Dhunu/धुनु/wash, Runu/रुनु/Cry
|
||||||
|
root = धु root1 = धुन् root2 = धो
|
||||||
|
|
||||||
|
6. Aaunu/आउनु/to Come, Pathaunu/पठाउनु/to Send
|
||||||
|
root = आउ root1 = आउँ root2 = आ
|
||||||
|
-}
|
||||||
|
|
||||||
|
root1 = case root of {
|
||||||
|
"जा" => root + "न्" ;
|
||||||
|
"हु" => root + "न्" ;
|
||||||
|
rot + "्" => root ;
|
||||||
|
rot + ("ा"|"ि"|"ी") => root + "न्" ;
|
||||||
|
rot + ("े"|"ु"|"ू") => root + "न्" ;
|
||||||
|
rot + ("उ"|"ऊ") => root + "ँ" ;
|
||||||
|
_ => root
|
||||||
|
} ;
|
||||||
|
root2 = case root of {
|
||||||
|
"जा" => "ग" ;
|
||||||
|
"हु" => "भ" ;
|
||||||
|
rot + "्" => rot ;
|
||||||
|
rot + ("ा"|"ि"|"ी") => root ;
|
||||||
|
rot + ("े"|"ु"|"ू") => rot + "ो" ;
|
||||||
|
rot + ("उ"|"ऊ") => rot ;
|
||||||
|
_ => root
|
||||||
|
} ;
|
||||||
|
vcase = case root of {
|
||||||
|
rot + "्" => VReg;
|
||||||
|
rot + "ह" => VReg;
|
||||||
|
_ => VIReg
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkVImperf : Str -> VTense -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, t, po, pn, n, g ->
|
||||||
|
let root1 = (rootCheck root).root1 ;
|
||||||
|
root2 = (rootCheck root).root2 ;
|
||||||
|
vcase = (rootCheck root).vcase ;
|
||||||
|
in
|
||||||
|
{s = case t of {
|
||||||
|
NPresent => (mkVPreNP root root1 vcase po pn n g).s ;
|
||||||
|
NPast Simpl => (mkVPstSNP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Hab => (mkVPstHNP root root1 vcase po pn n g).s ;
|
||||||
|
NPast Unknown => (mkVPstUNP root root2 vcase po pn n g).s ;
|
||||||
|
NFuture Defin => (mkVFutDNP root po pn n g).s ;
|
||||||
|
NFuture NDefin => (mkVFutNDNP root root2 vcase po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkVPerf : Str -> VTense -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, t, po, pn, n, g ->
|
||||||
|
let root1 = (rootCheck root).root1 ;
|
||||||
|
root2 = (rootCheck root).root2 ;
|
||||||
|
vcase = (rootCheck root).vcase ;
|
||||||
|
in
|
||||||
|
{s = case t of {
|
||||||
|
--it seems root has no use in these cases, root2 worsk for all
|
||||||
|
--if no problem arises better to remove root parameter
|
||||||
|
NPresent => (mkVPreP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Simpl => (mkVPstSP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Hab => (mkVPstHP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Unknown => (mkVPstUP root root2 vcase po pn n g).s ;
|
||||||
|
NFuture Defin => (mkVFutDefP root root2 vcase po pn n g).s ;
|
||||||
|
NFuture NDefin => (mkVFutNDefP root root2 vcase po pn n g).s
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Present, Nonperfective aspect, Non-progressive mode,
|
||||||
|
mkVPreNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPreNPReg root po pn n g).s ;
|
||||||
|
VIReg => (mkVPreNPIReg root root1 po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPreNP Helper for VRrg case
|
||||||
|
mkVPreNPReg : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root + "छु" ; -- छु
|
||||||
|
<Pos, Pers1, Pl, _> => root + "छौँ" ; -- छौं
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + "छस्" ; -- छस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + "छेस्" ; -- छेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "छौ" ; -- छौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + "छ्यौ" ; -- छ्यौ
|
||||||
|
<Pos, Pers2_M, _ , _> => root + "छौ" ; -- छौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "छ" ; -- छ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "छे" ; -- छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "छन्" ; -- छन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "छिन्" ; -- छिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "छन्" ; -- छन्
|
||||||
|
<Pos, _ , _, _> => root + "नुहुन्छ" ; -- नुहुन्छ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<Neg, Pers1, Sg, _> => root + "दिनँ" ; -- इनँ (पढ्दिनँ)
|
||||||
|
<Neg, Pers1, Pl, _> => root + "दैनैँ" ; -- ऐनैँ (पढ्दैनैँ)
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + "दैनस्" ; -- ऐनस् (पढदैनस्)
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + "दिनस्" ; -- इनस् (पढदिनस्)
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + "दैनै" ; -- ऐनै
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root + "दिनै" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _ , _> => root + "दैनै" ; -- ऐनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + "दैन" ; -- ऐन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + "दिन" ; -- इन
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + "दैन्न" ; -- ऐनन्
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + "दिन्न" ; -- इनन्
|
||||||
|
<Neg, Pers3_M, _, _> => root + "दैन्न" ; -- ऐनन्
|
||||||
|
<Neg, _ , _, _> => root + "नुहुन्न" -- नुहुन्न
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPreNP Helper for VIRrg case
|
||||||
|
mkVPreNPIReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root1 + "छु" ; -- छु
|
||||||
|
<Pos, Pers1, Pl, _> => root1 + "छौं" ; -- छौं
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root1 + "छस्" ; -- छस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root1 + "छेस्" ; -- छेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root1 + "छौ" ; -- छौ
|
||||||
|
<Pos, Pers2_M, Pl, Fem> => root1 + "छ्यौ" ; -- छ्यौ
|
||||||
|
<Pos, Pers2_M, _ , _> => root1 + "छौ" ; -- छौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root1 + "छ" ; -- छ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root1 + "छे" ; -- छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root1 + "छन्" ; -- छन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root1 + "छिन्" ; -- छिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root1 + "छन्" ; -- छन्
|
||||||
|
<Pos, _ , _, _> => root + "नुहुन्छ" ; -- नुहुन्छ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<Neg, Pers1, Sg, _> => root + "ँदिनँ" ; -- इनँ (खाँदिनँ)
|
||||||
|
<Neg, Pers1, Pl, _> => root + "ँदैनैँ" ; -- ऐनैँ (खाँदैनैँ)
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + "ँदैनस्" ; -- ऐनस् (आउँदैनस्)
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + "ँदिनस्" ; -- इनस् (खाँदिनस्)
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + "ँदैनै" ; -- ऐनै (खाँदैनै)
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root + "ँदिनै" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _ , _> => root + "ँदैनै" ; -- ऐनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + "ँदैन" ; -- ऐन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + "ँदिन" ; -- इन (खाँदिन)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + "ँदैन्न" ; -- ऐनन्
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + "ँदिन्न" ; -- इनन्
|
||||||
|
<Neg, Pers3_M, _, _> => root + "ँदैन्न" ; -- ऐनन्
|
||||||
|
<Neg, _ , _, _> => root + "ँनुहुन्न" -- नुहुन्न
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Simple, Nonprogressive mode, nonperfective aspect
|
||||||
|
mkVPstSNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstSNPReg root root2 po pn n g).s ;
|
||||||
|
VIReg => (mkVPstSNPIReg root root2 po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSNP Helper for VRrg case
|
||||||
|
mkVPstSNPReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root2 + "ेँ" ; -- एँ
|
||||||
|
<Pos, Pers1, Pl, _> => root + "यौं" ; -- यौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root2 + "िस्" ; -- इस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "यौ" ; -- यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + "यौ" ; -- यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "यो" ; -- यो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root2 + "ी" ; -- इ (पढी)
|
||||||
|
<Pos, Pers3_L, Pl, _> => root2 + "े" ; -- ए (पढे)
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root2 + "िन्" ; -- इन् (पढिन्)
|
||||||
|
<Pos, Pers3_M, _, _> => root2 + "े" ; -- ए (पढे)
|
||||||
|
<Pos, _, _, _> => root + "नुभयो" ; -- नुभयो
|
||||||
|
|
||||||
|
-- Negative case
|
||||||
|
<Neg, Pers1, Sg, _> => root2 + "िनँ" ; -- इनँ
|
||||||
|
<Neg, Pers1, Pl, _> => root2 + "ेनैँ" ; -- एनैँ
|
||||||
|
<Neg, Pers2_L, Sg, _> => root2 + "िनस्" ; -- इनस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root2 + "ेनै" ; -- एनै
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root2 + "िनै" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _, _> => root2 + "ेनै" ; -- एनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root2 + "ेन" ; -- एन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root2 + "िन" ; -- इन (पढिन)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root2 + "ेनन्" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root2 + "िनन्" ; -- इनन् (पढिनन्)
|
||||||
|
<Neg, Pers3_M, _, _> => root2 + "ेनन्" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, _, _, _> => root + "नुभएन" -- नुभएन
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSNP Helper for VIRrg case
|
||||||
|
mkVPstSNPIReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root2 + "एँ" ; -- एँ
|
||||||
|
<Pos, Pers1, Pl, _> => root2 + "यौं" ; -- यौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root2 + "इस्" ; -- इस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root2 + "यौ" ; -- यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root2 + "यौ" ; -- यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root2 + "यो" ; -- यो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root2 + "ई" ; -- ई
|
||||||
|
<Pos, Pers3_L, Pl, _> => root2 + "ए" ; -- ए
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root2 + "इन्" ; -- इन्
|
||||||
|
<Pos, Pers3_M, _, _> => root2 + "ए" ; -- ए
|
||||||
|
<Pos, _, _, _> => root + "नुभयो" ; -- नुभयो
|
||||||
|
|
||||||
|
-- Negative case
|
||||||
|
<Neg, Pers1, Sg, _> => root2 + "इनँ" ; -- इनँ
|
||||||
|
<Neg, Pers1, Pl, _> => root2 + "एनैँ" ; -- एनैँ
|
||||||
|
<Neg, Pers2_L, Sg, _> => root2 + "इनस्" ; -- इनस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root2 + "एनै" ; -- एनै
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root2 + "इनै" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _, _> => root2 + "एनै" ; -- एनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root2 + "एन" ; -- एन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root2 + "इन" ; -- इन (पढिन)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root2 + "एनन्" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root2 + "इनन्" ; -- इनन् (पढिनन्)
|
||||||
|
<Neg, Pers3_M, _, _> => root2 + "एनन्" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, _, _, _> => root + "नुभएन" -- नुभएन
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Habitual, Nonprogressive mode, nonperfective aspect
|
||||||
|
mkVPstHNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstHNPGen root root1 po pn n g).s ;
|
||||||
|
VIReg => (mkVPstHNPGen root1 root po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstHNP helper, handles bith VReg and VIReg cases
|
||||||
|
mkVPstHNPGen : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, po, pn, n, g ->
|
||||||
|
let neg = "दैन" ; -- दैन (TODO : CHECK FOR MAKE GENERIC FINCTION FOR POS AND NEG)
|
||||||
|
in
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + "थें" ; -- थें
|
||||||
|
<Pos, Pers1, Pl, _> => root + "थ्यौं" ; -- थ्यौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root + "थिस्" ; -- थिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "थ्यौ" ; -- थ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + "थ्यौ" ; -- थ्यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "थ्यो" ; -- थ्यो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "थी" ; -- थी
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "थे" ; -- थे
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "थिन्" ; -- थिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "थे" ; -- थे
|
||||||
|
<Pos, _, _, _> => root1 + "नुहुन्थ्यो" ; -- नुहुन्थ्यो
|
||||||
|
|
||||||
|
<Neg, Pers1, Sg, _> => root + neg + "थें" ; -- थें
|
||||||
|
<Neg, Pers1, Pl, _> => root + neg + "थ्यौं" ; -- थ्यौं
|
||||||
|
<Neg, Pers2_L, Sg, _> => root + neg + "थिस्" ; -- थिस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + neg + "थ्यौ" ; -- थ्यौ
|
||||||
|
<Neg, Pers2_M, _, _> => root + neg + "थ्यौ" ; -- थ्यौ
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + neg + "थ्यो" ; -- थ्यो
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + neg + "थी" ; -- थी
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + neg + "थे" ; -- थे
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + neg + "थीन्" ; -- थिन्
|
||||||
|
<Neg, Pers3_M, _, _> => root + neg + "थे" ; -- थे
|
||||||
|
<Neg, _, _, _> => root1 + "नुहुँदैनथ्यो" -- नुहुँदैनथ्यो
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Unknown, Nonprogressive mode, nonperfective aspect
|
||||||
|
mkVPstUNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\ root, root2, vc, po, p, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => case po of {
|
||||||
|
Pos => (mkVPstUNPReg root root2 "" p n g).s ;
|
||||||
|
Neg => (mkVPstUNPReg root root2 "न" p n g).s
|
||||||
|
} ;
|
||||||
|
VIReg => case po of {
|
||||||
|
Pos => (mkVPstUNPIReg root root2 "" p n g).s ;
|
||||||
|
Neg => (mkVPstUNPIReg root root2 "न" p n g).s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- mkVPstUNP helper for VReg case
|
||||||
|
mkVPstUNPReg : Str -> Str -> Str -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, na, pn, nu, g ->
|
||||||
|
{s = case <pn, nu, g> of {
|
||||||
|
<Pers1, Sg, Masc> => root2 + "े" + na + "छु" ; -- एछु
|
||||||
|
<Pers1, Sg, Fem> => root2 + "ि" + na + "छु" ; -- इछु
|
||||||
|
<Pers1, Pl, _> => root2 + "े" + na + "छौँ" ; -- एछौँ
|
||||||
|
<Pers2_L, Sg, Masc> => root2 + "े" + na + "छस्" ; -- एछस्
|
||||||
|
<Pers2_L, Sg, Fem> => root2 + "ि" + na + "छस्" ; -- इछस्
|
||||||
|
<Pers2_L, Pl, _> => root2 + "े" + na + "छौ" ; -- एछौ
|
||||||
|
<Pers2_M, Sg, Fem> => root2 + "ि" + na + "छौ" ; -- इछौ
|
||||||
|
<Pers2_M, _, _> => root2 + "े" + na + "छौ" ; -- एछौ
|
||||||
|
<Pers3_L, Sg, Masc> => root2 + "े" + na + "छ" ; -- एछ
|
||||||
|
<Pers3_L, Sg, Fem> => root2 + "ि" + na + "छ" ; -- इछ
|
||||||
|
<Pers3_L, Pl, _> => root2 + "े" + na + "छन्" ; -- एछन्
|
||||||
|
<Pers3_M, Sg, Fem> => root2 + "ि" + na + "छन्" ; -- इछन्
|
||||||
|
<Pers3_M, _, _> => root2 + "े" + na + "छन्" ; -- एछन्
|
||||||
|
< _, _, _> => root + "नुभए" + na +"छ" -- नुभएछ
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- mkVPstUNP helper for VIReg case
|
||||||
|
mkVPstUNPIReg : Str -> Str -> Str -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, na, pn, nu, g ->
|
||||||
|
{s = case <pn, nu, g> of {
|
||||||
|
<Pers1, Sg, Masc> => root2 + "ए" + na + "छु" ; -- एछु
|
||||||
|
<Pers1, Sg, Fem> => root2 + "इ" + na + "छु" ; -- इछु
|
||||||
|
<Pers1, Pl, _> => root2 + "ए" + na + "छौँ" ; -- एछौँ
|
||||||
|
<Pers2_L, Sg, Masc> => root2 + "ए" + na + "छस्" ; -- एछस्
|
||||||
|
<Pers2_L, Sg, Fem> => root2 + "इ" + na + "छस्" ; -- इछस्
|
||||||
|
<Pers2_L, Pl, _> => root2 + "ए" + na + "छौ" ; -- एछौ
|
||||||
|
<Pers2_M, Sg, Fem> => root2 + "इ" + na + "छौ" ; -- इछौ
|
||||||
|
<Pers2_M, _, _> => root2 + "ए" + na + "छौ" ; -- एछौ
|
||||||
|
|
||||||
|
<Pers3_L, Sg, Masc> => root2 + "ए" + na + "छ" ; -- एछ
|
||||||
|
<Pers3_L, Sg, Fem> => root2 + "इ" + na + "छ" ; -- इछ
|
||||||
|
<Pers3_L, Pl, _> => root2 + "ए" + na + "छन्" ; -- एछन्
|
||||||
|
<Pers3_M, Sg, fem> => root2 + "इ" + na + "छन्" ; -- इछन्
|
||||||
|
<Pers3_M, _, _> => root2 + "ए" + na + "छन्" ; -- एछन्
|
||||||
|
< _, _, _> => root + "नुभए" + na +"छ" -- नुभएनछ
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Definitive, Nonprogressive mode, nonperfective aspect
|
||||||
|
-- Handles Both cases
|
||||||
|
mkVFutDNP : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root + "नेछु" ; -- नेछु
|
||||||
|
<Pos, Pers1, Pl, _> => root + "नेछौं" ; -- नेछौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root + "नेछस्" ; -- नेछस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "नेछौं" ; -- नेछौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + "नेछौं" ; -- नेछौ
|
||||||
|
<Pos, Pers3_L, Sg, _> => root + "नेछ" ; -- नेछ
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "नेछन्" ; -- नेछन्
|
||||||
|
<Pos, Pers3_M, _, Masc> => root + "नेछन्" ; -- नेछन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "नेछिन्" ; -- नेछिन्
|
||||||
|
<Pos, Pers3_M, Pl, Fem> => root + "नेछिन्" ; -- नेछन्
|
||||||
|
<Pos, _, _, _> => root + "नुहुनेछ" ; -- नुहुनेछ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<Neg, Pers1, Sg, _> => root + "नेछैन" ; -- नेछैन
|
||||||
|
<Neg, Pers1, Pl, _> => root + "नेछैनैँ" ; -- नेछैनैँ
|
||||||
|
<Neg, Pers2_L, Sg, _> => root + "नेछैनस्" ; -- नेछैनस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + "नेछैनै" ; -- नेछैनै
|
||||||
|
<Neg, Pers2_M, _, _> => root + "नेछैनै" ; -- नेछैनै
|
||||||
|
<Neg, Pers3_L, Sg, _> => root + "नेछैन्" ; -- नेछैन्
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + "नेछैनन्" ; -- नेछैनन्
|
||||||
|
<Neg, Pers3_M, Sg, _> => root + "नेछैनन्" ; -- नेछैनन्
|
||||||
|
<Neg, Pers3_M, Pl, _> => root + "नेछैनै" ; -- नेछैनै
|
||||||
|
<Neg, _, _, _> => root + "नुहुनेछैन्" -- नुहुनेछैन्
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Nondefinitive, Nonperfective aspect, NonPregressive mode
|
||||||
|
mkVFutNDNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVFutNDNPReg root root2 po pn n g).s ;
|
||||||
|
VIReg => (mkVFutNDNPIReg root2 po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVFutNDNP helper for VReg case
|
||||||
|
mkVFutNDNPReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root2 + "ुँला" ; -- उँला
|
||||||
|
<Pos, Pers1, Pl, _> => root2 + "ौँला" ; -- आँला
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + "लास्" ; -- लास्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + "लीस्" ; -- लिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root2 + "ौला" ; -- औला
|
||||||
|
<Pos, Pers2_M, Pl, Fem> => root2 + "ौलि" ; -- औलि
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "ला" ; -- ला
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "ली" ; -- ली
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "लान्" ; -- लान्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "लीन्" ; -- लिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "लान्" ; -- लान्
|
||||||
|
<Pos, _, _, _> => root + "नुहोला" ; -- नुहोला
|
||||||
|
|
||||||
|
-- TODO : NOT CLEAR DEFINITION IN BOOK
|
||||||
|
<Neg, _, _, _> => "टुडु"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVFutNDNP helper for VIReg case
|
||||||
|
mkVFutNDNPIReg : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + "उँला" ; -- उँला
|
||||||
|
<Pos, Pers1, Pl, _> => root + "औँला" ; -- आँला
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + "लास्" ; -- लास्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + "लिस्" ; -- लिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "औला" ; -- औला
|
||||||
|
<Pos, Pers2_M, Pl, Fem> => root + "औलि" ; -- औलि
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "ला" ; -- ला
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "ली" ; -- ली
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "लान्" ; -- लान्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "लिन्" ; -- लिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "लान्" ; -- लान्
|
||||||
|
<Pos, _, _, _> => root + "नुहोला" ; -- नुहोला
|
||||||
|
|
||||||
|
-- TODO : NOT CLEAR DEFINITION IN BOOK
|
||||||
|
<Neg, _, _, _> => "टुडु"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Simple, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPstSP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstSPGen root2 "ेको" "ेकि" "ेका" po pn n g).s ;
|
||||||
|
VIReg => (mkVPstSPGen root2 "एको" "एकि" "एका" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSP Helper handles both VReg and VIreg cases
|
||||||
|
mkVPstSPGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "थिएँ" ; -- थिएँ
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "थियौँ" ; -- थियौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "थिइस्" ; -- थिइस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "थिइस्" ; -- थिइस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "थियौ" ; -- थियौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "थियौ" ; -- थियौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "थियो" ; -- थियो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "थिई" ; --थिई
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "थिए" ; -- थिए
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "थिइन्" ; -- थिइन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "थिए" ; -- थिए
|
||||||
|
<Pos, _, _, _> => root + sreg + "हुनुहुन्थ्यो" ; -- हुनुहुन्थ्यो (TODO: CONFIRM CORRECT)
|
||||||
|
|
||||||
|
-- Negative case
|
||||||
|
<Neg, Pers1, Sg, _> => root + sreg +"थिइनँ" ; --
|
||||||
|
<Neg, Pers1, Pl, _> => root + spl + "थिएनैँ" ; --
|
||||||
|
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + sreg + "थिइनस्" ; --
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + sfem + "थिइनस्" ; --
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + spl + "थिएनै" ; --
|
||||||
|
<Neg, Pers2_M, _, _> => root + spl + "थिनै" ; --
|
||||||
|
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + sreg + "थिएन" ; --
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + sfem + "थिइङ" ; --
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + spl + "थिएनन्" ; --
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + sfem + "थिइनन्" ; --
|
||||||
|
<Neg, Pers3_M, _, _> => root + spl + "थिएनन्" ; --
|
||||||
|
<Neg, _, _, _> => root + sreg + "हुनुहुन्नथ्यो" -- हुनुहुन्नथ्यो (TODO: CONFIRM CORRECT)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Habitual, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPstHP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstHPGen root2 "ेको" "ेकि" "ेका" po pn n g).s ;
|
||||||
|
VIReg => (mkVPstHPGen root2 "एको" "एकि" "एका" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSP Helper handles both VReg and VIreg cases
|
||||||
|
mkVPstHPGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "हुन्थेँ" ; -- हुन्थेँ
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "हुन्थौँ" ; -- हुन्थौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "हुन्थिस्" ; -- हुन्थिस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "हुन्थइस्" ; -- हुन्थिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "हुन्थ्यौ" ; -- हुन्थ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "हुन्थ्यौ" ; -- हुन्थ्यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "हुन्थ्यौ" ; -- हुन्थ्यौ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "हुन्थी" ; -- हुन्थी
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "हुन्थे" ; -- हुन्थे
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "हुन्थि" ; -- हुन्थि
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "हुन्थे" ; -- हुन्थे
|
||||||
|
<Pos, _, _, _> => root + sreg + "हुनुहुन्थ्यो" ; -- (TODO : हुनुहुन्थ्यो need to Confirm)
|
||||||
|
|
||||||
|
-- Negative case (TODO)
|
||||||
|
<Neg, Pers1, Sg, _> => root + sreg + "हुन्थेँ" ; -- हुन्थेँ
|
||||||
|
<Neg, Pers1, Pl, _> => root + spl + "हुन्थौँ" ; -- हुन्थौँ
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + sreg + "हुन्थिइस्" ; -- हुन्थिइस् ???? G Check
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + sfem + "हुन्थिइस्" ; -- हुन्थिइस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + spl + "हुन्थियौ" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw)
|
||||||
|
<Neg, Pers2_M, _, _> => root + spl + "हुन्थियौ" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw)
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + sreg + "हुन्थ्यौ" ; -- हुन्थ्यौ / (थियो ????)
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + sfem + "हुन्थी" ; -- हुन्थी/ (थिई ????)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + spl + "हुन्थे" ; -- हुन्थे / (थिए)
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + sfem + "हुन्थि" ; -- हुन्थि
|
||||||
|
<Neg, Pers3_M, _, _> => root + spl + "हुन्थे" ; -- हुन्थे / (थिए)
|
||||||
|
<Neg, _, _, _> => root + sreg + "हुनुहुन्नथ्यो" -- हुनुहुन्नथ्यो (TODO: CONFIRM CORRECT)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Unknown, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPstUP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstHPGen root2 "ेको" "ेकि" "ेका" po pn n g).s ;
|
||||||
|
VIReg => (mkVPstHPGen root2 "एको" "एकि" "एका" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstUP Helper handles both VReg and VIreg cases
|
||||||
|
mkVPstUPGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, Masc> => root + sreg + "रहेछु" ; -- रहेछु
|
||||||
|
<Pos, Pers1, Sg, Fem > => root + sfem + "रहेछु" ; -- रहेछु (खाएकिरहेछु)
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "रहेछौँ" ; -- रहेछौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "रहिछस्" ; --रहिछस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "रहिछस्" ; --रहिछस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "रहेछौ" ; -- रहेछौ
|
||||||
|
<Pos, Pers2_M, Sg, Masc> => root + spl + "रहेछौ" ; -- रहेछौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "रहिछौ" ; -- रहिछौ (छ्यौ ????)
|
||||||
|
<Pos, Pers2_M, Pl, _> => root + spl + "रहेछौ" ; -- रहेछौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "रहेछ" ; -- रहेछ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "रहिछ" ; -- रहिछ
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "रहेछन्" ; -- रहेछन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "रहिछीन्" ; -- रहिछीन्
|
||||||
|
<Pos, Pers3_M, Sg, Masc> => root + spl + "रहेछन्" ; -- रहेछन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "रहेछन्" ; -- रहेछन्
|
||||||
|
<Pos, _, _, _> => root + sreg + "हुनुहुदोरहेछ" ; -- हुनुहुदोरहेछ/नुभएकोरहेछ(nuBe:korhec)
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "टुडु" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Present, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPreP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPreGen root2 "ेको" "ेकि" "ेका" po pn n g).s ;
|
||||||
|
VIReg => (mkVPreGen root2 "एको" "एकि" "एका" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPreP helper handles both VReg and VIreg cases
|
||||||
|
mkVPreGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "छु" ; -- छु
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "छौं" ; -- छौं
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "छस्" ; -- छस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "छेस्" ; -- छेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "छौ" ; -- छौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "छ्यौ" ; --छ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "छौ" ; -- छौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "छ" ; -- छ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "छे" ; -- छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "छन्" ; -- छन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "छिन्" ; -- छिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "छन्" ; -- छन्
|
||||||
|
<Pos, _, _, _> => root + sreg + "हुनुहुन्छ" ; -- हुनुहुन्छ
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "टुडु" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Definitive, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVFutDefP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVFutDefGen root2 "ेको" "ेकि" "ेका" po pn n g).s ;
|
||||||
|
VIReg => (mkVFutDefGen root2 "एको" "एकि" "एका" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- mkVFutDef helper handles both VReg and VIreg cases
|
||||||
|
mkVFutDefGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + ("हुने"+"छु") ; -- हुनेछु
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "हुनेछौँ" ; -- हुनेछौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "हुनेछस्" ; -- हुनेछस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "हुनेछेस्" ; -- हुनेछेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "हुनेछौ" ; -- हुनेछौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "हुनेछ्यौ" ; -- हुनेछ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "हुनेछौ" ; -- हुनेछौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "हुनेछ" ; -- हुनेछ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "हुन्छे" ; -- हुन्छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "हुनेछन्" ; -- हुनेछन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "हुनेछिन्" ; -- हुनेछिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "हुनेछन्" ; -- हुनेछन्
|
||||||
|
<Pos, _, _, _> => root + sreg + "हुनुहुनेछ" ; -- हुनुहुनेछ
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "टुडु" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Nondefinitive, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVFutNDefP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVFutDefGen root2 "ेको" "ेकि" "ेका" po pn n g).s ;
|
||||||
|
VIReg => (mkVFutDefGen root2 "एको" "एकि" "एका" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- Helper mkVFutNDef handles both VReg and VIreg cases
|
||||||
|
mkVFutNDefGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "हुँला" ; -- हुँला
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "हौँलाँ" ; -- हौँलाँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "होलास्" ; -- होलास्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "होलिस्" ; -- होलिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "हौला" ; -- हौला
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "होलि" ; -- होलि
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "हौला" ; -- हौला
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "होला" ; -- होला
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "होली" ; -- होली
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "होलान्" ; -- होलान्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "होलिन्" ; -- होलिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "होलान्" ; -- होलान्
|
||||||
|
<Pos, _, _, _> => root + sreg + "हुनुहोला" ; -- हुनुहोला
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "टुडु" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- TODO - Refactor
|
||||||
|
IntPronForm = {s: Case => Str};
|
||||||
|
mkIntPronForm : (x1,x2,x3,x4:Str) -> IntPronForm =
|
||||||
|
\y1,y2,y3,y4 -> {
|
||||||
|
s = table {
|
||||||
|
Nom => y1;
|
||||||
|
_ => y2
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
137
lib/src/nepali/NounNep.gf
Normal file
137
lib/src/nepali/NounNep.gf
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
concrete NounNep of Noun = CatNep ** open ResNep, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
DetCN det cn = {
|
||||||
|
s = \\c => detcn2NP det cn c det.n ;
|
||||||
|
a = agrP3 cn.g det.n ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UsePN pn = {s = \\c => toNP pn.s c ; a = agrP3 pn.g Sg } ;
|
||||||
|
|
||||||
|
--TODO NEED TO CHANGE np2pronCase
|
||||||
|
UsePron p = {s = \\c => np2pronCase p.s c p.a ; a = p.a } ;
|
||||||
|
|
||||||
|
PredetNP pred np = {
|
||||||
|
s = \\c => pred.s ++ np.s ! c ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- Neds to change this,
|
||||||
|
-- needs to check for root ending case, now works for regular cases only
|
||||||
|
PPartNP np v2 = {
|
||||||
|
s = \\c => case (fromAgr np.a).n of {
|
||||||
|
Sg => np.s ! c ++ v2.s ! Root ++ eko;
|
||||||
|
Pl => np.s ! c ++ v2.s ! Root ++ eka
|
||||||
|
} ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelNP np rs = {
|
||||||
|
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvNP np adv = {
|
||||||
|
s = \\c => np.s ! c ++ adv.s ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetNP det = {
|
||||||
|
s = \\c => det2NP det c ; ---- case
|
||||||
|
a = agrP3 Masc Sg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- ?? quant
|
||||||
|
DetQuantOrd quant num ord = {
|
||||||
|
-- s = \\ c => detquant2det quant.s num.s c ++ ord.s ;
|
||||||
|
s = \\n,g => quant.s ! n ! g ++ ord.s ++ num.s ;
|
||||||
|
n = num.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetQuant quant num = {
|
||||||
|
-- s = \\c => detquant2det quant.s num.s c;
|
||||||
|
s = \\n,g => quant.s!num.n!g++ num.s;
|
||||||
|
n = num.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
NumSg = {s = []; n = Sg} ;
|
||||||
|
NumPl = {s = []; n = Pl} ;
|
||||||
|
|
||||||
|
NumCard n = n ** {hasCard = True} ;
|
||||||
|
|
||||||
|
PossPron p = {s = \\_,_ => p.ps ; a = p.a} ;
|
||||||
|
|
||||||
|
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 = sbvn ++ a.s ! Sg ! Masc ; 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 = \\_,_ => [] } ;
|
||||||
|
IndefArt = {s = \\_,_ => [] } ;
|
||||||
|
|
||||||
|
MassNP cn = {s = \\c => toNP (cn.s ! Sg) c ; a = agrP3 cn.g Sg } ;
|
||||||
|
|
||||||
|
UseN n = n ;
|
||||||
|
UseN2 n = { s = n.s ; g = n.g };
|
||||||
|
|
||||||
|
Use2N3 f = {
|
||||||
|
s = f.s;
|
||||||
|
g = f.g ;
|
||||||
|
c2 = f.c2;
|
||||||
|
c3 = f.c3
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Use3N3 f = {
|
||||||
|
s = f.s ;
|
||||||
|
g = f.g ;
|
||||||
|
c2 = f.c2;
|
||||||
|
c3 = f.c3
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComplN2 f x = {
|
||||||
|
s = \\n,c => x.s ! NPC Nom ++ f.c2 ++ f.s ! n ! c ;
|
||||||
|
g = f.g;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComplN3 f x = {
|
||||||
|
s = \\n,c => x.s ! NPObj ++ f.c3 ++ f.c4 ++ f.s ! n ! Nom ;
|
||||||
|
g = f.g ;
|
||||||
|
c2 = f.c2 ;
|
||||||
|
c3 = f.c3
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdjCN ap cn = {
|
||||||
|
s = \\n,c => ap.s ! n ! cn.g ++ cn.s ! n ! c ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelCN cn rs = {
|
||||||
|
s = \\n,c => cn.s ! n ! c ++ rs.s ! agrP3 cn.g n ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ;
|
||||||
|
|
||||||
|
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ;
|
||||||
|
|
||||||
|
ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! NPC c ; g = cn.g} ;
|
||||||
|
|
||||||
|
}
|
||||||
118
lib/src/nepali/NumeralNep.gf
Normal file
118
lib/src/nepali/NumeralNep.gf
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
concrete NumeralNep of Numeral = CatNep ** open ResNep, Prelude in {
|
||||||
|
-- By Harald Hammarstroem
|
||||||
|
-- Modification for Nepali by Dinesh and 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 ++ "ौँ" -- need to use mkOrd x0.s but it gives linking error
|
||||||
|
};
|
||||||
|
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 "दुई" "बीस" r2 ;
|
||||||
|
lin n3 = mkNum "तीन" "तीस" r3 ;
|
||||||
|
lin n4 = mkNum "चार" "चालीस" r4 ;
|
||||||
|
lin n5 = mkNum "पाँच" "पचास" r5 ;
|
||||||
|
lin n6 = mkNum "छ" "साठी" r6 ;
|
||||||
|
lin n7 = mkNum "सात" "सत्तरी" r7 ; -- सत्तरी
|
||||||
|
lin n8 = mkNum "आठ" "असी" r8 ;
|
||||||
|
lin n9 = mkNum "नौ" "नब्बे" r9 ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkR : (a1,_,_,_,_,_,_,_,a9 : 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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- REF http://dsal.uchicago.edu/dictionaries/schmidt/
|
||||||
|
-- Ordinals from One - Hundred are irregular
|
||||||
|
rows : DSize => DSize => Str = table {
|
||||||
|
sg => mkR "एघार" "एक्काइस" "एकतीस" "एकचालीस" "एकाउन्न" "एकसठ्ठी" "एकहत्तर" "एकासी" "एकान्नब्बे" ;
|
||||||
|
r2 => mkR "बाह्र" "बाइस" "बत्तीस" "बयालीस" "बाउन्न" "बैसठ्ठी" "बहत्तर" "बयासी" "बयान्नब्बे" ;
|
||||||
|
r3 => mkR "तेह्र" "तेइस" "तेत्तीस" "त्रिचालीस" "त्रिपन्न" "त्रिसठ्ठी" "त्रिहत्तर" "त्रियासी" "त्रियान्नब्बे" ;
|
||||||
|
r4 => mkR "चौध" "चौबीस" "चौंतीस" "चवालीस" "चवन्न" "चौसठ्ठी" "चौहत्तर" "चौरासी" "चौरान्नब्बे";
|
||||||
|
r5 => mkR "पन्ध्र" "पच्चीस" "पैंतीस" "पैंतालीस" "पचपन्न" "पैंसठ्ठी" "पचहत्तर" "पचासी" "पन्चान्नब्बे" ;
|
||||||
|
r6 => mkR "सोह्र" "छब्बीस" "छत्तीस" "छयालीस" "छपन्न" "छैंसठ्ठी" "छयहत्तर" "छयासी" "छयान्नब्बे" ;
|
||||||
|
r7 => mkR "सत्र" "सत्ताइस" "सौंतीस" "सतचालीस" "सन्ताउन्न" "सतसठ्ठी" "सतहत्तर" "सतासी" "सन्तान्नब्बे" ;
|
||||||
|
r8 => mkR "अठार" "अठ्ठाइस" "अठतीस" "अठतालीस" "अन्ठाउन्न" "अठसठ्ठी" "अठहत्तर" "अठासी" "अन्ठान्नब्बे" ;
|
||||||
|
r9 => mkR "उन्नाइस" "उनन्तीस" "उनन्चालीस" "उनन्पचास" "उनन्साठी" "उनन्सत्तरी" "उनासी" "उनान्नब्बे" "उनान्सय"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||||
|
|
||||||
|
lin pot01 = {s = table {unit => "एक" ; _ => "दमय" } ; 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 = "दमय" ; 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 ;
|
||||||
|
}
|
||||||
222
lib/src/nepali/ParadigmsNep.gf
Normal file
222
lib/src/nepali/ParadigmsNep.gf
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude:../common
|
||||||
|
--
|
||||||
|
----1 Lexical Paradigms
|
||||||
|
|
||||||
|
resource ParadigmsNep = open
|
||||||
|
Predef,
|
||||||
|
Prelude,
|
||||||
|
MorphoNep,
|
||||||
|
CatNep
|
||||||
|
in {
|
||||||
|
|
||||||
|
--2 Parameters
|
||||||
|
|
||||||
|
oper
|
||||||
|
masculine : Gender ;
|
||||||
|
feminine : Gender ;
|
||||||
|
singular : Number;
|
||||||
|
plural : Number;
|
||||||
|
|
||||||
|
singular = Sg ; plural = Pl;
|
||||||
|
|
||||||
|
masculine = Masc ; feminine = Fem ;
|
||||||
|
|
||||||
|
--2 Nouns
|
||||||
|
regN : Str -> N = \s -> mkNReg s ** {lock_N= <>} ;
|
||||||
|
mkNF : Str -> N = \s -> mkNFem s ** {lock_N= <>} ;
|
||||||
|
mkNUC : Str -> Gender -> N = \s,g -> mkNUnc s g ** {lock_N= <>} ;
|
||||||
|
|
||||||
|
mkN2 : N -> Prep -> Str -> N2;
|
||||||
|
mkN2 = \n,p,c -> n ** {lock_N2 = <> ; c2 = p.s ; c3 = c } ;
|
||||||
|
|
||||||
|
mkN3 : N -> Prep -> Prep -> Str-> N3 ;
|
||||||
|
mkN3 = \n,p,q,r -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s ; 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 = overload {
|
||||||
|
mkPN : Str -> PN =
|
||||||
|
\s -> let n = regN1 s Masc in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||||
|
|
||||||
|
mkPN : Str -> Gender -> PN =
|
||||||
|
\s, g -> let n = regN1 s g in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Personal Pronouns
|
||||||
|
mkPron = overload {
|
||||||
|
mkPron : Str -> Str -> Number -> Gender -> NPerson -> Pron =
|
||||||
|
\s,s1,nu,gn,pn -> let n = makePronReg s in {s = n.s ; ps = s1 ; a = toAgr nu pn gn ; lock_Pron = <> } ;
|
||||||
|
|
||||||
|
mkPron : (x1,_,_,_,_,_,x7 : Str) -> Number -> Gender -> NPerson -> Pron =
|
||||||
|
\x1,x2,x3,x4,x5,x6,x7,nu,gn,pn ->
|
||||||
|
let n = makePron x1 x2 x3 x4 x5 x6 in {s = n.s ; ps = x7 ; a = toAgr nu pn gn ; 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 = overload {
|
||||||
|
mkDet : (s1,s2:Str) -> Number -> Det =
|
||||||
|
\s1,s2,nb -> let dt = makeDet s1 s1 s2 s2 nb in {s = dt.s ; n = nb ; lock_Det = <>};
|
||||||
|
|
||||||
|
mkDet : (s1,s2,s3,s4: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 -> IP =
|
||||||
|
\s1,s2,s3,s4,n -> let p = mkIntPronForm s1 s2 s3 s4 in { s = p.s ; n = n ; lock_IP = <>};
|
||||||
|
|
||||||
|
|
||||||
|
--2 Adjectives
|
||||||
|
|
||||||
|
mkA = overload {
|
||||||
|
mkA : Str-> A
|
||||||
|
= \s -> mkAdjnp s ** {lock_A = <>} ;
|
||||||
|
mkA : Str -> Str -> A2
|
||||||
|
= \a,c -> let n = mkAdjnp 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 ; -- e.g. today
|
||||||
|
mkAdv x = lin Adv (ss x) ;
|
||||||
|
|
||||||
|
mkAdV : Str -> AdV ; -- e.g. always
|
||||||
|
mkAdV x = lin AdV (ss x) ;
|
||||||
|
|
||||||
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
|
mkAdA : Str -> AdA ; -- e.g. quite
|
||||||
|
mkAdA x = lin AdA (ss x) ;
|
||||||
|
|
||||||
|
-- Adverbs modifying numerals
|
||||||
|
|
||||||
|
mkAdN : Str -> AdN ; -- e.g. approximately
|
||||||
|
mkAdN x = lin AdN (ss x) ;
|
||||||
|
|
||||||
|
--2 Prepositions
|
||||||
|
--
|
||||||
|
-- A preposition as used for rection in the lexicon, as well as to
|
||||||
|
-- build $PP$s in the resource API, just requires a string.
|
||||||
|
mkPrep : Str -> Prep ;
|
||||||
|
mkPrep p = lin Prep (ss p) ;
|
||||||
|
|
||||||
|
noPrep : Prep ;
|
||||||
|
noPrep = mkPrep [] ;
|
||||||
|
|
||||||
|
|
||||||
|
--3 Determiners and quantifiers
|
||||||
|
|
||||||
|
mkQuant = overload {
|
||||||
|
--mkQuant : Pron -> Quant = \p -> {s = \\_,_,c => p.s!c ; lock_Quant = <>};
|
||||||
|
mkQuant : (s1,s2,s3,s4:Str) -> Quant =
|
||||||
|
\sm,sf,pm,pf -> {s = (makeQuant sm sf pm pf).s ; lock_Quant = <>};
|
||||||
|
|
||||||
|
mkQuant : (s1,s2:Str) -> Quant =
|
||||||
|
\sg,pl -> {s = (makeQuant sg sg pl pl).s ; lock_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 ;
|
||||||
|
-}
|
||||||
|
}
|
||||||
32
lib/src/nepali/PhraseNep.gf
Normal file
32
lib/src/nepali/PhraseNep.gf
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
concrete PhraseNep of Phrase = CatNep ** open Prelude, ResNep in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
|
|
||||||
|
UttS s = s ;
|
||||||
|
UttQS qs = {s = qs.s ! QDir} ;
|
||||||
|
-- be a man -> (मन्छे हउ)
|
||||||
|
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 ! Nom} ; --- Acc also
|
||||||
|
UttIAdv iadv = iadv ;
|
||||||
|
UttNP np = {s = np.s ! NPC Nom} ;
|
||||||
|
|
||||||
|
UttVP vp = {s = vp.ad ++ vp.obj.s ++ vp.comp ! (agrP3 Masc Sg) ++ (vp.s ! Inf).inf ++ vp. embComp} ;
|
||||||
|
|
||||||
|
UttAdv adv = {s = adv.s } ;
|
||||||
|
UttCN cn = {s = cn.s ! Sg ! Nom};
|
||||||
|
UttCard n = n ;
|
||||||
|
UttAP ap = {s = ap.s ! Sg ! Masc } ;
|
||||||
|
|
||||||
|
NoPConj = {s = []} ;
|
||||||
|
PConjConj conj = {s = conj.s2} ;
|
||||||
|
|
||||||
|
NoVoc = {s = []} ;
|
||||||
|
VocNP np = {s = np.s ! NPC Nom} ;
|
||||||
|
|
||||||
|
}
|
||||||
83
lib/src/nepali/QuestionNep.gf
Normal file
83
lib/src/nepali/QuestionNep.gf
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
concrete QuestionNep of Question = CatNep ** open ResNep, 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 Masc qp.n Pers3_L) vp;
|
||||||
|
qp1 = qp.s ! Nom;
|
||||||
|
qp2 = qp.s ! Ins
|
||||||
|
in { s = \\t,p,o =>
|
||||||
|
case t of {
|
||||||
|
-- VPSmplPast => qp2 ++ cl.s ! t ! p ! ODir ;
|
||||||
|
_ => qp1 ++ cl.s ! t ! p ! ODir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
QuestSlash ip slash =
|
||||||
|
let ip1 = ip.s ! Nom;
|
||||||
|
ip2 = ip.s ! Ins
|
||||||
|
in {
|
||||||
|
s = \\t,p,o => case t of {
|
||||||
|
-- VPSmplPast => 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 Nom ++ 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 ! ResNep.Nom ++ p.s } ; -- case need to be confirmed
|
||||||
|
|
||||||
|
AdvIP ip adv = {
|
||||||
|
s = \\c => adv.s ++ ip.s ! c ;
|
||||||
|
n = ip.n;
|
||||||
|
g = ip.g;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetCN idet cn = {
|
||||||
|
s = \\c => idet.s ! Masc++ cn.s ! idet.n ! c ;
|
||||||
|
n = idet.n;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetIP idet = {
|
||||||
|
s = \\_ => idet.s ! Masc ;
|
||||||
|
n = idet.n;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetQuant iqant num = {
|
||||||
|
s =\\_ => iqant.s ! num.n ++ num.s ;
|
||||||
|
n = num.n ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompIAdv a = a ;
|
||||||
|
CompIP p = ss (p.s ! Nom) ;
|
||||||
|
AdvIAdv i a = {s = i.s ++ a.s} ;
|
||||||
|
AdvQVP vp iadv = insertObj (\\_ => iadv.s) vp ;
|
||||||
|
AddAdvQVP qvp iadv = insertObj (\\_ => iadv.s) qvp ;
|
||||||
|
ComplSlashIP vpslash ip = insertObj (\\_ => ip.s ! Nom) vpslash ;
|
||||||
|
|
||||||
|
lincat QVP = CatNep.VP ;
|
||||||
|
|
||||||
|
}
|
||||||
9
lib/src/nepali/README
Normal file
9
lib/src/nepali/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.
|
||||||
63
lib/src/nepali/RelativeNep.gf
Normal file
63
lib/src/nepali/RelativeNep.gf
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
concrete RelativeNep of Relative = CatNep ** open ResNep in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
RelCl cl = {
|
||||||
|
s = \\t,p,o,agr => "जस्तिकी" ++ cl.s ! t ! p ! o ;
|
||||||
|
c = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- 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 ! Nom) 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 = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
---- Pied piping: 'at which we are looking'. Stranding and empty
|
||||||
|
---- relative are defined in $ExtraHin.gf$ ("तहात ौे ारे लोोकिनग ात",
|
||||||
|
---- "ौे ारे लोोकिनग ात").
|
||||||
|
--
|
||||||
|
RelSlash rp slash = {
|
||||||
|
s = \\t,p,o,agr => rp.s ! Nom ++ 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 = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- CHEK NEPALI RULES FOR RELSTIVE (PG 32)
|
||||||
|
FunRP p np rp = {
|
||||||
|
s = \\c => rp.s ! c ++ np.s ! NPC Nom ++ p.s ;
|
||||||
|
a = RAg np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdRP = {
|
||||||
|
s = table {
|
||||||
|
ResNep.Nom => "जो" ;
|
||||||
|
ResNep.Ins => "जस्ले" ;
|
||||||
|
_ => "जो"
|
||||||
|
} ;
|
||||||
|
a = RNoAg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
713
lib/src/nepali/ResNep.gf
Normal file
713
lib/src/nepali/ResNep.gf
Normal file
@@ -0,0 +1,713 @@
|
|||||||
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
--
|
||||||
|
--1 Pnbu auxiliary operations.
|
||||||
|
--
|
||||||
|
-- This module contains operations that are needed to make the
|
||||||
|
-- resource syntax work.
|
||||||
|
|
||||||
|
resource ResNep = ParamX ** open Prelude, Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
param
|
||||||
|
Case = Nom | Acc | Ins | Dat | Abl | Loc ;
|
||||||
|
Gender = Masc | Fem ;
|
||||||
|
VTense = NPresent | NPast PTypes | NFuture FTypes;
|
||||||
|
PTypes = Simpl | Hab | Unknown ;
|
||||||
|
FTypes = Defin | NDefin ;
|
||||||
|
NPerson = Pers1
|
||||||
|
| Pers2_L
|
||||||
|
| Pers2_M
|
||||||
|
| Pers2_H
|
||||||
|
| Pers3_L
|
||||||
|
| Pers3_M
|
||||||
|
| Pers3_H ;
|
||||||
|
|
||||||
|
Order = ODir | OQuest ;
|
||||||
|
|
||||||
|
--2 For $Relative$
|
||||||
|
|
||||||
|
RAgr = RNoAg | RAg Agr ;
|
||||||
|
RCase = RC Number Case ;
|
||||||
|
|
||||||
|
-- for Numerial
|
||||||
|
|
||||||
|
CardOrd = NCard | NOrd ;
|
||||||
|
|
||||||
|
------------------------------------------
|
||||||
|
--Verbs
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
VerbForm =
|
||||||
|
VF VTense Aspect Polarity NPerson Number Gender
|
||||||
|
| Root -- Root form 'kha' is the root of 'khanu'
|
||||||
|
| Inf -- Infinitive form 'khanau'
|
||||||
|
| ProgRoot Aspect Number Gender
|
||||||
|
| PVForm -- Partial verb form 'khan' is teh PVForm of 'khanu'
|
||||||
|
| Imp ;
|
||||||
|
|
||||||
|
-- Aspect Perfective and non-perfective
|
||||||
|
Aspect = Perf | Imperf ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
-- Noun = {s : Number => Case => Str ; g : Gender ; isHum : Bool } ; -- TODO ADD HUMAN/NON-HUMAN CASE
|
||||||
|
Noun = {s : Number => Case => Str ; g : Gender } ;
|
||||||
|
|
||||||
|
Verb = {s : VerbForm => Str} ;
|
||||||
|
|
||||||
|
Preposition = {s : Str};
|
||||||
|
|
||||||
|
-- DemPronForm = {s : Number => Gender => Case => Str};
|
||||||
|
-- PossPronForm = {s : Number => Gender => Case => Str};
|
||||||
|
--Determiner = {s : Number => Gender => Str ; n : Number};
|
||||||
|
|
||||||
|
Determiner = {s : Number => Gender => Str ; n : Number};
|
||||||
|
|
||||||
|
|
||||||
|
-- Nepali Adjectives
|
||||||
|
|
||||||
|
npAdjective = {s : Number => Gender => Str} ;
|
||||||
|
|
||||||
|
mkAdjnp : Str -> npAdjective = \str ->
|
||||||
|
case str of {
|
||||||
|
st + "ो" => mkAdj1 str (st+"ी") (st+"ा") ;
|
||||||
|
_ => mkAdj1 str str str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdj1 : (x1,_,x3 : Str) -> npAdjective =
|
||||||
|
\sm, sf, smf -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => sm ;
|
||||||
|
Fem => sf
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Masc => smf ;
|
||||||
|
Fem => smf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Reflective Pronoun
|
||||||
|
--eg. (i will do myself)
|
||||||
|
reflPron : Str;
|
||||||
|
reflPron = "आफैं"; -- आफैं
|
||||||
|
|
||||||
|
eko : Str;
|
||||||
|
eko = "एको";
|
||||||
|
|
||||||
|
eka : Str;
|
||||||
|
eka = "एका";
|
||||||
|
|
||||||
|
sbvn : Str;
|
||||||
|
sbvn = "सबँन्धा" ;
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
-- Grammar part
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
param
|
||||||
|
Agr = Ag Gender Number NPerson ;
|
||||||
|
NPCase = NPC Case | NPObj | NPErg ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
|
||||||
|
np2pronCase : (Case => Str) -> NPCase -> Agr -> Str =
|
||||||
|
\ppf,npc,a -> case npc of {
|
||||||
|
NPC c => ppf ! c ;
|
||||||
|
NPObj => ppf ! Nom ;
|
||||||
|
NPErg => ppf ! Ins --Nom ++ "ले"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
toNP : (Case => Str) -> NPCase -> Str = \pn, npc -> case npc of {
|
||||||
|
NPC c => pn ! c ;
|
||||||
|
NPObj => pn ! Nom ;
|
||||||
|
NPErg => pn ! Ins --Nom ++ "ले"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- ???? Hardcorded gender and Number
|
||||||
|
-- this/these
|
||||||
|
detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of {
|
||||||
|
NPC c => dt.s ! dt.n ! Masc ++ cn.s ! nn ! c ;
|
||||||
|
NPObj => dt.s ! dt.n ! Masc ++ cn.s ! nn ! Nom ;
|
||||||
|
NPErg => dt.s ! dt.n ! Masc ++ cn.s ! nn ! Ins --Nom ++ "ले"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of {
|
||||||
|
NPC c => dt.s ! dt.n ! Masc ;
|
||||||
|
NPObj => dt.s ! dt.n ! Masc ;
|
||||||
|
NPErg => dt.s ! dt.n ! Masc ++ "ले"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
-- Agreement transformations
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
toAgr : Number -> NPerson -> Gender -> Agr = \n,p,g ->
|
||||||
|
Ag g n p;
|
||||||
|
|
||||||
|
|
||||||
|
fromAgr : Agr -> {n : Number ; p : NPerson ; 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_L ;
|
||||||
|
|
||||||
|
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} ;
|
||||||
|
|
||||||
|
|
||||||
|
param
|
||||||
|
CTense = CPrsnt | CPast | CFuture ;
|
||||||
|
|
||||||
|
-- if the noun is of type occupation/Introductiary case it will take ho, instead of chh (in case of present)
|
||||||
|
oper
|
||||||
|
copula : CTense -> Polarity -> Number -> NPerson -> Gender -> Str =
|
||||||
|
\t, po, n, pn, g ->
|
||||||
|
case <t,po,pn,n,g> of {
|
||||||
|
-- Resembles with "मकँफरेणफृेग" function for positive
|
||||||
|
-- <CPrsnt, Pos, _, _, _> => mkVPreNPReg "" Pos pn n g ;
|
||||||
|
-- Present Positive
|
||||||
|
<CPrsnt, Pos, Pers1, Sg, _> => "छु" ; -- छु
|
||||||
|
<CPrsnt, Pos, Pers1, Pl, _> => "छौं" ; -- छौं
|
||||||
|
<CPrsnt, Pos, Pers2_L, Sg, Masc> => "छस्" ; -- छस्
|
||||||
|
<CPrsnt, Pos, Pers2_L, Sg, Fem> => "छेस्" ; -- छेस्
|
||||||
|
<CPrsnt, Pos, Pers2_L, Pl, _> => "छौ" ; -- छौ
|
||||||
|
<CPrsnt, Pos, Pers2_M, Pl, Fem> => "छ्यौ" ; -- छ्यौ
|
||||||
|
<CPrsnt, Pos, Pers2_M, _, _> => "छौ" ; -- छौ
|
||||||
|
<CPrsnt, Pos, Pers3_L, Sg, Masc> => "छ" ; -- छ
|
||||||
|
<CPrsnt, Pos, Pers3_L, Sg, Fem> => "छे" ; -- छे
|
||||||
|
<CPrsnt, Pos, Pers3_L, Pl, _> => "छन्" ; -- छन्
|
||||||
|
<CPrsnt, Pos, Pers3_M, Sg, Fem> => "छिन्" ; -- छिन्
|
||||||
|
<CPrsnt, Pos, Pers3_M, _, _> => "छन्" ; -- छन्
|
||||||
|
<CPrsnt, Pos, _ , _, _> => "हुनुहुन्छ" ; --हुनुहुन्छ
|
||||||
|
|
||||||
|
-- Present Negative
|
||||||
|
<CPrsnt, Neg, Pers1, Sg, _> => "छैनँ" ; -- छैनँ
|
||||||
|
<CPrsnt, Neg, Pers1, Pl, _> => "छैनौं" ; -- छैनौं
|
||||||
|
<CPrsnt, Neg, Pers2_L, Sg, _> => "छैनस्" ; -- छैनस्
|
||||||
|
<CPrsnt, Neg, Pers2_L, Pl, _> => "छैनौ" ; -- छैनौ
|
||||||
|
<CPrsnt, Neg, Pers2_M, _, _> => "छैनौ" ; -- छैनौ
|
||||||
|
<CPrsnt, Neg, Pers3_L, Sg, _> => "छैन" ; --छैन
|
||||||
|
<CPrsnt, Neg, Pers3_L, Pl, _> => "छैनन्" ; -- छैनन्
|
||||||
|
<CPrsnt, Neg, Pers3_M, _, _> => "छैनन्" ; -- छैनन्
|
||||||
|
<CPrsnt, Neg, _, _, _> => "हुनुहुन्न" ; -- हुनुहुन्न
|
||||||
|
|
||||||
|
-- Resemples with "मकँफसतशफघेन" case, should refactor to make it
|
||||||
|
-- take common function
|
||||||
|
|
||||||
|
-- Past Positive
|
||||||
|
<CPast, Pos, Pers1, Sg, _> => "थिएँ" ; -- थिएँ
|
||||||
|
<CPast, Pos, Pers1, Pl, _> => "थियौँ" ; -- थियौँ
|
||||||
|
<CPast, Pos, Pers2_L, Sg, _> => "थिइस्" ; -- थिइस्
|
||||||
|
<CPast, Pos, Pers2_L, Pl, _> => "थियौ" ; -- थियौ
|
||||||
|
<CPast, Pos, Pers2_M, _, _> => "थियौ" ; -- थियौ
|
||||||
|
<CPast, Pos, Pers3_L, Sg, Masc> => "थियो" ; -- थियो
|
||||||
|
<CPast, Pos, Pers3_L, Sg, Fem> => "थिई" ; --थिई
|
||||||
|
<CPast, Pos, Pers3_L, Pl, _> => "थिए" ; -- थिए
|
||||||
|
<CPast, Pos, Pers3_M, Sg, Fem> => "थिइन्" ; -- थिइन्
|
||||||
|
<CPast, Pos, Pers3_M, _, _> => "थिए" ; -- थिए
|
||||||
|
<CPast, Pos, _, _, _> => "हुनुहुन्थ्यो" ; -- हुनुहुन्थ्यो
|
||||||
|
|
||||||
|
-- Past Positive
|
||||||
|
<CPast, Neg, Pers1, Sg, _> => "थिनँ" ; -- थिनँ
|
||||||
|
<CPast, Neg, Pers1, Pl, _> => "थेनौं" ; -- थेनौं
|
||||||
|
<CPast, Neg, Pers2_L, Sg, _> => "थिनस्" ; -- थिनस्
|
||||||
|
<CPast, Neg, Pers2_L, Pl, _> => "थेनौ" ; -- थेनौ
|
||||||
|
<CPast, Neg, Pers2_M, _, _> => "थेनौ" ; -- थेनौ
|
||||||
|
<CPast, Neg, Pers3_L, Sg, Masc> => "थेन" ; -- थेन
|
||||||
|
<CPast, Neg, Pers3_L, Sg, Fem> => "थिन" ; --थिन
|
||||||
|
<CPast, Neg, Pers3_L, Pl, _> => "थेनन्" ; -- थेनन्
|
||||||
|
<CPast, Neg, Pers3_M, Sg, Fem> => "थिनन्" ; -- थिनन्
|
||||||
|
<CPast, Neg, Pers3_M, _, _> => "थेनन्" ; -- थेनन्
|
||||||
|
<CPast, Neg, _, _, _> => "हुनुहुन्नथ्यो" ; -- हुनुहुन्नथ्यो
|
||||||
|
|
||||||
|
|
||||||
|
-- Can be covered by the function "मकँऊुतधणफ"
|
||||||
|
-- Future Positive
|
||||||
|
<CFuture, Pos, Pers1, Sg, _> => "हुनेछु" ; -- हुनेछु
|
||||||
|
<CFuture, Pos, Pers1, Pl, _> => "हुनेछौं" ; -- हुनेछौं
|
||||||
|
<CFuture, Pos, Pers2_L, Sg, _> => "हुनेछस्" ; -- हुनेछस्
|
||||||
|
<CFuture, Pos, Pers2_L, Pl, _> => "हुनेछौं" ; -- हुनेछौ
|
||||||
|
<CFuture, Pos, Pers2_M, _, _> => "हुनेछौं" ; -- हुनेछौ
|
||||||
|
<CFuture, Pos, Pers3_L, Sg, _> => "हुनेछ" ; -- हुनेछ
|
||||||
|
<CFuture, Pos, Pers3_L, Pl, _> => "हुनेछन्" ; -- हुनेछन्
|
||||||
|
<CFuture, Pos, Pers3_M, _, Masc> => "हुनेछन्" ; -- हुनेछन्
|
||||||
|
<CFuture, Pos, Pers3_M, Sg, Fem> => "हुनेछन्" ; -- हुनेछिन्
|
||||||
|
<CFuture, Pos, Pers3_M, Pl, Fem> => "हुनेछन्" ; -- हुनेछन्
|
||||||
|
<CFuture, Pos, _, _, _> => "हुनुहुनेछ" ; -- हुनुहुनेछ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<CFuture, Neg, Pers1, Sg, _> => "हुनेछैन" ; -- हुनेछैन
|
||||||
|
<CFuture, Neg, Pers1, Pl, _> => "हुनेछैनैँ" ; -- हुनेछैनैँ
|
||||||
|
<CFuture, Neg, Pers2_L, Sg, _> => "हुनेछैनस्" ; -- हुनेछैनस्
|
||||||
|
<CFuture, Neg, Pers2_L, Pl, _> => "हुनेछैनै" ; -- हुनेछैनै
|
||||||
|
<CFuture, Neg, Pers2_M, _, _> => "हुनेछैनै" ; -- हुनेछैनै
|
||||||
|
<CFuture, Neg, Pers3_L, Sg, _> => "हुनेछैन्" ; -- हुनेछैन्
|
||||||
|
<CFuture, Neg, Pers3_L, Pl, _> => "हुनेछैनन्" ; -- हुनेछैनन्
|
||||||
|
<CFuture, Neg, Pers3_M, Sg, _> => "हुनेछैनन्" ; -- हुनेछैनन्
|
||||||
|
<CFuture, Neg, Pers3_M, Pl, _> => "हुनेछैनै" ; -- हुनेछैनै
|
||||||
|
<CFuture, Neg, _, _, _> => "हुनुहुनेछैन्" -- हुनुहुनेछैन्
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- For Human, occupation/Introductiary case case, (HAVENT INTEGRATED YET)
|
||||||
|
copulaOpn : CTense -> Polarity -> Number -> NPerson -> Gender -> Str =
|
||||||
|
\t, po, n, pn, g ->
|
||||||
|
case <t,po,pn,n,g> of {
|
||||||
|
-- Resembles with "मकँफरेणफृेग" function for positive
|
||||||
|
-- <CPrsnt, Pos, _, _, _> => mkVPreNPReg "" Pos pn n g ;
|
||||||
|
-- Present Positive
|
||||||
|
<CPrsnt, Pos, Pers1, Sg, _> => "हुँ" ; -- हुँ
|
||||||
|
<CPrsnt, Pos, Pers1, Pl, _> => "हौँ" ; -- हौँ
|
||||||
|
<CPrsnt, Pos, Pers2_L, Sg, _> => "होस्" ; -- होस्
|
||||||
|
--<CPrsnt, Pos, Pers2_L, Sg, Fem> => "होस्" ; -- छेस्
|
||||||
|
<CPrsnt, Pos, Pers2_L, Pl, _> => "हौ" ; -- हौ
|
||||||
|
--<CPrsnt, Pos, Pers2_M, Pl, Fem> => "छ्यौ" ; -- छ्यौ
|
||||||
|
<CPrsnt, Pos, Pers2_M, _, _> => "हौ" ; -- हौ
|
||||||
|
<CPrsnt, Pos, Pers3_L, Sg, Masc> => "हो" ; -- हो
|
||||||
|
--<CPrsnt, Pos, Pers3_L, Sg, Fem> => "हुन्" ; -- हुन्
|
||||||
|
<CPrsnt, Pos, Pers3_L, _, _> => "हुन्" ; -- हुन्
|
||||||
|
--<CPrsnt, Pos, Pers3_M, Sg, Fem> => "हौ" ; -- हौ
|
||||||
|
<CPrsnt, Pos, Pers3_M, _, _> => "हौ" ; -- हौ
|
||||||
|
<CPrsnt, Pos, _ , _, _> => "हुनुहुन्छ" ; --हुनुहुन्छ
|
||||||
|
|
||||||
|
-- Present Negative
|
||||||
|
<CPrsnt, Neg, Pers1, Sg, _> => "हैन" ; --
|
||||||
|
<CPrsnt, Neg, Pers1, Pl, _> => "हैनौं" ; -- हैनौं
|
||||||
|
<CPrsnt, Neg, Pers2_L, Sg, _> => "हैनस्" ; -- हैनस्
|
||||||
|
<CPrsnt, Neg, Pers2_L, Pl, _> => "हैनौ" ; -- हैनौ
|
||||||
|
<CPrsnt, Neg, Pers2_M, _, _> => "हैनौ" ; -- हैनौ
|
||||||
|
<CPrsnt, Neg, Pers3_L, Sg, _> => "हैन" ; --हैन
|
||||||
|
<CPrsnt, Neg, Pers3_L, Pl, _> => "हैनन्" ; -- हैनन्
|
||||||
|
<CPrsnt, Neg, Pers3_M, _, _> => "हैनन्" ; -- हैनन्
|
||||||
|
<CPrsnt, Neg, _, _, _> => "हुनुहुन्न" ; -- हुनुहुन्न
|
||||||
|
|
||||||
|
<_,_,_,_,_> => copula t po n pn g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
param
|
||||||
|
|
||||||
|
VPHTense =
|
||||||
|
VPGenPres -- impf hum nahim "ी गो"
|
||||||
|
| VPSmplPast -- impf Ta nahim "ी ौेनत"
|
||||||
|
| VPFut -- fut na/nahim "ी सहालल गो"
|
||||||
|
| VPPerfPres -- perf hum na/nahim "ी हावे गोने"
|
||||||
|
| VPPerfPast -- perf Ta na/nahim "ी हाद गोने"
|
||||||
|
| VPPerfFut
|
||||||
|
| VPCondPres -- subj na "ी माय गो"
|
||||||
|
| VPCondPast -- subj na "ी माय गो"
|
||||||
|
;
|
||||||
|
|
||||||
|
{-
|
||||||
|
VPHForm =
|
||||||
|
VPTense VPPTense Aspect Agr -- 9 * 12
|
||||||
|
| VPReq
|
||||||
|
| VPImp
|
||||||
|
| VPReqFut
|
||||||
|
| VPInf
|
||||||
|
| VPStem
|
||||||
|
;
|
||||||
|
-}
|
||||||
|
|
||||||
|
VType = VIntrans | VTrans | VTransPost ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
objVType : VType -> NPCase = \vt ->
|
||||||
|
case vt of {
|
||||||
|
VTrans => NPObj ;
|
||||||
|
_ => NPC Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPH : Type = {
|
||||||
|
s : VerbForm => {inf : Str} ;
|
||||||
|
obj : {s : Str ; a : Agr} ;
|
||||||
|
subj : VType ;
|
||||||
|
comp : Agr => Str;
|
||||||
|
inf : Str;
|
||||||
|
ad : Str;
|
||||||
|
embComp : Str ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPHSlash = VPH ** {c2 : Compl} ;
|
||||||
|
Compl : Type = {s : Str ; c : VType} ;
|
||||||
|
|
||||||
|
predV : Verb -> VPH = \verb ->
|
||||||
|
{s = \\vf =>
|
||||||
|
case vf of {
|
||||||
|
VF t a pl p n g => {inf = verb.s ! VF t a pl p n g } ;
|
||||||
|
Root => {inf = verb.s ! Root } ;
|
||||||
|
Inf => {inf = verb.s ! Inf } ;
|
||||||
|
Imp => {inf = verb.s ! Imp } ;
|
||||||
|
PVForm => {inf = verb.s ! PVForm } ;
|
||||||
|
ProgRoot a n g => {inf = verb.s ! ProgRoot a n g }
|
||||||
|
};
|
||||||
|
obj = {s = [] ; a = defaultAgr} ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.s ! Inf;
|
||||||
|
ad = [];
|
||||||
|
embComp = [];
|
||||||
|
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} } ;
|
||||||
|
------------------------
|
||||||
|
-}
|
||||||
|
{-
|
||||||
|
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 {
|
||||||
|
VF NPresent _ pl p n g => {inf = copula CPrsnt pl n p g } ;
|
||||||
|
VF (NPast _) _ pl p n g => {inf = copula CPast pl n p g } ;
|
||||||
|
VF (NFuture _) _ pl p n g => {inf = copula CFuture pl n p g } ;
|
||||||
|
Root => { inf = verb.inf} ;
|
||||||
|
Inf => {inf = verb.inf} ;
|
||||||
|
Imp => {inf = verb.inf} ;
|
||||||
|
ProgRoot a n g => {inf = "" } ;
|
||||||
|
PVForm => {inf = ""}
|
||||||
|
};
|
||||||
|
obj = {s = [] ; a = defaultAgr} ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.inf;
|
||||||
|
ad = [];
|
||||||
|
embComp = [];
|
||||||
|
comp = \\_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Aux = {
|
||||||
|
inf,ppart,prpart : Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
auxBe : Aux = {
|
||||||
|
inf = "" ;
|
||||||
|
ppart = "" ;
|
||||||
|
prpart = ""
|
||||||
|
} ;
|
||||||
|
|
||||||
|
raha : VTense -> Aspect -> Gender -> Number -> NPerson -> {s:Str} = \t,a,g,n,p -> {
|
||||||
|
s = case <t,a,g,n,p> of {
|
||||||
|
<NPresent,Perf,Masc,Sg,Pers1> => "इरहन्" ;
|
||||||
|
<_,_,_,_,_> => "इरहन्"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
predProg : VPH -> VPH = \verb -> {
|
||||||
|
s = \\vh =>
|
||||||
|
case vh of {
|
||||||
|
VF NPresent a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CPrsnt pl n p g } ;
|
||||||
|
VF (NPast _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CPast pl n p g } ;
|
||||||
|
VF (NFuture _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CFuture pl n p g } ;
|
||||||
|
Root => {inf = (verb.s ! Root).inf } ;
|
||||||
|
Inf => {inf = (verb.s ! ProgRoot Imperf Sg Masc).inf } ;
|
||||||
|
Imp => {inf = (verb.s ! Imp).inf } ;
|
||||||
|
PVForm => {inf = (verb.s ! PVForm).inf } ;
|
||||||
|
ProgRoot a n g => {inf = (verb.s ! ProgRoot a n g).inf }
|
||||||
|
};
|
||||||
|
obj = verb.obj ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.inf;
|
||||||
|
ad = verb.ad;
|
||||||
|
embComp = verb.embComp;
|
||||||
|
comp = verb.comp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
|
||||||
|
|
||||||
|
-- TODO, ERGATIVE CASE FROM NOUN INFLETION
|
||||||
|
mkClause : NP -> VPH -> Clause = \np,vp -> {
|
||||||
|
s = \\vt,b,ord =>
|
||||||
|
let
|
||||||
|
subjagr : NPCase * Agr = case vt of {
|
||||||
|
VPSmplPast => case vp.subj of {
|
||||||
|
VTrans => <NPErg, vp.obj.a> ;
|
||||||
|
VTransPost => <NPErg, defaultAgr> ;
|
||||||
|
_ => <NPC Nom, np.a>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPPerfPast => case vp.subj of {
|
||||||
|
VTrans => <NPErg, vp.obj.a> ;
|
||||||
|
VTransPost => <NPErg, defaultAgr> ;
|
||||||
|
_ => <NPC Nom, np.a>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
_ => <NPC Nom, np.a>
|
||||||
|
} ;
|
||||||
|
subj = subjagr.p1 ;
|
||||||
|
agr = subjagr.p2 ;
|
||||||
|
n = (fromAgr agr).n;
|
||||||
|
p = (fromAgr agr).p;
|
||||||
|
g = (fromAgr agr).g;
|
||||||
|
vps = case <vt,b> of {
|
||||||
|
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
|
||||||
|
<VPGenPres,Neg> => vp.s ! VF NPresent Imperf Neg p n g ;
|
||||||
|
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ;
|
||||||
|
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ;
|
||||||
|
|
||||||
|
<VPPerfPres,Pos> => vp.s ! VF NPresent Perf Pos p n g ;
|
||||||
|
<VPPerfPres,Neg> => vp.s ! VF NPresent Perf Neg p n g ;
|
||||||
|
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ;
|
||||||
|
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ;
|
||||||
|
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ;
|
||||||
|
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ;
|
||||||
|
|
||||||
|
<VPCondPres, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPres, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPCondPast, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPast, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
{-
|
||||||
|
<_, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<_, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
-}
|
||||||
|
};
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "के" };
|
||||||
|
|
||||||
|
in
|
||||||
|
quest ++ np.s ! subj ++ vp.ad ++ vp.obj.s ++ vp.comp ! np.a ++ vps.inf ++ vp.embComp
|
||||||
|
--quest ++ np.s ! subj ++ vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps.inf ++ 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,b> of {
|
||||||
|
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
|
||||||
|
<VPGenPres,Neg> => vp.s ! VF NPresent Imperf Neg p n g ;
|
||||||
|
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ;
|
||||||
|
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ;
|
||||||
|
|
||||||
|
<VPPerfPres,Pos> => vp.s ! VF NPresent Perf Pos p n g ;
|
||||||
|
<VPPerfPres,Neg> => vp.s ! VF NPresent Perf Neg p n g ;
|
||||||
|
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ;
|
||||||
|
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ;
|
||||||
|
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ;
|
||||||
|
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ;
|
||||||
|
|
||||||
|
<VPCondPres, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPres, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPCondPast, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPast, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
{-
|
||||||
|
<_, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<_, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
-}
|
||||||
|
};
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "के" };
|
||||||
|
|
||||||
|
in
|
||||||
|
quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vps.inf ++ vp.embComp
|
||||||
|
-- quest ++ subj ++ vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vps.inf ++ 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;
|
||||||
|
comp = \\a => vp.comp ! a ++ obj1 ! a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
insertVV : {s:Agr => 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;
|
||||||
|
-- comp = \\a => vp.comp ! a ++ obj1.s ! a
|
||||||
|
comp = \\a => obj1.s ! a ++ vp.comp ! a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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;
|
||||||
|
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 -> {s:Agr => Str} = \isAux,vp ->
|
||||||
|
{s= \\a => vp.obj.s ++ (vp.s! PVForm).inf ++ vp.comp ! a };
|
||||||
|
|
||||||
|
infVV : VPH -> {s:Agr => Str} = \vp -> {
|
||||||
|
s = \\ agr => vp.comp ! agr ++ (vp.s ! PVForm) . inf
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
infV2V : VPH -> {s :Agr => Str} = \vp -> {
|
||||||
|
s = \\agr => vp.comp ! agr ++ (vp.s ! PVForm).inf --++ "लाइ"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||||
|
s = vps.s ;
|
||||||
|
obj = {s = np.s ! objVType vps.c2.c ++ vps.c2.s ++ vps.obj.s ; a = np.a} ;
|
||||||
|
-- obj = {s = vps.obj.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;
|
||||||
|
comp = vps.comp
|
||||||
|
-- comp = \\a => vps.comp ! a ++ np.s ! (objVType vps.c2.c) ++ vps.c2.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
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
|
||||||
|
} ;
|
||||||
|
ad = vp.ad;
|
||||||
|
embComp = vp.embComp ;
|
||||||
|
comp = vp.comp
|
||||||
|
} ;
|
||||||
|
}
|
||||||
107
lib/src/nepali/SentenceNep.gf
Normal file
107
lib/src/nepali/SentenceNep.gf
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
concrete SentenceNep of Sentence = CatNep ** open Prelude, ResNep 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_M ;
|
||||||
|
verb = vp.obj.s ++ (vp.s! PVForm).inf ++ vp.comp ! 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 ++ 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 = vp.obj.s ++ (vp.s! PVForm).inf ++ vp.comp ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! ODir;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ cl.s ! VPCondPast ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! q;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ cl.s ! VPCondPast ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! ODir ! q;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ rcl.s ! VPCondPast ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! ODir;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ clslash.s ! VPCondPast ! p.p ! ODir
|
||||||
|
};
|
||||||
|
c2 = clslash.c2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvS a s = {s = a.s ++ s.s} ;
|
||||||
|
|
||||||
|
RelS s r = {s = s.s ++ r.s ! agrP3 Masc Sg} ;
|
||||||
|
SSubjS s sj s = { s = s.s ++ sj.s ++ s.s};
|
||||||
|
|
||||||
|
}
|
||||||
131
lib/src/nepali/StructuralNep.gf
Normal file
131
lib/src/nepali/StructuralNep.gf
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
concrete StructuralNep of Structural = CatNep **
|
||||||
|
open MorphoNep, ParadigmsNep, Prelude, NounNep in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
above_Prep = mkPrep "माथि" ; -- माथि
|
||||||
|
after_Prep = mkPrep "पछि" ; -- पछि
|
||||||
|
all_Predet = ss "सबै" ; -- सबै (adj)
|
||||||
|
almost_AdA = mkAdA "झण्डै" ;
|
||||||
|
almost_AdN = mkAdN "झण्डै" ; -- JNx:xE (Adv) झण्डै
|
||||||
|
although_Subj = ss "तैपनि" ; -- तैपनि (conj)
|
||||||
|
always_AdV = mkAdV "सधैँ" ; -- सधैँ
|
||||||
|
and_Conj = sd2 [] "र" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "किनभने" ; -- किनभने
|
||||||
|
before_Prep = mkPrep "अघि" ; -- अघि
|
||||||
|
behind_Prep = mkPrep "पछि" ; -- पछि
|
||||||
|
between_Prep = mkPrep "बिच" ; -- बिच
|
||||||
|
both7and_DConj = sd2 "दुबै" "र" ** {n = Pl} ; -- दुबै र
|
||||||
|
but_PConj = ss "तर" ; -- तर
|
||||||
|
by8agent_Prep = mkPrep "लाइ" ; --
|
||||||
|
by8means_Prep = mkPrep "ले" ;
|
||||||
|
can8know_VV,can_VV = mkV "सक्नु" ** { isAux = True} ;
|
||||||
|
during_Prep = mkPrep "पर्यान्त" ; -- पर्यान्त
|
||||||
|
either7or_DConj = sd2 "अथवा" "या" ** {n = Sg} ; -- अथवा , या
|
||||||
|
everybody_NP = MassNP (UseN (regN "सवौ जाना")) ; -- not a good way coz need to include Noun (सवौ जाना)
|
||||||
|
every_Det = mkDet "सबै" "हरेक" Sg ; -- सबै, हरेक
|
||||||
|
everything_NP = MassNP (UseN (regN "हारेक कुरा")) ; -- हारेक कुरा
|
||||||
|
everywhere_Adv = mkAdv "जाता ततै" ; -- जाता ततै
|
||||||
|
few_Det = mkDet "थोरै" "अलिकती" Pl ; -- थोरै, अलिकती
|
||||||
|
-- d first_Ord = {s = "पेहला" ; n = Sg} ; --DEPRECATED
|
||||||
|
for_Prep = mkPrep "लागि" ; -- लागि
|
||||||
|
from_Prep = mkPrep "बाट" ; -- बाट
|
||||||
|
|
||||||
|
i_Pron = mkPron "म" "मेरो" Sg Masc Pers1 ; -- म, मेरो
|
||||||
|
we_Pron = mkPron "हामीहरु" "हामीहरुको" Pl Masc Pers1 ; -- हामीहरु, हामीहरुको
|
||||||
|
he_Pron = mkPron "उ" "उस्लाई" "उस्ले" "उस्लाई" "उसबाट" "उस्मा" "उस्को" Sg Masc Pers3_L; --उ, उस्लाई, उस्ले, उस्लाई, उसवाट, उस्मा, उस्को
|
||||||
|
she_Pron = mkPron "उनी" "उन्लाई" "उन्ले" "उन्लाई" "उनबाट" "उन्मा" "उन्को" Sg Fem Pers3_M ; -- उनी , उन्को
|
||||||
|
youSg_Pron = mkPron "तिमी" "तिम्रो" Sg Masc Pers2_M ; -- तिमी, तिम्रो
|
||||||
|
youPl_Pron = mkPron "तिमीहरु" "तिमीहरुको" Pl Masc Pers2_M ; -- तिमीहरु, तिमीहरुको
|
||||||
|
youPol_Pron = mkPron "तपाई" "तपाईहरुको" Sg Masc Pers2_H ; -- तपाई, तपाईहरुको
|
||||||
|
they_Pron = mkPron "उनीहरु" "उनिहरुको" Pl Masc Pers3_L ; -- उनिहरु, उनिहरुको
|
||||||
|
it_Pron = mkPron "यो" "यसलाई" "येसले" "यसलाई" "यसबाट" "यसमा" "ुस्को" Sg Masc Pers3_L; -- यो, यसलाई, यसले, यसलाई, यसबाट, यसमा, उस्को
|
||||||
|
|
||||||
|
here_Adv = mkAdv "यहाँ" ; -- यहाँ
|
||||||
|
here7to_Adv = mkAdv ["यहाँ सम्म"] ; -- यहाँ सम्म
|
||||||
|
here7from_Adv = mkAdv ["यहाँ बाट"] ; -- यहाँ बाट
|
||||||
|
how_IAdv = ss "कसरी" ; -- कसरी
|
||||||
|
how8much_IAdv = ss "कती" ; -- कती
|
||||||
|
--how8many_IDet = mkDet "कती वटा" "कती वटी" Pl ; -- काती वटा, कती वटी (incase of humans it becomes, 'kati jana') NEEDS FIX
|
||||||
|
if_Subj = ss "यदि" ; -- यदि
|
||||||
|
in8front_Prep = mkPrep "सामु" ; -- सामु
|
||||||
|
in_Prep = mkPrep "मा" ; -- मा
|
||||||
|
less_CAdv = {s = "कम" ; p = "भन्दा"} ; -- ?? NOT CLEAR
|
||||||
|
many_Det = mkDet "धेरै" "थुप्रै" Pl ; -- धेरै, थुप्रै
|
||||||
|
more_CAdv = {s = "बढी" ; p = "भन्दा" } ;
|
||||||
|
most_Predet = ss "ज्यादै" ; -- ज्यादै
|
||||||
|
much_Det = mkDet "निक्कै" "बेसरी" Sg ; --
|
||||||
|
must_VV = mkV "अवश्य" ** { isAux = True} ; -- अवश्य
|
||||||
|
-- must_VV = {
|
||||||
|
-- s = table {
|
||||||
|
-- VVF VInf => ["हावे तो"] ;
|
||||||
|
-- VVF VPres => "मुसत" ;
|
||||||
|
-- VVF VPPart => ["हाद तो"] ;
|
||||||
|
-- VVF VPresPart => ["हाविनग तो"] ;
|
||||||
|
-- VVF VPast => ["हाद तो"] ; --# notpresent
|
||||||
|
-- VVPastNeg => ["हादn'त तो"] ; --# notpresent
|
||||||
|
-- VVPresNeg => "मुसतn'त"
|
||||||
|
-- } ;
|
||||||
|
-- isAux = True
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
-- d no_Phr = ss "हुन्न" ; -- हुन्न
|
||||||
|
no_Utt = ss "होईन" ; -- होईन
|
||||||
|
on_Prep = mkPrep "मा" ; -- मा
|
||||||
|
-- d one_Quant = mkQuant "एक" "एक" ; -- DEPRECATED
|
||||||
|
only_Predet = ss "मात्र" ; -- मात्र
|
||||||
|
or_Conj = sd2 [] "अथवा" ** {n = Sg} ; -- अथवा
|
||||||
|
otherwise_PConj = ss "अन्यथा" ; -- अन्यथा
|
||||||
|
part_Prep = mkPrep "भाग" ; -- भाग
|
||||||
|
please_Voc = ss "कृपया" ; -- कृपया
|
||||||
|
possess_Prep = mkPrep "धारणा गर्नु" ; -- धारणा गर्नु
|
||||||
|
quite_Adv = ss "एकदम" ; -- एकदम
|
||||||
|
so_AdA = mkAdA "यस कारण" ; -- यस कारण ???? NEED TO CHECK
|
||||||
|
somebody_NP = MassNP (UseN (regN "कोही")); -- कोही
|
||||||
|
someSg_Det = mkDet "कोही" "केही" Sg ;
|
||||||
|
somePl_Det = mkDet "कोही" "केही" Pl ;
|
||||||
|
something_NP = MassNP (UseN (regN "केही कुरा")) ;
|
||||||
|
somewhere_Adv = mkAdv "कहीं" ; -- कहीं
|
||||||
|
that_Quant = mkQuant "त्ये" "यिनीहरु" ;
|
||||||
|
that_Subj = ss "त्यो"; -- त्यो
|
||||||
|
there_Adv = mkAdv "त्यहाँ" ; -- त्यहाँ
|
||||||
|
there7to_Adv = mkAdv "त्यहाँ सम्म" ; -- त्यहाँ सम्म
|
||||||
|
there7from_Adv = mkAdv "त्यहाँ बाट" ; -- त्यहाँ बाट
|
||||||
|
therefore_PConj = ss "अतः" ; -- अतः
|
||||||
|
this_Quant = mkQuant "यो" "यि" ;
|
||||||
|
through_Prep = mkPrep "मार्फत" ; -- मार्फत
|
||||||
|
too_AdA = mkAdA "पनि" ; -- पनि
|
||||||
|
to_Prep = ss "सम्म" ; --
|
||||||
|
under_Prep = mkPrep "अन्तर्गत" ; -- अन्तर्गत
|
||||||
|
very_AdA = mkAdA "धेरै" ; -- धेरै
|
||||||
|
want_VV = mkV "चाहनु" ** { isAux = False} ;
|
||||||
|
whatSg_IP = mkIP "के" "के" "के" "" Sg ;
|
||||||
|
whatPl_IP = mkIP "के" "के" "के" "" Pl ;
|
||||||
|
when_IAdv = ss "कहिले" ; -- कहिले
|
||||||
|
when_Subj = ss "कहिले" ;
|
||||||
|
where_IAdv = ss "कहाँ" ; -- कहाँ
|
||||||
|
which_IQuant = {s = table {Sg => "कुन" ; Pl => "कुन" } }; -- कुन
|
||||||
|
-- d whichPl_IDet = {s = "कुन" ; n = Sg} ;
|
||||||
|
-- d whichSg_IDet = {s = "कुन" ; n = Pl} ;
|
||||||
|
whoSg_IP = mkIP "को" "कासलाई" "कसको" "" Sg ;
|
||||||
|
whoPl_IP = mkIP "को" "कासलाई" "कसको" "" Pl ;
|
||||||
|
why_IAdv = ss "किन" ; -- किन
|
||||||
|
without_Prep = mkPrep "विना" ; -- विना
|
||||||
|
with_Prep = mkPrep "सँग" ; -- सँग
|
||||||
|
-- d yes_Phr = ss "हजुर" ; -- हजुर
|
||||||
|
yes_Utt = ss "हजुर" ;
|
||||||
|
no_Quant = mkQuant "हैन" "हैनै" ;
|
||||||
|
not_Predet = {s="हैन"} ; -- हैन
|
||||||
|
if_then_Conj = sd2 "यदि" "भने" ** {n = Sg} ; -- यदि भने
|
||||||
|
at_least_AdN = mkAdN "कमसेकम" ; -- कमसेकम
|
||||||
|
at_most_AdN = mkAdN "बढीमा" ; -- बढीमा
|
||||||
|
nothing_NP = MassNP (UseN (regN "केही पनी")) ; -- केही पनी
|
||||||
|
nobody_NP = MassNP (UseN (regN "केही पनी")) ; --कोही पनी
|
||||||
|
except_Prep = mkPrep "बाहेक" ; -- बाहेक
|
||||||
|
as_CAdv = {s = "जत्तीकै" ; p = ""} ; -- जत्तीकै
|
||||||
|
have_V2 = mkV2 (mkV "हुनु") "" ; -- हुनु
|
||||||
|
language_title_Utt = ss "नेपाली" ; -- नेपाली
|
||||||
|
}
|
||||||
46
lib/src/nepali/SymbolNep.gf
Normal file
46
lib/src/nepali/SymbolNep.gf
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
concrete SymbolNep of Symbol = CatNep ** open Prelude, ResNep in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
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 ! Nom ++ i.s ;
|
||||||
|
a = agrP3 cn.g Sg
|
||||||
|
} ;
|
||||||
|
CNSymbNP det cn xs = {
|
||||||
|
s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Nom ++ xs.s ;
|
||||||
|
a = agrP3 cn.g det.n
|
||||||
|
} ;
|
||||||
|
CNNumNP cn i = {
|
||||||
|
s = \\c => cn.s ! Sg ! Nom ++ 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 ++ "दा" } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
5
lib/src/nepali/SyntaxNep.gf
Normal file
5
lib/src/nepali/SyntaxNep.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
instance SyntaxNep of Syntax =
|
||||||
|
ConstructorsNep, CatNep, StructuralNep, CombinatorsNep ;
|
||||||
|
|
||||||
20
lib/src/nepali/TransliterationNep.gf
Normal file
20
lib/src/nepali/TransliterationNep.gf
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{-
|
||||||
|
-- layout for unicode Nepali format, based on
|
||||||
|
-- http://mpp.org.np/index.php?option=com_docman&task=cat_view&gid=18&Itemid=63
|
||||||
|
-- keys like /, {, }.. are replaced by ([x]:) letters
|
||||||
|
-- http://jrgraphix.net/r/Unicode/0900-097F
|
||||||
|
-}
|
||||||
|
transNepali :: Transliteration
|
||||||
|
transNepali = mkTransliteration "Nepali" allTrans allCodes where
|
||||||
|
allTrans = words $
|
||||||
|
"z+ z= " ++
|
||||||
|
"- V M h: - H A i: I: f F Z - - - e: " ++
|
||||||
|
"E: - - O W k K g G n: C c j J Y q " ++
|
||||||
|
"Q x X N t T d D n - p P b B m y " ++
|
||||||
|
"r - l L - v S z s h - - ~ ` a i " ++
|
||||||
|
"I u U R - - - e E - - o w x: - - " ++
|
||||||
|
"O: - _ - - - - - - - - - - - - - " ++
|
||||||
|
"- - - - . > 0 1 2 3 4 5 6 7 8 9 " ++
|
||||||
|
"- - - - - - - - - - - - - - - - "
|
||||||
|
allCodes = [0x200c,0x200d] ++ [0x0900 .. 0x097f]
|
||||||
|
|
||||||
21
lib/src/nepali/TryNep.gf
Normal file
21
lib/src/nepali/TryNep.gf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
--# -path=.:alltenses:prelude:./abstract
|
||||||
|
resource TryNep = SyntaxNep - [mkAdN] , LexiconNep, ParadigmsNep - [mkAdv,mkDet,mkIP,mkAdN] **
|
||||||
|
open (P = ParadigmsNep) in {
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
mkAdv = overload SyntaxNep {
|
||||||
|
mkAdv : Str -> Adv = P.mkAdv ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdN = overload {
|
||||||
|
mkAdN : CAdv -> AdN = SyntaxNep.mkAdN ;
|
||||||
|
--- mkAdN : Str -> AdN = P.mkAdN ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkOrd = overload SyntaxNep {
|
||||||
|
-- mkOrd : A -> Ord = SyntaxNep.OrdSuperl ;
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
73
lib/src/nepali/VerbNep.gf
Normal file
73
lib/src/nepali/VerbNep.gf
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
concrete VerbNep of Verb = CatNep ** open ResNep in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseV v = predV v ;
|
||||||
|
|
||||||
|
SlashV2a v = predV v ** {c2 = {s = v.c2.s ; c = VTrans}} ;
|
||||||
|
|
||||||
|
-- use of these two functions
|
||||||
|
Slash2V3 v np =
|
||||||
|
insertObjc (\\_ => np.s ! NPObj ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ; -- NEEDS CHECKING
|
||||||
|
|
||||||
|
Slash3V3 v np =
|
||||||
|
insertObjc (\\_ => np.s ! NPC Nom ++ v.c3) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ;
|
||||||
|
|
||||||
|
|
||||||
|
ComplVV v vp = insertTrans (insertVV (infVV 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) ;
|
||||||
|
|
||||||
|
-- Need check for 'bhayo' inflection (past)
|
||||||
|
-- cc -all PredVP (MassNP (UseN cat_N)) (ComplVA become_VA (PositA red_A))
|
||||||
|
ComplVA v ap = insertObj (\\a => ap.s ! giveNumber a ! giveGender a) (predV v) ;
|
||||||
|
|
||||||
|
--cc -table PredVP (MassNP (UseN cat_N)) (ComplSlash (SlashV2V beg_V2V (UseV sleep_V)) (MassNP (UseN dog_N)))
|
||||||
|
SlashV2V v vp = insertVV (infV2V vp) (predV v) vp.embComp vp ** {c2 = {s = v.c1 ; c = VTrans}} ; -- 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
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (MassNP (UseN dog_N)))
|
||||||
|
SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ) (predV v ** {c2 = {s = v.c2.s ; c = VTrans}}) ;
|
||||||
|
|
||||||
|
ComplSlash vp np = insertObject np vp ;
|
||||||
|
|
||||||
|
SlashVV vv vp =
|
||||||
|
insertEmbCompl (insertObj (infVP vv.isAux vp).s (predV vv)) vp.embComp **
|
||||||
|
{c2 = vp.c2} ;
|
||||||
|
|
||||||
|
SlashV2VNP vv np vp =
|
||||||
|
insertObjPre (\\_ => np.s ! NPObj )
|
||||||
|
(insertObjc (infVP vv.isAux vp).s (predVc vv)) **
|
||||||
|
{c2 = vp.c2} ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (UseComp (CompAdv there_Adv))
|
||||||
|
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (AdvVP (UseV sleep_V) there_Adv)
|
||||||
|
AdvVP vp adv = insertObj (\\_ => adv.s ) vp ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (AdVVP always_AdV (UseV sleep_V))
|
||||||
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (ReflVP (SlashV2a eat_V2))
|
||||||
|
ReflVP v = insertObjPre (\\_ => reflPron) v ;
|
||||||
|
|
||||||
|
PassV2 v = predV v ; -- need to be fixed
|
||||||
|
|
||||||
|
CompAP ap = {s = \\a => ap.s ! giveNumber a ! giveGender a } ;
|
||||||
|
|
||||||
|
CompNP np = {s = \\_ => np.s ! NPObj} ;
|
||||||
|
CompCN cn = {s = \\a => cn.s ! giveNumber a ! Nom} ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (UseComp (CompAdv there_Adv))
|
||||||
|
CompAdv adv = {s = \\a => adv.s } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
68
lib/src/nepali/src/AdjectiveNep.gf
Normal file
68
lib/src/nepali/src/AdjectiveNep.gf
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
concrete AdjectiveNep of Adjective = CatNep ** open ResNep, Prelude in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
lin
|
||||||
|
|
||||||
|
-- ALL THE RULES FROM BOOK ARE NOT COVERED
|
||||||
|
|
||||||
|
--PositA : A -> AP ; -- warm
|
||||||
|
PositA a = a ;
|
||||||
|
|
||||||
|
|
||||||
|
--ComparA : A -> NP -> AP ; -- warmer than I
|
||||||
|
ComparA a np = {
|
||||||
|
s = \\n, g => np.s ! NPC Nom ++ "Bnx:da" ++ a.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--ComplA2 : A2 -> NP -> AP ; -- married to her
|
||||||
|
ComplA2 a np = {
|
||||||
|
s = \\n,g => np.s ! NPC Nom ++ a.c2 ++ a.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--ReflA2 : A2 -> AP ; -- married to itself
|
||||||
|
ReflA2 a = {
|
||||||
|
s = \\n, g => "APE" ++ a.c2 ++ a.s ! n ! g ; -- आफै सँग
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--UseA2 : A2 -> AP ; -- married
|
||||||
|
UseA2 a = a ;
|
||||||
|
|
||||||
|
|
||||||
|
--UseComparA : A -> AP ; -- warmer
|
||||||
|
UseComparA a = {
|
||||||
|
s = \\n, g => "HlI" ++ a.s ! n ! g ; -- अली
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--CAdvAP : CAdv -> AP -> NP -> AP ; -- as cool as John
|
||||||
|
CAdvAP cadv ap np = {
|
||||||
|
s = \\n,g => np.s ! NPC Nom ++ cadv.p ++ cadv.s ++ ap.s ! n ! g ;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
--AdjOrd : Ord -> AP ; -- warmest
|
||||||
|
AdjOrd ord = { s = \\_,_ => ord.s ; };
|
||||||
|
|
||||||
|
|
||||||
|
--SentAP : AP -> SC -> AP ; -- good that she is here
|
||||||
|
SentAP ap sc = {
|
||||||
|
s = \\n,g => sc.s ++ ap.s ! n ! g ;
|
||||||
|
--s = \\n,g => ap.s ! n ! g ++ sc.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--AdAP : AdA -> AP -> AP ; -- very warm
|
||||||
|
AdAP ada ap = {
|
||||||
|
s = \\n,g => ada.s ++ ap.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--AdvAP : AP -> Adv -> AP ; -- warm by nature
|
||||||
|
AdvAP ap adv = {
|
||||||
|
s = \\n,g => adv.s ++ ap.s ! n ! g ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
24
lib/src/nepali/src/AdverbNep.gf
Normal file
24
lib/src/nepali/src/AdverbNep.gf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
concrete AdverbNep of Adverb = CatNep ** open ResNep, Prelude, Predef in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
PositAdvAdj a = {s = a.s ! Sg ! Masc ++ "ri" } ;
|
||||||
|
|
||||||
|
ComparAdvAdj cadv a np = {
|
||||||
|
s = np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! Masc ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComparAdvAdjS cadv a s = {
|
||||||
|
s = cadv.p ++ cadv.s ++ a.s ! Sg ! Masc ++ s.s;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PrepNP prep np = {s = np.s ! NPObj ++ prep.s } ;
|
||||||
|
|
||||||
|
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
||||||
|
|
||||||
|
SubjS sub snt = {s = sub.s ++ snt.s } ;
|
||||||
|
|
||||||
|
AdnCAdv cadv = {s = cadv.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
39
lib/src/nepali/src/IdiomNep.gf
Normal file
39
lib/src/nepali/src/IdiomNep.gf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
concrete IdiomNep of Idiom = CatNep ** open Prelude,Predef, ResNep in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ;
|
||||||
|
|
||||||
|
GenericCl vp = mkSClause "kohI" (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 ++ ss.s};
|
||||||
|
|
||||||
|
ExistNP np =
|
||||||
|
mkSClause "tx:yhaV" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) -- त्यहाँ
|
||||||
|
(insertObj (\\_ => np.s ! NPC Nom) (predAux auxBe)) ;
|
||||||
|
|
||||||
|
ExistIP ip =
|
||||||
|
let cl = mkSClause ("junx:" ++ ip.s ! Nom) (agrP3 Masc 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 = (predProg vp) ;
|
||||||
|
|
||||||
|
|
||||||
|
ImpPl1 vp = {s = vp.obj.s ++ (vp.s ! ResNep.Imp).inf ++ vp.comp ! (agrP1 Masc Pl)} ;
|
||||||
|
|
||||||
|
ImpP3 np vp = {s = np.s!NPC Nom ++ "lai:" ++ (vp.s ! PVForm ).inf ++ "def"} ;
|
||||||
|
}
|
||||||
|
|
||||||
371
lib/src/nepali/src/LexiconNep.gf
Normal file
371
lib/src/nepali/src/LexiconNep.gf
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
--# -path=.:prelude:alltenses
|
||||||
|
|
||||||
|
-- regN - Regular Nouns
|
||||||
|
-- mkNF - Femenine Nouns
|
||||||
|
-- mkNUN - Uncountable Nouns
|
||||||
|
|
||||||
|
concrete LexiconNep of Lexicon = CatNep **
|
||||||
|
open ParadigmsNep, MorphoNep, Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
-- optimize=values ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
airplane_N = regN "hvaI:jhaj" ; -- हवाईजहाज
|
||||||
|
answer_V2S = mkV2 (compoundV "ftx:tr" (mkV "dinu")) ; -- उत्तर दिनु
|
||||||
|
apartment_N = regN "koQa" ; -- कोठा
|
||||||
|
apple_N = regN "sx:yaF"; -- स्याऊ
|
||||||
|
art_N = regN "kla" ; -- कला
|
||||||
|
ask_V2Q = mkV2 (mkV "soDx:nu") ; -- सोध्नु
|
||||||
|
baby_N = regN "bCx:Ca" ; -- बच्चा
|
||||||
|
bad_A = mkA "Krab" ; -- खराब
|
||||||
|
bank_N = regN "bx:yan:x:k" ; -- ब्याङ्क
|
||||||
|
beautiful_A = mkA "ramx:ro" ; -- राम्रो
|
||||||
|
become_VA = mkV "hunu" ; -- हुनु
|
||||||
|
beer_N = regN "biyr" ; -- बियर
|
||||||
|
beg_V2V = mkV2V (compoundV "Agx:rh" do_V2) lai "" False ; -- आग्रह
|
||||||
|
big_A = mkA "Qulo" ; -- ठुलो
|
||||||
|
bike_N = regN "sai:kl" ; --साइकल
|
||||||
|
bird_N = regN "Cra" ; -- चरा
|
||||||
|
black_A = mkA "kalo" ; -- कालो
|
||||||
|
blue_A = mkA "nilo" ; -- निलो
|
||||||
|
boat_N = regN "xun:x:ga" ; -- डुङ्गा
|
||||||
|
book_N = regN "kitab" ; -- किताब
|
||||||
|
boot_N = regN "jutx:ta" ; -- जुत्ता
|
||||||
|
boss_N = regN "hakim" ; -- हाकिम
|
||||||
|
boy_N = regN "keqa" ; -- केटा
|
||||||
|
bread_N = regN "roqI" ; -- रोटी
|
||||||
|
break_V2 = mkV2 (mkV "BaVCx:nu") ; -- भाँच्नु
|
||||||
|
broad_A = mkA "Prakilo" ; -- फराकिलो
|
||||||
|
brother_N2 = mkN2 (regN "daju") (mkPrep "ko") "" ;
|
||||||
|
brown_A = mkA "KEro" ; -- खैरो
|
||||||
|
butter_N = mkNUC "nwnI" feminine; -- नौनी
|
||||||
|
buy_V2 = mkV2 (mkV "kinx:nu"); -- किन्नु
|
||||||
|
camera_N = regN "kx:yamra" ; -- क्यामरा
|
||||||
|
cap_N = regN "qopi" ; -- टोपि
|
||||||
|
car_N = regN "kar" ; -- कार
|
||||||
|
carpet_N = regN "karx:rpeq" ; -- कार्रपेट
|
||||||
|
cat_N = regN "biralo" ; -- बिरालो
|
||||||
|
ceiling_N = regN "ct" ; -- छत
|
||||||
|
chair_N = regN "kurx:sI" ; -- कुर्सी
|
||||||
|
cheese_N = mkNF "Cij"; --चिज
|
||||||
|
child_N = regN "bCx:Ca" ; -- बच्चा
|
||||||
|
church_N = regN "girx:jaGr" ; -- चर्च , गिर्जाघर
|
||||||
|
city_N = regN "Shr" ; -- शहर
|
||||||
|
clean_A = mkA "sPa" ; -- सफा
|
||||||
|
clever_A = mkA "baQo" ; -- बाठो
|
||||||
|
close_V2 = mkV2 (compoundV "bnx:d" do_V2) ; -- बन्द गर्नु
|
||||||
|
coat_N = regN "koq" ; -- कोट
|
||||||
|
cold_A = mkA "Ciso" ; -- चिसो
|
||||||
|
come_V = mkV "Afnu" ; -- आउनु
|
||||||
|
computer_N = regN "kmx:px:yuqr" ; -- कम्प्युटर
|
||||||
|
country_N = regN "deS" ; -- देश
|
||||||
|
cousin_N = regN "kaka" ; -- काका
|
||||||
|
cow_N = regN "gaI:" ; -- गाई
|
||||||
|
die_V = mkV "mrx:nu" ; -- मर्नु
|
||||||
|
dirty_A = mkA "Pohor" ; -- फोहोर
|
||||||
|
distance_N3 = mkN3 (regN "durI") (mkPrep "deKi") (mkPrep "smx:m") "ko" ; -- दुरी, देखी, सम्म, त्यहाँ
|
||||||
|
doctor_N = regN "xakx:qr" ; -- डाक्टर, | Cikitx:sk - चिकित्सक
|
||||||
|
dog_N = regN "kukur" ; -- कुकुर
|
||||||
|
door_N = regN "Xoka" ; -- ढोका
|
||||||
|
drink_V2 = mkV2 (mkV "pifnu") ; -- पिउनु
|
||||||
|
--easy_A2V = mkA "sjIlo" ; -- सजीलो
|
||||||
|
eat_V2 = mkV2 (mkV "Kanu") "" ; -- खानु
|
||||||
|
empty_A = mkA "KalI" ; -- खाली
|
||||||
|
enemy_N = regN "Stx:ru" ; -- शत्रु
|
||||||
|
factory_N = regN "karKana" ; -- कारखाना
|
||||||
|
father_N2 = mkN2 (regN "buba") (mkPrep "ko") "" ; -- बुबा, बाबु
|
||||||
|
fear_VS = mkV "xrafnu"; -- डराउनु
|
||||||
|
find_V2 = mkV2 (mkV "pafnu") ; -- पाउनु
|
||||||
|
fish_N = regN "maca" ; -- माछा
|
||||||
|
floor_N = regN "BuVI:" ; -- भुँई
|
||||||
|
forget_V2 = mkV2 (mkV "birx:snu") ; -- बिर्सनु
|
||||||
|
fridge_N = regN "Px:rij" ; -- फ्रिज
|
||||||
|
friend_N = regN "saTI" ; -- साथी
|
||||||
|
fruit_N = regN "Pl" ; -- फल
|
||||||
|
--fun_AV = mkAdV "rmai:lo" ; -- रमाइलो
|
||||||
|
garden_N = regN "bgEVCa" ; -- बगैँचा
|
||||||
|
girl_N = mkNF "keqI" ; -- केटी
|
||||||
|
glove_N = regN "pYx:ja"; -- पञ्जा
|
||||||
|
gold_N = regN "sun" ; -- सुन
|
||||||
|
good_A = mkA "ramx:ro" ; -- राम्रो
|
||||||
|
go_V = mkV "janu" ; -- जानु
|
||||||
|
green_A = mkA "hriyo" ; -- हरियो
|
||||||
|
harbour_N = regN "bnx:drgah" ; -- बन्दरगाह
|
||||||
|
hate_V2 = mkV2 (compoundV "GRNa" do_V2) ; -- घृणा
|
||||||
|
hat_N = regN "qopI" ; -- टोपी
|
||||||
|
-- have_V2 = dirV2 (mk5V "ha?e" "has" "had" "had" "ha??ng") ; ????MAY BE NOT APPLICABLE
|
||||||
|
hear_V2 = mkV2 (mkV "sunx:nu") ; -- सुन्नु
|
||||||
|
hill_N = regN "phax" ; -- पहाड
|
||||||
|
hope_VS = (compoundV "ASa" do_V2); -- आशा
|
||||||
|
horse_N = regN "Goxa" ; -- घोडा
|
||||||
|
hot_A = mkA "tato" ; -- तातो
|
||||||
|
house_N = regN "Gr" ; -- घर
|
||||||
|
important_A = mkA "jrurI" ; -- जरुरी
|
||||||
|
industry_N = regN "fDog" ; -- उधोग
|
||||||
|
iron_N = regN "Plam" ; -- फलाम
|
||||||
|
king_N = regN "raja" ; -- राजा
|
||||||
|
know_V2 = mkV2 (mkV "Cinx:nu") ; -- चिन्नु
|
||||||
|
know_VS = (mkV "Taha pafnu") ; -- थाहा पाउनु
|
||||||
|
know_VQ = (compoundV "Taha" (mkV2 (mkV "pafnu"))) ; -- थाहा पाउनु
|
||||||
|
lake_N = regN "tal" ; -- ताल
|
||||||
|
lamp_N = regN "btx:ti" ; -- बत्ति
|
||||||
|
learn_V2 = mkV2 (mkV "sikx:nu") ; -- सिक्नु
|
||||||
|
leather_N = regN "cala" ; -- छाला
|
||||||
|
leave_V2 = mkV2 (mkV "coxx:nu") ; -- छोड्नु
|
||||||
|
like_V2 = mkV2 (compoundV "mn" (mkV "prx:nu")); -- मन पर्नु ???? NOT COVERED BY RULE
|
||||||
|
listen_V2 = mkV2 (mkV "sunx:nu") ; -- सुन्नु
|
||||||
|
live_V = mkV "jifnu" ; -- जिउनु -- px:rtkx:z प्रतक्ष
|
||||||
|
long_A = mkA "lamo" ; -- लामो
|
||||||
|
lose_V2 = mkV2 (mkV "hrafnu") ; -- हराउनु
|
||||||
|
love_N = regN "maya" ; -- माया
|
||||||
|
love_V2 = mkV2 (compoundV "maya" do_V2) "laI:" ; -- "nwN"; -- माया गर्नु
|
||||||
|
man_N = regN "manx:ce" ; -- मान्छे
|
||||||
|
married_A2 = mkA "vivahit" "sVg" ; -- सँग विवाहित
|
||||||
|
meat_N = mkNUC "masu" masculine ; -- मासु
|
||||||
|
milk_N = mkNUC "duD" masculine ; -- दुध
|
||||||
|
moon_N = regN "Cnx:rx:dma" ; -- चन्र्दमा ??
|
||||||
|
mother_N2 = mkN2 (mkNF "Ama") (mkPrep "ko") ""; -- need ko discuss
|
||||||
|
mountain_N = regN "himal" ; -- हिमाल
|
||||||
|
music_N = regN "sMgIt" ; -- संगीत
|
||||||
|
narrow_A = mkA "saMguro" ; -- सांगुरो
|
||||||
|
new_A = mkA "nayaV" ; -- नायाँ
|
||||||
|
newspaper_N = regN "smaCarptx:r" ; -- समाचारपत्र
|
||||||
|
oil_N = mkNUC "tel" masculine ; -- तेल
|
||||||
|
--old_A = mkA "purano" ; -- पुरानो
|
||||||
|
old_A = mkA "buXa" ; -- बुढा
|
||||||
|
open_V2 = mkV2 (mkV "Kolx:nu") ; -- खोल्नु
|
||||||
|
paint_V2A = mkV2 (compoundV "rVg" (mkV2 (mkV "lagafnu"))) "lai:" ;
|
||||||
|
paper_N = regN "kagj" ; -- कागज
|
||||||
|
paris_PN = mkPN "peris" ; -- ???? DEFAULT AS MALE (inflection) is this correct ????
|
||||||
|
peace_N = mkNUC "Sanx:ti" masculine ; -- शान्ति ???? Not sure
|
||||||
|
pen_N = regN "klm" ; -- कलम
|
||||||
|
planet_N = regN "gx:rh" ; -- ग्रह
|
||||||
|
plastic_N = regN "palx:sx:qik" ; -- पाल्स्टिक
|
||||||
|
play_V2 = mkV2 (mkV "Kelx:nu") ; -- खेल्नु
|
||||||
|
policeman_N = regN "px:rhrI" ; -- प्रहरी
|
||||||
|
priest_N = regN "purohit" ; -- पुरोहित
|
||||||
|
-- probable_AS = mkAdj1S (regA "pr?bable") ;
|
||||||
|
queen_N = mkNF "ranI" ; -- रानी
|
||||||
|
radio_N = regN "rexiyo"; -- रेडियो
|
||||||
|
rain_V0 = compoundV "brx:za" (mkV "hunu" ) ; -- बर्षा ???? hunu/bhayo irregular case need to be added
|
||||||
|
read_V2 = mkV2 (mkV "pXx:nu"); -- पढ्नु
|
||||||
|
red_A = mkA "rato" ; -- रातो
|
||||||
|
religion_N = regN "Drx:m" ; -- धर्म
|
||||||
|
restaurant_N = regN "resx:qurenx:q" ; -- रेस्टुरेन्ट
|
||||||
|
river_N = regN "Kola" ; --खोला
|
||||||
|
rock_N = regN "Xun:x:ga" ; -- ढुङ्गा
|
||||||
|
roof_N = regN "cana" ; -- छाना
|
||||||
|
rubber_N = regN "rbr" ; -- रबर
|
||||||
|
run_V = mkV "kudx:nu" ; -- कुद्नु
|
||||||
|
say_VS = mkV "Bnx:nu" ; -- भन्नु
|
||||||
|
school_N = regN "viDaly" ; -- विधालय
|
||||||
|
science_N = regN "vijx:Yn" ; -- विज्ञन
|
||||||
|
sea_N = regN "smunx:dx:r" ; -- समुन्द्र
|
||||||
|
seek_V2 = mkV2 (mkV "Kojx:nu" ) ;
|
||||||
|
sell_V3 = mkV3 (mkV "beCx:nu") "" "laI:" ; -- बेच्नु ???? ram(le) sita (lai) kitab bachyo
|
||||||
|
send_V3 = mkV3 (mkV "pQafnu") "" "laI:"; -- पठाउनु ????
|
||||||
|
sheep_N = regN "Bexa" ; -- भेडा
|
||||||
|
ship_N = regN "jhaj" ; -- जहाज
|
||||||
|
shirt_N = regN "srx:" ; -- सर्ट
|
||||||
|
shoe_N = regN "jutx:ta" ; -- जुत्ता
|
||||||
|
shop_N = regN "psl" ; -- पसल
|
||||||
|
short_A = mkA "coqo" ; --छोटो
|
||||||
|
silver_N = regN "CaVdi" ; -- चाँदि
|
||||||
|
sister_N = mkNF "dIdI" ; -- दीदी
|
||||||
|
sleep_V = mkV "sutx:nu" ; -- सुत्नु
|
||||||
|
small_A = mkA "sano" ; -- सानो
|
||||||
|
snake_N = regN "rx:zp" ; -- र्षप
|
||||||
|
sock_N = regN "moja" ; -- मोजा
|
||||||
|
speak_V2 = mkV2 (mkV "bolx:nu") ; -- बोल्नु
|
||||||
|
star_N = regN "tara" ; -- तारा
|
||||||
|
steel_N = regN "sx:qil" ; -- स्टिल
|
||||||
|
stone_N = regN "Xun:x:ga" ; -- ढुङ्गा
|
||||||
|
stove_N = regN "Culo" ; -- चुलो
|
||||||
|
student_N = regN "biDx:yarx:Ti" ; --बिध्यार्थि
|
||||||
|
stupid_A = mkA "murx:K" ; -- मुर्ख
|
||||||
|
sun_N = regN "surx:y"; -- सुर्य
|
||||||
|
switch8off_V2 = mkV2 (compoundV "sx:viC HP" do_V2) ; -- स्विच अन्
|
||||||
|
switch8on_V2 = mkV2 (compoundV "sx:viC Hnx:" do_V2) ; -- स्विच अफ
|
||||||
|
table_N = regN "qebl" ; -- टेबल
|
||||||
|
talk_V3 = mkV3 (compoundV "kura" (mkV2 (mkV "grx:nu"))) "sVg" ""; -- कुरा गर्नु सँग
|
||||||
|
teacher_N = regN "Sikx:zk" ; -- शिक्षक
|
||||||
|
teach_V2 = mkV2 (mkV "pXafnu") ; -- पढाउनु
|
||||||
|
television_N = regN "qeliBijnx:" ; -- टेलिभिजन्
|
||||||
|
thick_A = mkA "bakx:lo" ; -- बाक्लो
|
||||||
|
thin_A = mkA "patlo" ; -- पातलो
|
||||||
|
train_N = regN "rel" ; -- रेल
|
||||||
|
travel_V = (compoundV "yatx:ra" do_V2) ; -- Gumx:nu -- घुम्नु / यात्रा
|
||||||
|
tree_N = regN "ruK" ; -- रुख
|
||||||
|
ugly_A = mkA "nramx:ro" ; -- नराम्रो
|
||||||
|
understand_V2 = mkV2 (mkV "buJx:nu") ; -- बुझ्नु
|
||||||
|
university_N = regN "biSx:vbiDx:yaly" ; -- बिश्वबिध्यालय
|
||||||
|
village_N = regN "gaFV" ; -- गाऊँ
|
||||||
|
wait_V2 = mkV2 (mkV "prx:Knu") ; -- पर्खनु
|
||||||
|
walk_V = mkV "hixx:nu" ; -- हिड्नु
|
||||||
|
warm_A = mkA "tato" ; -- तातो
|
||||||
|
war_N = regN "lxaI:" ; -- लडाई
|
||||||
|
watch_V2 = mkV2 (mkV "herx:nu") ; -- हेर्नु
|
||||||
|
water_N = mkNUC "panI" feminine ;
|
||||||
|
white_A = mkA "seto" ; -- सेतो
|
||||||
|
window_N = regN "Jx:yal" ; -- झ्याल
|
||||||
|
wine_N = regN "vaI:n" ; -- वाईन
|
||||||
|
win_V2 = mkV2 (mkV "jitx:nu") ; -- जित्नु
|
||||||
|
woman_N = mkNF "AI:maI:" ; -- आईमाई
|
||||||
|
wonder_VQ = compoundV "HCmx:m" (mkV "hunu") ; -- अचम्म हुनु
|
||||||
|
wood_N = regN "kaQ" ; -- काठ
|
||||||
|
write_V2 = mkV2 (mkV "leKx:nu") ; -- लेख्नु
|
||||||
|
yellow_A = mkA "phelo" ; --पहेलो
|
||||||
|
young_A = mkA "jvan" ; -- जवान
|
||||||
|
do_V2 = mkV2 (mkV "grx:nu") ; -- गर्नु
|
||||||
|
now_Adv = mkAdv "HhIle" ; -- अहीले
|
||||||
|
already_Adv = mkAdv "HGinE" ; -- अघिनै
|
||||||
|
song_N = regN "gIt" ; -- गित
|
||||||
|
add_V3 = mkV3 (mkV "joxx:nu") "sVg" "" ; -- जोड्नु
|
||||||
|
number_N = regN "sMKx:ya" ; -- संख्या
|
||||||
|
put_V2 = mkV2 (mkV "raKx:nu") ; -- राख्नु
|
||||||
|
stop_V = mkV "rokx:nu" ; -- रोक्नु
|
||||||
|
jump_V = mkV "fPx:rnu" ; -- उफ्रनु
|
||||||
|
left_Ord = {s = "bayaV" ; n = singular}; -- ????
|
||||||
|
right_Ord = {s = "dayaV" ; n = singular}; -- ????
|
||||||
|
far_Adv = mkAdv "qaXa" ; -- टाढा
|
||||||
|
correct_A = mkA "Qik" ; -- ठिक
|
||||||
|
dry_A = mkA "suKx:Ka" ; -- सुख्खा
|
||||||
|
dull_A = mkA "mnx:D" ; -- मन्ध
|
||||||
|
full_A = mkA "Bri" ; -- भरि
|
||||||
|
heavy_A = mkA "BarI" ; -- भारी
|
||||||
|
near_A = mkA "njik" ; -- नजिक
|
||||||
|
rotten_A = mkA "kuhia:ko" ; -- कुहिएको
|
||||||
|
round_A = mkA "golo" ; -- गोलो
|
||||||
|
sharp_A = mkA "tIKo" ; -- तीखो
|
||||||
|
smooth_A = mkA "smtl" ; -- समतल
|
||||||
|
straight_A = mkA "siDa" ; -- सिधा
|
||||||
|
wet_A = mkA "Ciso" ; -- चिसो
|
||||||
|
wide_A = mkA "Prakilo" ; -- फराकिलो
|
||||||
|
animal_N = regN "jnavar" ; -- जनावार
|
||||||
|
ashes_N = mkNUC "KranI" masculine ; -- खरानी
|
||||||
|
back_N = regN "An:" ; -- आङ
|
||||||
|
bark_N = regN "bokx:ra" ; -- बोक्रा
|
||||||
|
belly_N = regN "peq" ; -- पेट
|
||||||
|
blood_N = mkNUC "rgt" feminine ; -- रगत
|
||||||
|
bone_N = regN "hxx:xI" ; -- हड्डी
|
||||||
|
breast_N = regN "sx:tn" ; -- स्तन
|
||||||
|
cloud_N = regN "badl" ; -- बादल
|
||||||
|
day_N = regN "din" ; -- दिन
|
||||||
|
dust_N = regN "Dulo" ; -- धुलो
|
||||||
|
ear_N = regN "kan" ; -- कान
|
||||||
|
earth_N = regN "pRTx:vi" ; -- पृथ्वि
|
||||||
|
egg_N = regN "HNx:xa" ; -- अण्डा
|
||||||
|
eye_N = regN "AVKa" ; -- आँखा
|
||||||
|
fat_N = regN "moqo" ; -- मोटो
|
||||||
|
feather_N = regN "px:vaVK" ; -- प्वाँख
|
||||||
|
fingernail_N = regN "nn:" ; -- नङ
|
||||||
|
fire_N = regN "Ago" ; -- आगो
|
||||||
|
flower_N = regN "Pul" ; -- फुल
|
||||||
|
fog_N = mkNUC "kuI:ro" feminine ; -- कुईरो
|
||||||
|
foot_N = regN "Kuqx:qa" ; -- खुट्टा
|
||||||
|
forest_N = regN "jVgl" ; -- जँगल
|
||||||
|
grass_N = mkNUC "GaVs" masculine ; -- घाँस
|
||||||
|
guts_N = regN "gt" ; -- FIXME: no singular
|
||||||
|
hair_N = mkNUC "kpal" masculine ; -- कपाल
|
||||||
|
hand_N = regN "hat" ; -- हात
|
||||||
|
head_N = regN "qafkos" ; -- टाउको
|
||||||
|
heart_N = regN "muqu" ; -- मुटु
|
||||||
|
horn_N = regN "hrx:n" ; -- हर्न
|
||||||
|
husband_N = regN "pti" ; -- पति
|
||||||
|
ice_N = mkNUC "hiFV" masculine ; -- हिऊँ
|
||||||
|
knee_N = regN "GuVxa" ; -- घुँडा
|
||||||
|
leaf_N = regN "pat" ; -- पात
|
||||||
|
leg_N = regN "Kuqx:qa" ; -- खुट्टा
|
||||||
|
liver_N = regN "klejo" ; -- कलेजो
|
||||||
|
louse_N = regN "jumx:ra" ; -- जुम्रा
|
||||||
|
mouth_N = regN "muK" ; -- मुख
|
||||||
|
name_N = regN "nam" ; -- नाम
|
||||||
|
neck_N = regN "GaVqI" ; -- घाँटी
|
||||||
|
night_N = regN "rat" ; -- रात
|
||||||
|
nose_N = regN "nak" ; -- नाक
|
||||||
|
person_N = regN "manis" ; -- मानिस
|
||||||
|
rain_N = mkNUC "brx:za" feminine ; -- बर्षा
|
||||||
|
road_N = regN "szk" ; -- सडक
|
||||||
|
root_N = regN "jx" ; -- जड
|
||||||
|
rope_N = regN "xorI" ; -- डोरी
|
||||||
|
salt_N = mkNUC "nun" masculine ; -- नुन
|
||||||
|
sand_N = mkNUC "baluva" masculine ; -- बालुवा
|
||||||
|
seed_N = regN "bif" ; -- बिउ
|
||||||
|
see_V2 = mkV2 (mkV "herrx:nu" ) "laI:" ; -- हेरर्नु
|
||||||
|
skin_N = regN "cala" ; -- छाला
|
||||||
|
sky_N = regN "AkaS" ; -- आकाश
|
||||||
|
smoke_N = mkNUC "DuvaV" masculine ; -- धुवाँ
|
||||||
|
snow_N = regN "hifV" ; -- हिउँ
|
||||||
|
stick_N = regN "lQx:Qi" ; -- लठ्ठि
|
||||||
|
tail_N = regN "puCx:cr" ; -- पुच्छर
|
||||||
|
tongue_N = regN "jibx:ro" ; -- जिब्रो
|
||||||
|
tooth_N = regN "daVt" ; -- दाँत
|
||||||
|
wife_N = mkNF "ptx:nI" ; -- पत्नी
|
||||||
|
wind_N = regN "hurI" ; -- हुरी
|
||||||
|
wing_N = regN "pMKa" ; -- पंखा
|
||||||
|
worm_N = regN "juga" ; -- जुगा
|
||||||
|
year_N = regN "brx:z" ; -- बर्ष
|
||||||
|
blow_V = mkV "px:rhar" ; -- प्रहार
|
||||||
|
breathe_V = compoundV "sas" (mkV "Perx:nu" ) ; -- सास फेर्नु
|
||||||
|
burn_V = mkV "balx:nu" ; -- बाल्नु
|
||||||
|
dig_V = mkV "Knx:nu" ; -- खन्नु
|
||||||
|
fall_V = mkV "Jrx:nu" ; -- झर्नु
|
||||||
|
float_V = mkV "ftx:rnu" ; -- उत्रनु
|
||||||
|
flow_V = mkV "bhnu" ; -- बहनु
|
||||||
|
fly_V = mkV "fxx:nu" ; -- उड्नु
|
||||||
|
freeze_V = mkV "jmafnu" ; -- जमाउनु
|
||||||
|
give_V3 = mkV3 (mkV "dinu") lai "" ; -- दिनु
|
||||||
|
laugh_V = mkV "hasx:nu" ; -- हास्नु
|
||||||
|
lie_V = compoundV "Juqo" (mkV "bolx:nu"); -- झुटो बोल्नु
|
||||||
|
play_V = mkV "Kelx:nu" ; -- खेल्नु
|
||||||
|
sit_V = mkV "bsx:nu" ; -- बस्नु
|
||||||
|
sew_V = mkV "sifnu" ; -- सिउनु
|
||||||
|
sing_V = mkV "gafnu" ; -- गाउनु
|
||||||
|
smell_V = mkV "sugnx:D" ; -- सुगन्ध
|
||||||
|
spit_V = mkV "Tukx:nu" ; -- थुक्नु
|
||||||
|
stand_V = mkV "fQx:nu" ; -- उठ्नु
|
||||||
|
swell_V = mkV "suninu" ; -- सुनिनु
|
||||||
|
swim_V = compoundV "pwxI" (mkV "Kelx:nu" ) ;
|
||||||
|
think_V = mkV "soCx:nu" ; -- सोच्नु
|
||||||
|
turn_V = mkV "plx:qinu" ; -- पल्टिनु
|
||||||
|
vomit_V = mkV "cadnu" ; -- छादनु
|
||||||
|
bite_V2 = mkV2 (mkV "qokx:nu") ; -- टोक्नु
|
||||||
|
count_V2 = mkV2 (mkV "gnx:nu") ; -- गन्नु
|
||||||
|
cut_V2 = mkV2 (mkV "kaqnu") ; -- काटनु
|
||||||
|
fear_V2 = mkV2 (mkV "xrafnu") ; -- डराउनु
|
||||||
|
fight_V2 = mkV2 (mkV "lxx:nu") ; -- लड्नु
|
||||||
|
hit_V2 = mkV2 (mkV "hanx:nu" ) "laI:" ; -- हान्नु
|
||||||
|
hold_V2 = mkV2 (mkV "smatx:nu") ; -- समात्नु
|
||||||
|
hunt_V2 = mkV2 (compoundV "Sikar" do_V2) ; -- शिकार
|
||||||
|
kill_V2 = mkV2 (mkV "marx:nu") ; -- मार्नु
|
||||||
|
pull_V2 = mkV2 (mkV "tanx:nu"); -- तान्नु
|
||||||
|
push_V2 = mkV2 (compoundV "Dkx:ka" (mkV "dinu")) lai ;
|
||||||
|
rub_V2 = mkV2 (mkV "maxnu") ; -- माडनु
|
||||||
|
scratch_V2 = mkV2 (mkV "korx:nu") lai ; -- कोर्नु
|
||||||
|
split_V2 = mkV2 (mkV "Cirx:nu") lai ; -- चिर्नु
|
||||||
|
squeeze_V2 = mkV2 (mkV "TiCx:nu") lai ; -- थिच्नु
|
||||||
|
stab_V2 = mkV2 (compoundV "cura" hit_V2) ; -- छुरा हान्नु
|
||||||
|
suck_V2 = mkV2 (mkV "Cusx:nu") ; -- चुस्नु
|
||||||
|
throw_V2 = mkV2 (mkV "Palx:nu") ; -- फाल्नु
|
||||||
|
tie_V2 = mkV2 (mkV "baVDnu") ; -- बाँधनु
|
||||||
|
wash_V2 = mkV2 (mkV "Dunu") ; -- धुनु
|
||||||
|
wipe_V2 = mkV2 (mkV "pucx:nu"); -- पुछ्नु
|
||||||
|
--b other_A = mkA "Hru" ; -- अरु NOT IN ABSTRACT
|
||||||
|
grammar_N = regN "vx:yakrN" ; -- व्याकरण
|
||||||
|
language_N = regN "Baza" ; -- भाषा
|
||||||
|
rule_N = regN "niym" ; -- नियम
|
||||||
|
|
||||||
|
-- added 4/6/2007
|
||||||
|
john_PN = mkPN "jon" ;
|
||||||
|
question_N = regN "px:rSx:n" ; -- प्रश्न
|
||||||
|
ready_A = mkA "tyar" ; -- तयार
|
||||||
|
reason_N = regN "karN" ; -- कारण
|
||||||
|
today_Adv = mkAdv "Aj" ; -- आज
|
||||||
|
uncertain_A = mkA "HniSx:Cit" ; -- अनिश्चित
|
||||||
|
|
||||||
|
oper
|
||||||
|
lai = "laI:" ;
|
||||||
|
|
||||||
|
} ;
|
||||||
894
lib/src/nepali/src/MorphoNep.gf
Normal file
894
lib/src/nepali/src/MorphoNep.gf
Normal file
@@ -0,0 +1,894 @@
|
|||||||
|
--# -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 MorphoNep = ResNep ** open Prelude,Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
param
|
||||||
|
{-
|
||||||
|
For distinguishing root ending in -a- and rest of other.
|
||||||
|
Root ending in -a/अ or h - is regarded as reg and rest ireg
|
||||||
|
-}
|
||||||
|
VCase = VReg | VIReg ;
|
||||||
|
|
||||||
|
|
||||||
|
--1 Nouns
|
||||||
|
oper
|
||||||
|
|
||||||
|
-- mkN : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Gender -> Bool -> Noun =
|
||||||
|
mkN : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Gender -> Noun =
|
||||||
|
\sn,sa,si,sd,sab,sl,pn,pa,pi,pd,pab,pl, g -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Nom => sn ;
|
||||||
|
Acc => sa ;
|
||||||
|
Ins => si ;
|
||||||
|
Dat => sd ;
|
||||||
|
Abl => sab ;
|
||||||
|
Loc => sl
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Nom => pn ;
|
||||||
|
Acc => pa ;
|
||||||
|
Ins => pi ;
|
||||||
|
Dat => pd ;
|
||||||
|
Abl => pab ;
|
||||||
|
Loc => pl
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
g = g
|
||||||
|
-- isHum = h
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- TODO
|
||||||
|
-- ?? NEED TO ADD CASE IF ENDS WITH 'o' (PG. 99 Jaya)
|
||||||
|
|
||||||
|
-- Regular nouns
|
||||||
|
mkNMF : Str -> Gender -> Noun ;
|
||||||
|
mkNMF str g = mkN str (str + "laI:") (str + "le") (str + "laI:") (str + "baq") (str + "ma")
|
||||||
|
(str + "hru") (str + "hrulaI:") (str + "hrule") (str + "hrulaI:") (str + "hrubaq") (str + "hruma") g ;
|
||||||
|
|
||||||
|
-- Regular Nouns
|
||||||
|
mkNReg : Str -> Noun ;
|
||||||
|
mkNReg str = mkNMF str Masc ;
|
||||||
|
|
||||||
|
-- Faminine nouns
|
||||||
|
mkNFem : Str -> Noun ;
|
||||||
|
mkNFem str = mkNMF str Fem ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Uncountable nouns, which have same singular and plular form
|
||||||
|
-- eg water
|
||||||
|
mkNUnc : Str -> Gender -> Noun ;
|
||||||
|
mkNUnc str g = mkN str (str + "laI:") (str + "le") (str + "laI:") (str + "baq") (str + "ma")
|
||||||
|
str (str + "laI:") (str + "le") (str + "laI:") (str + "baq") (str + "ma") g ;
|
||||||
|
|
||||||
|
-- Proper Names
|
||||||
|
regN1 : Str -> Gender -> Noun ;
|
||||||
|
regN1 str g = mkN str (str + "laI:") (str + "le") (str + "laI:") (str + "baq") (str + "ma")
|
||||||
|
str str str str str str g ;
|
||||||
|
|
||||||
|
|
||||||
|
-- pronouns
|
||||||
|
makePron : (x1,_,_,_,_,x6 : Str) -> {s : Case => Str} =
|
||||||
|
\n,ac,i,d,ab,l-> {
|
||||||
|
s = table {
|
||||||
|
Nom => n ;
|
||||||
|
Acc => ac ;
|
||||||
|
Ins => i ;
|
||||||
|
Dat => d ;
|
||||||
|
Abl => ab ;
|
||||||
|
Loc => l
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
makePronReg : Str -> {s : Case => Str} ;
|
||||||
|
makePronReg str = makePron str (str + "laI:") (str + "le") (str + "laI:") (str + "baq") (str + "ma") ;
|
||||||
|
|
||||||
|
--2. Derminers
|
||||||
|
|
||||||
|
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
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
IDeterminer = {s : Gender => Str ; n : Number};
|
||||||
|
makeIDet : Str -> Str -> Number -> IDeterminer =
|
||||||
|
\s1,s2,n -> {
|
||||||
|
s = table {
|
||||||
|
Masc => s1;
|
||||||
|
Fem => s2
|
||||||
|
} ;
|
||||||
|
n = n
|
||||||
|
};
|
||||||
|
{-
|
||||||
|
makeIQuant : Str -> Str -> Str -> Str -> {s:Number => Gender => Str} = \s1,s2,s3,s4 -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => s1 ;
|
||||||
|
Fem => s2
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Masc => s3 ;
|
||||||
|
Fem => s4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-}
|
||||||
|
|
||||||
|
-- Quantifiers
|
||||||
|
makeQuant : Str -> Str -> Str -> Str -> {s : Number => Gender => Str } =
|
||||||
|
\sm,sf,pm,pf -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table { Masc => sm ;
|
||||||
|
Fem => sf } ;
|
||||||
|
Pl => table { Masc => pm ;
|
||||||
|
Fem => pf }
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- Proposition
|
||||||
|
makePrep : Str -> Preposition = \str -> {s = str } ** { lock_Prep = <>};
|
||||||
|
|
||||||
|
|
||||||
|
--3. Verbs
|
||||||
|
mkVerb : (_: Str) -> Verb = \inf ->
|
||||||
|
let root = (tk 2 inf) ;
|
||||||
|
|
||||||
|
in {
|
||||||
|
s = table {
|
||||||
|
Root => root ;
|
||||||
|
Inf => inf ;
|
||||||
|
PVForm => (tk 1 inf) ;
|
||||||
|
Imp => (mkImpForm root).s ;
|
||||||
|
ProgRoot aspect number gender => (mkProgRoot root aspect number gender).s ;
|
||||||
|
|
||||||
|
VF tense aspect polarity person number gender =>
|
||||||
|
case aspect of {
|
||||||
|
Imperf => (mkVImperf root tense polarity person number gender).s ;
|
||||||
|
Perf => (mkVPerf root tense polarity person number gender).s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--For the case of lets (lets sleep)
|
||||||
|
mkImpForm : Str -> {s:Str} ;
|
||||||
|
mkImpForm str =
|
||||||
|
let vcase = (rootCheck str).vcase;
|
||||||
|
root2 = (rootCheck str).root2
|
||||||
|
in {
|
||||||
|
s = case vcase of {
|
||||||
|
VReg => root2 + "wV" ;
|
||||||
|
_ => root2 + "AV"
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
--For the progressive root case
|
||||||
|
mkProgRoot : Str -> Aspect -> Number -> Gender -> {s : Str } =
|
||||||
|
\root,aspect,number,gender ->
|
||||||
|
let root1 = (rootCheck root).root1 ;
|
||||||
|
root2 = (rootCheck root).root2 ;
|
||||||
|
vcase = (rootCheck root).vcase
|
||||||
|
in {
|
||||||
|
s= case <vcase,root> of {
|
||||||
|
<VReg, _> => (mkProgReg root2 aspect number gender).s ;
|
||||||
|
<_, "ja"> => (mkProgIReg root aspect number gender).s ;
|
||||||
|
<_, "ha"> => (mkProgIReg root aspect number gender).s ;
|
||||||
|
<_, _> => (mkProgIReg root2 aspect number gender).s
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mkProgReg : Str -> Aspect -> Number -> Gender -> {s : Str } =
|
||||||
|
\root2,aspect,number,gender -> {
|
||||||
|
s = case <aspect,number,gender> of {
|
||||||
|
<Imperf, _, _> => root2 + "dE" ;
|
||||||
|
|
||||||
|
<Perf, Sg, Masc> => root2 + "irheko" ;
|
||||||
|
<Perf, Sg, Fem> => root2 + "irheki" ;
|
||||||
|
<Perf, Pl, _> => root2 + "irheka"
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mkProgIReg : Str -> Aspect -> Number -> Gender -> {s : Str } =
|
||||||
|
\root,aspect,number,gender -> {
|
||||||
|
s = case <aspect,number,gender> of {
|
||||||
|
<Imperf, _, _> => root + "dE" ;
|
||||||
|
|
||||||
|
<Perf, Sg, Masc> => root + "i:rheko" ;
|
||||||
|
<Perf, Sg, Fem> => root + "i:rheki" ;
|
||||||
|
<Perf, Pl, _> => root + "i:rheka"
|
||||||
|
};
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--need to check for want_VV <- Not inflected correctly
|
||||||
|
|
||||||
|
rootCheck : Str -> {root1:Str; root2:Str; vcase: VCase} =
|
||||||
|
\root -> {
|
||||||
|
{-
|
||||||
|
Root inflection case
|
||||||
|
1. irregular case of Janu/जानु/go
|
||||||
|
root = जा root1 = जान् root2 = ग
|
||||||
|
|
||||||
|
2. irregular case of Hunu/हुनु/Become
|
||||||
|
root = हु root1 = हुन् root2 = भ
|
||||||
|
|
||||||
|
3. reg Verbs ending in Consonants - पढनु/to study
|
||||||
|
root = पढ्, root1 = पढ root2 = पढ् <- original
|
||||||
|
root = पढ्, root1 = पढ्, root2 = पढ <- changed to this
|
||||||
|
make sure it doesn't break
|
||||||
|
|
||||||
|
4. Khanu/खानु/to eat, Dinu/दिनु /to Give
|
||||||
|
root = खा root1 = खान् root2 = खा
|
||||||
|
|
||||||
|
5. Dhunu/धुनु/wash, Runu/रुनु/Cry
|
||||||
|
root = धु root1 = धुन् root2 = धो
|
||||||
|
|
||||||
|
6. Aaunu/आउनु/to Come, Pathaunu/पठाउनु/to Send
|
||||||
|
root = आउ root1 = आउँ root2 = आ
|
||||||
|
-}
|
||||||
|
|
||||||
|
root1 = case root of {
|
||||||
|
"ja" => root + "nx:" ;
|
||||||
|
"hu" => root + "nx:" ;
|
||||||
|
rot + "x:" => root ;
|
||||||
|
rot + ("a"|"i"|"I") => root + "nx:" ;
|
||||||
|
rot + ("e"|"u"|"U") => root + "nx:" ;
|
||||||
|
rot + ("f"|"F") => root + "V" ;
|
||||||
|
_ => root
|
||||||
|
} ;
|
||||||
|
root2 = case root of {
|
||||||
|
"ja" => "g" ;
|
||||||
|
"hu" => "B" ;
|
||||||
|
rot + "x:" => rot ;
|
||||||
|
rot + ("a"|"i"|"I") => root ;
|
||||||
|
rot + ("e"|"u"|"U") => rot + "o" ;
|
||||||
|
rot + ("f"|"F") => rot ;
|
||||||
|
_ => root
|
||||||
|
} ;
|
||||||
|
vcase = case root of {
|
||||||
|
rot + "x:" => VReg;
|
||||||
|
rot + "h" => VReg;
|
||||||
|
_ => VIReg
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkVImperf : Str -> VTense -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, t, po, pn, n, g ->
|
||||||
|
let root1 = (rootCheck root).root1 ;
|
||||||
|
root2 = (rootCheck root).root2 ;
|
||||||
|
vcase = (rootCheck root).vcase ;
|
||||||
|
in
|
||||||
|
{s = case t of {
|
||||||
|
NPresent => (mkVPreNP root root1 vcase po pn n g).s ;
|
||||||
|
NPast Simpl => (mkVPstSNP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Hab => (mkVPstHNP root root1 vcase po pn n g).s ;
|
||||||
|
NPast Unknown => (mkVPstUNP root root2 vcase po pn n g).s ;
|
||||||
|
NFuture Defin => (mkVFutDNP root po pn n g).s ;
|
||||||
|
NFuture NDefin => (mkVFutNDNP root root2 vcase po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkVPerf : Str -> VTense -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, t, po, pn, n, g ->
|
||||||
|
let root1 = (rootCheck root).root1 ;
|
||||||
|
root2 = (rootCheck root).root2 ;
|
||||||
|
vcase = (rootCheck root).vcase ;
|
||||||
|
in
|
||||||
|
{s = case t of {
|
||||||
|
--it seems root has no use in these cases, root2 worsk for all
|
||||||
|
--if no problem arises better to remove root parameter
|
||||||
|
NPresent => (mkVPreP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Simpl => (mkVPstSP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Hab => (mkVPstHP root root2 vcase po pn n g).s ;
|
||||||
|
NPast Unknown => (mkVPstUP root root2 vcase po pn n g).s ;
|
||||||
|
NFuture Defin => (mkVFutDefP root root2 vcase po pn n g).s ;
|
||||||
|
NFuture NDefin => (mkVFutNDefP root root2 vcase po pn n g).s
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Present, Nonperfective aspect, Non-progressive mode,
|
||||||
|
mkVPreNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPreNPReg root po pn n g).s ;
|
||||||
|
VIReg => (mkVPreNPIReg root root1 po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPreNP Helper for VRrg case
|
||||||
|
mkVPreNPReg : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root + "cu" ; -- छु
|
||||||
|
<Pos, Pers1, Pl, _> => root + "cwV" ; -- छौं
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + "csx:" ; -- छस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + "cesx:" ; -- छेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "cw" ; -- छौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + "cx:yw" ; -- छ्यौ
|
||||||
|
<Pos, Pers2_M, _ , _> => root + "cw" ; -- छौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "c" ; -- छ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "ce" ; -- छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "cnx:" ; -- छन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "cinx:" ; -- छिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "cnx:" ; -- छन्
|
||||||
|
<Pos, _ , _, _> => root + "nuhunx:c" ; -- नुहुन्छ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<Neg, Pers1, Sg, _> => root + "dinV" ; -- इनँ (पढ्दिनँ)
|
||||||
|
<Neg, Pers1, Pl, _> => root + "dEnEV" ; -- ऐनैँ (पढ्दैनैँ)
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + "dEnsx:" ; -- ऐनस् (पढदैनस्)
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + "dinsx:" ; -- इनस् (पढदिनस्)
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + "dEnE" ; -- ऐनै
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root + "dinE" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _ , _> => root + "dEnE" ; -- ऐनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + "dEn" ; -- ऐन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + "din" ; -- इन
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + "dEnx:n" ; -- ऐनन्
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + "dinx:n" ; -- इनन्
|
||||||
|
<Neg, Pers3_M, _, _> => root + "dEnx:n" ; -- ऐनन्
|
||||||
|
<Neg, _ , _, _> => root + "nuhunx:n" -- नुहुन्न
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPreNP Helper for VIRrg case
|
||||||
|
mkVPreNPIReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root1 + "cu" ; -- छु
|
||||||
|
<Pos, Pers1, Pl, _> => root1 + "cwM" ; -- छौं
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root1 + "csx:" ; -- छस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root1 + "cesx:" ; -- छेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root1 + "cw" ; -- छौ
|
||||||
|
<Pos, Pers2_M, Pl, Fem> => root1 + "cx:yw" ; -- छ्यौ
|
||||||
|
<Pos, Pers2_M, _ , _> => root1 + "cw" ; -- छौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root1 + "c" ; -- छ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root1 + "ce" ; -- छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root1 + "cnx:" ; -- छन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root1 + "cinx:" ; -- छिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root1 + "cnx:" ; -- छन्
|
||||||
|
<Pos, _ , _, _> => root + "nuhunx:c" ; -- नुहुन्छ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<Neg, Pers1, Sg, _> => root + "VdinV" ; -- इनँ (खाँदिनँ)
|
||||||
|
<Neg, Pers1, Pl, _> => root + "VdEnEV" ; -- ऐनैँ (खाँदैनैँ)
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + "VdEnsx:" ; -- ऐनस् (आउँदैनस्)
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + "Vdinsx:" ; -- इनस् (खाँदिनस्)
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + "VdEnE" ; -- ऐनै (खाँदैनै)
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root + "VdinE" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _ , _> => root + "VdEnE" ; -- ऐनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + "VdEn" ; -- ऐन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + "Vdin" ; -- इन (खाँदिन)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + "VdEnx:n" ; -- ऐनन्
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + "Vdinx:n" ; -- इनन्
|
||||||
|
<Neg, Pers3_M, _, _> => root + "VdEnx:n" ; -- ऐनन्
|
||||||
|
<Neg, _ , _, _> => root + "Vnuhunx:z=n" -- नुहुन्न
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Simple, Nonprogressive mode, nonperfective aspect
|
||||||
|
mkVPstSNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstSNPReg root root2 po pn n g).s ;
|
||||||
|
VIReg => (mkVPstSNPIReg root root2 po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSNP Helper for VRrg case
|
||||||
|
mkVPstSNPReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root2 + "eV" ; -- एँ
|
||||||
|
<Pos, Pers1, Pl, _> => root + "ywM" ; -- यौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root2 + "isx:" ; -- इस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "yw" ; -- यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + "yw" ; -- यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "yo" ; -- यो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root2 + "I" ; -- इ (पढी)
|
||||||
|
<Pos, Pers3_L, Pl, _> => root2 + "e" ; -- ए (पढे)
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root2 + "inx:" ; -- इन् (पढिन्)
|
||||||
|
<Pos, Pers3_M, _, _> => root2 + "e" ; -- ए (पढे)
|
||||||
|
<Pos, _, _, _> => root + "nuByo" ; -- नुभयो
|
||||||
|
|
||||||
|
-- Negative case
|
||||||
|
<Neg, Pers1, Sg, _> => root2 + "inV" ; -- इनँ
|
||||||
|
<Neg, Pers1, Pl, _> => root2 + "enEV" ; -- एनैँ
|
||||||
|
<Neg, Pers2_L, Sg, _> => root2 + "insx:" ; -- इनस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root2 + "enE" ; -- एनै
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root2 + "inE" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _, _> => root2 + "enE" ; -- एनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root2 + "en" ; -- एन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root2 + "in" ; -- इन (पढिन)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root2 + "ennx:" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root2 + "innx:" ; -- इनन् (पढिनन्)
|
||||||
|
<Neg, Pers3_M, _, _> => root2 + "ennx:" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, _, _, _> => root + "nuBe:n" -- नुभएन
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSNP Helper for VIRrg case
|
||||||
|
mkVPstSNPIReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root2 + "e:V" ; -- एँ
|
||||||
|
<Pos, Pers1, Pl, _> => root2 + "ywM" ; -- यौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root2 + "i:sx:" ; -- इस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root2 + "yw" ; -- यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root2 + "yw" ; -- यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root2 + "yo" ; -- यो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root2 + "I:" ; -- ई
|
||||||
|
<Pos, Pers3_L, Pl, _> => root2 + "e:" ; -- ए
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root2 + "i:nx:" ; -- इन्
|
||||||
|
<Pos, Pers3_M, _, _> => root2 + "e:" ; -- ए
|
||||||
|
<Pos, _, _, _> => root + "nuByo" ; -- नुभयो
|
||||||
|
|
||||||
|
-- Negative case
|
||||||
|
<Neg, Pers1, Sg, _> => root2 + "i:nV" ; -- इनँ
|
||||||
|
<Neg, Pers1, Pl, _> => root2 + "e:nEV" ; -- एनैँ
|
||||||
|
<Neg, Pers2_L, Sg, _> => root2 + "i:nsx:" ; -- इनस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root2 + "e:nE" ; -- एनै
|
||||||
|
<Neg, Pers2_M, Sg, Fem> => root2 + "i:nE" ; -- इनै
|
||||||
|
<Neg, Pers2_M, _, _> => root2 + "e:nE" ; -- एनै
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root2 + "e:n" ; -- एन
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root2 + "i:n" ; -- इन (पढिन)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root2 + "e:nnx:" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root2 + "i:nnx:" ; -- इनन् (पढिनन्)
|
||||||
|
<Neg, Pers3_M, _, _> => root2 + "e:nnx:" ; -- एनन् (पढेनन्)
|
||||||
|
<Neg, _, _, _> => root + "nuBe:n" -- नुभएन
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Habitual, Nonprogressive mode, nonperfective aspect
|
||||||
|
mkVPstHNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstHNPGen root root1 po pn n g).s ;
|
||||||
|
VIReg => (mkVPstHNPGen root1 root po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstHNP helper, handles bith VReg and VIReg cases
|
||||||
|
mkVPstHNPGen : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root1, po, pn, n, g ->
|
||||||
|
let neg = "dEn" ; -- दैन (TODO : CHECK FOR MAKE GENERIC FINCTION FOR POS AND NEG)
|
||||||
|
in
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + "TeM" ; -- थें
|
||||||
|
<Pos, Pers1, Pl, _> => root + "Tx:ywM" ; -- थ्यौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root + "Tisx:" ; -- थिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "Tx:yw" ; -- थ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + "Tx:yw" ; -- थ्यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "Tx:yo" ; -- थ्यो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "TI" ; -- थी
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "Te" ; -- थे
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "Tinx:" ; -- थिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "Te" ; -- थे
|
||||||
|
<Pos, _, _, _> => root1 + "nuhunx:z+Tx:yo" ; -- नुहुन्थ्यो
|
||||||
|
|
||||||
|
<Neg, Pers1, Sg, _> => root + neg + "TeM" ; -- थें
|
||||||
|
<Neg, Pers1, Pl, _> => root + neg + "Tx:ywM" ; -- थ्यौं
|
||||||
|
<Neg, Pers2_L, Sg, _> => root + neg + "Tisx:" ; -- थिस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + neg + "Tx:yw" ; -- थ्यौ
|
||||||
|
<Neg, Pers2_M, _, _> => root + neg + "Tx:yw" ; -- थ्यौ
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + neg + "Tx:yo" ; -- थ्यो
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + neg + "TI" ; -- थी
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + neg + "Te" ; -- थे
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + neg + "TInx:" ; -- थिन्
|
||||||
|
<Neg, Pers3_M, _, _> => root + neg + "Te" ; -- थे
|
||||||
|
<Neg, _, _, _> => root1 + "nuhuVdEnTx:yo" -- नुहुँदैनथ्यो
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Unknown, Nonprogressive mode, nonperfective aspect
|
||||||
|
mkVPstUNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\ root, root2, vc, po, p, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => case po of {
|
||||||
|
Pos => (mkVPstUNPReg root root2 "" p n g).s ;
|
||||||
|
Neg => (mkVPstUNPReg root root2 "n" p n g).s
|
||||||
|
} ;
|
||||||
|
VIReg => case po of {
|
||||||
|
Pos => (mkVPstUNPIReg root root2 "" p n g).s ;
|
||||||
|
Neg => (mkVPstUNPIReg root root2 "n" p n g).s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- mkVPstUNP helper for VReg case
|
||||||
|
mkVPstUNPReg : Str -> Str -> Str -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, na, pn, nu, g ->
|
||||||
|
{s = case <pn, nu, g> of {
|
||||||
|
<Pers1, Sg, Masc> => root2 + "e" + na + "cu" ; -- एछु
|
||||||
|
<Pers1, Sg, Fem> => root2 + "i" + na + "cu" ; -- इछु
|
||||||
|
<Pers1, Pl, _> => root2 + "e" + na + "cwV" ; -- एछौँ
|
||||||
|
<Pers2_L, Sg, Masc> => root2 + "e" + na + "csx:" ; -- एछस्
|
||||||
|
<Pers2_L, Sg, Fem> => root2 + "i" + na + "csx:" ; -- इछस्
|
||||||
|
<Pers2_L, Pl, _> => root2 + "e" + na + "cw" ; -- एछौ
|
||||||
|
<Pers2_M, Sg, Fem> => root2 + "i" + na + "cw" ; -- इछौ
|
||||||
|
<Pers2_M, _, _> => root2 + "e" + na + "cw" ; -- एछौ
|
||||||
|
<Pers3_L, Sg, Masc> => root2 + "e" + na + "c" ; -- एछ
|
||||||
|
<Pers3_L, Sg, Fem> => root2 + "i" + na + "c" ; -- इछ
|
||||||
|
<Pers3_L, Pl, _> => root2 + "e" + na + "cnx:" ; -- एछन्
|
||||||
|
<Pers3_M, Sg, Fem> => root2 + "i" + na + "cnx:" ; -- इछन्
|
||||||
|
<Pers3_M, _, _> => root2 + "e" + na + "cnx:" ; -- एछन्
|
||||||
|
< _, _, _> => root + "nuBe:" + na +"c" -- नुभएछ
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- mkVPstUNP helper for VIReg case
|
||||||
|
mkVPstUNPIReg : Str -> Str -> Str -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, na, pn, nu, g ->
|
||||||
|
{s = case <pn, nu, g> of {
|
||||||
|
<Pers1, Sg, Masc> => root2 + "e:" + na + "cu" ; -- एछु
|
||||||
|
<Pers1, Sg, Fem> => root2 + "i:" + na + "cu" ; -- इछु
|
||||||
|
<Pers1, Pl, _> => root2 + "e:" + na + "cwV" ; -- एछौँ
|
||||||
|
<Pers2_L, Sg, Masc> => root2 + "e:" + na + "csx:" ; -- एछस्
|
||||||
|
<Pers2_L, Sg, Fem> => root2 + "i:" + na + "csx:" ; -- इछस्
|
||||||
|
<Pers2_L, Pl, _> => root2 + "e:" + na + "cw" ; -- एछौ
|
||||||
|
<Pers2_M, Sg, Fem> => root2 + "i:" + na + "cw" ; -- इछौ
|
||||||
|
<Pers2_M, _, _> => root2 + "e:" + na + "cw" ; -- एछौ
|
||||||
|
|
||||||
|
<Pers3_L, Sg, Masc> => root2 + "e:" + na + "c" ; -- एछ
|
||||||
|
<Pers3_L, Sg, Fem> => root2 + "i:" + na + "c" ; -- इछ
|
||||||
|
<Pers3_L, Pl, _> => root2 + "e:" + na + "cnx:" ; -- एछन्
|
||||||
|
<Pers3_M, Sg, fem> => root2 + "i:" + na + "cnx:" ; -- इछन्
|
||||||
|
<Pers3_M, _, _> => root2 + "e:" + na + "cnx:" ; -- एछन्
|
||||||
|
< _, _, _> => root + "nuBe:" + na +"c" -- नुभएनछ
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Definitive, Nonprogressive mode, nonperfective aspect
|
||||||
|
-- Handles Both cases
|
||||||
|
mkVFutDNP : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root + "necu" ; -- नेछु
|
||||||
|
<Pos, Pers1, Pl, _> => root + "necwM" ; -- नेछौं
|
||||||
|
<Pos, Pers2_L, Sg, _> => root + "necsx:" ; -- नेछस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "necwM" ; -- नेछौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + "necwM" ; -- नेछौ
|
||||||
|
<Pos, Pers3_L, Sg, _> => root + "nec" ; -- नेछ
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "necnx:" ; -- नेछन्
|
||||||
|
<Pos, Pers3_M, _, Masc> => root + "necnx:" ; -- नेछन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "necinx:" ; -- नेछिन्
|
||||||
|
<Pos, Pers3_M, Pl, Fem> => root + "necinx:" ; -- नेछन्
|
||||||
|
<Pos, _, _, _> => root + "nuhunec" ; -- नुहुनेछ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<Neg, Pers1, Sg, _> => root + "necEn" ; -- नेछैन
|
||||||
|
<Neg, Pers1, Pl, _> => root + "necEnEV" ; -- नेछैनैँ
|
||||||
|
<Neg, Pers2_L, Sg, _> => root + "necEnsx:" ; -- नेछैनस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + "necEnE" ; -- नेछैनै
|
||||||
|
<Neg, Pers2_M, _, _> => root + "necEnE" ; -- नेछैनै
|
||||||
|
<Neg, Pers3_L, Sg, _> => root + "necEnx:" ; -- नेछैन्
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + "necEnnx:" ; -- नेछैनन्
|
||||||
|
<Neg, Pers3_M, Sg, _> => root + "necEnnx:" ; -- नेछैनन्
|
||||||
|
<Neg, Pers3_M, Pl, _> => root + "necEnE" ; -- नेछैनै
|
||||||
|
<Neg, _, _, _> => root + "nuhunecEnx:" -- नुहुनेछैन्
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Nondefinitive, Nonperfective aspect, NonPregressive mode
|
||||||
|
mkVFutNDNP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVFutNDNPReg root root2 po pn n g).s ;
|
||||||
|
VIReg => (mkVFutNDNPIReg root2 po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVFutNDNP helper for VReg case
|
||||||
|
mkVFutNDNPReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root2 + "uVla" ; -- उँला
|
||||||
|
<Pos, Pers1, Pl, _> => root2 + "wVla" ; -- आँला
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + "z=lasx:" ; -- लास्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + "lIsx:" ; -- लिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root2 + "wla" ; -- औला
|
||||||
|
<Pos, Pers2_M, Pl, Fem> => root2 + "wli" ; -- औलि
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "la" ; -- ला
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "lI" ; -- ली
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "lanx:" ; -- लान्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "lInx:" ; -- लिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "lanx:" ; -- लान्
|
||||||
|
<Pos, _, _, _> => root + "z=nuhola" ; -- नुहोला
|
||||||
|
|
||||||
|
-- TODO : NOT CLEAR DEFINITION IN BOOK
|
||||||
|
<Neg, _, _, _> => "quxu"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVFutNDNP helper for VIReg case
|
||||||
|
mkVFutNDNPIReg : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + "fVla" ; -- उँला
|
||||||
|
<Pos, Pers1, Pl, _> => root + "WVla" ; -- आँला
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + "lasx:" ; -- लास्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + "lisx:" ; -- लिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + "Wla" ; -- औला
|
||||||
|
<Pos, Pers2_M, Pl, Fem> => root + "Wli" ; -- औलि
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + "la" ; -- ला
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + "lI" ; -- ली
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + "lanx:" ; -- लान्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + "linx:" ; -- लिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + "lanx:" ; -- लान्
|
||||||
|
<Pos, _, _, _> => root + "nuhola" ; -- नुहोला
|
||||||
|
|
||||||
|
-- TODO : NOT CLEAR DEFINITION IN BOOK
|
||||||
|
<Neg, _, _, _> => "quxu"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Simple, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPstSP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstSPGen root2 "eko" "eki" "eka" po pn n g).s ;
|
||||||
|
VIReg => (mkVPstSPGen root2 "e:ko" "e:ki" "e:ka" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSP Helper handles both VReg and VIreg cases
|
||||||
|
mkVPstSPGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
-- Positive case
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "Tie:V" ; -- थिएँ
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "TiywV" ; -- थियौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "Tii:sx:" ; -- थिइस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "Tii:sx:" ; -- थिइस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "Tiyw" ; -- थियौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "Tiyw" ; -- थियौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "Tiyo" ; -- थियो
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "TiI:" ; --थिई
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "Tie:" ; -- थिए
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "Tii:nx:" ; -- थिइन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "Tie:" ; -- थिए
|
||||||
|
<Pos, _, _, _> => root + sreg + "hunuhunx:z+Tx:yo" ; -- हुनुहुन्थ्यो (TODO: CONFIRM CORRECT)
|
||||||
|
|
||||||
|
-- Negative case
|
||||||
|
<Neg, Pers1, Sg, _> => root + sreg +"Tii:nV" ; --
|
||||||
|
<Neg, Pers1, Pl, _> => root + spl + "Tie:nEV" ; --
|
||||||
|
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + sreg + "Tii:nsx:" ; --
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + sfem + "Tii:nsx:" ; --
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + spl + "Tie:nE" ; --
|
||||||
|
<Neg, Pers2_M, _, _> => root + spl + "TinE" ; --
|
||||||
|
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + sreg + "Tie:n" ; --
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + sfem + "Tii:n:" ; --
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + spl + "Tie:nnx:" ; --
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + sfem + "Tii:nnx:" ; --
|
||||||
|
<Neg, Pers3_M, _, _> => root + spl + "Tie:nnx:" ; --
|
||||||
|
<Neg, _, _, _> => root + sreg + "hunuhunx:z+nTx:yo" -- हुनुहुन्नथ्यो (TODO: CONFIRM CORRECT)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Habitual, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPstHP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstHPGen root2 "eko" "eki" "eka" po pn n g).s ;
|
||||||
|
VIReg => (mkVPstHPGen root2 "e:ko" "e:ki" "e:ka" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstSP Helper handles both VReg and VIreg cases
|
||||||
|
mkVPstHPGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "hunx:TeV" ; -- हुन्थेँ
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "hunx:TwV" ; -- हुन्थौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "hunx:Tisx:" ; -- हुन्थिस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "hunx:Ti:sx:" ; -- हुन्थिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "hunx:Tx:yw" ; -- हुन्थ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "hunx:Tx:yw" ; -- हुन्थ्यौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "hunx:z+Tx:yw" ; -- हुन्थ्यौ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "hunx:TI" ; -- हुन्थी
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "hunx:Te" ; -- हुन्थे
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "hunx:z+Ti" ; -- हुन्थि
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "hunx:Te" ; -- हुन्थे
|
||||||
|
<Pos, _, _, _> => root + sreg + "hunuhunx:Tx:yo" ; -- (TODO : हुनुहुन्थ्यो need to Confirm)
|
||||||
|
|
||||||
|
-- Negative case (TODO)
|
||||||
|
<Neg, Pers1, Sg, _> => root + sreg + "hunx:TeV" ; -- हुन्थेँ
|
||||||
|
<Neg, Pers1, Pl, _> => root + spl + "hunx:TwV" ; -- हुन्थौँ
|
||||||
|
<Neg, Pers2_L, Sg, Masc> => root + sreg + "hunx:Tii:sx:" ; -- हुन्थिइस् ???? G Check
|
||||||
|
<Neg, Pers2_L, Sg, Fem> => root + sfem + "hunx:Tii:sx:" ; -- हुन्थिइस्
|
||||||
|
<Neg, Pers2_L, Pl, _> => root + spl + "hunx:Tiyw" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw)
|
||||||
|
<Neg, Pers2_M, _, _> => root + spl + "hunx:Tiyw" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw)
|
||||||
|
<Neg, Pers3_L, Sg, Masc> => root + sreg + "hunx:Tx:yw" ; -- हुन्थ्यौ / (थियो ????)
|
||||||
|
<Neg, Pers3_L, Sg, Fem> => root + sfem + "hunx:TI" ; -- हुन्थी/ (थिई ????)
|
||||||
|
<Neg, Pers3_L, Pl, _> => root + spl + "hunx:Te" ; -- हुन्थे / (थिए)
|
||||||
|
<Neg, Pers3_M, Sg, Fem> => root + sfem + "hunx:Ti" ; -- हुन्थि
|
||||||
|
<Neg, Pers3_M, _, _> => root + spl + "hunx:Te" ; -- हुन्थे / (थिए)
|
||||||
|
<Neg, _, _, _> => root + sreg + "hunuhunx:z+nTx:yo" -- हुनुहुन्नथ्यो (TODO: CONFIRM CORRECT)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Past Unknown, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPstUP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPstHPGen root2 "eko" "eki" "eka" po pn n g).s ;
|
||||||
|
VIReg => (mkVPstHPGen root2 "e:ko" "e:ki" "e:ka" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPstUP Helper handles both VReg and VIreg cases
|
||||||
|
mkVPstUPGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, Masc> => root + sreg + "rhecu" ; -- रहेछु
|
||||||
|
<Pos, Pers1, Sg, Fem > => root + sfem + "rhecu" ; -- रहेछु (खाएकिरहेछु)
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "rhecwV" ; -- रहेछौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "rhicsx:" ; --रहिछस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "rhicsx:" ; --रहिछस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "rhecw" ; -- रहेछौ
|
||||||
|
<Pos, Pers2_M, Sg, Masc> => root + spl + "rhecw" ; -- रहेछौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "rhicw" ; -- रहिछौ (छ्यौ ????)
|
||||||
|
<Pos, Pers2_M, Pl, _> => root + spl + "rhecw" ; -- रहेछौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "rhec" ; -- रहेछ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "rhic" ; -- रहिछ
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "rhecnx:" ; -- रहेछन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "rhicInx:" ; -- रहिछीन्
|
||||||
|
<Pos, Pers3_M, Sg, Masc> => root + spl + "rhecnx:" ; -- रहेछन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "rhecnx:" ; -- रहेछन्
|
||||||
|
<Pos, _, _, _> => root + sreg + "hunuhudorhec" ; -- हुनुहुदोरहेछ/नुभएकोरहेछ(nuBe:korhec)
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "quxu" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Present, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVPreP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVPreGen root2 "eko" "eki" "eka" po pn n g).s ;
|
||||||
|
VIReg => (mkVPreGen root2 "e:ko" "e:ki" "e:ka" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- mkVPreP helper handles both VReg and VIreg cases
|
||||||
|
mkVPreGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "cu" ; -- छु
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "cwM" ; -- छौं
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "csx:" ; -- छस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "cesx:" ; -- छेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "cw" ; -- छौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "cx:yw" ; --छ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "cw" ; -- छौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "c" ; -- छ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "ce" ; -- छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "cnx:" ; -- छन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "cinx:" ; -- छिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "cnx:" ; -- छन्
|
||||||
|
<Pos, _, _, _> => root + sreg + "hunuhunx:c" ; -- हुनुहुन्छ
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "quxu" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Definitive, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVFutDefP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVFutDefGen root2 "eko" "eki" "eka" po pn n g).s ;
|
||||||
|
VIReg => (mkVFutDefGen root2 "e:ko" "e:ki" "e:ka" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- mkVFutDef helper handles both VReg and VIreg cases
|
||||||
|
mkVFutDefGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + ("hune"+"cu") ; -- हुनेछु
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "hunecwV" ; -- हुनेछौँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "hunecsx:" ; -- हुनेछस्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "hunecesx:" ; -- हुनेछेस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "hunecw" ; -- हुनेछौ
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "hunecx:yw" ; -- हुनेछ्यौ
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "hunecw" ; -- हुनेछौ
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "hunec" ; -- हुनेछ
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "hunx:ce" ; -- हुन्छे
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "hunecnx:" ; -- हुनेछन्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "hunecinx:" ; -- हुनेछिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "hunecnx:" ; -- हुनेछन्
|
||||||
|
<Pos, _, _, _> => root + sreg + "hunuhunec" ; -- हुनुहुनेछ
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "quxu" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Future Nondefinitive, Perfective aspect, Nonprogressive Mode
|
||||||
|
mkVFutNDefP : Str -> Str -> VCase -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, root2, vc, po, pn, n, g ->
|
||||||
|
{s = case vc of {
|
||||||
|
VReg => (mkVFutDefGen root2 "eko" "eki" "eka" po pn n g).s ;
|
||||||
|
VIReg => (mkVFutDefGen root2 "e:ko" "e:ki" "e:ka" po pn n g).s
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- Helper mkVFutNDef handles both VReg and VIreg cases
|
||||||
|
mkVFutNDefGen : Str -> Str -> Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} =
|
||||||
|
\root, sreg, sfem, spl, po, pn, n, g ->
|
||||||
|
{s = case <po, pn, n, g> of {
|
||||||
|
<Pos, Pers1, Sg, _> => root + sreg + "huVla" ; -- हुँला
|
||||||
|
<Pos, Pers1, Pl, _> => root + spl + "hwVlaV" ; -- हौँलाँ
|
||||||
|
<Pos, Pers2_L, Sg, Masc> => root + sreg + "holasx:" ; -- होलास्
|
||||||
|
<Pos, Pers2_L, Sg, Fem> => root + sfem + "holisx:" ; -- होलिस्
|
||||||
|
<Pos, Pers2_L, Pl, _> => root + spl + "hwla" ; -- हौला
|
||||||
|
<Pos, Pers2_M, Sg, Fem> => root + sfem + "holi" ; -- होलि
|
||||||
|
<Pos, Pers2_M, _, _> => root + spl + "hwla" ; -- हौला
|
||||||
|
<Pos, Pers3_L, Sg, Masc> => root + sreg + "hola" ; -- होला
|
||||||
|
<Pos, Pers3_L, Sg, Fem> => root + sfem + "holI" ; -- होली
|
||||||
|
<Pos, Pers3_L, Pl, _> => root + spl + "holanx:" ; -- होलान्
|
||||||
|
<Pos, Pers3_M, Sg, Fem> => root + sfem + "holinx:" ; -- होलिन्
|
||||||
|
<Pos, Pers3_M, _, _> => root + spl + "holanx:" ; -- होलान्
|
||||||
|
<Pos, _, _, _> => root + sreg + "hunuhola" ; -- हुनुहोला
|
||||||
|
|
||||||
|
-- Negative Case (TODO)
|
||||||
|
<Neg, _, _, _> => "quxu" -- TODO--
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
-- TODO - Refactor
|
||||||
|
IntPronForm = {s: Case => Str};
|
||||||
|
mkIntPronForm : (x1,x2,x3,x4:Str) -> IntPronForm =
|
||||||
|
\y1,y2,y3,y4 -> {
|
||||||
|
s = table {
|
||||||
|
Nom => y1;
|
||||||
|
_ => y2
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
118
lib/src/nepali/src/NumeralNep.gf
Normal file
118
lib/src/nepali/src/NumeralNep.gf
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
concrete NumeralNep of Numeral = CatNep ** open ResNep, Prelude in {
|
||||||
|
-- By Harald Hammarstroem
|
||||||
|
-- Modification for Nepali by Dinesh and 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 ++ "wV" -- need to use mkOrd x0.s but it gives linking error
|
||||||
|
};
|
||||||
|
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 "duI:" "bIs" r2 ;
|
||||||
|
lin n3 = mkNum "tIn" "tIs" r3 ;
|
||||||
|
lin n4 = mkNum "Car" "CalIs" r4 ;
|
||||||
|
lin n5 = mkNum "paVC" "pCas" r5 ;
|
||||||
|
lin n6 = mkNum "c" "saQI" r6 ;
|
||||||
|
lin n7 = mkNum "sat" "stx:trI" r7 ; -- सत्तरी
|
||||||
|
lin n8 = mkNum "AQ" "HsI" r8 ;
|
||||||
|
lin n9 = mkNum "nw" "nbx:be" r9 ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkR : (a1,_,_,_,_,_,_,_,a9 : 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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- REF http://dsal.uchicago.edu/dictionaries/schmidt/
|
||||||
|
-- Ordinals from One - Hundred are irregular
|
||||||
|
rows : DSize => DSize => Str = table {
|
||||||
|
sg => mkR "e:Gar" "e:kx:kai:s" "e:ktIs" "e:kCalIs" "e:kafnx:z=n" "e:ksQx:QI" "e:khtx:tr" "e:kasI" "e:kanx:z=nbx:be" ;
|
||||||
|
r2 => mkR "bahx:r" "bai:s" "btx:tIs" "byalIs" "bafnx:z=n" "bEsQx:QI" "bhtx:tr" "byasI" "byanx:z=nbx:be" ;
|
||||||
|
r3 => mkR "tehx:r" "tei:s" "tetx:tIs" "tx:riCalIs" "tx:ripnx:z=n" "tx:risQx:QI" "tx:rihtx:tr" "tx:riyasI" "tx:riyanx:z=nbx:be" ;
|
||||||
|
r4 => mkR "CwD" "CwbIs" "CwMtIs" "CvalIs" "Cvnx:z=n" "CwsQx:QI" "Cwhtx:tr" "CwrasI" "Cwranx:z=nbx:be";
|
||||||
|
r5 => mkR "pnx:Dx:r" "pCx:CIs" "pEMtIs" "pEMtalIs" "pCpnx:z=n" "pEMsQx:QI" "pChtx:tr" "pCasI" "pnx:Canx:z=nbx:be" ;
|
||||||
|
r6 => mkR "sohx:r" "cbx:bIs" "ctx:tIs" "cyalIs" "cpnx:z=n" "cEMsQx:QI" "cyhtx:tr" "cyasI" "cyanx:z=nbx:be" ;
|
||||||
|
r7 => mkR "stx:r" "stx:tai:s" "swMtIs" "stCalIs" "snx:tafnx:z=n" "stsQx:QI" "sthtx:tr" "stasI" "snx:tanx:z=nbx:be" ;
|
||||||
|
r8 => mkR "HQar" "HQx:Qai:s" "HQtIs" "HQtalIs" "Hnx:Qafnx:z=n" "HQsQx:QI" "HQhtx:tr" "HQasI" "Hnx:Qanx:z=nbx:be" ;
|
||||||
|
r9 => mkR "fnx:z=nai:s" "fnnx:tIs" "fnnx:CalIs" "fnnx:pCas" "fnnx:saQI" "fnnx:stx:trI" "fnasI" "fnanx:z=nbx:be" "fnanx:sy"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||||
|
|
||||||
|
lin pot01 = {s = table {unit => "e:k" ; _ => "dmy" } ; size = sg ; n = Sg} ;
|
||||||
|
lin pot0 d = d ;
|
||||||
|
lin pot110 = {s = "ds" ; 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 = "dmy" ; size = n.size ; n = n.n} ;
|
||||||
|
lin pot2 d = {s = (mksau (d.s ! unit) d.size) ;
|
||||||
|
s2 = d.s ! unit ++ "laK" ; size = more100 ; n = d.n} ;
|
||||||
|
lin pot2plus d e =
|
||||||
|
{s = (mksau (d.s ! unit) d.size) ++ e.s ;
|
||||||
|
s2 = (d.s ! unit) ++ "laK" ++ (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 ++ "hjar" ;
|
||||||
|
more100 => n.s2 } ! n.size ; n = n.n} ;
|
||||||
|
lin pot3plus n m =
|
||||||
|
{s = table {singl => ekhazar ;
|
||||||
|
less100 => n.s ++ "hjar" ;
|
||||||
|
more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ;
|
||||||
|
|
||||||
|
lin D_0 = { s = "0" ; n = Sg};
|
||||||
|
lin D_1 = { s = "1" ; n = Sg};
|
||||||
|
lin D_2 = { s = "2" ; n = Pl};
|
||||||
|
lin D_3 = { s = "3" ; n = Pl};
|
||||||
|
lin D_4 = { s = "4" ; n = Pl};
|
||||||
|
lin D_5 = { s = "5" ; n = Pl};
|
||||||
|
lin D_6 = { s = "6" ; n = Pl};
|
||||||
|
lin D_7 = { s = "7" ; n = Pl};
|
||||||
|
lin D_8 = { s = "8" ; n = Pl};
|
||||||
|
lin D_9 = { s = "9" ; 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 {"e:k" ++ "hjar" ; "hjar"} ;
|
||||||
|
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "hjar"} ! sz ;
|
||||||
|
oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "e:k" ++ "sy" ; _ => s ++ "sy"} ! sz ;
|
||||||
|
}
|
||||||
32
lib/src/nepali/src/PhraseNep.gf
Normal file
32
lib/src/nepali/src/PhraseNep.gf
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
concrete PhraseNep of Phrase = CatNep ** open Prelude, ResNep in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
|
|
||||||
|
UttS s = s ;
|
||||||
|
UttQS qs = {s = qs.s ! QDir} ;
|
||||||
|
-- be a man -> (मन्छे हउ)
|
||||||
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False ++ "hf"} ;
|
||||||
|
|
||||||
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False ++ "hA"} ;
|
||||||
|
|
||||||
|
UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True ++ "hf"} ;
|
||||||
|
|
||||||
|
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||||
|
UttIAdv iadv = iadv ;
|
||||||
|
UttNP np = {s = np.s ! NPC Nom} ;
|
||||||
|
|
||||||
|
UttVP vp = {s = vp.ad ++ vp.obj.s ++ vp.comp ! (agrP3 Masc Sg) ++ (vp.s ! Inf).inf ++ vp. embComp} ;
|
||||||
|
|
||||||
|
UttAdv adv = {s = adv.s } ;
|
||||||
|
UttCN cn = {s = cn.s ! Sg ! Nom};
|
||||||
|
UttCard n = n ;
|
||||||
|
UttAP ap = {s = ap.s ! Sg ! Masc } ;
|
||||||
|
|
||||||
|
NoPConj = {s = []} ;
|
||||||
|
PConjConj conj = {s = conj.s2} ;
|
||||||
|
|
||||||
|
NoVoc = {s = []} ;
|
||||||
|
VocNP np = {s = np.s ! NPC Nom} ;
|
||||||
|
|
||||||
|
}
|
||||||
83
lib/src/nepali/src/QuestionNep.gf
Normal file
83
lib/src/nepali/src/QuestionNep.gf
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
concrete QuestionNep of Question = CatNep ** open ResNep, 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 => "yedi" ++ cl.s ! t ! p ! ODir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
QuestVP qp vp =
|
||||||
|
let cl = mkSClause ("") (Ag Masc qp.n Pers3_L) vp;
|
||||||
|
qp1 = qp.s ! Nom;
|
||||||
|
qp2 = qp.s ! Ins
|
||||||
|
in { s = \\t,p,o =>
|
||||||
|
case t of {
|
||||||
|
-- VPSmplPast => qp2 ++ cl.s ! t ! p ! ODir ;
|
||||||
|
_ => qp1 ++ cl.s ! t ! p ! ODir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
QuestSlash ip slash =
|
||||||
|
let ip1 = ip.s ! Nom;
|
||||||
|
ip2 = ip.s ! Ins
|
||||||
|
in {
|
||||||
|
s = \\t,p,o => case t of {
|
||||||
|
-- VPSmplPast => 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 Nom ++ 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 ! ResNep.Nom ++ p.s } ; -- case need to be confirmed
|
||||||
|
|
||||||
|
AdvIP ip adv = {
|
||||||
|
s = \\c => adv.s ++ ip.s ! c ;
|
||||||
|
n = ip.n;
|
||||||
|
g = ip.g;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetCN idet cn = {
|
||||||
|
s = \\c => idet.s ! Masc++ cn.s ! idet.n ! c ;
|
||||||
|
n = idet.n;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetIP idet = {
|
||||||
|
s = \\_ => idet.s ! Masc ;
|
||||||
|
n = idet.n;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetQuant iqant num = {
|
||||||
|
s =\\_ => iqant.s ! num.n ++ num.s ;
|
||||||
|
n = num.n ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompIAdv a = a ;
|
||||||
|
CompIP p = ss (p.s ! Nom) ;
|
||||||
|
AdvIAdv i a = {s = i.s ++ a.s} ;
|
||||||
|
AdvQVP vp iadv = insertObj (\\_ => iadv.s) vp ;
|
||||||
|
AddAdvQVP qvp iadv = insertObj (\\_ => iadv.s) qvp ;
|
||||||
|
ComplSlashIP vpslash ip = insertObj (\\_ => ip.s ! Nom) vpslash ;
|
||||||
|
|
||||||
|
lincat QVP = CatNep.VP ;
|
||||||
|
|
||||||
|
}
|
||||||
63
lib/src/nepali/src/RelativeNep.gf
Normal file
63
lib/src/nepali/src/RelativeNep.gf
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
concrete RelativeNep of Relative = CatNep ** open ResNep in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
RelCl cl = {
|
||||||
|
s = \\t,p,o,agr => "jsx:tikI" ++ cl.s ! t ! p ! o ;
|
||||||
|
c = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- 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 ! Nom) 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 = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
---- 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 ! Nom ++ 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 = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- CHEK NEPALI RULES FOR RELSTIVE (PG 32)
|
||||||
|
FunRP p np rp = {
|
||||||
|
s = \\c => rp.s ! c ++ np.s ! NPC Nom ++ p.s ;
|
||||||
|
a = RAg np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdRP = {
|
||||||
|
s = table {
|
||||||
|
ResNep.Nom => "jo" ;
|
||||||
|
ResNep.Ins => "jsx:le" ;
|
||||||
|
_ => "jo"
|
||||||
|
} ;
|
||||||
|
a = RNoAg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
709
lib/src/nepali/src/ResNep.gf
Normal file
709
lib/src/nepali/src/ResNep.gf
Normal file
@@ -0,0 +1,709 @@
|
|||||||
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
--
|
||||||
|
--1 Pnbu auxiliary operations.
|
||||||
|
--
|
||||||
|
-- This module contains operations that are needed to make the
|
||||||
|
-- resource syntax work.
|
||||||
|
|
||||||
|
resource ResNep = ParamX ** open Prelude, Predef in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
param
|
||||||
|
Case = Nom | Acc | Ins | Dat | Abl | Loc ;
|
||||||
|
Gender = Masc | Fem ;
|
||||||
|
NPerson = Pers1
|
||||||
|
| Pers2_L
|
||||||
|
| Pers2_M
|
||||||
|
| Pers2_H
|
||||||
|
| Pers3_L
|
||||||
|
| Pers3_M
|
||||||
|
| Pers3_H ;
|
||||||
|
|
||||||
|
Order = ODir | OQuest ;
|
||||||
|
|
||||||
|
--2 For $Relative$
|
||||||
|
|
||||||
|
RAgr = RNoAg | RAg Agr ;
|
||||||
|
RCase = RC Number Case ;
|
||||||
|
|
||||||
|
-- for Numerial
|
||||||
|
|
||||||
|
CardOrd = NCard | NOrd ;
|
||||||
|
|
||||||
|
------------------------------------------
|
||||||
|
--Verbs
|
||||||
|
-------------------------------------------
|
||||||
|
VTense = NPresent | NPast PTypes | NFuture FTypes;
|
||||||
|
PTypes = Simpl | Hab | Unknown ;
|
||||||
|
FTypes = Defin | NDefin ;
|
||||||
|
|
||||||
|
VerbForm =
|
||||||
|
VF VTense Aspect Polarity NPerson Number Gender
|
||||||
|
| Root -- Root form, 'kha' is the root of 'khanu'
|
||||||
|
| Inf -- Infinitive form 'khanau'
|
||||||
|
| ProgRoot Aspect Number Gender
|
||||||
|
| PVForm -- Partial verb form 'khan' is teh PVForm of 'khanu'
|
||||||
|
| Imp ;
|
||||||
|
|
||||||
|
-- Aspect Perfective and non-perfective
|
||||||
|
Aspect = Perf | Imperf ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
-- Noun = {s : Number => Case => Str ; g : Gender ; isHum : Bool } ; -- TODO ADD HUMAN/NON-HUMAN CASE
|
||||||
|
Noun = {s : Number => Case => Str ; g : Gender } ;
|
||||||
|
|
||||||
|
Verb = {s : VerbForm => Str} ;
|
||||||
|
|
||||||
|
Preposition = {s : Str};
|
||||||
|
|
||||||
|
-- DemPronForm = {s : Number => Gender => Case => Str};
|
||||||
|
-- PossPronForm = {s : Number => Gender => Case => Str};
|
||||||
|
--Determiner = {s : Number => Gender => Str ; n : Number};
|
||||||
|
|
||||||
|
Determiner = {s : Number => Gender => Str ; n : Number};
|
||||||
|
|
||||||
|
|
||||||
|
-- Nepali Adjectives
|
||||||
|
|
||||||
|
npAdjective = {s : Number => Gender => Str} ;
|
||||||
|
|
||||||
|
mkAdjnp : Str -> npAdjective = \str ->
|
||||||
|
case str of {
|
||||||
|
st + "o" => mkAdj1 str (st+"I") (st+"a") ;
|
||||||
|
st + "to" => mkAdj1 str str str ;
|
||||||
|
_ => mkAdj1 str str str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdj1 : (x1,_,x3 : Str) -> npAdjective =
|
||||||
|
\sm, sf, smf -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Masc => sm ;
|
||||||
|
Fem => sf
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Masc => smf ;
|
||||||
|
Fem => smf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-- Reflective Pronoun
|
||||||
|
--eg. (i will do myself)
|
||||||
|
reflPron : Str ;
|
||||||
|
reflPron = "APEM" ; -- आफैं
|
||||||
|
|
||||||
|
eko : Str ;
|
||||||
|
eko = "e:ko" ;
|
||||||
|
|
||||||
|
eka : Str ;
|
||||||
|
eka = "e:ka" ;
|
||||||
|
|
||||||
|
sbvn : Str ;
|
||||||
|
sbvn = "sbBnx:Da" ;
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
-- Grammar part
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
param
|
||||||
|
Agr = Ag Gender Number NPerson ;
|
||||||
|
NPCase = NPC Case | NPObj | NPErg ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
np2pronCase : (Case => Str) -> NPCase -> Agr -> Str =
|
||||||
|
\ppf,npc,a -> case npc of {
|
||||||
|
NPC c => ppf ! c ;
|
||||||
|
NPObj => ppf ! Nom ;
|
||||||
|
NPErg => ppf ! Ins --Nom ++ "le"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
toNP : (Case => Str) -> NPCase -> Str = \pn, npc -> case npc of {
|
||||||
|
NPC c => pn ! c ;
|
||||||
|
NPObj => pn ! Nom ;
|
||||||
|
NPErg => pn ! Ins --Nom ++ "le"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of {
|
||||||
|
NPC c => dt.s ! dt.n ! Masc ++ cn.s ! nn ! c ;
|
||||||
|
NPObj => dt.s ! dt.n ! Masc ++ cn.s ! nn ! Nom ;
|
||||||
|
NPErg => dt.s ! dt.n ! Masc ++ cn.s ! nn ! Ins --Nom ++ "le"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of {
|
||||||
|
NPC c => dt.s ! dt.n ! Masc ;
|
||||||
|
NPObj => dt.s ! dt.n ! Masc ;
|
||||||
|
NPErg => dt.s ! dt.n ! Masc ++ "le"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
-- Agreement transformations
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
toAgr : Number -> NPerson -> Gender -> Agr = \n,p,g ->
|
||||||
|
Ag g n p;
|
||||||
|
|
||||||
|
|
||||||
|
fromAgr : Agr -> {n : Number ; p : NPerson ; 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_L ;
|
||||||
|
|
||||||
|
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} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
CTense = CPrsnt | CPast | CFuture ;
|
||||||
|
|
||||||
|
-- if the noun is of type occupation/Introductiary case it will take ho, instead of chh (in case of present)
|
||||||
|
oper
|
||||||
|
copula : CTense -> Polarity -> Number -> NPerson -> Gender -> Str =
|
||||||
|
\t, po, n, pn, g ->
|
||||||
|
case <t,po,pn,n,g> of {
|
||||||
|
-- Resembles with "mkVPreNPReg" function for positive
|
||||||
|
-- <CPrsnt, Pos, _, _, _> => mkVPreNPReg "" Pos pn n g ;
|
||||||
|
-- Present Positive
|
||||||
|
<CPrsnt, Pos, Pers1, Sg, _> => "cu" ; -- छु
|
||||||
|
<CPrsnt, Pos, Pers1, Pl, _> => "cwM" ; -- छौं
|
||||||
|
<CPrsnt, Pos, Pers2_L, Sg, Masc> => "csx:" ; -- छस्
|
||||||
|
<CPrsnt, Pos, Pers2_L, Sg, Fem> => "cesx:" ; -- छेस्
|
||||||
|
<CPrsnt, Pos, Pers2_L, Pl, _> => "cw" ; -- छौ
|
||||||
|
<CPrsnt, Pos, Pers2_M, Pl, Fem> => "cx:yw" ; -- छ्यौ
|
||||||
|
<CPrsnt, Pos, Pers2_M, _, _> => "cw" ; -- छौ
|
||||||
|
<CPrsnt, Pos, Pers3_L, Sg, Masc> => "c" ; -- छ
|
||||||
|
<CPrsnt, Pos, Pers3_L, Sg, Fem> => "ce" ; -- छे
|
||||||
|
<CPrsnt, Pos, Pers3_L, Pl, _> => "cnx:" ; -- छन्
|
||||||
|
<CPrsnt, Pos, Pers3_M, Sg, Fem> => "cinx:" ; -- छिन्
|
||||||
|
<CPrsnt, Pos, Pers3_M, _, _> => "cnx:" ; -- छन्
|
||||||
|
<CPrsnt, Pos, _ , _, _> => "hunuhunx:c" ; --हुनुहुन्छ
|
||||||
|
|
||||||
|
-- Present Negative
|
||||||
|
<CPrsnt, Neg, Pers1, Sg, _> => "cEnV" ; -- छैनँ
|
||||||
|
<CPrsnt, Neg, Pers1, Pl, _> => "cEnwM" ; -- छैनौं
|
||||||
|
<CPrsnt, Neg, Pers2_L, Sg, _> => "cEnsx:" ; -- छैनस्
|
||||||
|
<CPrsnt, Neg, Pers2_L, Pl, _> => "cEnw" ; -- छैनौ
|
||||||
|
<CPrsnt, Neg, Pers2_M, _, _> => "cEnw" ; -- छैनौ
|
||||||
|
<CPrsnt, Neg, Pers3_L, Sg, _> => "cEn" ; --छैन
|
||||||
|
<CPrsnt, Neg, Pers3_L, Pl, _> => "cEnnx:" ; -- छैनन्
|
||||||
|
<CPrsnt, Neg, Pers3_M, _, _> => "cEnnx:" ; -- छैनन्
|
||||||
|
<CPrsnt, Neg, _, _, _> => "hunuhunx:z+n" ; -- हुनुहुन्न
|
||||||
|
|
||||||
|
-- Resemples with "mkVPstSPGen" case, should refactor to make it
|
||||||
|
-- take common function
|
||||||
|
|
||||||
|
-- Past Positive
|
||||||
|
<CPast, Pos, Pers1, Sg, _> => "Tie:V" ; -- थिएँ
|
||||||
|
<CPast, Pos, Pers1, Pl, _> => "TiywV" ; -- थियौँ
|
||||||
|
<CPast, Pos, Pers2_L, Sg, _> => "Tii:sx:" ; -- थिइस्
|
||||||
|
<CPast, Pos, Pers2_L, Pl, _> => "Tiyw" ; -- थियौ
|
||||||
|
<CPast, Pos, Pers2_M, _, _> => "Tiyw" ; -- थियौ
|
||||||
|
<CPast, Pos, Pers3_L, Sg, Masc> => "Tiyo" ; -- थियो
|
||||||
|
<CPast, Pos, Pers3_L, Sg, Fem> => "TiI:" ; --थिई
|
||||||
|
<CPast, Pos, Pers3_L, Pl, _> => "Tie:" ; -- थिए
|
||||||
|
<CPast, Pos, Pers3_M, Sg, Fem> => "Tii:nx:" ; -- थिइन्
|
||||||
|
<CPast, Pos, Pers3_M, _, _> => "Tie:" ; -- थिए
|
||||||
|
<CPast, Pos, _, _, _> => "hunuhunx:z+Tx:yo" ; -- हुनुहुन्थ्यो
|
||||||
|
|
||||||
|
-- Past Positive
|
||||||
|
<CPast, Neg, Pers1, Sg, _> => "TinV" ; -- थिनँ
|
||||||
|
<CPast, Neg, Pers1, Pl, _> => "TenwM" ; -- थेनौं
|
||||||
|
<CPast, Neg, Pers2_L, Sg, _> => "Tinsx:" ; -- थिनस्
|
||||||
|
<CPast, Neg, Pers2_L, Pl, _> => "Tenw" ; -- थेनौ
|
||||||
|
<CPast, Neg, Pers2_M, _, _> => "Tenw" ; -- थेनौ
|
||||||
|
<CPast, Neg, Pers3_L, Sg, Masc> => "Ten" ; -- थेन
|
||||||
|
<CPast, Neg, Pers3_L, Sg, Fem> => "Tin" ; --थिन
|
||||||
|
<CPast, Neg, Pers3_L, Pl, _> => "Tennx:" ; -- थेनन्
|
||||||
|
<CPast, Neg, Pers3_M, Sg, Fem> => "Tinnx:" ; -- थिनन्
|
||||||
|
<CPast, Neg, Pers3_M, _, _> => "Tennx:" ; -- थेनन्
|
||||||
|
<CPast, Neg, _, _, _> => "hunuhunx:z+nTx:yo" ; -- हुनुहुन्नथ्यो
|
||||||
|
|
||||||
|
|
||||||
|
-- Can be covered by the function "mkVFutDNP"
|
||||||
|
-- Future Positive
|
||||||
|
<CFuture, Pos, Pers1, Sg, _> => "hunecu" ; -- हुनेछु
|
||||||
|
<CFuture, Pos, Pers1, Pl, _> => "hunecwM" ; -- हुनेछौं
|
||||||
|
<CFuture, Pos, Pers2_L, Sg, _> => "hunecsx:" ; -- हुनेछस्
|
||||||
|
<CFuture, Pos, Pers2_L, Pl, _> => "hunecwM" ; -- हुनेछौ
|
||||||
|
<CFuture, Pos, Pers2_M, _, _> => "hunecwM" ; -- हुनेछौ
|
||||||
|
<CFuture, Pos, Pers3_L, Sg, _> => "hunec" ; -- हुनेछ
|
||||||
|
<CFuture, Pos, Pers3_L, Pl, _> => "hunecnx:" ; -- हुनेछन्
|
||||||
|
<CFuture, Pos, Pers3_M, _, Masc> => "hunecnx:" ; -- हुनेछन्
|
||||||
|
<CFuture, Pos, Pers3_M, Sg, Fem> => "hunecnx:" ; -- हुनेछिन्
|
||||||
|
<CFuture, Pos, Pers3_M, Pl, Fem> => "hunecnx:" ; -- हुनेछन्
|
||||||
|
<CFuture, Pos, _, _, _> => "hunuhunec" ; -- हुनुहुनेछ
|
||||||
|
|
||||||
|
-- Negative Case
|
||||||
|
<CFuture, Neg, Pers1, Sg, _> => "hunecEn" ; -- हुनेछैन
|
||||||
|
<CFuture, Neg, Pers1, Pl, _> => "hunecEnEV" ; -- हुनेछैनैँ
|
||||||
|
<CFuture, Neg, Pers2_L, Sg, _> => "hunecEnsx:" ; -- हुनेछैनस्
|
||||||
|
<CFuture, Neg, Pers2_L, Pl, _> => "hunecEnE" ; -- हुनेछैनै
|
||||||
|
<CFuture, Neg, Pers2_M, _, _> => "hunecEnE" ; -- हुनेछैनै
|
||||||
|
<CFuture, Neg, Pers3_L, Sg, _> => "hunecEnx:" ; -- हुनेछैन्
|
||||||
|
<CFuture, Neg, Pers3_L, Pl, _> => "hunecEnnx:" ; -- हुनेछैनन्
|
||||||
|
<CFuture, Neg, Pers3_M, Sg, _> => "hunecEnnx:" ; -- हुनेछैनन्
|
||||||
|
<CFuture, Neg, Pers3_M, Pl, _> => "hunecEnE" ; -- हुनेछैनै
|
||||||
|
<CFuture, Neg, _, _, _> => "hunuhunecEnx:" -- हुनुहुनेछैन्
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- For Human, occupation/Introductiary case case, (HAVENT INTEGRATED YET)
|
||||||
|
copulaOpn : CTense -> Polarity -> Number -> NPerson -> Gender -> Str =
|
||||||
|
\t, po, n, pn, g ->
|
||||||
|
case <t,po,pn,n,g> of {
|
||||||
|
-- Resembles with "mkVPreNPReg" function for positive
|
||||||
|
-- <CPrsnt, Pos, _, _, _> => mkVPreNPReg "" Pos pn n g ;
|
||||||
|
-- Present Positive
|
||||||
|
<CPrsnt, Pos, Pers1, Sg, _> => "huV" ; -- हुँ
|
||||||
|
<CPrsnt, Pos, Pers1, Pl, _> => "hwV" ; -- हौँ
|
||||||
|
<CPrsnt, Pos, Pers2_L, Sg, _> => "hosx:" ; -- होस्
|
||||||
|
--<CPrsnt, Pos, Pers2_L, Sg, Fem> => "hosx:" ; -- छेस्
|
||||||
|
<CPrsnt, Pos, Pers2_L, Pl, _> => "hw" ; -- हौ
|
||||||
|
--<CPrsnt, Pos, Pers2_M, Pl, Fem> => "cx:yw" ; -- छ्यौ
|
||||||
|
<CPrsnt, Pos, Pers2_M, _, _> => "hw" ; -- हौ
|
||||||
|
<CPrsnt, Pos, Pers3_L, Sg, Masc> => "ho" ; -- हो
|
||||||
|
--<CPrsnt, Pos, Pers3_L, Sg, Fem> => "hunx:" ; -- हुन्
|
||||||
|
<CPrsnt, Pos, Pers3_L, _, _> => "hunx:" ; -- हुन्
|
||||||
|
--<CPrsnt, Pos, Pers3_M, Sg, Fem> => "hw" ; -- हौ
|
||||||
|
<CPrsnt, Pos, Pers3_M, _, _> => "hw" ; -- हौ
|
||||||
|
<CPrsnt, Pos, _ , _, _> => "hunuhunx:c" ; --हुनुहुन्छ
|
||||||
|
|
||||||
|
-- Present Negative
|
||||||
|
<CPrsnt, Neg, Pers1, Sg, _> => "hEn" ; --
|
||||||
|
<CPrsnt, Neg, Pers1, Pl, _> => "hEnwM" ; -- हैनौं
|
||||||
|
<CPrsnt, Neg, Pers2_L, Sg, _> => "hEnsx:" ; -- हैनस्
|
||||||
|
<CPrsnt, Neg, Pers2_L, Pl, _> => "hEnw" ; -- हैनौ
|
||||||
|
<CPrsnt, Neg, Pers2_M, _, _> => "hEnw" ; -- हैनौ
|
||||||
|
<CPrsnt, Neg, Pers3_L, Sg, _> => "hEn" ; --हैन
|
||||||
|
<CPrsnt, Neg, Pers3_L, Pl, _> => "hEnnx:" ; -- हैनन्
|
||||||
|
<CPrsnt, Neg, Pers3_M, _, _> => "hEnnx:" ; -- हैनन्
|
||||||
|
<CPrsnt, Neg, _, _, _> => "hunuhunx:z+n" ; -- हुनुहुन्न
|
||||||
|
|
||||||
|
<_,_,_,_,_> => copula t po n pn g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
param
|
||||||
|
|
||||||
|
VPHTense =
|
||||||
|
VPGenPres -- impf hum nahim "I go"
|
||||||
|
| VPSmplPast -- impf Ta nahim "I went"
|
||||||
|
| VPFut -- fut na/nahim "I shall go"
|
||||||
|
| VPPerfPres -- perf hum na/nahim "I have gone"
|
||||||
|
| VPPerfPast -- perf Ta na/nahim "I had gone"
|
||||||
|
| VPPerfFut
|
||||||
|
| VPCondPres -- subj na "I may go"
|
||||||
|
| VPCondPast -- subj na "I may go"
|
||||||
|
;
|
||||||
|
|
||||||
|
{-
|
||||||
|
VPHForm =
|
||||||
|
VPTense VPPTense Aspect Agr -- 9 * 12
|
||||||
|
| VPReq
|
||||||
|
| VPImp
|
||||||
|
| VPReqFut
|
||||||
|
| VPInf
|
||||||
|
| VPStem
|
||||||
|
;
|
||||||
|
-}
|
||||||
|
|
||||||
|
VType = VIntrans | VTrans | VTransPost ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
objVType : VType -> NPCase = \vt ->
|
||||||
|
case vt of {
|
||||||
|
VTrans => NPObj ;
|
||||||
|
_ => NPC Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPH : Type = {
|
||||||
|
s : VerbForm => {inf : Str} ;
|
||||||
|
obj : {s : Str ; a : Agr} ;
|
||||||
|
subj : VType ;
|
||||||
|
comp : Agr => Str;
|
||||||
|
inf : Str;
|
||||||
|
ad : Str;
|
||||||
|
embComp : Str ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPHSlash = VPH ** {c2 : Compl} ;
|
||||||
|
Compl : Type = {s : Str ; c : VType} ;
|
||||||
|
|
||||||
|
predV : Verb -> VPH = \verb ->
|
||||||
|
{s = \\vf =>
|
||||||
|
case vf of {
|
||||||
|
VF t a pl p n g => {inf = verb.s ! VF t a pl p n g } ;
|
||||||
|
Root => {inf = verb.s ! Root } ;
|
||||||
|
Inf => {inf = verb.s ! Inf } ;
|
||||||
|
Imp => {inf = verb.s ! Imp } ;
|
||||||
|
PVForm => {inf = verb.s ! PVForm } ;
|
||||||
|
ProgRoot a n g => {inf = verb.s ! ProgRoot a n g }
|
||||||
|
};
|
||||||
|
obj = {s = [] ; a = defaultAgr} ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.s ! Inf;
|
||||||
|
ad = [];
|
||||||
|
embComp = [];
|
||||||
|
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} } ;
|
||||||
|
------------------------
|
||||||
|
-}
|
||||||
|
{-
|
||||||
|
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 {
|
||||||
|
VF NPresent _ pl p n g => {inf = copula CPrsnt pl n p g } ;
|
||||||
|
VF (NPast _) _ pl p n g => {inf = copula CPast pl n p g } ;
|
||||||
|
VF (NFuture _) _ pl p n g => {inf = copula CFuture pl n p g } ;
|
||||||
|
Root => { inf = verb.inf} ;
|
||||||
|
Inf => {inf = verb.inf} ;
|
||||||
|
Imp => {inf = verb.inf} ;
|
||||||
|
ProgRoot a n g => {inf = "" } ;
|
||||||
|
PVForm => {inf = ""}
|
||||||
|
};
|
||||||
|
obj = {s = [] ; a = defaultAgr} ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.inf;
|
||||||
|
ad = [];
|
||||||
|
embComp = [];
|
||||||
|
comp = \\_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Aux = {
|
||||||
|
inf,ppart,prpart : Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
auxBe : Aux = {
|
||||||
|
inf = "" ;
|
||||||
|
ppart = "" ;
|
||||||
|
prpart = ""
|
||||||
|
} ;
|
||||||
|
|
||||||
|
raha : VTense -> Aspect -> Gender -> Number -> NPerson -> {s:Str} = \t,a,g,n,p -> {
|
||||||
|
s = case <t,a,g,n,p> of {
|
||||||
|
<NPresent,Perf,Masc,Sg,Pers1> => "i:rhnx:" ;
|
||||||
|
<_,_,_,_,_> => "i:rhnx:"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
predProg : VPH -> VPH = \verb -> {
|
||||||
|
s = \\vh =>
|
||||||
|
case vh of {
|
||||||
|
VF NPresent a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CPrsnt pl n p g } ;
|
||||||
|
VF (NPast _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CPast pl n p g } ;
|
||||||
|
VF (NFuture _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CFuture pl n p g } ;
|
||||||
|
Root => {inf = (verb.s ! Root).inf } ;
|
||||||
|
Inf => {inf = (verb.s ! ProgRoot Imperf Sg Masc).inf } ;
|
||||||
|
Imp => {inf = (verb.s ! Imp).inf } ;
|
||||||
|
PVForm => {inf = (verb.s ! PVForm).inf } ;
|
||||||
|
ProgRoot a n g => {inf = (verb.s ! ProgRoot a n g).inf }
|
||||||
|
};
|
||||||
|
obj = verb.obj ;
|
||||||
|
subj = VIntrans ;
|
||||||
|
inf = verb.inf;
|
||||||
|
ad = verb.ad;
|
||||||
|
embComp = verb.embComp;
|
||||||
|
comp = verb.comp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
|
||||||
|
|
||||||
|
-- TODO, ERGATIVE CASE FROM NOUN INFLETION
|
||||||
|
mkClause : NP -> VPH -> Clause = \np,vp -> {
|
||||||
|
s = \\vt,b,ord =>
|
||||||
|
let
|
||||||
|
subjagr : NPCase * Agr = case vt of {
|
||||||
|
VPSmplPast => case vp.subj of {
|
||||||
|
VTrans => <NPErg, vp.obj.a> ;
|
||||||
|
VTransPost => <NPErg, defaultAgr> ;
|
||||||
|
_ => <NPC Nom, np.a>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
VPPerfPast => case vp.subj of {
|
||||||
|
VTrans => <NPErg, vp.obj.a> ;
|
||||||
|
VTransPost => <NPErg, defaultAgr> ;
|
||||||
|
_ => <NPC Nom, np.a>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
_ => <NPC Nom, np.a>
|
||||||
|
} ;
|
||||||
|
subj = subjagr.p1 ;
|
||||||
|
agr = subjagr.p2 ;
|
||||||
|
n = (fromAgr agr).n;
|
||||||
|
p = (fromAgr agr).p;
|
||||||
|
g = (fromAgr agr).g;
|
||||||
|
vps = case <vt,b> of {
|
||||||
|
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
|
||||||
|
<VPGenPres,Neg> => vp.s ! VF NPresent Imperf Neg p n g ;
|
||||||
|
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ;
|
||||||
|
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ;
|
||||||
|
|
||||||
|
<VPPerfPres,Pos> => vp.s ! VF NPresent Perf Pos p n g ;
|
||||||
|
<VPPerfPres,Neg> => vp.s ! VF NPresent Perf Neg p n g ;
|
||||||
|
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ;
|
||||||
|
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ;
|
||||||
|
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ;
|
||||||
|
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ;
|
||||||
|
|
||||||
|
<VPCondPres, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPres, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPCondPast, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPast, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
{-
|
||||||
|
<_, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<_, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
-}
|
||||||
|
};
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "ke" };
|
||||||
|
|
||||||
|
in
|
||||||
|
quest ++ np.s ! subj ++ vp.ad ++ vp.obj.s ++ vp.comp ! np.a ++ vps.inf ++ vp.embComp
|
||||||
|
--quest ++ np.s ! subj ++ vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps.inf ++ 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,b> of {
|
||||||
|
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
|
||||||
|
<VPGenPres,Neg> => vp.s ! VF NPresent Imperf Neg p n g ;
|
||||||
|
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ;
|
||||||
|
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ;
|
||||||
|
|
||||||
|
<VPPerfPres,Pos> => vp.s ! VF NPresent Perf Pos p n g ;
|
||||||
|
<VPPerfPres,Neg> => vp.s ! VF NPresent Perf Neg p n g ;
|
||||||
|
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ;
|
||||||
|
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ;
|
||||||
|
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ;
|
||||||
|
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ;
|
||||||
|
|
||||||
|
<VPCondPres, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPres, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
|
||||||
|
<VPCondPast, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<VPCondPast, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
{-
|
||||||
|
<_, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
|
||||||
|
<_, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
|
||||||
|
-}
|
||||||
|
};
|
||||||
|
|
||||||
|
quest =
|
||||||
|
case ord of
|
||||||
|
{ ODir => [];
|
||||||
|
OQuest => "ke" };
|
||||||
|
|
||||||
|
in
|
||||||
|
quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ vps.inf ++ vp.embComp
|
||||||
|
-- quest ++ subj ++ vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vps.inf ++ 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;
|
||||||
|
comp = \\a => vp.comp ! a ++ obj1 ! a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
insertVV : {s:Agr => 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;
|
||||||
|
-- comp = \\a => vp.comp ! a ++ obj1.s ! a
|
||||||
|
comp = \\a => obj1.s ! a ++ vp.comp ! a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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;
|
||||||
|
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 -> {s:Agr => Str} = \isAux,vp ->
|
||||||
|
{s= \\a => vp.obj.s ++ (vp.s! PVForm).inf ++ vp.comp ! a };
|
||||||
|
|
||||||
|
infVV : VPH -> {s:Agr => Str} = \vp -> {
|
||||||
|
s = \\ agr => vp.comp ! agr ++ (vp.s ! PVForm) . inf
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
infV2V : VPH -> {s :Agr => Str} = \vp -> {
|
||||||
|
s = \\agr => vp.comp ! agr ++ (vp.s ! PVForm).inf --++ "lai:"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||||
|
s = vps.s ;
|
||||||
|
obj = {s = np.s ! objVType vps.c2.c ++ vps.c2.s ++ vps.obj.s ; a = np.a} ;
|
||||||
|
-- obj = {s = vps.obj.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;
|
||||||
|
comp = vps.comp
|
||||||
|
-- comp = \\a => vps.comp ! a ++ np.s ! (objVType vps.c2.c) ++ vps.c2.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
comp = vp.comp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
conjThat : Str = "kI" ; -- की
|
||||||
|
|
||||||
|
{-
|
||||||
|
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;
|
||||||
|
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
|
||||||
|
} ;
|
||||||
|
ad = vp.ad;
|
||||||
|
embComp = vp.embComp ;
|
||||||
|
comp = vp.comp
|
||||||
|
} ;
|
||||||
|
}
|
||||||
107
lib/src/nepali/src/SentenceNep.gf
Normal file
107
lib/src/nepali/src/SentenceNep.gf
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
concrete SentenceNep of Sentence = CatNep ** open Prelude, ResNep 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_M ;
|
||||||
|
verb = vp.obj.s ++ (vp.s! PVForm).inf ++ vp.comp ! agr ;
|
||||||
|
dont = case pol of {
|
||||||
|
CNeg True => "ngr" ;
|
||||||
|
CNeg False => "ngr" ;
|
||||||
|
_ => []
|
||||||
|
}
|
||||||
|
in
|
||||||
|
dont ++ verb
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SlashVP np vp =
|
||||||
|
mkClause np vp ** {c2 = vp.c2} ;
|
||||||
|
|
||||||
|
AdvSlash slash adv = {
|
||||||
|
s = \\t,p,o => adv.s ++ 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 = vp.obj.s ++ (vp.s! PVForm).inf ++ vp.comp ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! ODir;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ cl.s ! VPCondPast ! p.p ! ODir
|
||||||
|
|
||||||
|
};
|
||||||
|
} ;
|
||||||
|
|
||||||
|
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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! q;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ cl.s ! VPCondPast ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! ODir ! q;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ rcl.s ! VPCondPast ! 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 ! VPSmplPast ! 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 ! VPCondPres ! p.p ! ODir;
|
||||||
|
<Cond,Anter> => temp.s ++ p.s ++ clslash.s ! VPCondPast ! p.p ! ODir
|
||||||
|
};
|
||||||
|
c2 = clslash.c2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvS a s = {s = a.s ++ s.s} ;
|
||||||
|
|
||||||
|
RelS s r = {s = s.s ++ r.s ! agrP3 Masc Sg} ;
|
||||||
|
SSubjS s sj s = { s = s.s ++ sj.s ++ s.s};
|
||||||
|
|
||||||
|
}
|
||||||
131
lib/src/nepali/src/StructuralNep.gf
Normal file
131
lib/src/nepali/src/StructuralNep.gf
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
concrete StructuralNep of Structural = CatNep **
|
||||||
|
open MorphoNep, ParadigmsNep, Prelude, NounNep in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
above_Prep = mkPrep "maTi" ; -- माथि
|
||||||
|
after_Prep = mkPrep "pci" ; -- पछि
|
||||||
|
all_Predet = ss "sbE" ; -- सबै (adj)
|
||||||
|
almost_AdA = mkAdA "JNx:xE" ;
|
||||||
|
almost_AdN = mkAdN "JNx:xE" ; -- JNx:xE (Adv) झण्डै
|
||||||
|
although_Subj = ss "tEpni" ; -- तैपनि (conj)
|
||||||
|
always_AdV = mkAdV "sDEV" ; -- सधैँ
|
||||||
|
and_Conj = sd2 [] "r" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "kinBne" ; -- किनभने
|
||||||
|
before_Prep = mkPrep "HGi" ; -- अघि
|
||||||
|
behind_Prep = mkPrep "pci" ; -- पछि
|
||||||
|
between_Prep = mkPrep "biC" ; -- बिच
|
||||||
|
both7and_DConj = sd2 "dubE" "r" ** {n = Pl} ; -- दुबै र
|
||||||
|
but_PConj = ss "tr" ; -- तर
|
||||||
|
by8agent_Prep = mkPrep "lai:" ; --
|
||||||
|
by8means_Prep = mkPrep "le" ;
|
||||||
|
can8know_VV,can_VV = mkV "skx:nu" ** { isAux = True} ;
|
||||||
|
during_Prep = mkPrep "prx:yanx:t" ; -- पर्यान्त
|
||||||
|
either7or_DConj = sd2 "HTva" "ya" ** {n = Sg} ; -- अथवा , या
|
||||||
|
everybody_NP = MassNP (UseN (regN "svw jana")) ; -- not a good way coz need to include Noun (सवौ जाना)
|
||||||
|
every_Det = mkDet "sbE" "hrek" Sg ; -- सबै, हरेक
|
||||||
|
everything_NP = MassNP (UseN (regN "harek kura")) ; -- हारेक कुरा
|
||||||
|
everywhere_Adv = mkAdv "jata ttE" ; -- जाता ततै
|
||||||
|
few_Det = mkDet "TorE" "HliktI" Pl ; -- थोरै, अलिकती
|
||||||
|
-- d first_Ord = {s = "pehla" ; n = Sg} ; --DEPRECATED
|
||||||
|
for_Prep = mkPrep "lagi" ; -- लागि
|
||||||
|
from_Prep = mkPrep "baq" ; -- बाट
|
||||||
|
|
||||||
|
i_Pron = mkPron "m" "mero" Sg Masc Pers1 ; -- म, मेरो
|
||||||
|
we_Pron = mkPron "hamIhru" "hamIhruko" Pl Masc Pers1 ; -- हामीहरु, हामीहरुको
|
||||||
|
he_Pron = mkPron "f" "fsx:laI:" "fsx:le" "fsx:laI:" "fsbaq" "fsx:ma" "fsx:ko" Sg Masc Pers3_L; --उ, उस्लाई, उस्ले, उस्लाई, उसवाट, उस्मा, उस्को
|
||||||
|
she_Pron = mkPron "fnI" "fnx:laI:" "fnx:le" "fnx:laI:" "fnbaq" "fnx:ma" "fnx:ko" Sg Fem Pers3_M ; -- उनी , उन्को
|
||||||
|
youSg_Pron = mkPron "timI" "timx:ro" Sg Masc Pers2_M ; -- तिमी, तिम्रो
|
||||||
|
youPl_Pron = mkPron "timIhru" "timIhruko" Pl Masc Pers2_M ; -- तिमीहरु, तिमीहरुको
|
||||||
|
youPol_Pron = mkPron "tpaI:" "tpaI:hruko" Sg Masc Pers2_H ; -- तपाई, तपाईहरुको
|
||||||
|
they_Pron = mkPron "fnIhru" "fnihruko" Pl Masc Pers3_L ; -- उनिहरु, उनिहरुको
|
||||||
|
it_Pron = mkPron "yo" "yslaI:" "yesle" "yslaI:" "ysbaq" "ysma" "usx:ko" Sg Masc Pers3_L; -- यो, यसलाई, यसले, यसलाई, यसबाट, यसमा, उस्को
|
||||||
|
|
||||||
|
here_Adv = mkAdv "yhaV" ; -- यहाँ
|
||||||
|
here7to_Adv = mkAdv ["yhaV smx:m"] ; -- यहाँ सम्म
|
||||||
|
here7from_Adv = mkAdv ["yhaV baq"] ; -- यहाँ बाट
|
||||||
|
how_IAdv = ss "ksrI" ; -- कसरी
|
||||||
|
how8much_IAdv = ss "ktI" ; -- कती
|
||||||
|
--how8many_IDet = mkDet "ktI vqa" "ktI vqI" Pl ; -- काती वटा, कती वटी (incase of humans it becomes, 'kati jana') NEEDS FIX
|
||||||
|
if_Subj = ss "ydi" ; -- यदि
|
||||||
|
in8front_Prep = mkPrep "samu" ; -- सामु
|
||||||
|
in_Prep = mkPrep "ma" ; -- मा
|
||||||
|
less_CAdv = {s = "km" ; p = "Bnx:da"} ; -- ?? NOT CLEAR
|
||||||
|
many_Det = mkDet "DerE" "Tupx:rE" Pl ; -- धेरै, थुप्रै
|
||||||
|
more_CAdv = {s = "bXI" ; p = "Bnx:da" } ;
|
||||||
|
most_Predet = ss "jx:yadE" ; -- ज्यादै
|
||||||
|
much_Det = mkDet "nikx:kE" "besrI" Sg ; --
|
||||||
|
must_VV = mkV "HvSx:y" ** { isAux = True} ; -- अवश्य
|
||||||
|
-- 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
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
-- d no_Phr = ss "hunx:n" ; -- हुन्न
|
||||||
|
no_Utt = ss "hoI:n" ; -- होईन
|
||||||
|
on_Prep = mkPrep "ma" ; -- मा
|
||||||
|
-- d one_Quant = mkQuant "e:k" "e:k" ; -- DEPRECATED
|
||||||
|
only_Predet = ss "matx:r" ; -- मात्र
|
||||||
|
or_Conj = sd2 [] "HTva" ** {n = Sg} ; -- अथवा
|
||||||
|
otherwise_PConj = ss "Hnx:yTa" ; -- अन्यथा
|
||||||
|
part_Prep = mkPrep "Bag" ; -- भाग
|
||||||
|
please_Voc = ss "kRpya" ; -- कृपया
|
||||||
|
possess_Prep = mkPrep "DarNa grx:nu" ; -- धारणा गर्नु
|
||||||
|
quite_Adv = ss "e:kdm" ; -- एकदम
|
||||||
|
so_AdA = mkAdA "ys karN" ; -- यस कारण ???? NEED TO CHECK
|
||||||
|
somebody_NP = MassNP (UseN (regN "kohI")); -- कोही
|
||||||
|
someSg_Det = mkDet "kohI" "kehI" Sg ;
|
||||||
|
somePl_Det = mkDet "kohI" "kehI" Pl ;
|
||||||
|
something_NP = MassNP (UseN (regN "kehI kura")) ;
|
||||||
|
somewhere_Adv = mkAdv "khIM" ; -- कहीं
|
||||||
|
that_Quant = mkQuant "tx:ye" "yinIhru" ;
|
||||||
|
that_Subj = ss "tx:yo"; -- त्यो
|
||||||
|
there_Adv = mkAdv "tx:yhaV" ; -- त्यहाँ
|
||||||
|
there7to_Adv = mkAdv "tx:yhaV smx:m" ; -- त्यहाँ सम्म
|
||||||
|
there7from_Adv = mkAdv "tx:yhaV baq" ; -- त्यहाँ बाट
|
||||||
|
therefore_PConj = ss "Hth:" ; -- अतः
|
||||||
|
this_Quant = mkQuant "yo" "yi" ;
|
||||||
|
through_Prep = mkPrep "marx:Pt" ; -- मार्फत
|
||||||
|
too_AdA = mkAdA "pni" ; -- पनि
|
||||||
|
to_Prep = ss "smx:m" ; --
|
||||||
|
under_Prep = mkPrep "Hnx:trx:gt" ; -- अन्तर्गत
|
||||||
|
very_AdA = mkAdA "DerE" ; -- धेरै
|
||||||
|
want_VV = mkV "Cahnu" ** { isAux = False} ;
|
||||||
|
whatSg_IP = mkIP "ke" "ke" "ke" "" Sg ;
|
||||||
|
whatPl_IP = mkIP "ke" "ke" "ke" "" Pl ;
|
||||||
|
when_IAdv = ss "khile" ; -- कहिले
|
||||||
|
when_Subj = ss "khile" ;
|
||||||
|
where_IAdv = ss "khaV" ; -- कहाँ
|
||||||
|
which_IQuant = {s = table {Sg => "kun" ; Pl => "kun" } }; -- कुन
|
||||||
|
-- d whichPl_IDet = {s = "kun" ; n = Sg} ;
|
||||||
|
-- d whichSg_IDet = {s = "kun" ; n = Pl} ;
|
||||||
|
whoSg_IP = mkIP "ko" "kaslaI:" "ksko" "" Sg ;
|
||||||
|
whoPl_IP = mkIP "ko" "kaslaI:" "ksko" "" Pl ;
|
||||||
|
why_IAdv = ss "kin" ; -- किन
|
||||||
|
without_Prep = mkPrep "vina" ; -- विना
|
||||||
|
with_Prep = mkPrep "sVg" ; -- सँग
|
||||||
|
-- d yes_Phr = ss "hjur" ; -- हजुर
|
||||||
|
yes_Utt = ss "hjur" ;
|
||||||
|
no_Quant = mkQuant "hEn" "hEnE" ;
|
||||||
|
not_Predet = {s="hEn"} ; -- हैन
|
||||||
|
if_then_Conj = sd2 "ydi" "Bne" ** {n = Sg} ; -- यदि भने
|
||||||
|
at_least_AdN = mkAdN "kmsekm" ; -- कमसेकम
|
||||||
|
at_most_AdN = mkAdN "bXIma" ; -- बढीमा
|
||||||
|
nothing_NP = MassNP (UseN (regN "kehI pnI")) ; -- केही पनी
|
||||||
|
nobody_NP = MassNP (UseN (regN "kehI pnI")) ; --कोही पनी
|
||||||
|
except_Prep = mkPrep "bahek" ; -- बाहेक
|
||||||
|
as_CAdv = {s = "jtx:tIkE" ; p = ""} ; -- जत्तीकै
|
||||||
|
have_V2 = mkV2 (mkV "hunu") "" ; -- हुनु
|
||||||
|
language_title_Utt = ss "nepalI" ; -- नेपाली
|
||||||
|
}
|
||||||
46
lib/src/nepali/src/SymbolNep.gf
Normal file
46
lib/src/nepali/src/SymbolNep.gf
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
concrete SymbolNep of Symbol = CatNep ** open Prelude, ResNep in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
|
||||||
|
lin
|
||||||
|
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 ! Nom ++ i.s ;
|
||||||
|
a = agrP3 cn.g Sg
|
||||||
|
} ;
|
||||||
|
CNSymbNP det cn xs = {
|
||||||
|
s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Nom ++ xs.s ;
|
||||||
|
a = agrP3 cn.g det.n
|
||||||
|
} ;
|
||||||
|
CNNumNP cn i = {
|
||||||
|
s = \\c => cn.s ! Sg ! Nom ++ i.s ;
|
||||||
|
a = agrP3 cn.g Sg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SymbS sy = sy ;
|
||||||
|
SymbNum sy = { s = sy.s ; n = Pl } ;
|
||||||
|
SymbOrd sy = { s = sy.s ++ "wV" ; n = Pl} ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
|
||||||
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
MkSymb s = s ;
|
||||||
|
|
||||||
|
BaseSymb = infixSS "r" ;
|
||||||
|
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" } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
73
lib/src/nepali/src/VerbNep.gf
Normal file
73
lib/src/nepali/src/VerbNep.gf
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
concrete VerbNep of Verb = CatNep ** open ResNep in {
|
||||||
|
|
||||||
|
flags coding = utf8;
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseV v = predV v ;
|
||||||
|
|
||||||
|
SlashV2a v = predV v ** {c2 = {s = v.c2.s ; c = VTrans}} ;
|
||||||
|
|
||||||
|
-- use of these two functions
|
||||||
|
Slash2V3 v np =
|
||||||
|
insertObjc (\\_ => np.s ! NPObj ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ; -- NEEDS CHECKING
|
||||||
|
|
||||||
|
Slash3V3 v np =
|
||||||
|
insertObjc (\\_ => np.s ! NPC Nom ++ v.c3) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ;
|
||||||
|
|
||||||
|
|
||||||
|
ComplVV v vp = insertTrans (insertVV (infVV 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) ;
|
||||||
|
|
||||||
|
-- Need check for 'bhayo' inflection (past)
|
||||||
|
-- cc -all PredVP (MassNP (UseN cat_N)) (ComplVA become_VA (PositA red_A))
|
||||||
|
ComplVA v ap = insertObj (\\a => ap.s ! giveNumber a ! giveGender a) (predV v) ;
|
||||||
|
|
||||||
|
--cc -table PredVP (MassNP (UseN cat_N)) (ComplSlash (SlashV2V beg_V2V (UseV sleep_V)) (MassNP (UseN dog_N)))
|
||||||
|
SlashV2V v vp = insertVV (infV2V vp) (predV v) vp.embComp vp ** {c2 = {s = v.c1 ; c = VTrans}} ; -- 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 = "laI:" ; c = VTransPost}}) ;
|
||||||
|
|
||||||
|
SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = "sVg" ; c = VTransPost}}) ; -- chek for VTransPost, as in this case , case should be ergative but agrement should be default
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (MassNP (UseN dog_N)))
|
||||||
|
SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ) (predV v ** {c2 = {s = v.c2.s ; c = VTrans}}) ;
|
||||||
|
|
||||||
|
ComplSlash vp np = insertObject np vp ;
|
||||||
|
|
||||||
|
SlashVV vv vp =
|
||||||
|
insertEmbCompl (insertObj (infVP vv.isAux vp).s (predV vv)) vp.embComp **
|
||||||
|
{c2 = vp.c2} ;
|
||||||
|
|
||||||
|
SlashV2VNP vv np vp =
|
||||||
|
insertObjPre (\\_ => np.s ! NPObj )
|
||||||
|
(insertObjc (infVP vv.isAux vp).s (predVc vv)) **
|
||||||
|
{c2 = vp.c2} ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (UseComp (CompAdv there_Adv))
|
||||||
|
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (AdvVP (UseV sleep_V) there_Adv)
|
||||||
|
AdvVP vp adv = insertObj (\\_ => adv.s ) vp ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (AdVVP always_AdV (UseV sleep_V))
|
||||||
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (ReflVP (SlashV2a eat_V2))
|
||||||
|
ReflVP v = insertObjPre (\\_ => reflPron) v ;
|
||||||
|
|
||||||
|
PassV2 v = predV v ; -- need to be fixed
|
||||||
|
|
||||||
|
CompAP ap = {s = \\a => ap.s ! giveNumber a ! giveGender a } ;
|
||||||
|
|
||||||
|
CompNP np = {s = \\_ => np.s ! NPObj} ;
|
||||||
|
CompCN cn = {s = \\a => cn.s ! giveNumber a ! Nom} ;
|
||||||
|
|
||||||
|
-- cc -table PredVP (MassNP (UseN cat_N)) (UseComp (CompAdv there_Adv))
|
||||||
|
CompAdv adv = {s = \\a => adv.s } ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
14
lib/src/nepali/translit.gfs
Normal file
14
lib/src/nepali/translit.gfs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
rf -file=src/AdjectiveNep.gf | ps -env=quotes -to_devanagari | wf -file=AdjectiveNep.gf
|
||||||
|
rf -file=src/LexiconNep.gf | ps -env=quotes -to_devanagari | wf -file=LexiconNep.gf
|
||||||
|
rf -file=src/MorphoNep.gf | ps -env=quotes -to_devanagari | wf -file=MorphoNep.gf
|
||||||
|
rf -file=src/ResNep.gf | ps -env=quotes -to_devanagari | wf -file=ResNep.gf
|
||||||
|
rf -file=src/StructuralNep.gf | ps -env=quotes -to_devanagari | wf -file=StructuralNep.gf
|
||||||
|
rf -file=src/AdverbNep.gf | ps -env=quotes -to_devanagari | wf -file=AdverbNep.gf
|
||||||
|
rf -file=src/QuestionNep.gf | ps -env=quotes -to_devanagari | wf -file=QuestionNep.gf
|
||||||
|
rf -file=src/NumeralNep.gf | ps -env=quotes -to_devanagari | wf -file=NumeralNep.gf
|
||||||
|
rf -file=src/RelativeNep.gf | ps -env=quotes -to_devanagari | wf -file=RelativeNep.gf
|
||||||
|
rf -file=src/IdiomNep.gf | ps -env=quotes -to_devanagari | wf -file=IdiomNep.gf
|
||||||
|
rf -file=src/SymbolNep.gf | ps -env=quotes -to_devanagari | wf -file=SymbolNep.gf
|
||||||
|
rf -file=src/VerbNep.gf | ps -env=quotes -to_devanagari | wf -file=VerbNep.gf
|
||||||
|
rf -file=src/SentenceNep.gf | ps -env=quotes -to_devanagari | wf -file=SentenceNep.gf
|
||||||
|
rf -file=src/PhraseNep.gf | ps -env=quotes -to_devanagari | wf -file=PhraseNep.gf
|
||||||
Reference in New Issue
Block a user