forked from GitHub/gf-rgl
Merge pull request #82 from inariksit/arabic
(Ara) Various fixes with nouns, compounding, attributes etc.
This commit is contained in:
@@ -99,7 +99,7 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
s = \\_,_,_,_ => p.s ! Gen;
|
s = \\_,_,_,_ => BIND ++ p.s ! Gen;
|
||||||
d = Poss;
|
d = Poss;
|
||||||
is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ;
|
is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ;
|
||||||
isPron = True;
|
isPron = True;
|
||||||
@@ -195,7 +195,7 @@ lin
|
|||||||
-- : CN -> NP -> CN ; -- house of Paris, house of mine
|
-- : CN -> NP -> CN ; -- house of Paris, house of mine
|
||||||
PossNP cn np = cn ** {
|
PossNP cn np = cn ** {
|
||||||
s = \\n,_d,c => cn.s ! n ! Const ! c ;
|
s = \\n,_d,c => cn.s ! n ! Const ! c ;
|
||||||
s2 = \\n,_d,c => cn.s2 ! n ! Const ! c ;
|
s2 = \\n,_d,c => cn.s2 ! n ! Const ! Gen ; -- unsure about this /IL
|
||||||
np = \\c => cn.np ! c ++ np.s ! Gen
|
np = \\c => cn.np ! c ++ np.s ! Gen
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ resource ParadigmsAra = open
|
|||||||
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 noun with invariant attribute
|
mkN : N -> (attr : Str) -> N ; -- Compound noun with invariant attribute
|
||||||
mkN : N -> N -> N ; -- Compound noun where both parts inflect
|
mkN : N -> N -> N ; -- Compound noun where attribute inflects in state and case but not number
|
||||||
|
mkN : Number -> N -> N -> N ; -- Compound noun where attribute inflects in state, case and number
|
||||||
--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural
|
--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural
|
||||||
--- = sdfN ;
|
--- = sdfN ;
|
||||||
} ;
|
} ;
|
||||||
@@ -100,7 +101,7 @@ 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
|
mkPN : N -> PN
|
||||||
= \n -> lin PN (n ** {s = \\c => n.s ! Sg ! Const ! Bare}) ; -- no idea /IL
|
= \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 ;
|
||||||
@@ -338,16 +339,21 @@ resource ParadigmsAra = open
|
|||||||
= mkFullN ;
|
= mkFullN ;
|
||||||
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 with noninflecting attribute
|
||||||
= \n,attr -> n ** {s2 = \\n,s,c => attr} ;
|
= \n,attr -> n ** {s2 = \\n,s,c => attr} ;
|
||||||
mkN : N -> N -> N -- Compound nouns
|
mkN : N -> N -> N -- Compound nouns where attribute inflects in state and case but not number
|
||||||
= \n1,n2 -> n1 ** {
|
= attrN Sg ;
|
||||||
s = \\n,_,c => n1.s ! n ! Const ! c ;
|
mkN : Number -> N -> N -> N -- Compound nouns where attribute inflects in state, case and number
|
||||||
s2 = \\n,s,c => n1.s2 ! n ! s ! c
|
= attrN ;
|
||||||
++ n2.s ! n ! s ! c
|
|
||||||
++ n2.s2 ! n ! s ! c} ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
attrN : Number -> N -> N -> N = \num,n1,n2 -> n1 ** {
|
||||||
|
s = \\n,_,c => n1.s ! n ! Const ! c ;
|
||||||
|
s2 = \\n,s,c => let c' = case c of {Dat => Gen; _ => c} in -- the Dat with liPrep hack only applies to the first word
|
||||||
|
n1.s2 ! num ! s ! c' -- attribute doesn't change
|
||||||
|
++ n2.s ! num ! s ! c'
|
||||||
|
++ n2.s2 ! num ! s ! c'} ;
|
||||||
|
|
||||||
dualN : N -> N = \n -> n ** {isDual=True} ;
|
dualN : N -> N = \n -> n ** {isDual=True} ;
|
||||||
|
|
||||||
proDrop : NP -> NP ; -- Force a NP to lose its string, only contributing with its agreement.
|
proDrop : NP -> NP ; -- Force a NP to lose its string, only contributing with its agreement.
|
||||||
@@ -361,7 +367,7 @@ resource ParadigmsAra = open
|
|||||||
= v1 ;
|
= v1 ;
|
||||||
mkV : (root : Str) -> VerbForm -> V -- FormI .. FormX (no VII, IX) ; default vowels a u for I
|
mkV : (root : Str) -> VerbForm -> V -- FormI .. FormX (no VII, IX) ; default vowels a u for I
|
||||||
= formV ;
|
= formV ;
|
||||||
mkV : V -> (particle : Str) -> V = \v,p ->
|
mkV : V -> (particle : Str) -> V = \v,p ->
|
||||||
v ** { s = \\vf => v.s ! vf ++ p } ;
|
v ** { s = \\vf => v.s ! vf ++ p } ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -466,7 +472,7 @@ resource ParadigmsAra = open
|
|||||||
rbT = mkRoot3 rootStr ;
|
rbT = mkRoot3 rootStr ;
|
||||||
v8fun = case rbT.f of {
|
v8fun = case rbT.f of {
|
||||||
("و"|"ي"|"ّ") => v8assimilated ;
|
("و"|"ي"|"ّ") => v8assimilated ;
|
||||||
_ =>
|
_ =>
|
||||||
case rbT.c of {
|
case rbT.c of {
|
||||||
#weak => v8hollow ;
|
#weak => v8hollow ;
|
||||||
_ => v8sound }}
|
_ => v8sound }}
|
||||||
@@ -512,7 +518,7 @@ resource ParadigmsAra = open
|
|||||||
let { kalimaStr = mkWord sg root;
|
let { kalimaStr = mkWord sg root;
|
||||||
kalimaRaw = sndf kalimaStr;
|
kalimaRaw = sndf kalimaStr;
|
||||||
kalima : NTable = \\n,d,c => case root of {
|
kalima : NTable = \\n,d,c => case root of {
|
||||||
_ + #hamza + _
|
_ + #hamza + _
|
||||||
=> rectifyHmz (kalimaRaw ! n ! d ! c);
|
=> rectifyHmz (kalimaRaw ! n ! d ! c);
|
||||||
_ => kalimaRaw ! n ! d ! c
|
_ => kalimaRaw ! n ! d ! c
|
||||||
};
|
};
|
||||||
@@ -540,9 +546,9 @@ resource ParadigmsAra = open
|
|||||||
prepN2 : N -> Preposition -> N2 = \n,p -> lin N2 (n ** {c2 = p}) ;
|
prepN2 : N -> Preposition -> N2 = \n,p -> lin N2 (n ** {c2 = p}) ;
|
||||||
|
|
||||||
mkN3 = overload {
|
mkN3 = overload {
|
||||||
mkN3 : N -> Preposition -> Preposition -> N3 = \n,p,q ->
|
mkN3 : N -> Preposition -> Preposition -> N3 = \n,p,q ->
|
||||||
lin N3 (n ** {c2 = p ; c3 = q}) ;
|
lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||||
mkN3 : N -> Str -> Str -> N3 = \n,p,q ->
|
mkN3 : N -> Str -> Str -> N3 = \n,p,q ->
|
||||||
lin N3 (n ** {c2 = mkPreposition p ; c3 = mkPreposition q}) ;
|
lin N3 (n ** {c2 = mkPreposition p ; c3 = mkPreposition q}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -552,12 +558,12 @@ resource ParadigmsAra = open
|
|||||||
proDrop : NP -> NP = \np -> lin NP (ResAra.proDrop np) ;
|
proDrop : NP -> NP = \np -> lin NP (ResAra.proDrop np) ;
|
||||||
|
|
||||||
-- e.g. al-jamii3, 2a7ad
|
-- e.g. al-jamii3, 2a7ad
|
||||||
regNP : Str -> Number -> NP = \word,n -> lin NP (emptyNP ** {
|
regNP : Str -> Number -> NP = \word,n -> lin NP (emptyNP ** {
|
||||||
s = \\c => fixShd word (dec1sg ! Def ! c)
|
s = \\c => fixShd word (dec1sg ! Def ! c)
|
||||||
});
|
});
|
||||||
|
|
||||||
-- e.g. hadha, dhaalika
|
-- e.g. hadha, dhaalika
|
||||||
indeclNP : Str -> Number -> NP = \word,n -> lin NP (emptyNP ** {
|
indeclNP : Str -> Number -> NP = \word,n -> lin NP (emptyNP ** {
|
||||||
s = \\c => word
|
s = \\c => word
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -656,18 +662,18 @@ resource ParadigmsAra = open
|
|||||||
dirV2 v = prepV2 v (casePrep acc) ;
|
dirV2 v = prepV2 v (casePrep acc) ;
|
||||||
|
|
||||||
mkV3 = overload {
|
mkV3 = overload {
|
||||||
mkV3 : V -> Preposition -> Preposition -> V3 = \v,p,q ->
|
mkV3 : V -> Preposition -> Preposition -> V3 = \v,p,q ->
|
||||||
lin V3 (prepV3 v p q) ;
|
lin V3 (prepV3 v p q) ;
|
||||||
mkV3 : V -> Str -> Str -> V3 = \v,p,q ->
|
mkV3 : V -> Str -> Str -> V3 = \v,p,q ->
|
||||||
lin V3 (v ** {s = v.s ; c2 = mkPreposition p ; c3 = mkPreposition q})
|
lin V3 (v ** {s = v.s ; c2 = mkPreposition p ; c3 = mkPreposition q})
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
prepV3 : V -> Preposition -> Preposition -> Verb3 = \v,p,q ->
|
prepV3 : V -> Preposition -> Preposition -> Verb3 = \v,p,q ->
|
||||||
v ** {s = v.s ; c2 = p ; c3 = q} ;
|
v ** {s = v.s ; c2 = p ; c3 = q} ;
|
||||||
|
|
||||||
dirV3 = overload {
|
dirV3 = overload {
|
||||||
dirV3 : V -> Preposition -> V3 = \v,p -> mkV3 v (casePrep acc) p ;
|
dirV3 : V -> Preposition -> V3 = \v,p -> mkV3 v (casePrep acc) p ;
|
||||||
dirV3 : V -> Str -> V3 = \v,s -> mkV3 v (casePrep acc) (mkPreposition s)
|
dirV3 : V -> Str -> V3 = \v,s -> mkV3 v (casePrep acc) (mkPreposition s)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
dirdirV3 v = dirV3 v (casePrep acc) ;
|
dirdirV3 v = dirV3 v (casePrep acc) ;
|
||||||
@@ -687,7 +693,7 @@ resource ParadigmsAra = open
|
|||||||
mkV0 v = v ;
|
mkV0 v = v ;
|
||||||
mkV2S v p = lin V2S (prepV2 v (mkPreposition p)) ;
|
mkV2S v p = lin V2S (prepV2 v (mkPreposition p)) ;
|
||||||
mkV2V = overload {
|
mkV2V = overload {
|
||||||
mkV2V : V -> Str -> Str -> V2V = \v,p,q ->
|
mkV2V : V -> Str -> Str -> V2V = \v,p,q ->
|
||||||
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q) ** {sc = noPrep}) ;
|
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q) ** {sc = noPrep}) ;
|
||||||
mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q ->
|
mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q ->
|
||||||
lin V2V (prepV3 v p q ** {sc = noPrep}) ;
|
lin V2V (prepV3 v p q ** {sc = noPrep}) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user