From 67c804d9a8740f13571b4c8708d0495eeec950d3 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 14 Jun 2011 11:19:59 +0000 Subject: [PATCH] Nepali resource by Dinesh Simk - almost complete --- lib/src/nepali/AdjectiveNep.gf | 68 ++ lib/src/nepali/AdverbNep.gf | 24 + lib/src/nepali/AllNep.gf | 6 + lib/src/nepali/AllNepAbs.gf | 4 + lib/src/nepali/CatNep.gf | 99 +++ lib/src/nepali/CombinatorsNep.gf | 6 + lib/src/nepali/ConjunctionNep.gf | 42 ++ lib/src/nepali/ConstructorsNep.gf | 3 + lib/src/nepali/Coordination.gf | 170 +++++ lib/src/nepali/GrammarNep.gf | 24 + lib/src/nepali/IdiomNep.gf | 39 ++ lib/src/nepali/LangNep.gf | 10 + lib/src/nepali/LexiconNep.gf | 371 +++++++++++ lib/src/nepali/MorphoNep.gf | 894 +++++++++++++++++++++++++++ lib/src/nepali/NounNep.gf | 137 ++++ lib/src/nepali/NumeralNep.gf | 118 ++++ lib/src/nepali/ParadigmsNep.gf | 222 +++++++ lib/src/nepali/PhraseNep.gf | 32 + lib/src/nepali/QuestionNep.gf | 83 +++ lib/src/nepali/README | 9 + lib/src/nepali/RelativeNep.gf | 63 ++ lib/src/nepali/ResNep.gf | 713 +++++++++++++++++++++ lib/src/nepali/SentenceNep.gf | 107 ++++ lib/src/nepali/StructuralNep.gf | 131 ++++ lib/src/nepali/SymbolNep.gf | 46 ++ lib/src/nepali/SyntaxNep.gf | 5 + lib/src/nepali/TransliterationNep.gf | 20 + lib/src/nepali/TryNep.gf | 21 + lib/src/nepali/VerbNep.gf | 73 +++ lib/src/nepali/src/AdjectiveNep.gf | 68 ++ lib/src/nepali/src/AdverbNep.gf | 24 + lib/src/nepali/src/IdiomNep.gf | 39 ++ lib/src/nepali/src/LexiconNep.gf | 371 +++++++++++ lib/src/nepali/src/MorphoNep.gf | 894 +++++++++++++++++++++++++++ lib/src/nepali/src/NumeralNep.gf | 118 ++++ lib/src/nepali/src/PhraseNep.gf | 32 + lib/src/nepali/src/QuestionNep.gf | 83 +++ lib/src/nepali/src/RelativeNep.gf | 63 ++ lib/src/nepali/src/ResNep.gf | 709 +++++++++++++++++++++ lib/src/nepali/src/SentenceNep.gf | 107 ++++ lib/src/nepali/src/StructuralNep.gf | 131 ++++ lib/src/nepali/src/SymbolNep.gf | 46 ++ lib/src/nepali/src/VerbNep.gf | 73 +++ lib/src/nepali/translit.gfs | 14 + 44 files changed, 6312 insertions(+) create mode 100644 lib/src/nepali/AdjectiveNep.gf create mode 100644 lib/src/nepali/AdverbNep.gf create mode 100644 lib/src/nepali/AllNep.gf create mode 100644 lib/src/nepali/AllNepAbs.gf create mode 100644 lib/src/nepali/CatNep.gf create mode 100644 lib/src/nepali/CombinatorsNep.gf create mode 100644 lib/src/nepali/ConjunctionNep.gf create mode 100644 lib/src/nepali/ConstructorsNep.gf create mode 100644 lib/src/nepali/Coordination.gf create mode 100644 lib/src/nepali/GrammarNep.gf create mode 100644 lib/src/nepali/IdiomNep.gf create mode 100644 lib/src/nepali/LangNep.gf create mode 100644 lib/src/nepali/LexiconNep.gf create mode 100644 lib/src/nepali/MorphoNep.gf create mode 100644 lib/src/nepali/NounNep.gf create mode 100644 lib/src/nepali/NumeralNep.gf create mode 100644 lib/src/nepali/ParadigmsNep.gf create mode 100644 lib/src/nepali/PhraseNep.gf create mode 100644 lib/src/nepali/QuestionNep.gf create mode 100644 lib/src/nepali/README create mode 100644 lib/src/nepali/RelativeNep.gf create mode 100644 lib/src/nepali/ResNep.gf create mode 100644 lib/src/nepali/SentenceNep.gf create mode 100644 lib/src/nepali/StructuralNep.gf create mode 100644 lib/src/nepali/SymbolNep.gf create mode 100644 lib/src/nepali/SyntaxNep.gf create mode 100644 lib/src/nepali/TransliterationNep.gf create mode 100644 lib/src/nepali/TryNep.gf create mode 100644 lib/src/nepali/VerbNep.gf create mode 100644 lib/src/nepali/src/AdjectiveNep.gf create mode 100644 lib/src/nepali/src/AdverbNep.gf create mode 100644 lib/src/nepali/src/IdiomNep.gf create mode 100644 lib/src/nepali/src/LexiconNep.gf create mode 100644 lib/src/nepali/src/MorphoNep.gf create mode 100644 lib/src/nepali/src/NumeralNep.gf create mode 100644 lib/src/nepali/src/PhraseNep.gf create mode 100644 lib/src/nepali/src/QuestionNep.gf create mode 100644 lib/src/nepali/src/RelativeNep.gf create mode 100644 lib/src/nepali/src/ResNep.gf create mode 100644 lib/src/nepali/src/SentenceNep.gf create mode 100644 lib/src/nepali/src/StructuralNep.gf create mode 100644 lib/src/nepali/src/SymbolNep.gf create mode 100644 lib/src/nepali/src/VerbNep.gf create mode 100644 lib/src/nepali/translit.gfs diff --git a/lib/src/nepali/AdjectiveNep.gf b/lib/src/nepali/AdjectiveNep.gf new file mode 100644 index 000000000..1e11ce3b3 --- /dev/null +++ b/lib/src/nepali/AdjectiveNep.gf @@ -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 ; + } ; + +} diff --git a/lib/src/nepali/AdverbNep.gf b/lib/src/nepali/AdverbNep.gf new file mode 100644 index 000000000..0caf5ab4e --- /dev/null +++ b/lib/src/nepali/AdverbNep.gf @@ -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} ; + +} diff --git a/lib/src/nepali/AllNep.gf b/lib/src/nepali/AllNep.gf new file mode 100644 index 000000000..ceef53c6f --- /dev/null +++ b/lib/src/nepali/AllNep.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common:../prelude + +concrete AllNep of AllNepAbs = + LangNep +-- ExtraNep + ** {} ; diff --git a/lib/src/nepali/AllNepAbs.gf b/lib/src/nepali/AllNepAbs.gf new file mode 100644 index 000000000..ed01a2614 --- /dev/null +++ b/lib/src/nepali/AllNepAbs.gf @@ -0,0 +1,4 @@ +abstract AllNepAbs = + Lang +-- ExtraPnbAbs + ** {} ; diff --git a/lib/src/nepali/CatNep.gf b/lib/src/nepali/CatNep.gf new file mode 100644 index 000000000..a2c43ca02 --- /dev/null +++ b/lib/src/nepali/CatNep.gf @@ -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} ; +} diff --git a/lib/src/nepali/CombinatorsNep.gf b/lib/src/nepali/CombinatorsNep.gf new file mode 100644 index 000000000..4e980ec96 --- /dev/null +++ b/lib/src/nepali/CombinatorsNep.gf @@ -0,0 +1,6 @@ +--# -path=.:alltenses:prelude + +resource CombinatorsNep = Combinators with + (Cat = CatNep), + (Structural = StructuralNep), + (Constructors = ConstructorsNep) ; diff --git a/lib/src/nepali/ConjunctionNep.gf b/lib/src/nepali/ConjunctionNep.gf new file mode 100644 index 000000000..94dd7d7c6 --- /dev/null +++ b/lib/src/nepali/ConjunctionNep.gf @@ -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}; + +} diff --git a/lib/src/nepali/ConstructorsNep.gf b/lib/src/nepali/ConstructorsNep.gf new file mode 100644 index 000000000..13b99179f --- /dev/null +++ b/lib/src/nepali/ConstructorsNep.gf @@ -0,0 +1,3 @@ +--# -path=.:alltenses:prelude + +resource ConstructorsNep = Constructors with (Grammar = GrammarNep) ; diff --git a/lib/src/nepali/Coordination.gf b/lib/src/nepali/Coordination.gf new file mode 100644 index 000000000..faa30ba7e --- /dev/null +++ b/lib/src/nepali/Coordination.gf @@ -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 + } ; + + +} ; diff --git a/lib/src/nepali/GrammarNep.gf b/lib/src/nepali/GrammarNep.gf new file mode 100644 index 000000000..afa074f55 --- /dev/null +++ b/lib/src/nepali/GrammarNep.gf @@ -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 ; + +} + + diff --git a/lib/src/nepali/IdiomNep.gf b/lib/src/nepali/IdiomNep.gf new file mode 100644 index 000000000..298a343fd --- /dev/null +++ b/lib/src/nepali/IdiomNep.gf @@ -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 ++ "देउ"} ; +} + diff --git a/lib/src/nepali/LangNep.gf b/lib/src/nepali/LangNep.gf new file mode 100644 index 000000000..b9d90e2e1 --- /dev/null +++ b/lib/src/nepali/LangNep.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common + +concrete LangNep of Lang = + GrammarNep, + LexiconNep + ** { + +flags startcat = Phr ; unlexer=unwords ; lexer=words ; + +} diff --git a/lib/src/nepali/LexiconNep.gf b/lib/src/nepali/LexiconNep.gf new file mode 100644 index 000000000..0c13e1dc1 --- /dev/null +++ b/lib/src/nepali/LexiconNep.gf @@ -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 = "लाई" ; + +} ; diff --git a/lib/src/nepali/MorphoNep.gf b/lib/src/nepali/MorphoNep.gf new file mode 100644 index 000000000..7700a2389 --- /dev/null +++ b/lib/src/nepali/MorphoNep.gf @@ -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 of { + => (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 of { + => root2 + "दै" ; + + => root2 + "िरहेको" ; + => root2 + "िरहेकि" ; + => root2 + "िरहेका" + }; + }; + + + mkProg1 : Str -> Aspect -> Number -> Gender -> {s : Str } = + \root,aspect,number,gender -> { + s = case of { + => root + "दै" ; + + => root + "इरहेको" ; + => root + "इरहेकि" ; + => 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 of { + -- Positive case + => root + "छु" ; -- छु + => root + "छौँ" ; -- छौं + => root + "छस्" ; -- छस् + => root + "छेस्" ; -- छेस् + => root + "छौ" ; -- छौ + => root + "छ्यौ" ; -- छ्यौ + => root + "छौ" ; -- छौ + => root + "छ" ; -- छ + => root + "छे" ; -- छे + => root + "छन्" ; -- छन् + => root + "छिन्" ; -- छिन् + => root + "छन्" ; -- छन् + => root + "नुहुन्छ" ; -- नुहुन्छ + + -- Negative Case + => root + "दिनँ" ; -- इनँ (पढ्दिनँ) + => root + "दैनैँ" ; -- ऐनैँ (पढ्दैनैँ) + => root + "दैनस्" ; -- ऐनस् (पढदैनस्) + => root + "दिनस्" ; -- इनस् (पढदिनस्) + => root + "दैनै" ; -- ऐनै + => root + "दिनै" ; -- इनै + => root + "दैनै" ; -- ऐनै + => root + "दैन" ; -- ऐन + => root + "दिन" ; -- इन + => root + "दैन्न" ; -- ऐनन् + => root + "दिन्न" ; -- इनन् + => root + "दैन्न" ; -- ऐनन् + => root + "नुहुन्न" -- नुहुन्न + } + } ; + + -- mkVPreNP Helper for VIRrg case + mkVPreNPIReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} = + \root, root1, po, pn, n, g -> + {s = case of { + -- Positive case + => root1 + "छु" ; -- छु + => root1 + "छौं" ; -- छौं + => root1 + "छस्" ; -- छस् + => root1 + "छेस्" ; -- छेस् + => root1 + "छौ" ; -- छौ + => root1 + "छ्यौ" ; -- छ्यौ + => root1 + "छौ" ; -- छौ + => root1 + "छ" ; -- छ + => root1 + "छे" ; -- छे + => root1 + "छन्" ; -- छन् + => root1 + "छिन्" ; -- छिन् + => root1 + "छन्" ; -- छन् + => root + "नुहुन्छ" ; -- नुहुन्छ + + -- Negative Case + => root + "ँदिनँ" ; -- इनँ (खाँदिनँ) + => root + "ँदैनैँ" ; -- ऐनैँ (खाँदैनैँ) + => root + "ँदैनस्" ; -- ऐनस् (आउँदैनस्) + => root + "ँदिनस्" ; -- इनस् (खाँदिनस्) + => root + "ँदैनै" ; -- ऐनै (खाँदैनै) + => root + "ँदिनै" ; -- इनै + => root + "ँदैनै" ; -- ऐनै + => root + "ँदैन" ; -- ऐन + => root + "ँदिन" ; -- इन (खाँदिन) + => root + "ँदैन्न" ; -- ऐनन् + => root + "ँदिन्न" ; -- इनन् + => root + "ँदैन्न" ; -- ऐनन् + => 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 of { + -- Positive case + => root2 + "ेँ" ; -- एँ + => root + "यौं" ; -- यौं + => root2 + "िस्" ; -- इस् + => root + "यौ" ; -- यौ + => root + "यौ" ; -- यौ + => root + "यो" ; -- यो + => root2 + "ी" ; -- इ (पढी) + => root2 + "े" ; -- ए (पढे) + => root2 + "िन्" ; -- इन् (पढिन्) + => root2 + "े" ; -- ए (पढे) + => root + "नुभयो" ; -- नुभयो + + -- Negative case + => root2 + "िनँ" ; -- इनँ + => root2 + "ेनैँ" ; -- एनैँ + => root2 + "िनस्" ; -- इनस् + => root2 + "ेनै" ; -- एनै + => root2 + "िनै" ; -- इनै + => root2 + "ेनै" ; -- एनै + => root2 + "ेन" ; -- एन + => root2 + "िन" ; -- इन (पढिन) + => root2 + "ेनन्" ; -- एनन् (पढेनन्) + => root2 + "िनन्" ; -- इनन् (पढिनन्) + => root2 + "ेनन्" ; -- एनन् (पढेनन्) + => root + "नुभएन" -- नुभएन + } + } ; + + -- mkVPstSNP Helper for VIRrg case + mkVPstSNPIReg : Str -> Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} = + \root, root2, po, pn, n, g -> + {s = case of { + -- Positive case + => root2 + "एँ" ; -- एँ + => root2 + "यौं" ; -- यौं + => root2 + "इस्" ; -- इस् + => root2 + "यौ" ; -- यौ + => root2 + "यौ" ; -- यौ + => root2 + "यो" ; -- यो + => root2 + "ई" ; -- ई + => root2 + "ए" ; -- ए + => root2 + "इन्" ; -- इन् + => root2 + "ए" ; -- ए + => root + "नुभयो" ; -- नुभयो + + -- Negative case + => root2 + "इनँ" ; -- इनँ + => root2 + "एनैँ" ; -- एनैँ + => root2 + "इनस्" ; -- इनस् + => root2 + "एनै" ; -- एनै + => root2 + "इनै" ; -- इनै + => root2 + "एनै" ; -- एनै + => root2 + "एन" ; -- एन + => root2 + "इन" ; -- इन (पढिन) + => root2 + "एनन्" ; -- एनन् (पढेनन्) + => root2 + "इनन्" ; -- इनन् (पढिनन्) + => root2 + "एनन्" ; -- एनन् (पढेनन्) + => 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 of { + => root + "थें" ; -- थें + => root + "थ्यौं" ; -- थ्यौं + => root + "थिस्" ; -- थिस् + => root + "थ्यौ" ; -- थ्यौ + => root + "थ्यौ" ; -- थ्यौ + => root + "थ्यो" ; -- थ्यो + => root + "थी" ; -- थी + => root + "थे" ; -- थे + => root + "थिन्" ; -- थिन् + => root + "थे" ; -- थे + => root1 + "नुहुन्‌थ्यो" ; -- नुहुन्‌थ्यो + + => root + neg + "थें" ; -- थें + => root + neg + "थ्यौं" ; -- थ्यौं + => root + neg + "थिस्" ; -- थिस् + => root + neg + "थ्यौ" ; -- थ्यौ + => root + neg + "थ्यौ" ; -- थ्यौ + => root + neg + "थ्यो" ; -- थ्यो + => root + neg + "थी" ; -- थी + => root + neg + "थे" ; -- थे + => root + neg + "थीन्" ; -- थिन् + => root + 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 of { + => root2 + "े" + na + "छु" ; -- एछु + => root2 + "ि" + na + "छु" ; -- इछु + => root2 + "े" + na + "छौँ" ; -- एछौँ + => root2 + "े" + na + "छस्" ; -- एछस् + => root2 + "ि" + na + "छस्" ; -- इछस् + => root2 + "े" + na + "छौ" ; -- एछौ + => root2 + "ि" + na + "छौ" ; -- इछौ + => root2 + "े" + na + "छौ" ; -- एछौ + => root2 + "े" + na + "छ" ; -- एछ + => root2 + "ि" + na + "छ" ; -- इछ + => root2 + "े" + na + "छन्" ; -- एछन् + => root2 + "ि" + na + "छन्" ; -- इछन् + => 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 of { + => root2 + "ए" + na + "छु" ; -- एछु + => root2 + "इ" + na + "छु" ; -- इछु + => root2 + "ए" + na + "छौँ" ; -- एछौँ + => root2 + "ए" + na + "छस्" ; -- एछस् + => root2 + "इ" + na + "छस्" ; -- इछस् + => root2 + "ए" + na + "छौ" ; -- एछौ + => root2 + "इ" + na + "छौ" ; -- इछौ + => root2 + "ए" + na + "छौ" ; -- एछौ + + => root2 + "ए" + na + "छ" ; -- एछ + => root2 + "इ" + na + "छ" ; -- इछ + => root2 + "ए" + na + "छन्" ; -- एछन् + => root2 + "इ" + na + "छन्" ; -- इछन् + => 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 of { + -- Positive case + => root + "नेछु" ; -- नेछु + => root + "नेछौं" ; -- नेछौं + => root + "नेछस्" ; -- नेछस् + => root + "नेछौं" ; -- नेछौ + => root + "नेछौं" ; -- नेछौ + => root + "नेछ" ; -- नेछ + => root + "नेछन्" ; -- नेछन् + => root + "नेछन्" ; -- नेछन् + => root + "नेछिन्" ; -- नेछिन् + => root + "नेछिन्" ; -- नेछन् + => root + "नुहुनेछ" ; -- नुहुनेछ + + -- Negative Case + => root + "नेछैन" ; -- नेछैन + => root + "नेछैनैँ" ; -- नेछैनैँ + => root + "नेछैनस्" ; -- नेछैनस् + => root + "नेछैनै" ; -- नेछैनै + => root + "नेछैनै" ; -- नेछैनै + => root + "नेछैन्" ; -- नेछैन् + => root + "नेछैनन्" ; -- नेछैनन् + => root + "नेछैनन्" ; -- नेछैनन् + => root + "नेछैनै" ; -- नेछैनै + => 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 of { + => root2 + "ुँला" ; -- उँला + => root2 + "ौँला" ; -- आँला + => root + "‍लास्" ; -- लास् + => root + "लीस्" ; -- लिस् + => root2 + "ौला" ; -- औला + => root2 + "ौलि" ; -- औलि + => root + "ला" ; -- ला + => root + "ली" ; -- ली + => root + "लान्" ; -- लान् + => root + "लीन्" ; -- लिन् + => root + "लान्" ; -- लान् + => root + "‍नुहोला" ; -- नुहोला + + -- TODO : NOT CLEAR DEFINITION IN BOOK + => "टुडु" + } + } ; + + -- mkVFutNDNP helper for VIReg case + mkVFutNDNPIReg : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} = + \root, po, pn, n, g -> + {s = case of { + => root + "उँला" ; -- उँला + => root + "औँला" ; -- आँला + => root + "लास्" ; -- लास् + => root + "लिस्" ; -- लिस् + => root + "औला" ; -- औला + => root + "औलि" ; -- औलि + => root + "ला" ; -- ला + => root + "ली" ; -- ली + => root + "लान्" ; -- लान् + => root + "लिन्" ; -- लिन् + => root + "लान्" ; -- लान् + => root + "नुहोला" ; -- नुहोला + + -- TODO : NOT CLEAR DEFINITION IN BOOK + => "टुडु" + } + } ; + + + +-- 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 of { + -- Positive case + => root + sreg + "थिएँ" ; -- थिएँ + => root + spl + "थियौँ" ; -- थियौँ + => root + sreg + "थिइस्" ; -- थिइस् + => root + sfem + "थिइस्" ; -- थिइस् + => root + spl + "थियौ" ; -- थियौ + => root + spl + "थियौ" ; -- थियौ + => root + sreg + "थियो" ; -- थियो + => root + sfem + "थिई" ; --थिई + => root + spl + "थिए" ; -- थिए + => root + sfem + "थिइन्" ; -- थिइन् + => root + spl + "थिए" ; -- थिए + => root + sreg + "हुनुहुन्‌थ्यो" ; -- हुनुहुन्‌थ्यो (TODO: CONFIRM CORRECT) + + -- Negative case + => root + sreg +"थिइनँ" ; -- + => root + spl + "थिएनैँ" ; -- + + => root + sreg + "थिइनस्" ; -- + => root + sfem + "थिइनस्" ; -- + => root + spl + "थिएनै" ; -- + => root + spl + "थिनै" ; -- + + => root + sreg + "थिएन" ; -- + => root + sfem + "थिइङ" ; -- + => root + spl + "थिएनन्" ; -- + => root + sfem + "थिइनन्" ; -- + => root + spl + "थिएनन्" ; -- + => 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 of { + => root + sreg + "हुन्थेँ" ; -- हुन्थेँ + => root + spl + "हुन्थौँ" ; -- हुन्थौँ + => root + sreg + "हुन्थिस्" ; -- हुन्थिस् + => root + sfem + "हुन्थइस्" ; -- हुन्थिस् + => root + spl + "हुन्थ्यौ" ; -- हुन्थ्यौ + => root + spl + "हुन्थ्यौ" ; -- हुन्थ्यौ + => root + sreg + "हुन्‌थ्यौ" ; -- हुन्‌थ्यौ + => root + sfem + "हुन्थी" ; -- हुन्थी + => root + spl + "हुन्थे" ; -- हुन्थे + => root + sfem + "हुन्‌थि" ; -- हुन्थि + => root + spl + "हुन्थे" ; -- हुन्थे + => root + sreg + "हुनुहुन्थ्यो" ; -- (TODO : हुनुहुन्थ्यो need to Confirm) + + -- Negative case (TODO) + => root + sreg + "हुन्थेँ" ; -- हुन्थेँ + => root + spl + "हुन्थौँ" ; -- हुन्थौँ + => root + sreg + "हुन्थिइस्" ; -- हुन्थिइस् ???? G Check + => root + sfem + "हुन्थिइस्" ; -- हुन्थिइस् + => root + spl + "हुन्थियौ" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw) + => root + spl + "हुन्थियौ" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw) + => root + sreg + "हुन्थ्यौ" ; -- हुन्थ्यौ / (थियो ????) + => root + sfem + "हुन्थी" ; -- हुन्थी/ (थिई ????) + => root + spl + "हुन्थे" ; -- हुन्थे / (थिए) + => root + sfem + "हुन्थि" ; -- हुन्थि + => root + spl + "हुन्थे" ; -- हुन्थे / (थिए) + => 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 of { + => root + sreg + "रहेछु" ; -- रहेछु + => root + sfem + "रहेछु" ; -- रहेछु (खाएकिरहेछु) + => root + spl + "रहेछौँ" ; -- रहेछौँ + => root + sreg + "रहिछस्" ; --रहिछस् + => root + sfem + "रहिछस्" ; --रहिछस् + => root + spl + "रहेछौ" ; -- रहेछौ + => root + spl + "रहेछौ" ; -- रहेछौ + => root + sfem + "रहिछौ" ; -- रहिछौ (छ्यौ ????) + => root + spl + "रहेछौ" ; -- रहेछौ + => root + sreg + "रहेछ" ; -- रहेछ + => root + sfem + "रहिछ" ; -- रहिछ + => root + spl + "रहेछन्" ; -- रहेछन् + => root + sfem + "रहिछीन्" ; -- रहिछीन् + => root + spl + "रहेछन्" ; -- रहेछन् + => root + spl + "रहेछन्" ; -- रहेछन् + => root + sreg + "हुनुहुदोरहेछ" ; -- हुनुहुदोरहेछ/नुभएकोरहेछ(nuBe:korhec) + + -- Negative Case (TODO) + => "टुडु" -- 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 of { + => root + sreg + "छु" ; -- छु + => root + spl + "छौं" ; -- छौं + => root + sreg + "छस्" ; -- छस् + => root + sfem + "छेस्" ; -- छेस् + => root + spl + "छौ" ; -- छौ + => root + sfem + "छ्यौ" ; --छ्यौ + => root + spl + "छौ" ; -- छौ + => root + sreg + "छ" ; -- छ + => root + sfem + "छे" ; -- छे + => root + spl + "छन्" ; -- छन् + => root + sfem + "छिन्" ; -- छिन् + => root + spl + "छन्" ; -- छन् + => root + sreg + "हुनुहुन्छ" ; -- हुनुहुन्छ + + -- Negative Case (TODO) + => "टुडु" -- 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 of { + => root + sreg + ("हुने"+"छु") ; -- हुनेछु + => root + spl + "हुनेछौँ" ; -- हुनेछौँ + => root + sreg + "हुनेछस्" ; -- हुनेछस् + => root + sfem + "हुनेछेस्" ; -- हुनेछेस् + => root + spl + "हुनेछौ" ; -- हुनेछौ + => root + sfem + "हुनेछ्यौ" ; -- हुनेछ्यौ + => root + spl + "हुनेछौ" ; -- हुनेछौ + => root + sreg + "हुनेछ" ; -- हुनेछ + => root + sfem + "हुन्छे" ; -- हुन्छे + => root + spl + "हुनेछन्" ; -- हुनेछन् + => root + sfem + "हुनेछिन्" ; -- हुनेछिन् + => root + spl + "हुनेछन्" ; -- हुनेछन् + => root + sreg + "हुनुहुनेछ" ; -- हुनुहुनेछ + + -- Negative Case (TODO) + => "टुडु" -- 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 of { + => root + sreg + "हुँला" ; -- हुँला + => root + spl + "हौँलाँ" ; -- हौँलाँ + => root + sreg + "होलास्" ; -- होलास् + => root + sfem + "होलिस्" ; -- होलिस् + => root + spl + "हौला" ; -- हौला + => root + sfem + "होलि" ; -- होलि + => root + spl + "हौला" ; -- हौला + => root + sreg + "होला" ; -- होला + => root + sfem + "होली" ; -- होली + => root + spl + "होलान्" ; -- होलान् + => root + sfem + "होलिन्" ; -- होलिन् + => root + spl + "होलान्" ; -- होलान् + => root + sreg + "हुनुहोला" ; -- हुनुहोला + + -- Negative Case (TODO) + => "टुडु" -- TODO-- + } + }; + + -- TODO - Refactor + IntPronForm = {s: Case => Str}; + mkIntPronForm : (x1,x2,x3,x4:Str) -> IntPronForm = + \y1,y2,y3,y4 -> { + s = table { + Nom => y1; + _ => y2 + } + }; + + } diff --git a/lib/src/nepali/NounNep.gf b/lib/src/nepali/NounNep.gf new file mode 100644 index 000000000..7428bd3e0 --- /dev/null +++ b/lib/src/nepali/NounNep.gf @@ -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} ; + +} diff --git a/lib/src/nepali/NumeralNep.gf b/lib/src/nepali/NumeralNep.gf new file mode 100644 index 000000000..3e59f577d --- /dev/null +++ b/lib/src/nepali/NumeralNep.gf @@ -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 ; +} diff --git a/lib/src/nepali/ParadigmsNep.gf b/lib/src/nepali/ParadigmsNep.gf new file mode 100644 index 000000000..9d6af011f --- /dev/null +++ b/lib/src/nepali/ParadigmsNep.gf @@ -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 ; + -} +} diff --git a/lib/src/nepali/PhraseNep.gf b/lib/src/nepali/PhraseNep.gf new file mode 100644 index 000000000..add4d7b43 --- /dev/null +++ b/lib/src/nepali/PhraseNep.gf @@ -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} ; + +} diff --git a/lib/src/nepali/QuestionNep.gf b/lib/src/nepali/QuestionNep.gf new file mode 100644 index 000000000..d61974cf6 --- /dev/null +++ b/lib/src/nepali/QuestionNep.gf @@ -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 ; + +} diff --git a/lib/src/nepali/README b/lib/src/nepali/README new file mode 100644 index 000000000..2874bfe7f --- /dev/null +++ b/lib/src/nepali/README @@ -0,0 +1,9 @@ +Some of the sources are transliterated, in + + ./src + +Before compilation, do + + gf -s "जस्तिकी" ++ 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 + } ; + +} diff --git a/lib/src/nepali/ResNep.gf b/lib/src/nepali/ResNep.gf new file mode 100644 index 000000000..c58b5688e --- /dev/null +++ b/lib/src/nepali/ResNep.gf @@ -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 of { + -- Resembles with "मकँफरेणफृेग" function for positive + -- => mkVPreNPReg "" Pos pn n g ; + -- Present Positive + => "छु" ; -- छु + => "छौं" ; -- छौं + => "छस्" ; -- छस् + => "छेस्" ; -- छेस् + => "छौ" ; -- छौ + => "छ्यौ" ; -- छ्यौ + => "छौ" ; -- छौ + => "छ" ; -- छ + => "छे" ; -- छे + => "छन्" ; -- छन् + => "छिन्" ; -- छिन् + => "छन्" ; -- छन् + => "हुनुहुन्छ" ; --हुनुहुन्छ + + -- Present Negative + => "छैनँ" ; -- छैनँ + => "छैनौं" ; -- छैनौं + => "छैनस्" ; -- छैनस् + => "छैनौ" ; -- छैनौ + => "छैनौ" ; -- छैनौ + => "छैन" ; --छैन + => "छैनन्" ; -- छैनन् + => "छैनन्" ; -- छैनन् + => "हुनुहुन्‌न" ; -- हुनुहुन्‌न + + -- Resemples with "मकँफसतशफघेन" case, should refactor to make it + -- take common function + + -- Past Positive + => "थिएँ" ; -- थिएँ + => "थियौँ" ; -- थियौँ + => "थिइस्" ; -- थिइस् + => "थियौ" ; -- थियौ + => "थियौ" ; -- थियौ + => "थियो" ; -- थियो + => "थिई" ; --थिई + => "थिए" ; -- थिए + => "थिइन्" ; -- थिइन् + => "थिए" ; -- थिए + => "हुनुहुन्‌थ्यो" ; -- हुनुहुन्‌थ्यो + + -- Past Positive + => "थिनँ" ; -- थिनँ + => "थेनौं" ; -- थेनौं + => "थिनस्" ; -- थिनस् + => "थेनौ" ; -- थेनौ + => "थेनौ" ; -- थेनौ + => "थेन" ; -- थेन + => "थिन" ; --थिन + => "थेनन्" ; -- थेनन् + => "थिनन्" ; -- थिनन् + => "थेनन्" ; -- थेनन् + => "हुनुहुन्‌नथ्यो" ; -- हुनुहुन्‌नथ्यो + + + -- Can be covered by the function "मकँऊुतधणफ" + -- Future Positive + => "हुनेछु" ; -- हुनेछु + => "हुनेछौं" ; -- हुनेछौं + => "हुनेछस्" ; -- हुनेछस् + => "हुनेछौं" ; -- हुनेछौ + => "हुनेछौं" ; -- हुनेछौ + => "हुनेछ" ; -- हुनेछ + => "हुनेछन्" ; -- हुनेछन् + => "हुनेछन्" ; -- हुनेछन् + => "हुनेछन्" ; -- हुनेछिन् + => "हुनेछन्" ; -- हुनेछन् + => "हुनुहुनेछ" ; -- हुनुहुनेछ + + -- Negative Case + => "हुनेछैन" ; -- हुनेछैन + => "हुनेछैनैँ" ; -- हुनेछैनैँ + => "हुनेछैनस्" ; -- हुनेछैनस् + => "हुनेछैनै" ; -- हुनेछैनै + => "हुनेछैनै" ; -- हुनेछैनै + => "हुनेछैन्" ; -- हुनेछैन् + => "हुनेछैनन्" ; -- हुनेछैनन् + => "हुनेछैनन्" ; -- हुनेछैनन् + => "हुनेछैनै" ; -- हुनेछैनै + => "हुनुहुनेछैन्" -- हुनुहुनेछैन् + } ; + + -- For Human, occupation/Introductiary case case, (HAVENT INTEGRATED YET) + copulaOpn : CTense -> Polarity -> Number -> NPerson -> Gender -> Str = + \t, po, n, pn, g -> + case of { + -- Resembles with "मकँफरेणफृेग" function for positive + -- => mkVPreNPReg "" Pos pn n g ; + -- Present Positive + => "हुँ" ; -- हुँ + => "हौँ" ; -- हौँ + => "होस्" ; -- होस् + -- => "होस्" ; -- छेस् + => "हौ" ; -- हौ + -- => "छ्यौ" ; -- छ्यौ + => "हौ" ; -- हौ + => "हो" ; -- हो + -- => "हुन्" ; -- हुन् + => "हुन्" ; -- हुन् + -- => "हौ" ; -- हौ + => "हौ" ; -- हौ + => "हुनुहुन्छ" ; --हुनुहुन्छ + + -- Present Negative + => "हैन" ; -- + => "हैनौं" ; -- हैनौं + => "हैनस्" ; -- हैनस् + => "हैनौ" ; -- हैनौ + => "हैनौ" ; -- हैनौ + => "हैन" ; --हैन + => "हैनन्" ; -- हैनन् + => "हैनन्" ; -- हैनन् + => "हुनुहुन्‌न" ; -- हुनुहुन्‌न + + <_,_,_,_,_> => 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 of { + => "हौौाण"; + => "हौौयण"; + => "हौौ"; + => "हौौ"; + => "हौौै"; + => "हौन"; + => "हौौै"; + => "हौन" + + }; + -} + + 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 of { + => "इरहन्" ; + <_,_,_,_,_> => "इरहन्" + } + } ; + + 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 => ; + VTransPost => ; + _ => + } ; + + VPPerfPast => case vp.subj of { + VTrans => ; + VTransPost => ; + _ => + } ; + + _ => + } ; + subj = subjagr.p1 ; + agr = subjagr.p2 ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case of { + => vp.s ! VF NPresent Imperf Pos p n g ; + => vp.s ! VF NPresent Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NPast Simpl) Imperf Pos p n g ; + => vp.s ! VF (NPast Simpl) Imperf Neg p n g ; + + => vp.s ! VF NPresent Perf Pos p n g ; + => vp.s ! VF NPresent Perf Neg p n g ; + => vp.s ! VF (NPast Simpl) Perf Pos p n g ; + => vp.s ! VF (NPast Simpl) Perf Neg p n g ; + => vp.s ! VF (NFuture Defin) Perf Pos p n g ; + => vp.s ! VF (NFuture Defin) Perf Neg p n g ; + + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => 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 of { + => vp.s ! VF NPresent Imperf Pos p n g ; + => vp.s ! VF NPresent Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NPast Simpl) Imperf Pos p n g ; + => vp.s ! VF (NPast Simpl) Imperf Neg p n g ; + + => vp.s ! VF NPresent Perf Pos p n g ; + => vp.s ! VF NPresent Perf Neg p n g ; + => vp.s ! VF (NPast Simpl) Perf Pos p n g ; + => vp.s ! VF (NPast Simpl) Perf Neg p n g ; + => vp.s ! VF (NFuture Defin) Perf Pos p n g ; + => vp.s ! VF (NFuture Defin) Perf Neg p n g ; + + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => 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 + } ; + } diff --git a/lib/src/nepali/SentenceNep.gf b/lib/src/nepali/SentenceNep.gf new file mode 100644 index 000000000..2b2414d5d --- /dev/null +++ b/lib/src/nepali/SentenceNep.gf @@ -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 of { + => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPSmplPast ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPCondPres ! p.p ! ODir; + => 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 of { + => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPSmplPast ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPCondPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPCondPast ! p.p ! q + + }; + } ; + + UseRCl temp p rcl = { + s = \\q => case of { + => temp.s ++ p.s ++ rcl.s ! VPGenPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPSmplPast ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfPast ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPFut ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfFut ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPCondPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPCondPast ! p.p ! ODir ! q + }; + c = rcl.c + } ; + + UseSlash temp p clslash = { + s = case of { + => temp.s ++ p.s ++ clslash.s ! VPGenPres ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPPerfPres ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPSmplPast ! p.p ! ODir ; + => temp.s ++ p.s ++ clslash.s ! VPPerfPast ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPFut ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPPerfFut ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPCondPres ! p.p ! ODir; + => 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}; + +} diff --git a/lib/src/nepali/StructuralNep.gf b/lib/src/nepali/StructuralNep.gf new file mode 100644 index 000000000..55a7f1129 --- /dev/null +++ b/lib/src/nepali/StructuralNep.gf @@ -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 "नेपाली" ; -- नेपाली +} diff --git a/lib/src/nepali/SymbolNep.gf b/lib/src/nepali/SymbolNep.gf new file mode 100644 index 000000000..5caf47dd9 --- /dev/null +++ b/lib/src/nepali/SymbolNep.gf @@ -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 ++ "दा" } ; + + +} diff --git a/lib/src/nepali/SyntaxNep.gf b/lib/src/nepali/SyntaxNep.gf new file mode 100644 index 000000000..f7ffc8e40 --- /dev/null +++ b/lib/src/nepali/SyntaxNep.gf @@ -0,0 +1,5 @@ +--# -path=.:alltenses:prelude + +instance SyntaxNep of Syntax = + ConstructorsNep, CatNep, StructuralNep, CombinatorsNep ; + diff --git a/lib/src/nepali/TransliterationNep.gf b/lib/src/nepali/TransliterationNep.gf new file mode 100644 index 000000000..ab2e1e521 --- /dev/null +++ b/lib/src/nepali/TransliterationNep.gf @@ -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] + diff --git a/lib/src/nepali/TryNep.gf b/lib/src/nepali/TryNep.gf new file mode 100644 index 000000000..78840f85a --- /dev/null +++ b/lib/src/nepali/TryNep.gf @@ -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 ; +-- } ; + + +} diff --git a/lib/src/nepali/VerbNep.gf b/lib/src/nepali/VerbNep.gf new file mode 100644 index 000000000..294d345c6 --- /dev/null +++ b/lib/src/nepali/VerbNep.gf @@ -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 } ; + + +} diff --git a/lib/src/nepali/src/AdjectiveNep.gf b/lib/src/nepali/src/AdjectiveNep.gf new file mode 100644 index 000000000..c1078ceff --- /dev/null +++ b/lib/src/nepali/src/AdjectiveNep.gf @@ -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 ; + } ; + +} diff --git a/lib/src/nepali/src/AdverbNep.gf b/lib/src/nepali/src/AdverbNep.gf new file mode 100644 index 000000000..9b53211c8 --- /dev/null +++ b/lib/src/nepali/src/AdverbNep.gf @@ -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} ; + +} diff --git a/lib/src/nepali/src/IdiomNep.gf b/lib/src/nepali/src/IdiomNep.gf new file mode 100644 index 000000000..248e91b71 --- /dev/null +++ b/lib/src/nepali/src/IdiomNep.gf @@ -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"} ; +} + diff --git a/lib/src/nepali/src/LexiconNep.gf b/lib/src/nepali/src/LexiconNep.gf new file mode 100644 index 000000000..69985ac9f --- /dev/null +++ b/lib/src/nepali/src/LexiconNep.gf @@ -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:" ; + +} ; diff --git a/lib/src/nepali/src/MorphoNep.gf b/lib/src/nepali/src/MorphoNep.gf new file mode 100644 index 000000000..855aaf4ba --- /dev/null +++ b/lib/src/nepali/src/MorphoNep.gf @@ -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 of { + => (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 of { + => root2 + "dE" ; + + => root2 + "irheko" ; + => root2 + "irheki" ; + => root2 + "irheka" + }; + }; + + + mkProgIReg : Str -> Aspect -> Number -> Gender -> {s : Str } = + \root,aspect,number,gender -> { + s = case of { + => root + "dE" ; + + => root + "i:rheko" ; + => root + "i:rheki" ; + => 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 of { + -- Positive case + => root + "cu" ; -- छु + => root + "cwV" ; -- छौं + => root + "csx:" ; -- छस् + => root + "cesx:" ; -- छेस् + => root + "cw" ; -- छौ + => root + "cx:yw" ; -- छ्यौ + => root + "cw" ; -- छौ + => root + "c" ; -- छ + => root + "ce" ; -- छे + => root + "cnx:" ; -- छन् + => root + "cinx:" ; -- छिन् + => root + "cnx:" ; -- छन् + => root + "nuhunx:c" ; -- नुहुन्छ + + -- Negative Case + => root + "dinV" ; -- इनँ (पढ्दिनँ) + => root + "dEnEV" ; -- ऐनैँ (पढ्दैनैँ) + => root + "dEnsx:" ; -- ऐनस् (पढदैनस्) + => root + "dinsx:" ; -- इनस् (पढदिनस्) + => root + "dEnE" ; -- ऐनै + => root + "dinE" ; -- इनै + => root + "dEnE" ; -- ऐनै + => root + "dEn" ; -- ऐन + => root + "din" ; -- इन + => root + "dEnx:n" ; -- ऐनन् + => root + "dinx:n" ; -- इनन् + => root + "dEnx:n" ; -- ऐनन् + => 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 of { + -- Positive case + => root1 + "cu" ; -- छु + => root1 + "cwM" ; -- छौं + => root1 + "csx:" ; -- छस् + => root1 + "cesx:" ; -- छेस् + => root1 + "cw" ; -- छौ + => root1 + "cx:yw" ; -- छ्यौ + => root1 + "cw" ; -- छौ + => root1 + "c" ; -- छ + => root1 + "ce" ; -- छे + => root1 + "cnx:" ; -- छन् + => root1 + "cinx:" ; -- छिन् + => root1 + "cnx:" ; -- छन् + => root + "nuhunx:c" ; -- नुहुन्छ + + -- Negative Case + => root + "VdinV" ; -- इनँ (खाँदिनँ) + => root + "VdEnEV" ; -- ऐनैँ (खाँदैनैँ) + => root + "VdEnsx:" ; -- ऐनस् (आउँदैनस्) + => root + "Vdinsx:" ; -- इनस् (खाँदिनस्) + => root + "VdEnE" ; -- ऐनै (खाँदैनै) + => root + "VdinE" ; -- इनै + => root + "VdEnE" ; -- ऐनै + => root + "VdEn" ; -- ऐन + => root + "Vdin" ; -- इन (खाँदिन) + => root + "VdEnx:n" ; -- ऐनन् + => root + "Vdinx:n" ; -- इनन् + => root + "VdEnx:n" ; -- ऐनन् + => 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 of { + -- Positive case + => root2 + "eV" ; -- एँ + => root + "ywM" ; -- यौं + => root2 + "isx:" ; -- इस् + => root + "yw" ; -- यौ + => root + "yw" ; -- यौ + => root + "yo" ; -- यो + => root2 + "I" ; -- इ (पढी) + => root2 + "e" ; -- ए (पढे) + => root2 + "inx:" ; -- इन् (पढिन्) + => root2 + "e" ; -- ए (पढे) + => root + "nuByo" ; -- नुभयो + + -- Negative case + => root2 + "inV" ; -- इनँ + => root2 + "enEV" ; -- एनैँ + => root2 + "insx:" ; -- इनस् + => root2 + "enE" ; -- एनै + => root2 + "inE" ; -- इनै + => root2 + "enE" ; -- एनै + => root2 + "en" ; -- एन + => root2 + "in" ; -- इन (पढिन) + => root2 + "ennx:" ; -- एनन् (पढेनन्) + => root2 + "innx:" ; -- इनन् (पढिनन्) + => root2 + "ennx:" ; -- एनन् (पढेनन्) + => 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 of { + -- Positive case + => root2 + "e:V" ; -- एँ + => root2 + "ywM" ; -- यौं + => root2 + "i:sx:" ; -- इस् + => root2 + "yw" ; -- यौ + => root2 + "yw" ; -- यौ + => root2 + "yo" ; -- यो + => root2 + "I:" ; -- ई + => root2 + "e:" ; -- ए + => root2 + "i:nx:" ; -- इन् + => root2 + "e:" ; -- ए + => root + "nuByo" ; -- नुभयो + + -- Negative case + => root2 + "i:nV" ; -- इनँ + => root2 + "e:nEV" ; -- एनैँ + => root2 + "i:nsx:" ; -- इनस् + => root2 + "e:nE" ; -- एनै + => root2 + "i:nE" ; -- इनै + => root2 + "e:nE" ; -- एनै + => root2 + "e:n" ; -- एन + => root2 + "i:n" ; -- इन (पढिन) + => root2 + "e:nnx:" ; -- एनन् (पढेनन्) + => root2 + "i:nnx:" ; -- इनन् (पढिनन्) + => root2 + "e:nnx:" ; -- एनन् (पढेनन्) + => 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 of { + => root + "TeM" ; -- थें + => root + "Tx:ywM" ; -- थ्यौं + => root + "Tisx:" ; -- थिस् + => root + "Tx:yw" ; -- थ्यौ + => root + "Tx:yw" ; -- थ्यौ + => root + "Tx:yo" ; -- थ्यो + => root + "TI" ; -- थी + => root + "Te" ; -- थे + => root + "Tinx:" ; -- थिन् + => root + "Te" ; -- थे + => root1 + "nuhunx:z+Tx:yo" ; -- नुहुन्‌थ्यो + + => root + neg + "TeM" ; -- थें + => root + neg + "Tx:ywM" ; -- थ्यौं + => root + neg + "Tisx:" ; -- थिस् + => root + neg + "Tx:yw" ; -- थ्यौ + => root + neg + "Tx:yw" ; -- थ्यौ + => root + neg + "Tx:yo" ; -- थ्यो + => root + neg + "TI" ; -- थी + => root + neg + "Te" ; -- थे + => root + neg + "TInx:" ; -- थिन् + => root + neg + "Te" ; -- थे + => 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 of { + => root2 + "e" + na + "cu" ; -- एछु + => root2 + "i" + na + "cu" ; -- इछु + => root2 + "e" + na + "cwV" ; -- एछौँ + => root2 + "e" + na + "csx:" ; -- एछस् + => root2 + "i" + na + "csx:" ; -- इछस् + => root2 + "e" + na + "cw" ; -- एछौ + => root2 + "i" + na + "cw" ; -- इछौ + => root2 + "e" + na + "cw" ; -- एछौ + => root2 + "e" + na + "c" ; -- एछ + => root2 + "i" + na + "c" ; -- इछ + => root2 + "e" + na + "cnx:" ; -- एछन् + => root2 + "i" + na + "cnx:" ; -- इछन् + => 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 of { + => root2 + "e:" + na + "cu" ; -- एछु + => root2 + "i:" + na + "cu" ; -- इछु + => root2 + "e:" + na + "cwV" ; -- एछौँ + => root2 + "e:" + na + "csx:" ; -- एछस् + => root2 + "i:" + na + "csx:" ; -- इछस् + => root2 + "e:" + na + "cw" ; -- एछौ + => root2 + "i:" + na + "cw" ; -- इछौ + => root2 + "e:" + na + "cw" ; -- एछौ + + => root2 + "e:" + na + "c" ; -- एछ + => root2 + "i:" + na + "c" ; -- इछ + => root2 + "e:" + na + "cnx:" ; -- एछन् + => root2 + "i:" + na + "cnx:" ; -- इछन् + => 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 of { + -- Positive case + => root + "necu" ; -- नेछु + => root + "necwM" ; -- नेछौं + => root + "necsx:" ; -- नेछस् + => root + "necwM" ; -- नेछौ + => root + "necwM" ; -- नेछौ + => root + "nec" ; -- नेछ + => root + "necnx:" ; -- नेछन् + => root + "necnx:" ; -- नेछन् + => root + "necinx:" ; -- नेछिन् + => root + "necinx:" ; -- नेछन् + => root + "nuhunec" ; -- नुहुनेछ + + -- Negative Case + => root + "necEn" ; -- नेछैन + => root + "necEnEV" ; -- नेछैनैँ + => root + "necEnsx:" ; -- नेछैनस् + => root + "necEnE" ; -- नेछैनै + => root + "necEnE" ; -- नेछैनै + => root + "necEnx:" ; -- नेछैन् + => root + "necEnnx:" ; -- नेछैनन् + => root + "necEnnx:" ; -- नेछैनन् + => root + "necEnE" ; -- नेछैनै + => 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 of { + => root2 + "uVla" ; -- उँला + => root2 + "wVla" ; -- आँला + => root + "z=lasx:" ; -- लास् + => root + "lIsx:" ; -- लिस् + => root2 + "wla" ; -- औला + => root2 + "wli" ; -- औलि + => root + "la" ; -- ला + => root + "lI" ; -- ली + => root + "lanx:" ; -- लान् + => root + "lInx:" ; -- लिन् + => root + "lanx:" ; -- लान् + => root + "z=nuhola" ; -- नुहोला + + -- TODO : NOT CLEAR DEFINITION IN BOOK + => "quxu" + } + } ; + + -- mkVFutNDNP helper for VIReg case + mkVFutNDNPIReg : Str -> Polarity -> NPerson -> Number -> Gender -> {s:Str} = + \root, po, pn, n, g -> + {s = case of { + => root + "fVla" ; -- उँला + => root + "WVla" ; -- आँला + => root + "lasx:" ; -- लास् + => root + "lisx:" ; -- लिस् + => root + "Wla" ; -- औला + => root + "Wli" ; -- औलि + => root + "la" ; -- ला + => root + "lI" ; -- ली + => root + "lanx:" ; -- लान् + => root + "linx:" ; -- लिन् + => root + "lanx:" ; -- लान् + => root + "nuhola" ; -- नुहोला + + -- TODO : NOT CLEAR DEFINITION IN BOOK + => "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 of { + -- Positive case + => root + sreg + "Tie:V" ; -- थिएँ + => root + spl + "TiywV" ; -- थियौँ + => root + sreg + "Tii:sx:" ; -- थिइस् + => root + sfem + "Tii:sx:" ; -- थिइस् + => root + spl + "Tiyw" ; -- थियौ + => root + spl + "Tiyw" ; -- थियौ + => root + sreg + "Tiyo" ; -- थियो + => root + sfem + "TiI:" ; --थिई + => root + spl + "Tie:" ; -- थिए + => root + sfem + "Tii:nx:" ; -- थिइन् + => root + spl + "Tie:" ; -- थिए + => root + sreg + "hunuhunx:z+Tx:yo" ; -- हुनुहुन्‌थ्यो (TODO: CONFIRM CORRECT) + + -- Negative case + => root + sreg +"Tii:nV" ; -- + => root + spl + "Tie:nEV" ; -- + + => root + sreg + "Tii:nsx:" ; -- + => root + sfem + "Tii:nsx:" ; -- + => root + spl + "Tie:nE" ; -- + => root + spl + "TinE" ; -- + + => root + sreg + "Tie:n" ; -- + => root + sfem + "Tii:n:" ; -- + => root + spl + "Tie:nnx:" ; -- + => root + sfem + "Tii:nnx:" ; -- + => root + spl + "Tie:nnx:" ; -- + => 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 of { + => root + sreg + "hunx:TeV" ; -- हुन्थेँ + => root + spl + "hunx:TwV" ; -- हुन्थौँ + => root + sreg + "hunx:Tisx:" ; -- हुन्थिस् + => root + sfem + "hunx:Ti:sx:" ; -- हुन्थिस् + => root + spl + "hunx:Tx:yw" ; -- हुन्थ्यौ + => root + spl + "hunx:Tx:yw" ; -- हुन्थ्यौ + => root + sreg + "hunx:z+Tx:yw" ; -- हुन्‌थ्यौ + => root + sfem + "hunx:TI" ; -- हुन्थी + => root + spl + "hunx:Te" ; -- हुन्थे + => root + sfem + "hunx:z+Ti" ; -- हुन्थि + => root + spl + "hunx:Te" ; -- हुन्थे + => root + sreg + "hunuhunx:Tx:yo" ; -- (TODO : हुनुहुन्थ्यो need to Confirm) + + -- Negative case (TODO) + => root + sreg + "hunx:TeV" ; -- हुन्थेँ + => root + spl + "hunx:TwV" ; -- हुन्थौँ + => root + sreg + "hunx:Tii:sx:" ; -- हुन्थिइस् ???? G Check + => root + sfem + "hunx:Tii:sx:" ; -- हुन्थिइस् + => root + spl + "hunx:Tiyw" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw) + => root + spl + "hunx:Tiyw" ; -- हुन्थियौ / or हुन्थ्यौ (hunx:Tx:yw) + => root + sreg + "hunx:Tx:yw" ; -- हुन्थ्यौ / (थियो ????) + => root + sfem + "hunx:TI" ; -- हुन्थी/ (थिई ????) + => root + spl + "hunx:Te" ; -- हुन्थे / (थिए) + => root + sfem + "hunx:Ti" ; -- हुन्थि + => root + spl + "hunx:Te" ; -- हुन्थे / (थिए) + => 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 of { + => root + sreg + "rhecu" ; -- रहेछु + => root + sfem + "rhecu" ; -- रहेछु (खाएकिरहेछु) + => root + spl + "rhecwV" ; -- रहेछौँ + => root + sreg + "rhicsx:" ; --रहिछस् + => root + sfem + "rhicsx:" ; --रहिछस् + => root + spl + "rhecw" ; -- रहेछौ + => root + spl + "rhecw" ; -- रहेछौ + => root + sfem + "rhicw" ; -- रहिछौ (छ्यौ ????) + => root + spl + "rhecw" ; -- रहेछौ + => root + sreg + "rhec" ; -- रहेछ + => root + sfem + "rhic" ; -- रहिछ + => root + spl + "rhecnx:" ; -- रहेछन् + => root + sfem + "rhicInx:" ; -- रहिछीन् + => root + spl + "rhecnx:" ; -- रहेछन् + => root + spl + "rhecnx:" ; -- रहेछन् + => root + sreg + "hunuhudorhec" ; -- हुनुहुदोरहेछ/नुभएकोरहेछ(nuBe:korhec) + + -- Negative Case (TODO) + => "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 of { + => root + sreg + "cu" ; -- छु + => root + spl + "cwM" ; -- छौं + => root + sreg + "csx:" ; -- छस् + => root + sfem + "cesx:" ; -- छेस् + => root + spl + "cw" ; -- छौ + => root + sfem + "cx:yw" ; --छ्यौ + => root + spl + "cw" ; -- छौ + => root + sreg + "c" ; -- छ + => root + sfem + "ce" ; -- छे + => root + spl + "cnx:" ; -- छन् + => root + sfem + "cinx:" ; -- छिन् + => root + spl + "cnx:" ; -- छन् + => root + sreg + "hunuhunx:c" ; -- हुनुहुन्छ + + -- Negative Case (TODO) + => "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 of { + => root + sreg + ("hune"+"cu") ; -- हुनेछु + => root + spl + "hunecwV" ; -- हुनेछौँ + => root + sreg + "hunecsx:" ; -- हुनेछस् + => root + sfem + "hunecesx:" ; -- हुनेछेस् + => root + spl + "hunecw" ; -- हुनेछौ + => root + sfem + "hunecx:yw" ; -- हुनेछ्यौ + => root + spl + "hunecw" ; -- हुनेछौ + => root + sreg + "hunec" ; -- हुनेछ + => root + sfem + "hunx:ce" ; -- हुन्छे + => root + spl + "hunecnx:" ; -- हुनेछन् + => root + sfem + "hunecinx:" ; -- हुनेछिन् + => root + spl + "hunecnx:" ; -- हुनेछन् + => root + sreg + "hunuhunec" ; -- हुनुहुनेछ + + -- Negative Case (TODO) + => "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 of { + => root + sreg + "huVla" ; -- हुँला + => root + spl + "hwVlaV" ; -- हौँलाँ + => root + sreg + "holasx:" ; -- होलास् + => root + sfem + "holisx:" ; -- होलिस् + => root + spl + "hwla" ; -- हौला + => root + sfem + "holi" ; -- होलि + => root + spl + "hwla" ; -- हौला + => root + sreg + "hola" ; -- होला + => root + sfem + "holI" ; -- होली + => root + spl + "holanx:" ; -- होलान् + => root + sfem + "holinx:" ; -- होलिन् + => root + spl + "holanx:" ; -- होलान् + => root + sreg + "hunuhola" ; -- हुनुहोला + + -- Negative Case (TODO) + => "quxu" -- TODO-- + } + }; + + -- TODO - Refactor + IntPronForm = {s: Case => Str}; + mkIntPronForm : (x1,x2,x3,x4:Str) -> IntPronForm = + \y1,y2,y3,y4 -> { + s = table { + Nom => y1; + _ => y2 + } + }; + + } diff --git a/lib/src/nepali/src/NumeralNep.gf b/lib/src/nepali/src/NumeralNep.gf new file mode 100644 index 000000000..ccd5fa7ee --- /dev/null +++ b/lib/src/nepali/src/NumeralNep.gf @@ -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 ; +} diff --git a/lib/src/nepali/src/PhraseNep.gf b/lib/src/nepali/src/PhraseNep.gf new file mode 100644 index 000000000..1567555cc --- /dev/null +++ b/lib/src/nepali/src/PhraseNep.gf @@ -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} ; + +} diff --git a/lib/src/nepali/src/QuestionNep.gf b/lib/src/nepali/src/QuestionNep.gf new file mode 100644 index 000000000..87fc8d20d --- /dev/null +++ b/lib/src/nepali/src/QuestionNep.gf @@ -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 ; + +} diff --git a/lib/src/nepali/src/RelativeNep.gf b/lib/src/nepali/src/RelativeNep.gf new file mode 100644 index 000000000..68402d5d8 --- /dev/null +++ b/lib/src/nepali/src/RelativeNep.gf @@ -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 + } ; + +} diff --git a/lib/src/nepali/src/ResNep.gf b/lib/src/nepali/src/ResNep.gf new file mode 100644 index 000000000..558a3d121 --- /dev/null +++ b/lib/src/nepali/src/ResNep.gf @@ -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 of { + -- Resembles with "mkVPreNPReg" function for positive + -- => mkVPreNPReg "" Pos pn n g ; + -- Present Positive + => "cu" ; -- छु + => "cwM" ; -- छौं + => "csx:" ; -- छस् + => "cesx:" ; -- छेस् + => "cw" ; -- छौ + => "cx:yw" ; -- छ्यौ + => "cw" ; -- छौ + => "c" ; -- छ + => "ce" ; -- छे + => "cnx:" ; -- छन् + => "cinx:" ; -- छिन् + => "cnx:" ; -- छन् + => "hunuhunx:c" ; --हुनुहुन्छ + + -- Present Negative + => "cEnV" ; -- छैनँ + => "cEnwM" ; -- छैनौं + => "cEnsx:" ; -- छैनस् + => "cEnw" ; -- छैनौ + => "cEnw" ; -- छैनौ + => "cEn" ; --छैन + => "cEnnx:" ; -- छैनन् + => "cEnnx:" ; -- छैनन् + => "hunuhunx:z+n" ; -- हुनुहुन्‌न + + -- Resemples with "mkVPstSPGen" case, should refactor to make it + -- take common function + + -- Past Positive + => "Tie:V" ; -- थिएँ + => "TiywV" ; -- थियौँ + => "Tii:sx:" ; -- थिइस् + => "Tiyw" ; -- थियौ + => "Tiyw" ; -- थियौ + => "Tiyo" ; -- थियो + => "TiI:" ; --थिई + => "Tie:" ; -- थिए + => "Tii:nx:" ; -- थिइन् + => "Tie:" ; -- थिए + => "hunuhunx:z+Tx:yo" ; -- हुनुहुन्‌थ्यो + + -- Past Positive + => "TinV" ; -- थिनँ + => "TenwM" ; -- थेनौं + => "Tinsx:" ; -- थिनस् + => "Tenw" ; -- थेनौ + => "Tenw" ; -- थेनौ + => "Ten" ; -- थेन + => "Tin" ; --थिन + => "Tennx:" ; -- थेनन् + => "Tinnx:" ; -- थिनन् + => "Tennx:" ; -- थेनन् + => "hunuhunx:z+nTx:yo" ; -- हुनुहुन्‌नथ्यो + + + -- Can be covered by the function "mkVFutDNP" + -- Future Positive + => "hunecu" ; -- हुनेछु + => "hunecwM" ; -- हुनेछौं + => "hunecsx:" ; -- हुनेछस् + => "hunecwM" ; -- हुनेछौ + => "hunecwM" ; -- हुनेछौ + => "hunec" ; -- हुनेछ + => "hunecnx:" ; -- हुनेछन् + => "hunecnx:" ; -- हुनेछन् + => "hunecnx:" ; -- हुनेछिन् + => "hunecnx:" ; -- हुनेछन् + => "hunuhunec" ; -- हुनुहुनेछ + + -- Negative Case + => "hunecEn" ; -- हुनेछैन + => "hunecEnEV" ; -- हुनेछैनैँ + => "hunecEnsx:" ; -- हुनेछैनस् + => "hunecEnE" ; -- हुनेछैनै + => "hunecEnE" ; -- हुनेछैनै + => "hunecEnx:" ; -- हुनेछैन् + => "hunecEnnx:" ; -- हुनेछैनन् + => "hunecEnnx:" ; -- हुनेछैनन् + => "hunecEnE" ; -- हुनेछैनै + => "hunuhunecEnx:" -- हुनुहुनेछैन् + } ; + + -- For Human, occupation/Introductiary case case, (HAVENT INTEGRATED YET) + copulaOpn : CTense -> Polarity -> Number -> NPerson -> Gender -> Str = + \t, po, n, pn, g -> + case of { + -- Resembles with "mkVPreNPReg" function for positive + -- => mkVPreNPReg "" Pos pn n g ; + -- Present Positive + => "huV" ; -- हुँ + => "hwV" ; -- हौँ + => "hosx:" ; -- होस् + -- => "hosx:" ; -- छेस् + => "hw" ; -- हौ + -- => "cx:yw" ; -- छ्यौ + => "hw" ; -- हौ + => "ho" ; -- हो + -- => "hunx:" ; -- हुन् + => "hunx:" ; -- हुन् + -- => "hw" ; -- हौ + => "hw" ; -- हौ + => "hunuhunx:c" ; --हुनुहुन्छ + + -- Present Negative + => "hEn" ; -- + => "hEnwM" ; -- हैनौं + => "hEnsx:" ; -- हैनस् + => "hEnw" ; -- हैनौ + => "hEnw" ; -- हैनौ + => "hEn" ; --हैन + => "hEnnx:" ; -- हैनन् + => "hEnnx:" ; -- हैनन् + => "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 of { + => "hwwaN"; + => "hwwyN"; + => "hww"; + => "hww"; + => "hwwE"; + => "hwn"; + => "hwwE"; + => "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 of { + => "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 => ; + VTransPost => ; + _ => + } ; + + VPPerfPast => case vp.subj of { + VTrans => ; + VTransPost => ; + _ => + } ; + + _ => + } ; + subj = subjagr.p1 ; + agr = subjagr.p2 ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case of { + => vp.s ! VF NPresent Imperf Pos p n g ; + => vp.s ! VF NPresent Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NPast Simpl) Imperf Pos p n g ; + => vp.s ! VF (NPast Simpl) Imperf Neg p n g ; + + => vp.s ! VF NPresent Perf Pos p n g ; + => vp.s ! VF NPresent Perf Neg p n g ; + => vp.s ! VF (NPast Simpl) Perf Pos p n g ; + => vp.s ! VF (NPast Simpl) Perf Neg p n g ; + => vp.s ! VF (NFuture Defin) Perf Pos p n g ; + => vp.s ! VF (NFuture Defin) Perf Neg p n g ; + + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => 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 of { + => vp.s ! VF NPresent Imperf Pos p n g ; + => vp.s ! VF NPresent Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NPast Simpl) Imperf Pos p n g ; + => vp.s ! VF (NPast Simpl) Imperf Neg p n g ; + + => vp.s ! VF NPresent Perf Pos p n g ; + => vp.s ! VF NPresent Perf Neg p n g ; + => vp.s ! VF (NPast Simpl) Perf Pos p n g ; + => vp.s ! VF (NPast Simpl) Perf Neg p n g ; + => vp.s ! VF (NFuture Defin) Perf Pos p n g ; + => vp.s ! VF (NFuture Defin) Perf Neg p n g ; + + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; + => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; + => 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 + } ; + } diff --git a/lib/src/nepali/src/SentenceNep.gf b/lib/src/nepali/src/SentenceNep.gf new file mode 100644 index 000000000..7219a0d92 --- /dev/null +++ b/lib/src/nepali/src/SentenceNep.gf @@ -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 of { + => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPSmplPast ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPCondPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPCondPast ! p.p ! ODir + + }; + } ; + + UseQCl temp p cl = { + s = \\q => case of { + => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPSmplPast ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPCondPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPCondPast ! p.p ! q + + }; + } ; + + UseRCl temp p rcl = { + s = \\q => case of { + => temp.s ++ p.s ++ rcl.s ! VPGenPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPSmplPast ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfPast ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPFut ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfFut ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPCondPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPCondPast ! p.p ! ODir ! q + }; + c = rcl.c + } ; + + UseSlash temp p clslash = { + s = case of { + => temp.s ++ p.s ++ clslash.s ! VPGenPres ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPPerfPres ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPSmplPast ! p.p ! ODir ; + => temp.s ++ p.s ++ clslash.s ! VPPerfPast ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPFut ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPPerfFut ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPCondPres ! p.p ! ODir; + => 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}; + +} diff --git a/lib/src/nepali/src/StructuralNep.gf b/lib/src/nepali/src/StructuralNep.gf new file mode 100644 index 000000000..197f9bb94 --- /dev/null +++ b/lib/src/nepali/src/StructuralNep.gf @@ -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" ; -- नेपाली +} diff --git a/lib/src/nepali/src/SymbolNep.gf b/lib/src/nepali/src/SymbolNep.gf new file mode 100644 index 000000000..6ef890e0d --- /dev/null +++ b/lib/src/nepali/src/SymbolNep.gf @@ -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" } ; + + +} diff --git a/lib/src/nepali/src/VerbNep.gf b/lib/src/nepali/src/VerbNep.gf new file mode 100644 index 000000000..12f1f3c7f --- /dev/null +++ b/lib/src/nepali/src/VerbNep.gf @@ -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 } ; + + +} diff --git a/lib/src/nepali/translit.gfs b/lib/src/nepali/translit.gfs new file mode 100644 index 000000000..6809a9971 --- /dev/null +++ b/lib/src/nepali/translit.gfs @@ -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