1
0
forked from GitHub/gf-core

refinementNepali-11-06-20

This commit is contained in:
virk.shafqat
2011-06-20 11:24:22 +00:00
parent f08c6a10a1
commit a9d8634147
33 changed files with 1153 additions and 1296 deletions

View File

@@ -1,6 +1,7 @@
--# -path=.:../abstract:../common:../../prelude
--
--1 Pnbu auxiliary operations.
--1 Nep auxiliary operations.
-- by Dinesh SImkhada and Shafqat Virk - 2011
--
-- This module contains operations that are needed to make the
-- resource syntax work.
@@ -13,9 +14,6 @@ resource ResNep = ParamX ** open Prelude, Predef in {
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
@@ -38,10 +36,13 @@ resource ResNep = ParamX ** open Prelude, Predef in {
------------------------------------------
--Verbs
-------------------------------------------
VTense = NPresent | NPast PTypes | NFuture FTypes;
PTypes = Simpl | Hab ; -- Unknown - Currently we didn't find the use of 'Unknown' type
FTypes = Defin | NDefin ;
VerbForm =
VF VTense Aspect Polarity NPerson Number Gender
| Root -- Root form 'kha' is the root of 'khanu'
| 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'
@@ -49,30 +50,31 @@ resource ResNep = ParamX ** open Prelude, Predef in {
-- Aspect Perfective and non-perfective
Aspect = Perf | Imperf ;
-- For distinguishing the type of noun
-- Prefessions/Occupations, Humans all mapped to Living category
NType = Living | NonLiving ;
oper
-- Noun = {s : Number => Case => Str ; g : Gender ; isHum : Bool } ; -- TODO ADD HUMAN/NON-HUMAN CASE
Noun = {s : Number => Case => Str ; g : Gender } ;
Noun = {s : Number => Case => Str ; g : Gender ; t : NType ; h : NPerson } ;
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
st + t@"त" + "ो" => mkAdj1 str str (st+t+"ा") ; -- No Fem for red [couple of places which takes Fem but no general rule]
st + "ो" => mkAdj1 str (st+"ी") (st+"ा") ;
_ => mkAdj1 str str str
} ;
mkAdj1 : (x1,_,x3 : Str) -> npAdjective =
@@ -92,17 +94,21 @@ resource ResNep = ParamX ** open Prelude, Predef in {
-- Reflective Pronoun
--eg. (i will do myself)
reflPron : Str;
reflPron = "आफैं"; -- आफैं
-- Functions used at NounNep [TODO: inflection at morphological level and attach with VP might be good option]
reflPron : Str ;
reflPron = "आफैं" ; -- आफैं
eko : Str;
eko = "एको";
eko : Str ;
eko = "एको" ;
eka : Str;
eka = "एका";
eko : Str ;
eki = "एकी" ;
sbvn : Str;
sbvn = "सबँन्धा" ;
eka : Str ;
eka = "एका" ;
sbvn : Str ;
sbvn = "सबभन्दा" ;
----------------------------------------------------------
-- Grammar part
@@ -113,24 +119,20 @@ resource ResNep = ParamX ** open Prelude, Predef in {
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 ++ "ले"
} ;
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 ++ "ले"
} ;
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 ;
@@ -141,7 +143,7 @@ resource ResNep = ParamX ** open Prelude, Predef in {
NPC c => dt.s ! dt.n ! Masc ;
NPObj => dt.s ! dt.n ! Masc ;
NPErg => dt.s ! dt.n ! Masc ++ "ले"
} ;
} ;
------------------------------------
-- Agreement transformations
@@ -162,201 +164,65 @@ resource ResNep = ParamX ** open Prelude, Predef in {
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
let a = fromAgr a0 ; b = fromAgr b0
in
toAgr
(conjNumber a.n b.n)
b.p a.g;
toAgr (conjNumber a.n b.n) b.p a.g;
giveNumber : Agr -> Number = \a -> case a of {
giveNumber : Agr -> Number =
\a -> case a of {
Ag _ n _ => n
};
} ;
giveGender : Agr -> Gender = \a -> case a of {
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
personalAgr : Agr = agrP1 Masc Sg ;
param
CPolarity =
CPos
| CNeg Bool ; -- contracted or not
oper
oper
contrNeg : Bool -> Polarity -> CPolarity =
\b,p -> case p of {
Pos => CPos ;
Neg => CNeg b
} ;
NP : Type = {s : NPCase => Str ; a : Agr} ;
NP : Type = {s : NPCase => Str ; a : Agr ; t : NType } ;
param
CTense = CPrsnt | CPast | CFuture ;
-- if the noun is of type occupation/Introductiary case it will take ho, instead of chh (in case of present)
oper
copula : CTense -> Polarity -> Number -> NPerson -> Gender -> Str =
\t, po, n, pn, g ->
case <t,po,pn,n,g> of {
-- Resembles with "मकँफरेणफृेग" function for positive
-- <CPrsnt, Pos, _, _, _> => mkVPreNPReg "" Pos pn n g ;
-- Present Positive
<CPrsnt, Pos, Pers1, Sg, _> => "छु" ; -- छु
<CPrsnt, Pos, Pers1, Pl, _> => "छौं" ; -- छौं
<CPrsnt, Pos, Pers2_L, Sg, Masc> => "छस्" ; -- छस्
<CPrsnt, Pos, Pers2_L, Sg, Fem> => "छेस्" ; -- छेस्
<CPrsnt, Pos, Pers2_L, Pl, _> => "छौ" ; -- छौ
<CPrsnt, Pos, Pers2_M, Pl, Fem> => "छ्यौ" ; -- छ्यौ
<CPrsnt, Pos, Pers2_M, _, _> => "छौ" ; -- छौ
<CPrsnt, Pos, Pers3_L, Sg, Masc> => "छ" ; -- छ
<CPrsnt, Pos, Pers3_L, Sg, Fem> => "छे" ; -- छे
<CPrsnt, Pos, Pers3_L, Pl, _> => "छन्" ; -- छन्
<CPrsnt, Pos, Pers3_M, Sg, Fem> => "छिन्" ; -- छिन्
<CPrsnt, Pos, Pers3_M, _, _> => "छन्" ; -- छन्
<CPrsnt, Pos, _ , _, _> => "हुनुहुन्छ" ; --हुनुहुन्छ
-- Present Negative
<CPrsnt, Neg, Pers1, Sg, _> => "छैनँ" ; -- छैनँ
<CPrsnt, Neg, Pers1, Pl, _> => "छैनौं" ; -- छैनौं
<CPrsnt, Neg, Pers2_L, Sg, _> => "छैनस्" ; -- छैनस्
<CPrsnt, Neg, Pers2_L, Pl, _> => "छैनौ" ; -- छैनौ
<CPrsnt, Neg, Pers2_M, _, _> => "छैनौ" ; -- छैनौ
<CPrsnt, Neg, Pers3_L, Sg, _> => "छैन" ; --छैन
<CPrsnt, Neg, Pers3_L, Pl, _> => "छैनन्" ; -- छैनन्
<CPrsnt, Neg, Pers3_M, _, _> => "छैनन्" ; -- छैनन्
<CPrsnt, Neg, _, _, _> => "हुनुहुन्‌न" ; -- हुनुहुन्‌न
-- Resemples with "मकँफसतशफघेन" case, should refactor to make it
-- take common function
-- Past Positive
<CPast, Pos, Pers1, Sg, _> => "थिएँ" ; -- थिएँ
<CPast, Pos, Pers1, Pl, _> => "थियौँ" ; -- थियौँ
<CPast, Pos, Pers2_L, Sg, _> => "थिइस्" ; -- थिइस्
<CPast, Pos, Pers2_L, Pl, _> => "थियौ" ; -- थियौ
<CPast, Pos, Pers2_M, _, _> => "थियौ" ; -- थियौ
<CPast, Pos, Pers3_L, Sg, Masc> => "थियो" ; -- थियो
<CPast, Pos, Pers3_L, Sg, Fem> => "थिई" ; --थिई
<CPast, Pos, Pers3_L, Pl, _> => "थिए" ; -- थिए
<CPast, Pos, Pers3_M, Sg, Fem> => "थिइन्" ; -- थिइन्
<CPast, Pos, Pers3_M, _, _> => "थिए" ; -- थिए
<CPast, Pos, _, _, _> => "हुनुहुन्‌थ्यो" ; -- हुनुहुन्‌थ्यो
-- Past Positive
<CPast, Neg, Pers1, Sg, _> => "थिनँ" ; -- थिनँ
<CPast, Neg, Pers1, Pl, _> => "थेनौं" ; -- थेनौं
<CPast, Neg, Pers2_L, Sg, _> => "थिनस्" ; -- थिनस्
<CPast, Neg, Pers2_L, Pl, _> => "थेनौ" ; -- थेनौ
<CPast, Neg, Pers2_M, _, _> => "थेनौ" ; -- थेनौ
<CPast, Neg, Pers3_L, Sg, Masc> => "थेन" ; -- थेन
<CPast, Neg, Pers3_L, Sg, Fem> => "थिन" ; --थिन
<CPast, Neg, Pers3_L, Pl, _> => "थेनन्" ; -- थेनन्
<CPast, Neg, Pers3_M, Sg, Fem> => "थिनन्" ; -- थिनन्
<CPast, Neg, Pers3_M, _, _> => "थेनन्" ; -- थेनन्
<CPast, Neg, _, _, _> => "हुनुहुन्‌नथ्यो" ; -- हुनुहुन्‌नथ्यो
-- Can be covered by the function "मकँऊुतधणफ"
-- Future Positive
<CFuture, Pos, Pers1, Sg, _> => "हुनेछु" ; -- हुनेछु
<CFuture, Pos, Pers1, Pl, _> => "हुनेछौं" ; -- हुनेछौं
<CFuture, Pos, Pers2_L, Sg, _> => "हुनेछस्" ; -- हुनेछस्
<CFuture, Pos, Pers2_L, Pl, _> => "हुनेछौं" ; -- हुनेछौ
<CFuture, Pos, Pers2_M, _, _> => "हुनेछौं" ; -- हुनेछौ
<CFuture, Pos, Pers3_L, Sg, _> => "हुनेछ" ; -- हुनेछ
<CFuture, Pos, Pers3_L, Pl, _> => "हुनेछन्" ; -- हुनेछन्
<CFuture, Pos, Pers3_M, _, Masc> => "हुनेछन्" ; -- हुनेछन्
<CFuture, Pos, Pers3_M, Sg, Fem> => "हुनेछन्" ; -- हुनेछिन्
<CFuture, Pos, Pers3_M, Pl, Fem> => "हुनेछन्" ; -- हुनेछन्
<CFuture, Pos, _, _, _> => "हुनुहुनेछ" ; -- हुनुहुनेछ
-- Negative Case
<CFuture, Neg, Pers1, Sg, _> => "हुनेछैन" ; -- हुनेछैन
<CFuture, Neg, Pers1, Pl, _> => "हुनेछैनैँ" ; -- हुनेछैनैँ
<CFuture, Neg, Pers2_L, Sg, _> => "हुनेछैनस्" ; -- हुनेछैनस्
<CFuture, Neg, Pers2_L, Pl, _> => "हुनेछैनै" ; -- हुनेछैनै
<CFuture, Neg, Pers2_M, _, _> => "हुनेछैनै" ; -- हुनेछैनै
<CFuture, Neg, Pers3_L, Sg, _> => "हुनेछैन्" ; -- हुनेछैन्
<CFuture, Neg, Pers3_L, Pl, _> => "हुनेछैनन्" ; -- हुनेछैनन्
<CFuture, Neg, Pers3_M, Sg, _> => "हुनेछैनन्" ; -- हुनेछैनन्
<CFuture, Neg, Pers3_M, Pl, _> => "हुनेछैनै" ; -- हुनेछैनै
<CFuture, Neg, _, _, _> => "हुनुहुनेछैन्" -- हुनुहुनेछैन्
} ;
-- For Human, occupation/Introductiary case case, (HAVENT INTEGRATED YET)
copulaOpn : CTense -> Polarity -> Number -> NPerson -> Gender -> Str =
\t, po, n, pn, g ->
case <t,po,pn,n,g> of {
-- Resembles with "मकँफरेणफृेग" function for positive
-- <CPrsnt, Pos, _, _, _> => mkVPreNPReg "" Pos pn n g ;
-- Present Positive
<CPrsnt, Pos, Pers1, Sg, _> => "हुँ" ; -- हुँ
<CPrsnt, Pos, Pers1, Pl, _> => "हौँ" ; -- हौँ
<CPrsnt, Pos, Pers2_L, Sg, _> => "होस्" ; -- होस्
--<CPrsnt, Pos, Pers2_L, Sg, Fem> => "होस्" ; -- छेस्
<CPrsnt, Pos, Pers2_L, Pl, _> => "हौ" ; -- हौ
--<CPrsnt, Pos, Pers2_M, Pl, Fem> => "छ्यौ" ; -- छ्यौ
<CPrsnt, Pos, Pers2_M, _, _> => "हौ" ; -- हौ
<CPrsnt, Pos, Pers3_L, Sg, Masc> => "हो" ; -- हो
--<CPrsnt, Pos, Pers3_L, Sg, Fem> => "हुन्" ; -- हुन्
<CPrsnt, Pos, Pers3_L, _, _> => "हुन्" ; -- हुन्
--<CPrsnt, Pos, Pers3_M, Sg, Fem> => "हौ" ; -- हौ
<CPrsnt, Pos, Pers3_M, _, _> => "हौ" ; -- हौ
<CPrsnt, Pos, _ , _, _> => "हुनुहुन्छ" ; --हुनुहुन्छ
-- Present Negative
<CPrsnt, Neg, Pers1, Sg, _> => "हैन" ; --
<CPrsnt, Neg, Pers1, Pl, _> => "हैनौं" ; -- हैनौं
<CPrsnt, Neg, Pers2_L, Sg, _> => "हैनस्" ; -- हैनस्
<CPrsnt, Neg, Pers2_L, Pl, _> => "हैनौ" ; -- हैनौ
<CPrsnt, Neg, Pers2_M, _, _> => "हैनौ" ; -- हैनौ
<CPrsnt, Neg, Pers3_L, Sg, _> => "हैन" ; --हैन
<CPrsnt, Neg, Pers3_L, Pl, _> => "हैनन्" ; -- हैनन्
<CPrsnt, Neg, Pers3_M, _, _> => "हैनन्" ; -- हैनन्
<CPrsnt, Neg, _, _, _> => "हुनुहुन्‌न" ; -- हुनुहुन्‌न
<_,_,_,_,_> => copula t po n pn g
} ;
param
VPHTense =
VPGenPres -- impf hum nahim "ी गो"
| VPSmplPast -- impf Ta nahim "ी ौेनत"
| VPFut -- fut na/nahim "ी सहालल गो"
| VPPerfPres -- perf hum na/nahim "ी हावे गोने"
| VPPerfPast -- perf Ta na/nahim "ी हाद गोने"
| VPPerfFut
| VPCondPres -- subj na "ी माय गो"
| VPCondPast -- subj na "ी माय गो"
VPGenPres -- impf hum nahim "ी गो"
| VPSmplPast --# notpresent -- impf Ta nahim "ी ौेनत"
| VPFut --# notpresent -- fut na/nahim "ी सहालल गो"
| VPPerfPres -- perf hum na/nahim "ी हावे गोने"
| VPPerfPast --# notpresent -- perf Ta na/nahim "ी हाद गोने"
| VPPerfFut --# notpresent
| VPCondPres -- subj na "ी माय गो"
| VPCondPast --# notpresent -- subj na "ी माय गो"
;
{-
VPHForm =
VPTense VPPTense Aspect Agr -- 9 * 12
| VPReq
| VPImp
| VPReqFut
| VPInf
| VPStem
;
-}
VType = VIntrans | VTrans | VTransPost ;
-- Tense defined for coupla case
CTense = CPrsnt | CPast | CFuture ;
oper
objVType : VType -> NPCase = \vt ->
@@ -396,86 +262,44 @@ resource ResNep = ParamX ** open Prelude, Predef in {
comp = \\_ => []
} ;
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ;
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ;
{-
-------------------------
-- added for cauitives
predVcc : (Verb **{c2:Compl}) -> VPHSlash = \verb ->
predV verb ** {c2 = {s = "" ; c = VTrans} } ;
------------------------
-}
{-
pya : Gender -> Number -> Str = \g,n ->
(mkAdj1 "पया").s ! n ! g ! Dir ;
cka : Gender -> Number -> Str = \g,n ->
(mkAdj1 "छका").s ! n ! g ! Dir ;
hw : PPerson -> Number -> Str = \pp,n ->
case <pp,n> of {
<Pers1,_> => "हौौाण";
<Pers2_Casual,Sg> => "हौौयण";
<Pers2_Casual,Pl> => "हौौ";
<Pers2_Respect,_> => "हौौ";
<Pers3_Distant,Sg> => "हौौै";
<Pers3_Distant,Pl> => "हौन";
<Pers3_Near,Sg> => "हौौै";
<Pers3_Near,Pl> => "हौन"
};
-}
predAux : Aux -> VPH = \verb -> {
s = \\vh =>
let
inf = verb.inf ;
part = verb.ppart ;
in
predAux : NType -> VPH =\ctype -> {
s = \\vh =>
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} ;
VF NPresent _ pl p n g =>
case ctype of {
Living => {inf = copulaPrLvng pl n p g } ;
_ => {inf = copulaPrGen pl n p g }
} ;
VF (NPast _) _ pl p n g => {inf = copulaPsGen pl n p g } ;
VF (NFuture _) _ pl p n g => {inf = copulaFtGen pl n p g } ;
Root => { inf = ""} ;
Inf=> {inf = ""} ;
Imp => {inf = ""} ;
ProgRoot a n g => {inf = "" } ;
PVForm => {inf = ""}
};
obj = {s = [] ; a = defaultAgr} ;
subj = VIntrans ;
inf = verb.inf;
inf = "";
ad = [];
embComp = [];
comp = \\_ => []
} ;
Aux = {
inf,ppart,prpart : Str
} ;
auxBe : Aux = {
inf = "" ;
ppart = "" ;
prpart = ""
} ;
raha : VTense -> Aspect -> Gender -> Number -> NPerson -> {s:Str} = \t,a,g,n,p -> {
s = case <t,a,g,n,p> of {
<NPresent,Perf,Masc,Sg,Pers1> => "इरहन्" ;
<_,_,_,_,_> => "इरहन्"
}
} ;
predProg : VPH -> VPH = \verb -> {
s = \\vh =>
case vh of {
VF NPresent a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CPrsnt pl n p g } ;
VF (NPast _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CPast pl n p g } ;
VF (NFuture _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copula CFuture pl n p g } ;
Root => {inf = (verb.s ! Root).inf } ;
VF NPresent a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copulaPrGen pl n p g} ;
VF (NPast _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copulaPsGen pl n p g} ; --# notpresent
VF (NFuture _) a pl p n g => {inf = (verb.s ! ProgRoot a n g).inf ++ copulaFtGen pl n p g} ; --# notpresent
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 } ;
@@ -491,54 +315,49 @@ resource ResNep = ParamX ** open Prelude, Predef in {
Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
-- TODO, ERGATIVE CASE FROM NOUN INFLETION
-- TODO, ERGATIVE CASE FROM NOUN INFLETION [No Proper grammer resource found]
mkClause : NP -> VPH -> Clause = \np,vp -> {
s = \\vt,b,ord =>
let
subjagr : NPCase * Agr = case vt of {
VPSmplPast => case vp.subj of {
VPSmplPast => case vp.subj of {
VTrans => <NPErg, vp.obj.a> ;
VTransPost => <NPErg, defaultAgr> ;
_ => <NPC Nom, np.a>
} ;
} ;
VPPerfPast => case vp.subj of {
VPPerfPast => case vp.subj of {
VTrans => <NPErg, vp.obj.a> ;
VTransPost => <NPErg, defaultAgr> ;
_ => <NPC Nom, np.a>
} ;
_ => <NPC Nom, np.a>
} ;
_ => <NPC Nom, np.a>
} ;
subj = subjagr.p1 ;
agr = subjagr.p2 ;
n = (fromAgr agr).n;
p = (fromAgr agr).p;
g = (fromAgr agr).g;
vps = case <vt,b> of {
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
subj = subjagr.p1 ;
agr = subjagr.p2 ;
n = (fromAgr agr).n;
p = (fromAgr agr).p;
g = (fromAgr agr).g;
vps = case <vt,b> of {
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
<VPGenPres,Neg> => vp.s ! VF NPresent Imperf Neg p n g ;
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ;
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ;
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; --# notpresent
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; --# notpresent
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ; --# notpresent
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ; --# notpresent
<VPPerfPres,Pos> => vp.s ! VF NPresent Perf Pos p n g ;
<VPPerfPres,Neg> => vp.s ! VF NPresent Perf Neg p n g ;
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ;
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ;
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ;
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ;
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ; --# notpresent
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ; --# notpresent
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ; --# notpresent
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ; --# notpresent
<VPCondPres, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<VPCondPres, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
<VPCondPast, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<VPCondPast, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
{-
<_, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<_, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
-}
};
<VPCondPast, Pos> => vp.s ! VF (NPast Hab) Perf Pos p n g ; --# notpresent
<VPCondPast, Neg> => vp.s ! VF (NPast Hab) Perf Neg p n g --# notpresent
} ;
quest =
case ord of
@@ -555,33 +374,29 @@ resource ResNep = ParamX ** open Prelude, Predef in {
\subj,agr,vp -> {
s = \\t,b,ord =>
let
n = (fromAgr agr).n;
p = (fromAgr agr).p;
g = (fromAgr agr).g;
vps = case <t,b> of {
n = (fromAgr agr).n;
p = (fromAgr agr).p;
g = (fromAgr agr).g;
vps = case <t,b> of {
<VPGenPres,Pos> => vp.s ! VF NPresent Imperf Pos p n g ;
<VPGenPres,Neg> => vp.s ! VF NPresent Imperf Neg p n g ;
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ;
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ;
<VPFut,Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ; --# notpresent
<VPFut,Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ; --# notpresent
<VPSmplPast,Pos> => vp.s ! VF (NPast Simpl) Imperf Pos p n g ; --# notpresent
<VPSmplPast,Neg> => vp.s ! VF (NPast Simpl) Imperf Neg p n g ; --# notpresent
<VPPerfPres,Pos> => vp.s ! VF NPresent Perf Pos p n g ;
<VPPerfPres,Neg> => vp.s ! VF NPresent Perf Neg p n g ;
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ;
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ;
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ;
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ;
<VPPerfPast,Pos> => vp.s ! VF (NPast Simpl) Perf Pos p n g ; --# notpresent
<VPPerfPast,Neg> => vp.s ! VF (NPast Simpl) Perf Neg p n g ; --# notpresent
<VPPerfFut,Pos> => vp.s ! VF (NFuture Defin) Perf Pos p n g ; --# notpresent
<VPPerfFut,Neg> => vp.s ! VF (NFuture Defin) Perf Neg p n g ; --# notpresent
<VPCondPres, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<VPCondPres, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g ;
<VPCondPast, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<VPCondPast, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
{-
<_, Pos> => vp.s ! VF (NFuture Defin) Imperf Pos p n g ;
<_, Neg> => vp.s ! VF (NFuture Defin) Imperf Neg p n g
-}
};
<VPCondPast, Pos> => vp.s ! VF (NPast Hab) Perf Pos p n g ; --# notpresent
<VPCondPast, Neg> => vp.s ! VF (NPast Hab) Perf Neg p n g --# notpresent
} ;
quest =
case ord of
@@ -590,112 +405,99 @@ resource ResNep = ParamX ** open Prelude, Predef in {
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
--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
} ;
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
} ;
s = vp.s ;
obj = vp2.obj ;
subj = vp.subj ;
inf = vp.inf;
ad = vp.ad;
embComp = vp.embComp ++ emb;
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
} ;
insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> {
s = vp.s;
obj = vp.obj ;
subj = vp.subj ;
inf = vp.inf;
ad = vp.ad;
embComp = Prelude.glue vp.embComp obj1;
comp = vp.comp
} ;
insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp ->
insertObj obj vp ** {c2 = vp.c2} ;
insertObj obj vp ** {c2 = vp.c2} ;
insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp ->
insertObj2 obj vp ** {c2 = vp.c2} ;
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 };
{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
s = \\ agr => vp.comp ! agr ++ (vp.s ! PVForm).inf
} ;
infV2V : VPH -> {s :Agr => Str} = \vp -> {
s = \\agr => vp.comp ! agr ++ (vp.s ! PVForm).inf --++ "लाइ"
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}
---};
obj = {s = np.s ! objVType vps.c2.c ++ vps.c2.s ++ vps.obj.s ; 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
} ;
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
} ;
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
} ;
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 ;
@@ -710,4 +512,128 @@ resource ResNep = ParamX ** open Prelude, Predef in {
embComp = vp.embComp ;
comp = vp.comp
} ;
}
-- copula cases
oper
-- For Human, occupation/Introductiary case
copulaPrLvng : Polarity -> Number -> NPerson -> Gender -> Str =
\po,n,pn,g ->
case <po,pn,n,g> of {
-- Resembles with 'mkVPreNPReg' function for positive --TODO
-- Present Positive
<Pos, Pers1, Sg, _> => "हुँ" ; -- हुँ
<Pos, Pers1, Pl, _> => "हौँ" ; -- हौँ
<Pos, Pers2_L, Sg, _> => "होस्" ; -- होस्
--<Pos, Pers2_L, Sg, Fem> => "होस्" ; -- छेस्
<Pos, Pers2_L, Pl, _> => "हौ" ; -- हौ
--<Pos, Pers2_M, Pl, Fem> => "छ्यौ" ; -- छ्यौ
<Pos, Pers2_M, _, _> => "हौ" ; -- हौ
<Pos, Pers3_L, Sg, Masc> => "हो" ; -- हो
<Pos, Pers3_L, Sg, Fem> => "हुन्" ; -- हुन्
<Pos, Pers3_L, Pl, _> => "हुन्" ; -- हुन्
--<Pos, Pers3_M, Sg, Fem> => "हुन्" ; -- हुन्
<Pos, Pers3_M, _, _> => "हुन्" ; -- हुन् --"हौ" ; -- हौ
<Pos, _ , _, _> => "हुनुहुन्छ" ; --हुनुहुन्छ
-- Present Negative
<Neg, Pers1, Sg, _> => "हैन" ; --
<Neg, Pers1, Pl, _> => "हैनौं" ; -- हैनौं
<Neg, Pers2_L, Sg, _> => "हैनस्" ; -- हैनस्
<Neg, Pers2_L, Pl, _> => "हैनौ" ; -- हैनौ
<Neg, Pers2_M, _, _> => "हैनौ" ; -- हैनौ
<Neg, Pers3_L, Sg, _> => "हैन" ; --हैन
<Neg, Pers3_L, Pl, _> => "हैनन्" ; -- हैनन्
<Neg, Pers3_M, _, _> => "हैनन्" ; -- हैनन्
<Neg, _, _, _> => "हुनुहुन्‌न" -- हुनुहुन्‌न
} ;
copulaPrGen : Polarity -> Number -> NPerson -> Gender -> Str =
\po,n,pn,g ->
case <po,pn,n,g> of {
<Pos, Pers1, Sg, _> => "छु" ; -- छु
<Pos, Pers1, Pl, _> => "छौं" ; -- छौं
<Pos, Pers2_L, Sg, Masc> => "छस्" ; -- छस्
<Pos, Pers2_L, Sg, Fem> => "छेस्" ; -- छेस्
<Pos, Pers2_L, Pl, _> => "छौ" ; -- छौ
<Pos, Pers2_M, Pl, Fem> => "छ्यौ" ; -- छ्यौ
<Pos, Pers2_M, _, _> => "छौ" ; -- छौ
<Pos, Pers3_L, Sg, Masc> => "छ" ; -- छ
<Pos, Pers3_L, Sg, Fem> => "छे" ; -- छे
<Pos, Pers3_L, Pl, _> => "छन्" ; -- छन्
<Pos, Pers3_M, Sg, Fem> => "छिन्" ; -- छिन्
<Pos, Pers3_M, _, _> => "छन्" ; -- छन्
<Pos, _ , _, _> => "हुनुहुन्छ" ; --हुनुहुन्छ
-- Present Negative
<Neg, Pers1, Sg, _> => "छैनँ" ; -- छैनँ
<Neg, Pers1, Pl, _> => "छैनौं" ; -- छैनौं
<Neg, Pers2_L, Sg, _> => "छैनस्" ; -- छैनस्
<Neg, Pers2_L, Pl, _> => "छैनौ" ; -- छैनौ
<Neg, Pers2_M, _, _> => "छैनौ" ; -- छैनौ
<Neg, Pers3_L, Sg, _> => "छैन" ; --छैन
<Neg, Pers3_L, Pl, _> => "छैनन्" ; -- छैनन्
<Neg, Pers3_M, _, _> => "छैनन्" ; -- छैनन्
<Neg, _, _, _> => "हुनुहुन्‌न" -- हुनुहुन्‌न
} ;
copulaPsGen : Polarity -> Number -> NPerson -> Gender -> Str =
\po,n,pn,g ->
case <po,pn,n,g> of {
-- Past Positive
<Pos, Pers1, Sg, _> => "थिएँ" ; -- थिएँ
<Pos, Pers1, Pl, _> => "थियौँ" ; -- थियौँ
<Pos, Pers2_L, Sg, _> => "थिइस्" ; -- थिइस्
<Pos, Pers2_L, Pl, _> => "थियौ" ; -- थियौ
<Pos, Pers2_M, _, _> => "थियौ" ; -- थियौ
<Pos, Pers3_L, Sg, Masc> => "थियो" ; -- थियो
<Pos, Pers3_L, Sg, Fem> => "थिई" ; --थिई
<Pos, Pers3_L, Pl, _> => "थिए" ; -- थिए
<Pos, Pers3_M, Sg, Fem> => "थिइन्" ; -- थिइन्
<Pos, Pers3_M, _, _> => "थिए" ; -- थिए
<Pos, _, _, _> => "हुनुहुन्‌थ्यो" ; -- हुनुहुन्‌थ्यो
-- Past Positive
<Neg, Pers1, Sg, _> => "थिनँ" ; -- थिनँ
<Neg, Pers1, Pl, _> => "थेनौं" ; -- थेनौं
<Neg, Pers2_L, Sg, _> => "थिनस्" ; -- थिनस्
<Neg, Pers2_L, Pl, _> => "थेनौ" ; -- थेनौ
<Neg, Pers2_M, _, _> => "थेनौ" ; -- थेनौ
<Neg, Pers3_L, Sg, Masc> => "थेन" ; -- थेन
<Neg, Pers3_L, Sg, Fem> => "थिन" ; --थिन
<Neg, Pers3_L, Pl, _> => "थेनन्" ; -- थेनन्
<Neg, Pers3_M, Sg, Fem> => "थिनन्" ; -- थिनन्
<Neg, Pers3_M, _, _> => "थेनन्" ; -- थेनन्
<Neg, _, _, _> => "हुनुहुन्‌नथ्यो" -- हुनुहुन्‌नथ्यो
} ;
copulaFtGen : Polarity -> Number -> NPerson -> Gender -> Str =
\po,n,pn,g ->
case <po,pn,n,g> of {
-- Future Positive
<Pos, Pers1, Sg, _> => "हुनेछु" ; -- हुनेछु
<Pos, Pers1, Pl, _> => "हुनेछौं" ; -- हुनेछौं
<Pos, Pers2_L, Sg, _> => "हुनेछस्" ; -- हुनेछस्
<Pos, Pers2_L, Pl, _> => "हुनेछौं" ; -- हुनेछौ
<Pos, Pers2_M, _, _> => "हुनेछौं" ; -- हुनेछौ
<Pos, Pers3_L, Sg, _> => "हुनेछ" ; -- हुनेछ
<Pos, Pers3_L, Pl, _> => "हुनेछन्" ; -- हुनेछन्
<Pos, Pers3_M, _, Masc> => "हुनेछन्" ; -- हुनेछन्
<Pos, Pers3_M, Sg, Fem> => "हुनेछन्" ; -- हुनेछिन्
<Pos, Pers3_M, Pl, Fem> => "हुनेछन्" ; -- हुनेछन्
<Pos, _, _, _> => "हुनुहुनेछ" ; -- हुनुहुनेछ
-- Negative Case
<Neg, Pers1, Sg, _> => "हुनेछैन" ; -- हुनेछैन
<Neg, Pers1, Pl, _> => "हुनेछैनैँ" ; -- हुनेछैनैँ
<Neg, Pers2_L, Sg, _> => "हुनेछैनस्" ; -- हुनेछैनस्
<Neg, Pers2_L, Pl, _> => "हुनेछैनै" ; -- हुनेछैनै
<Neg, Pers2_M, _, _> => "हुनेछैनै" ; -- हुनेछैनै
<Neg, Pers3_L, Sg, _> => "हुनेछैन्" ; -- हुनेछैन्
<Neg, Pers3_L, Pl, _> => "हुनेछैनन्" ; -- हुनेछैनन्
<Neg, Pers3_M, Sg, _> => "हुनेछैनन्" ; -- हुनेछैनन्
<Neg, Pers3_M, Pl, _> => "हुनेछैनै" ; -- हुनेछैनै
<Neg, _, _, _> => "हुनुहुनेछैन्" -- हुनुहुनेछैन्
} ;
}