forked from GitHub/gf-rgl
(Ara) Changes to nouns and NPs
This commit is contained in:
@@ -93,5 +93,6 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
|||||||
linref
|
linref
|
||||||
|
|
||||||
CN = \cn -> uttCN cn ! Masc ;
|
CN = \cn -> uttCN cn ! Masc ;
|
||||||
|
N = \n -> uttCN (useN n) ! Masc ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ lin
|
|||||||
cn.s ! number
|
cn.s ! number
|
||||||
! nounState det.d number
|
! nounState det.d number
|
||||||
! nounCase c det.n det.d ;
|
! nounCase c det.n det.d ;
|
||||||
adj : Case -> Str = \c ->
|
adj : NTable -> Case -> Str = \ntable,c ->
|
||||||
cn.adj ! number
|
ntable ! number
|
||||||
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
||||||
! c
|
! c
|
||||||
} in {
|
} in {
|
||||||
@@ -22,30 +22,34 @@ lin
|
|||||||
case cnB4det det.isPron det.isNum det.n det.d of {
|
case cnB4det det.isPron det.isNum det.n det.d of {
|
||||||
False => determiner c
|
False => determiner c
|
||||||
++ noun c
|
++ noun c
|
||||||
++ adj c
|
++ adj cn.s2 c
|
||||||
|
++ adj cn.adj c
|
||||||
++ cn.np ! c ;
|
++ cn.np ! c ;
|
||||||
True => noun (cas c) -- deal with possessive suffix
|
True => noun (cas c) -- deal with possessive suffix
|
||||||
++ determiner c
|
++ determiner c
|
||||||
++ adj c
|
++ adj cn.s2 c
|
||||||
|
++ adj cn.adj c
|
||||||
++ cn.np ! c
|
++ cn.np ! c
|
||||||
};
|
};
|
||||||
a = { pgn = agrP3 cn.h cn.g number;
|
a = { pgn = agrP3 cn.h cn.g number;
|
||||||
isPron = False }
|
isPron = False } ;
|
||||||
|
empty = []
|
||||||
};
|
};
|
||||||
|
|
||||||
UsePN pn = {
|
UsePN pn = {
|
||||||
s = pn.s;
|
s = pn.s;
|
||||||
a = {pgn = (Per3 pn.g Sg); isPron = False }
|
a = {pgn = Per3 pn.g Sg ; isPron = False} ;
|
||||||
|
empty = []
|
||||||
};
|
};
|
||||||
|
|
||||||
UsePron p = p ;
|
UsePron p = p ;
|
||||||
|
|
||||||
PredetNP pred np = {
|
PredetNP pred np = np ** {
|
||||||
s = \\c => case pred.isDecl of {
|
s = \\c => case pred.isDecl of {
|
||||||
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
|
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
|
||||||
False => pred.s!c ++ np.s ! c
|
False => pred.s!c ++ np.s ! c
|
||||||
};
|
} ;
|
||||||
a = np.a
|
a = np.a ** {isPron=False}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
@@ -167,21 +171,18 @@ lin
|
|||||||
|
|
||||||
MassNP cn = ---- AR
|
MassNP cn = ---- AR
|
||||||
{s = \\c => cn.s ! Sg ! Indef ! c ++ cn.np ! c ++ cn.adj ! Sg ! Indef ! c ;
|
{s = \\c => cn.s ! Sg ! Indef ! c ++ cn.np ! c ++ cn.adj ! Sg ! Indef ! c ;
|
||||||
a = {pgn = Per3 cn.g Sg ; isPron = False}} ;
|
a = {pgn = Per3 cn.g Sg ; isPron = False} ;
|
||||||
|
empty = []} ;
|
||||||
|
|
||||||
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
|
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
|
||||||
-- isNum = False; isPron = False} ;
|
-- isNum = False; isPron = False} ;
|
||||||
|
|
||||||
UseN,
|
UseN,
|
||||||
UseN2 = \n -> n ** {
|
UseN2 = useN ;
|
||||||
adj = \\_,_,_ => [];
|
|
||||||
np = \\_ => []};
|
|
||||||
Use2N3 n3 = n3 ;
|
Use2N3 n3 = n3 ;
|
||||||
Use3N3 n3 = n3 ** {c2 = n3.c3} ;
|
Use3N3 n3 = n3 ** {c2 = n3.c3} ;
|
||||||
|
|
||||||
ComplN2 n2 np = UseN n2 ** --- IL
|
ComplN2 n2 np = UseN n2 ** {np=np.s} ;
|
||||||
{s = \\n,s,c => n2.s ! n ! s ! c ++ n2.c2.s ++ np.s ! n2.c2.c} ;
|
|
||||||
|
|
||||||
|
|
||||||
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;
|
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ resource ParadigmsAra = open
|
|||||||
mkN : (sg,pl : Str) -> Gender -> Species -> N ;
|
mkN : (sg,pl : Str) -> Gender -> Species -> N ;
|
||||||
mkN : NTable -> Gender -> Species -> N ; -- loan words, irregular
|
mkN : NTable -> Gender -> Species -> N ; -- loan words, irregular
|
||||||
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N ; -- broken plural
|
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N ; -- broken plural
|
||||||
mkN : N -> (attr : Str) -> N ; -- Compound nouns
|
mkN : N -> (attr : Str) -> N ; -- Compound noun with invariant attribute
|
||||||
|
mkN : N -> N -> N ; -- Compound noun where both parts inflect
|
||||||
--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural
|
--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural
|
||||||
--- = sdfN ;
|
--- = sdfN ;
|
||||||
} ;
|
} ;
|
||||||
@@ -97,6 +98,8 @@ resource ParadigmsAra = open
|
|||||||
mkPN = overload {
|
mkPN = overload {
|
||||||
mkPN : Str -> PN -- Fem Hum if ends with ة, otherwise Masc Hum
|
mkPN : Str -> PN -- Fem Hum if ends with ة, otherwise Masc Hum
|
||||||
= smartPN ;
|
= smartPN ;
|
||||||
|
mkPN : N -> PN
|
||||||
|
= \n -> lin PN (n ** {s = \\c => n.s ! Sg ! Const ! Bare}) ; -- no idea /IL
|
||||||
mkPN : Str -> Gender -> Species -> PN
|
mkPN : Str -> Gender -> Species -> PN
|
||||||
= mkFullPN ;
|
= mkFullPN ;
|
||||||
} ;
|
} ;
|
||||||
@@ -343,7 +346,12 @@ resource ParadigmsAra = open
|
|||||||
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural
|
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural
|
||||||
= brkN ;
|
= brkN ;
|
||||||
mkN : N -> (attr : Str) -> N -- Compound nouns
|
mkN : N -> (attr : Str) -> N -- Compound nouns
|
||||||
= \n,attr -> n ** { s = \\num,s,c => n.s ! num ! s ! c ++ attr } ; --- IL (TODO: all kinds of compounds)
|
= \n,attr -> n ** {s2 = \\n,s,c => attr} ;
|
||||||
|
mkN : N -> N -> N -- Compound nouns
|
||||||
|
= \n1,n2 -> n1 ** {s2 =
|
||||||
|
\\n,s,c => n1.s2 ! n ! s ! c -- card
|
||||||
|
++ n2.s ! n ! s ! c -- type
|
||||||
|
++ n2.s2 ! n ! s ! c} ; -- blood
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV = overload {
|
mkV = overload {
|
||||||
@@ -464,6 +472,7 @@ resource ParadigmsAra = open
|
|||||||
|
|
||||||
mkFullN nsc gen spec =
|
mkFullN nsc gen spec =
|
||||||
{ s = nsc; --NTable
|
{ s = nsc; --NTable
|
||||||
|
s2 = emptyNTable;
|
||||||
g = gen;
|
g = gen;
|
||||||
h = spec;
|
h = spec;
|
||||||
lock_N = <>
|
lock_N = <>
|
||||||
@@ -476,14 +485,12 @@ resource ParadigmsAra = open
|
|||||||
} in mkFullN (reg kitAb kutub) gen spec;
|
} in mkFullN (reg kitAb kutub) gen spec;
|
||||||
|
|
||||||
brkN root sg pl gen spec =
|
brkN root sg pl gen spec =
|
||||||
let { raw = brkN' root sg pl gen spec} in
|
let { raw = brkN' root sg pl gen spec} in raw **
|
||||||
{ s = \\n,d,c =>
|
{ s = \\n,d,c =>
|
||||||
case root of {
|
case root of {
|
||||||
_ + #hamza + _ => rectifyHmz(raw.s ! n ! d ! c);
|
_ + #hamza + _ => rectifyHmz(raw.s ! n ! d ! c);
|
||||||
_ => raw.s ! n ! d ! c
|
_ => raw.s ! n ! d ! c
|
||||||
};
|
}
|
||||||
g = gen;
|
|
||||||
h = spec ; lock_N = <>
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sdfN =
|
sdfN =
|
||||||
@@ -525,31 +532,31 @@ resource ParadigmsAra = open
|
|||||||
lin N3 (n ** {c2 = mkPreposition p ; c3 = mkPreposition q}) ;
|
lin N3 (n ** {c2 = mkPreposition p ; c3 = mkPreposition q}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
|
mkPron : (_,_,_ : Str) -> PerGenNum -> Pron = \ana,nI,I,pgn ->
|
||||||
{ s =
|
lin Pron { s =
|
||||||
table {
|
table {
|
||||||
Acc => BIND ++ nI; -- object suffix
|
Acc => BIND ++ nI; -- object suffix
|
||||||
Gen => BIND ++ I; -- possessive suffix
|
Gen => BIND ++ I; -- possessive suffix
|
||||||
_ => ana
|
_ => ana
|
||||||
};
|
};
|
||||||
a = {pgn = pgn; isPron = True };
|
a = {pgn = pgn; isPron = True };
|
||||||
lock_NP = <>
|
empty = []
|
||||||
};
|
};
|
||||||
|
|
||||||
proDrop : NP -> NP = ResAra.proDrop ; -- Force a NP to lose its string, only contributing with its agreement.
|
proDrop : NP -> NP = ResAra.proDrop ; -- Force a NP to lose its string, only contributing with its agreement.
|
||||||
|
|
||||||
-- e.g. al-jamii3, 2a7ad
|
-- e.g. al-jamii3, 2a7ad
|
||||||
regNP : Str -> Number -> NP = \word,n ->
|
regNP : Str -> Number -> NP = \word,n -> lin NP
|
||||||
{ s = \\c => fixShd word (dec1sg ! Def ! c) ;
|
{ s = \\c => fixShd word (dec1sg ! Def ! c) ;
|
||||||
a = {pgn = Per3 Masc n; isPron = False };
|
a = {pgn = Per3 Masc n; isPron = False };
|
||||||
lock_NP = <>
|
empty = []
|
||||||
};
|
};
|
||||||
|
|
||||||
-- e.g. hadha, dhaalika
|
-- e.g. hadha, dhaalika
|
||||||
indeclNP : Str -> Number -> NP = \word,n ->
|
indeclNP : Str -> Number -> NP = \word,n -> lin NP
|
||||||
{ s = \\c => word ;
|
{ s = \\c => word ;
|
||||||
a = {pgn = Per3 Masc n; isPron = False };
|
a = {pgn = Per3 Masc n; isPron = False };
|
||||||
lock_NP = <>
|
empty = []
|
||||||
};
|
};
|
||||||
|
|
||||||
mkQuant7 : (_,_,_,_,_,_,_ : Str) -> State -> Quant =
|
mkQuant7 : (_,_,_,_,_,_,_ : Str) -> State -> Quant =
|
||||||
|
|||||||
@@ -106,9 +106,10 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
|||||||
--types of open classes:
|
--types of open classes:
|
||||||
|
|
||||||
NTable = Number => State => Case => Str;
|
NTable = Number => State => Case => Str;
|
||||||
|
emptyNTable : NTable = \\n,s,c => [] ;
|
||||||
|
|
||||||
Preposition : Type = {s : Str ; c : Case} ;
|
Preposition : Type = {s : Str ; c : Case} ;
|
||||||
Noun : Type = {s : NTable ; g : Gender; h : Species} ;
|
Noun : Type = {s,s2 : NTable ; g : Gender; h : Species} ;
|
||||||
Noun2 : Type = Noun ** {c2 : Preposition} ;
|
Noun2 : Type = Noun ** {c2 : Preposition} ;
|
||||||
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
|
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
|
||||||
|
|
||||||
@@ -129,8 +130,13 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
|||||||
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL
|
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL
|
||||||
|
|
||||||
CN : Type = Noun ** {adj : NTable ; np : Case => Str};
|
CN : Type = Noun ** {adj : NTable ; np : Case => Str};
|
||||||
|
|
||||||
|
useN : Noun -> CN = \n -> n ** {adj = \\_,_,_ => []; np = \\_ => []} ;
|
||||||
|
|
||||||
uttCN : CN -> (Gender => Str) ;
|
uttCN : CN -> (Gender => Str) ;
|
||||||
uttCN cn = \\_ => cn.s ! Sg ! Indef ! Bare ;
|
uttCN cn = \\_ => cn.s ! Sg ! Indef ! Bare ++
|
||||||
|
cn.s2 ! Sg ! Indef ! Bare ++
|
||||||
|
cn.adj ! Sg ! Indef ! Bare ;
|
||||||
|
|
||||||
NumOrdCard : Type = {
|
NumOrdCard : Type = {
|
||||||
s : Gender => State => Case => Str ;
|
s : Gender => State => Case => Str ;
|
||||||
@@ -1206,7 +1212,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
|
|
||||||
NP : Type = {
|
NP : Type = {
|
||||||
s : Case => Str ;
|
s : Case => Str ;
|
||||||
a : Agr
|
a : Agr ;
|
||||||
|
empty : Str -- to prevent ambiguities with prodrop
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
proDrop : NP -> NP = \np ->
|
proDrop : NP -> NP = \np ->
|
||||||
@@ -1215,7 +1222,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
_ => np
|
_ => np
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
emptyNP : NP = {s = \\_ => [] ; a = {pgn = Per3 Masc Sg ; isPron = False}} ;
|
emptyNP : NP = {
|
||||||
|
s = \\_ => [] ;
|
||||||
|
a = {pgn = Per3 Masc Sg ; isPron = False} ;
|
||||||
|
empty = []} ;
|
||||||
|
|
||||||
IP : Type = {
|
IP : Type = {
|
||||||
s : Bool -- different forms for "what is this" and "what do you do"
|
s : Bool -- different forms for "what is this" and "what do you do"
|
||||||
|
|||||||
Reference in New Issue
Block a user