mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
@@ -22,13 +22,20 @@ lin
|
|||||||
n_hours_NP : NP = mkNP n_card time ;
|
n_hours_NP : NP = mkNP n_card time ;
|
||||||
in SyntaxAra.mkAdv during_Prep n_hours_NP | ParadigmsAra.mkAdv (n_hours_NP.s ! R.Nom) ;
|
in SyntaxAra.mkAdv during_Prep n_hours_NP | ParadigmsAra.mkAdv (n_hours_NP.s ! R.Nom) ;
|
||||||
|
|
||||||
-- random guesses
|
weekdayPunctualAdv w = ParadigmsAra.mkAdv ((mkNP w).s ! R.Nom) ; -- on Sunday
|
||||||
weekdayPunctualAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- on Sunday
|
-- weekdayPunctualAdv w = SyntaxAra.mkAdv noPrep (mkNP w) ; -- on Sunday
|
||||||
weekdayHabitualAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- on Sundays
|
-- TODO
|
||||||
weekdayNextAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- next Sunday
|
weekdayHabitualAdv, -- on Sundays
|
||||||
weekdayLastAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- last Sunday
|
weekdayNextAdv, -- next Sunday
|
||||||
|
weekdayLastAdv = weekdayPunctualAdv ; -- last Sunday
|
||||||
|
|
||||||
|
monthAdv january =
|
||||||
|
let january_CN : CN = mkCN month_Timeunit (mkNP (mkPN january)) ;
|
||||||
|
january_NP : NP = R.emptyNP **
|
||||||
|
{s = \\c => R.cn2str january_CN R.Sg R.Const c ;
|
||||||
|
a = {pgn = R.Per3 january_CN.g R.Sg ; isPron = False}} ;
|
||||||
|
in SyntaxAra.mkAdv R.biPrep january_NP ;
|
||||||
|
|
||||||
monthAdv m = SyntaxAra.mkAdv in_Prep (mkNP m) ;
|
|
||||||
yearAdv y = SyntaxAra.mkAdv in_Prep y ;
|
yearAdv y = SyntaxAra.mkAdv in_Prep y ;
|
||||||
|
|
||||||
-- dummy
|
-- dummy
|
||||||
@@ -91,31 +98,31 @@ oper mkLanguage : Str -> N = mkN ;
|
|||||||
lin second_Timeunit = mkN "second" ;
|
lin second_Timeunit = mkN "second" ;
|
||||||
lin minute_Timeunit = mkN "minute" ;
|
lin minute_Timeunit = mkN "minute" ;
|
||||||
lin hour_Timeunit = mkN "hour" ;
|
lin hour_Timeunit = mkN "hour" ;
|
||||||
lin day_Timeunit = mkN "day" ;
|
lin day_Timeunit = mkN "يَوْم" ;
|
||||||
lin week_Timeunit = mkN "week" ;
|
lin week_Timeunit = mkN "week" ;
|
||||||
lin month_Timeunit = mkN "month" ;
|
lin month_Timeunit = mkN "شَهْر" "أَشْهُر" masc nohum ;
|
||||||
lin year_Timeunit = mkN "year" ;
|
lin year_Timeunit = mkN "year" ;
|
||||||
|
|
||||||
lin monday_Weekday = mkN "Monday" ;
|
lin monday_Weekday = mkN day_Timeunit (mkN "إثْنَيْن") ;
|
||||||
lin tuesday_Weekday = mkN "Tuesday" ;
|
lin tuesday_Weekday = mkN day_Timeunit (mkN "ثُلَاثَاء") ;
|
||||||
lin wednesday_Weekday = mkN "Wednesday" ;
|
lin wednesday_Weekday = mkN day_Timeunit (mkN "أَرْبَعَاء") ;
|
||||||
lin thursday_Weekday = mkN "Thursday" ;
|
lin thursday_Weekday = mkN day_Timeunit (mkN "خَمِيس") ;
|
||||||
lin friday_Weekday = mkN "Friday" ;
|
lin friday_Weekday = mkN day_Timeunit (mkN "جُمْعَة") ;
|
||||||
lin saturday_Weekday = mkN "Saturday" ;
|
lin saturday_Weekday = mkN day_Timeunit (mkN "سَبْت") ;
|
||||||
lin sunday_Weekday = mkN "Sunday" ;
|
lin sunday_Weekday = mkN day_Timeunit (mkN "أَحَد") ;
|
||||||
|
|
||||||
lin january_Month = mkN "January" ;
|
lin january_Month = mkN (mkN "كَانُون") (mkAP (mkOrd (mkNumeral n2_Unit))) ;
|
||||||
lin february_Month = mkN "February" ;
|
lin february_Month = mkN "شُبَاط" ;
|
||||||
lin march_Month = mkN "March" ;
|
lin march_Month = mkN "آذَار" ;
|
||||||
lin april_Month = mkN "April" ;
|
lin april_Month = mkN "نَيْسَان" ;
|
||||||
lin may_Month = mkN "May" ;
|
lin may_Month = mkN "أَيَّار" ;
|
||||||
lin june_Month = mkN "June" ;
|
lin june_Month = mkN "حَزِيرَان" ;
|
||||||
lin july_Month = mkN "July" ;
|
lin july_Month = mkN "تَمُّوز" ;
|
||||||
lin august_Month = mkN "August" ;
|
lin august_Month = mkN "آب" ;
|
||||||
lin september_Month = mkN "September" ;
|
lin september_Month = mkN "أَيْلُول" ;
|
||||||
lin october_Month = mkN "October" ;
|
lin october_Month = mkN (mkN "تِشْرِين") (mkAP (mkOrd (mkNumeral n1_Unit))) ;
|
||||||
lin november_Month = mkN "November" ;
|
lin november_Month = mkN (mkN "تِشْرِين") (mkAP (mkOrd (mkNumeral n2_Unit))) ;
|
||||||
lin december_Month = mkN "December" ;
|
lin december_Month = mkN (mkN "كَانُون") (mkAP (mkOrd (mkNumeral n1_Unit))) ;
|
||||||
|
|
||||||
-- lin afrikaans_Language = mkLanguage "Afrikaans" ;
|
-- lin afrikaans_Language = mkLanguage "Afrikaans" ;
|
||||||
-- lin amharic_Language = mkLanguage "Amharic" ;
|
-- lin amharic_Language = mkLanguage "Amharic" ;
|
||||||
@@ -140,7 +147,7 @@ lin finnish_Language = mkLanguage "فِنْلَنْدِيّة" ;
|
|||||||
-- lin maltese_Language = mkLanguage "Maltese" ;
|
-- lin maltese_Language = mkLanguage "Maltese" ;
|
||||||
-- lin nepali_Language = mkLanguage "Nepali" ;
|
-- lin nepali_Language = mkLanguage "Nepali" ;
|
||||||
-- lin norwegian_Language = mkLanguage "Norwegian" ;
|
-- lin norwegian_Language = mkLanguage "Norwegian" ;
|
||||||
lin nprsian_Language = mkLanguage "فَارِسيّة" ;
|
lin persian_Language = mkLanguage "فَارِسيّة" ;
|
||||||
-- lin polish_Language = mkLanguage "Polish" ;
|
-- lin polish_Language = mkLanguage "Polish" ;
|
||||||
-- lin punjabi_Language = mkLanguage "Punjabi" ;
|
-- lin punjabi_Language = mkLanguage "Punjabi" ;
|
||||||
-- lin romanian_Language = mkLanguage "Romanian" ;
|
-- lin romanian_Language = mkLanguage "Romanian" ;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ concrete ExtendAra of Extend =
|
|||||||
in {
|
in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
GenNP np = {s = \\_,_,_,_ => np.s ! Gen ; d = Const ; isNum,isPron,is1sg = False} ;
|
GenNP np = baseQuant ** {s = \\_,_,_,_ => np.s ! Gen ; d = Const} ;
|
||||||
|
|
||||||
-- : NP -> NP -> NP
|
-- : NP -> NP -> NP
|
||||||
ApposNP np1 np2 = np2 ** {s = \\c => np1.s ! c ++ np2.s ! c} ;
|
ApposNP np1 np2 = np2 ** {s = \\c => np1.s ! c ++ np2.s ! c} ;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ concrete IdiomAra of Idiom = CatAra ** open
|
|||||||
-- : VP -> Cl ; -- it is hot
|
-- : VP -> Cl ; -- it is hot
|
||||||
ImpersCl vp =
|
ImpersCl vp =
|
||||||
let it : ResAra.NP = case vp.isPred of {
|
let it : ResAra.NP = case vp.isPred of {
|
||||||
True => pron2np (pgn2pron vp.obj.a.pgn) ;
|
True => pron2np (gn2pron vp.obj.a.gn) ;
|
||||||
False => pgn2pron vp.obj.a.pgn } ; -- if no obj, Per3 Masc Sg chosen by default
|
False => gn2pron vp.obj.a.gn } ; -- if no obj, Per3 Masc Sg chosen by default
|
||||||
in predVP it vp ;
|
in predVP it vp ;
|
||||||
|
|
||||||
-- : VP -> Cl ; -- one sleeps
|
-- : VP -> Cl ; -- one sleeps
|
||||||
|
|||||||
@@ -6,13 +6,10 @@ flags optimize = all ;--noexpand;
|
|||||||
oper
|
oper
|
||||||
|
|
||||||
mkDet : Str -> Number -> State -> Det
|
mkDet : Str -> Number -> State -> Det
|
||||||
= \word,num,state ->
|
= \word,num,state -> baseQuant **
|
||||||
{ s = \\_,_,c => word + caseTbl ! c ;
|
{ s = \\_,_,c => word + caseTbl ! c ;
|
||||||
n = numberToSize num;
|
n = numberToSize num;
|
||||||
d = state; --only Const is used now. check StructuralAra
|
d = state; --only Const is used now. check StructuralAra
|
||||||
is1sg = False;
|
|
||||||
isNum = False;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPredet : Str -> Bool -> Predet
|
mkPredet : Str -> Bool -> Predet
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ lin
|
|||||||
_ => Dl } ;
|
_ => Dl } ;
|
||||||
False => sizeToNumber det.n } ;
|
False => sizeToNumber det.n } ;
|
||||||
determiner : Case -> Str = \c ->
|
determiner : Case -> Str = \c ->
|
||||||
det.s ! cn.h ! (detGender cn.g det.n) ! c ;
|
det.s ! cn.h ! detGender cn.g det.n ! c ;
|
||||||
noun : Case -> Str = \c ->
|
noun : Case -> Str = \c ->
|
||||||
cn.s ! number
|
cn.s ! number
|
||||||
! nounState det.d number
|
! nounState det.d number
|
||||||
@@ -23,16 +23,17 @@ lin
|
|||||||
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
||||||
! c
|
! c
|
||||||
} in {
|
} in {
|
||||||
s = \\c =>
|
s = \\c => -- Dat is just a hack for liPrep
|
||||||
case cnB4det det.isPron det.isNum det.n det.d of {
|
let c' = case c of {Dat => Gen ; x => x} in
|
||||||
False => determiner c
|
case cnB4det det of {
|
||||||
++ noun c
|
False => determiner c'
|
||||||
++ adj c
|
++ noun c'
|
||||||
++ cn.np ! c ;
|
++ adj c'
|
||||||
|
++ cn.np ! c' ;
|
||||||
True => noun (cas c) -- deal with possessive suffix
|
True => noun (cas c) -- deal with possessive suffix
|
||||||
++ determiner c -- (nounCase c det.n det.d) --??
|
++ determiner c'
|
||||||
++ adj c
|
++ 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 } ;
|
||||||
@@ -84,7 +85,7 @@ lin
|
|||||||
isNum = orB num.isNum ord.isNum ;
|
isNum = orB num.isNum ord.isNum ;
|
||||||
-- ord may come from OrdDigits or OrdNumeral
|
-- ord may come from OrdDigits or OrdNumeral
|
||||||
-- num may come from NumCard : Card -> Num
|
-- num may come from NumCard : Card -> Num
|
||||||
|
isEmpty = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuant quant num = quant ** {
|
DetQuant quant num = quant ** {
|
||||||
@@ -95,15 +96,18 @@ lin
|
|||||||
case num.n of {
|
case num.n of {
|
||||||
None => False;
|
None => False;
|
||||||
_ => num.isNum
|
_ => num.isNum
|
||||||
}
|
} ;
|
||||||
|
isEmpty =
|
||||||
|
case quant.isEmpty of {
|
||||||
|
True => notB num.isNum ;
|
||||||
|
_ => False }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = baseQuant ** {
|
||||||
s = \\_,_,_,_ => BIND ++ 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} ;
|
||||||
isNum = False } ;
|
|
||||||
|
|
||||||
NumSg = {
|
NumSg = {
|
||||||
s = \\_,_,_ => [] ;
|
s = \\_,_,_ => [] ;
|
||||||
@@ -154,13 +158,15 @@ lin
|
|||||||
DefArt = {
|
DefArt = {
|
||||||
s = \\_,_,_,_ => [];
|
s = \\_,_,_,_ => [];
|
||||||
d = Def ;
|
d = Def ;
|
||||||
isNum,isPron,is1sg = False
|
isNum,isPron,is1sg = False ;
|
||||||
|
isEmpty = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
s = \\_,_,_,_ => [];
|
s = \\_,_,_,_ => [];
|
||||||
d = Indef ;
|
d = Indef ;
|
||||||
isNum,isPron,is1sg = False
|
isNum,isPron,is1sg = False ;
|
||||||
|
isEmpty = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassNP cn =
|
MassNP cn =
|
||||||
@@ -168,7 +174,6 @@ lin
|
|||||||
a = {pgn = Per3 cn.g Sg ; isPron = False} ;
|
a = {pgn = Per3 cn.g Sg ; isPron = False} ;
|
||||||
empty = []} ;
|
empty = []} ;
|
||||||
|
|
||||||
|
|
||||||
UseN,
|
UseN,
|
||||||
UseN2 = useN ;
|
UseN2 = useN ;
|
||||||
Use2N3 n3 = n3 ;
|
Use2N3 n3 = n3 ;
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ resource ParadigmsAra = open
|
|||||||
Predef,
|
Predef,
|
||||||
Prelude,
|
Prelude,
|
||||||
MorphoAra,
|
MorphoAra,
|
||||||
OrthoAra,(ResAra=ResAra),
|
OrthoAra,
|
||||||
|
(ResAra=ResAra),
|
||||||
|
(A=AdjectiveAra),
|
||||||
CatAra
|
CatAra
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@@ -75,8 +77,10 @@ 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 attribute inflects in state and case. Attribute in singular.
|
mkN : N -> N -> N ; -- Compound noun with singular genitive attribute, but inflects in state.
|
||||||
mkN : Number -> N -> N -> N ; -- Compound noun where attribute inflects in state and case. Attribute's number specified by 1st arg.
|
mkN : Number -> N -> N -> N ; -- Compound noun with genitive attribute, but inflects in state. Attribute's number specified by 1st arg.
|
||||||
|
mkN : N -> A -> N ; -- Force adjective modifier into the noun. Adjective inflects in state, case and number.
|
||||||
|
mkN : N -> AP -> N ; -- Force AP modifier into the noun. AP 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 ;
|
||||||
} ;
|
} ;
|
||||||
@@ -106,7 +110,7 @@ resource ParadigmsAra = open
|
|||||||
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 ! c ++ n.s2 ! Sg ! Const ! c }) ; -- no idea /IL
|
= \n -> lin PN (n ** {s = \\c => n.s ! Sg ! Const ! c ++ n.s2 ! Sg ! Def ! c }) ; -- no idea /IL
|
||||||
mkPN : Str -> Gender -> Species -> PN
|
mkPN : Str -> Gender -> Species -> PN
|
||||||
= mkFullPN ;
|
= mkFullPN ;
|
||||||
} ;
|
} ;
|
||||||
@@ -360,6 +364,11 @@ resource ParadigmsAra = open
|
|||||||
= attrN Sg ;
|
= attrN Sg ;
|
||||||
mkN : Number -> N -> N -> N -- Compound nouns where attribute inflects in state, case and number
|
mkN : Number -> N -> N -> N -- Compound nouns where attribute inflects in state, case and number
|
||||||
= attrN ;
|
= attrN ;
|
||||||
|
mkN : N -> A -> N
|
||||||
|
= mkAN ;
|
||||||
|
mkN : N -> AP -> N
|
||||||
|
= mkAPN
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
attrN : Number -> N -> N -> N = \num,n1,n2 -> n1 ** {
|
attrN : Number -> N -> N -> N = \num,n1,n2 -> n1 ** {
|
||||||
@@ -368,6 +377,13 @@ resource ParadigmsAra = open
|
|||||||
++ n2.s ! num ! s ! Gen
|
++ n2.s ! num ! s ! Gen
|
||||||
++ n2.s2 ! num ! s ! Gen} ;
|
++ n2.s2 ! num ! s ! Gen} ;
|
||||||
|
|
||||||
|
mkAN : N -> A -> N = \n,a -> mkAPN n (A.PositA a) ;
|
||||||
|
|
||||||
|
mkAPN : N -> AP -> N = \n,ap -> n ** {
|
||||||
|
s2 = \\num,s,c => n.s2 ! num ! s ! c
|
||||||
|
++ ap.s ! n.h ! n.g ! 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.
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
|||||||
|
|
||||||
AP : Type = {s : Species => Gender => NTable } ;
|
AP : Type = {s : Species => Gender => NTable } ;
|
||||||
uttAP : AP -> (Gender => Str) ;
|
uttAP : AP -> (Gender => Str) ;
|
||||||
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL
|
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Indef ! Bare ; ----IL
|
||||||
|
|
||||||
CN : Type = Noun ** {np : Case => Str};
|
CN : Type = Noun ** {np : Case => Str};
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
uttNum : NumOrdCard -> (Gender => Str) ;
|
uttNum : NumOrdCard -> (Gender => Str) ;
|
||||||
uttNum n = \\g => n.s ! g ! Def ! Nom ; ----IL
|
uttNum n = \\g => n.s ! g ! Def ! Bare ; ----IL
|
||||||
|
|
||||||
param
|
param
|
||||||
VForm =
|
VForm =
|
||||||
@@ -1155,7 +1155,6 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
--declension 2 (ends in yaa')
|
--declension 2 (ends in yaa')
|
||||||
dec2sg : State => Case => Str = \\s,c =>
|
dec2sg : State => Case => Str = \\s,c =>
|
||||||
case <s,c> of {
|
case <s,c> of {
|
||||||
<_, Bare> => [] ;
|
|
||||||
<Indef,Acc> => "ِياً" ;
|
<Indef,Acc> => "ِياً" ;
|
||||||
<Indef> => "ٍ" ;
|
<Indef> => "ٍ" ;
|
||||||
<_, Acc> => "ِيَ" ;
|
<_, Acc> => "ِيَ" ;
|
||||||
@@ -1311,13 +1310,14 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
-- e.g. some determiners act as adjectives modifying the noun they count
|
-- e.g. some determiners act as adjectives modifying the noun they count
|
||||||
-- 'the three children, two children'
|
-- 'the three children, two children'
|
||||||
-- e.g. possesive pronouns: his book ('kitaabuhu'
|
-- e.g. possesive pronouns: his book ('kitaabuhu'
|
||||||
cnB4det : Bool -> Bool -> Size -> State -> Bool = \isPron,isNum,s,d ->
|
cnB4det : Det -> Bool = \det ->
|
||||||
case <isPron,isNum,s,d> of {
|
case <det.isEmpty,det.isPron,det.isNum,det.n,det.d> of {
|
||||||
<True,_,_,_> => True;
|
<True,_,_,_,_> => True; -- hack to make liPrep work
|
||||||
<_,False,_,_> => False; --non-numerals
|
<_,True,_,_,_> => True;
|
||||||
<_,True,_,Def> => True; --definite numbers act as adjectives
|
<_,_,False,_,_> => False; --non-numerals
|
||||||
<_,True,Two,_> => True; --numerals one and two always adjectives
|
<_,_,True,_,Def> => True; --definite numbers act as adjectives
|
||||||
<_,True,One,_> => True; --numerals one and two always adjectives
|
<_,_,True,Two,_> => True; --numerals one and two always adjectives
|
||||||
|
<_,_,True,One,_> => True; --numerals one and two always adjectives
|
||||||
_ => False
|
_ => False
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1369,10 +1369,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
isNum : Bool;
|
isNum : Bool;
|
||||||
-- for genitive pronouns (suffixes). if true, then "cn ++ det"
|
-- for genitive pronouns (suffixes). if true, then "cn ++ det"
|
||||||
--should be used instead of "det ++ cn" when constructing the NP
|
--should be used instead of "det ++ cn" when constructing the NP
|
||||||
isPron: Bool} ;
|
isPron: Bool;
|
||||||
|
isEmpty: Bool} ; -- to know if liPrep should attach to the noun
|
||||||
|
|
||||||
baseQuant = { d = Indef ;
|
baseQuant = { d = Indef ;
|
||||||
is1sg,isNum,isPron = False } ;
|
is1sg,isNum,isPron,isEmpty = False } ;
|
||||||
|
|
||||||
Quant : Type = BaseQuant ** {
|
Quant : Type = BaseQuant ** {
|
||||||
s : ResAra.Number => Species => Gender => Case => Str
|
s : ResAra.Number => Species => Gender => Case => Str
|
||||||
@@ -1389,8 +1390,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
};
|
};
|
||||||
|
|
||||||
Agr = {pgn : PerGenNum; isPron : Bool} ;
|
Agr = {pgn : PerGenNum; isPron : Bool} ;
|
||||||
|
AgrLite = {gn : AAgr ; isPron : Bool} ; --used in ImpersCl
|
||||||
AAgr = {g : Gender ; n : Number} ;
|
AAgr = {g : Gender ; n : Number} ;
|
||||||
|
|
||||||
|
agrLite : Agr -> AgrLite = \a -> a ** {gn = pgn2gn a.pgn} ;
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- NP, Pron
|
-- NP, Pron
|
||||||
@@ -1481,6 +1484,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
Per3 Masc Pl => theyMasc_Pron
|
Per3 Masc Pl => theyMasc_Pron
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
gn2pron : AAgr -> NP = \gn ->
|
||||||
|
pgn2pron (gn2pgn gn) ;
|
||||||
|
|
||||||
pron2np : NP -> NP = \np -> np ** {
|
pron2np : NP -> NP = \np -> np ** {
|
||||||
a = np.a ** {isPron=False} -- hack, sometimes we *don't* want prodrop
|
a = np.a ** {isPron=False} -- hack, sometimes we *don't* want prodrop
|
||||||
} ;
|
} ;
|
||||||
@@ -1572,9 +1578,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
{ s = \\pgn,vf =>
|
{ s = \\pgn,vf =>
|
||||||
let gn = pgn2gn pgn in
|
let gn = pgn2gn pgn in
|
||||||
case vf of {
|
case vf of {
|
||||||
VPPerf => v.s ! (VPerf Act pgn);
|
VPPerf => v.s ! VPerf Act pgn ;
|
||||||
VPImpf m => v.s ! (VImpf m Act pgn);
|
VPImpf m => v.s ! VImpf m Act pgn ;
|
||||||
VPImp => v.s ! (VImp gn.g gn.n)
|
VPImp => v.s ! VImp gn.g gn.n
|
||||||
};
|
};
|
||||||
sc = noPrep ;
|
sc = noPrep ;
|
||||||
obj = emptyObj ;
|
obj = emptyObj ;
|
||||||
@@ -1587,8 +1593,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
let actVP = predV v in actVP ** {
|
let actVP = predV v in actVP ** {
|
||||||
s = \\pgn,vf =>
|
s = \\pgn,vf =>
|
||||||
case vf of {
|
case vf of {
|
||||||
VPPerf => v.s ! (VPerf Pas pgn) ;
|
VPPerf => v.s ! VPerf Pas pgn ;
|
||||||
VPImpf m => v.s ! (VImpf m Pas pgn) ;
|
VPImpf m => v.s ! VImpf m Pas pgn ;
|
||||||
_ => actVP.s ! pgn ! vf
|
_ => actVP.s ! pgn ! vf
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1609,7 +1615,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
True => noPrep ; -- to prevent weird stuff with VVs, might be overly specific
|
True => noPrep ; -- to prevent weird stuff with VVs, might be overly specific
|
||||||
_ => vp.sc }
|
_ => vp.sc }
|
||||||
} ;
|
} ;
|
||||||
subj = np.empty ++ sc.s
|
subj = np.empty ++ sc.s ++ bindIf sc.binds
|
||||||
++ case vp.isPred of {
|
++ case vp.isPred of {
|
||||||
False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative
|
False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative
|
||||||
True => np.s ! sc.c
|
True => np.s ! sc.c
|
||||||
@@ -1694,20 +1700,20 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
|
|
||||||
Obj : Type = {
|
Obj : Type = {
|
||||||
s : Str ;
|
s : Str ;
|
||||||
a : Agr -- default Agr in a VP without real Obj is Per3 Masc Sg.
|
a : AgrLite -- default Agr in a VP without real Obj is Per3 Masc Sg.
|
||||||
}; -- need isPron for word order in predVP, and pgn for ImpersCl
|
}; -- need isPron for word order in predVP, and pgn for ImpersCl
|
||||||
|
|
||||||
Subj : Type = {s : Case => Str ; isPron : Bool} ;
|
Subj : Type = {s : Case => Str ; isPron : Bool} ;
|
||||||
|
|
||||||
np2subj : NP -> Subj = \np -> np ** {isPron = np.a.isPron} ;
|
np2subj : NP -> Subj = \np -> np ** {isPron = np.a.isPron} ;
|
||||||
subj2np : Subj -> NP = \su -> su ** {a = {pgn = emptyNP.a.pgn ; isPron = su.isPron} ; empty=[]} ;
|
subj2np : Subj -> NP = \su -> su ** {a = {pgn = emptyNP.a.pgn ; isPron = su.isPron} ; empty=[]} ;
|
||||||
emptyObj : Obj = emptyNP ** {s=[]} ;
|
emptyObj : Obj = {a = {gn = {g=Masc ; n=Sg} ; isPron = False}; s = []} ;
|
||||||
|
|
||||||
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** {
|
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** {
|
||||||
obj = {s = vp.obj.s -- old object, if there was one
|
obj = {s = vp.obj.s -- old object, if there was one
|
||||||
++ bindIfPron np vp -- new object, bind if pronoun and not pred
|
++ bindIfPron np vp -- new object, bind if pronoun and not pred
|
||||||
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
|
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
|
||||||
a = np.a}
|
a = agrLite np.a}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;
|
bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;
|
||||||
@@ -1844,29 +1850,30 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
{ s = table {
|
{ s = table {
|
||||||
unit => table {
|
unit => table {
|
||||||
NCard => table {
|
NCard => table {
|
||||||
Masc => \\s,c => Al ! s + "ٱِثن" + dl ! s ! c ;
|
Masc => \\s,c => defArt s c "ٱِثن" + dl ! s ! c ;
|
||||||
Fem => \\s,c => Al ! s + "ٱِثنَت" + dl ! s ! c
|
Fem => \\s,c => defArt s c "ٱِثنَت" + dl ! s ! c
|
||||||
};
|
};
|
||||||
NOrd => table {
|
NOrd => table {
|
||||||
Masc => \\s,c => Al ! s + "ثان" + dec2sg ! s ! c ;
|
Masc => \\s,c => defArt s c "ثَان" + dec2sg ! s ! c ;
|
||||||
Fem => \\s,c => Al ! s + "ثانِيَة" + dec1sg ! s ! c
|
Fem => \\s,c => defArt s c "ثَانِيَة" + dec1sg ! s ! c
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ten => \\_,_,s,c => Al ! s + "عِشر" + m_pl ! Indef ! c
|
ten => \\_,_,s,c => defArt s c "عِشر" + m_pl ! Indef ! c
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
num100 : State => Case => Str =
|
num100 : State => Case => Str =
|
||||||
\\s,c => Al ! s + "مِٱَة" + dec1sg ! s ! c;
|
\\s,c => defArt s c "مِٱَة" + dec1sg ! s ! c;
|
||||||
|
|
||||||
num200 : State => Case => Str =
|
num200 : State => Case => Str =
|
||||||
\\s,c => Al ! s + "مِٱَة" + dl ! s ! c ;
|
\\s,c => defArt s c "مِٱَة" + dl ! s ! c ;
|
||||||
|
|
||||||
num1000 : State => Case => Str =
|
num1000 : State => Case => Str =
|
||||||
\\s,c => Al ! s + "أَلف" + dec1sg ! s ! c;
|
\\s,c => defArt s c "أَلف" + dec1sg ! s ! c;
|
||||||
|
|
||||||
num2000 : State => Case => Str =
|
num2000 : State => Case => Str =
|
||||||
\\s,c => Al ! s + "أَلف" + dl ! s ! c ;
|
\\s,c => defArt s c "أَلف" + dl ! s ! c ;
|
||||||
|
|
||||||
teen : Gender => Str =
|
teen : Gender => Str =
|
||||||
table {
|
table {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ concrete StructuralAra of Structural = CatAra **
|
|||||||
no_Utt = {s = \\_ => "لا"} ;
|
no_Utt = {s = \\_ => "لا"} ;
|
||||||
on_Prep = mkPrep "عَلَى" ;
|
on_Prep = mkPrep "عَلَى" ;
|
||||||
only_Predet = mkPredet "فَقَط" False;
|
only_Predet = mkPredet "فَقَط" False;
|
||||||
-- or_Conj = ss "ْر" ** {n = Sg} ;
|
or_Conj = ss "أَوْ" ** {n = Sg} ;
|
||||||
-- otherwise_PConj = ss "ْتهروِسي" ;
|
-- otherwise_PConj = ss "ْتهروِسي" ;
|
||||||
part_Prep = mkPrep "مِنَ" ;
|
part_Prep = mkPrep "مِنَ" ;
|
||||||
-- please_Voc = ss "ةلَسي" ;
|
-- please_Voc = ss "ةلَسي" ;
|
||||||
|
|||||||
@@ -97,7 +97,9 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
|
|||||||
|
|
||||||
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
|
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
|
||||||
obj = emptyObj ; isNP = False} ;
|
obj = emptyObj ; isNP = False} ;
|
||||||
CompNP np = {s = \\_,_ => [] ; obj = np ** {s = np.s ! Nom} ; isNP = True} ;
|
CompNP np = {s = \\_,_ => [] ;
|
||||||
|
obj = {s = np.s ! Nom ; a = agrLite np.a} ;
|
||||||
|
isNP = True} ;
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user