@@ -16,138 +16,114 @@ resource ParadigmsPes = open
--2 Parameters
oper
Animacy : Type ; -- Argument to mkN
animate : Animacy ;
inanimate : Animacy ;
singular : Number;
plural : Number;
singular = Sg ; plural = Pl;
Number : Type ; -- Argument to
singular : Number ;
plural : Number ;
animate = Animate ; inanimate = Inanimate ; --i
mkN01 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, forms plural with ها
mkN01 sg ani =
let pl = zwnj sg "ها" ; -- Using zero-width non-joiner, defined in ResPes
in M.mkN sg pl ani ;
mkN02 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, pattern matches singular and forms plural with either گان, یان or ان
mkN02 str ani = case last str of {
"ه" => M.mkN str (init str + "گان") ani ;
("ا"|"و") => M.mkN str (str + "یان") ani ;
_ => M.mkN str (str + "ان") ani
};
--2 Nouns
mkN = overload {
mkN : (sg : Str) -> N -- Takes singular form, returns an inanimate noun with ها as the plural form
= \sg -> mkN01 sg inanimate ;
mkN : (sg,pl : Str) -> N -- Takes singular and plural form, returns an inanimate noun
= \sg,pl -> M.mkN sg pl inanimate ;
mkN : (sg,pl : Str) -> Animacy -> N -- Worst-case constructor: takes singular and plural forms and animacy
mkN : (sg : Str) -> Animacy -> N -- Takes singular form and animacy. Inaminate plural ها. Animate plural ان or an allomorph of it (یان or گان) depending on the singular form.
= \sg,ani -> case ani of {
Inanimate => mkN01 sg ani ;
Animate => mkN02 sg ani } ;
-- mkN : (sg,pl : Str) -> N -- Takes singular and plural form, returns an inanimate noun
-- = \sg,pl -> M.mkN sg pl inanimate ;
mkN : (sg,pl : Str) -> Animacy -> N -- Worst-case constructor: takes singular and plural forms and animacy. Use for e.g. loanwords with Arabic plural.
= \sg,pl,ani -> M.mkN sg pl ani
} ;
{-
--2 Nouns
mkN2 : overload {
mkN2 : (key : N) -> (to : Str) -> N2 -- Takes a noun and a complementiser, returns a N2.
} ;
mkN3 : overload {
mkN3 : (distance : N) -> (from,to : Str) -> N3 -- Takes a noun and two complementisers, returns a N3.
} ;
mkN2 : N -> Prep -> Str -> N2;
mkN2 = \n,p,c -> n ** {lock_N2 = <> ; c2 = p.s ; c3 = c } ;
-- mkVerb takes both the Infinitive and the present root(root2) and is applied for iregular verbs
haveVerb : V = lin V M.haveVerb ;
beVerb : V = lin V M.beVerb ;
mkV_1 : Str -> V
= \s -> mkVerb1 s ** {lock_V = <>} ;
mkV = overload {
mkV : (inf : Str) -> V -- Takes infinitive. Use for predictable verbs: if it ends in vowel+دن, the present stem removes the vowel as well. If it ends in consonant+تن or consonant+دن, present stem only removes تن/دن.
= regV ;
mkV : (inf,pres : Str) -> V -- Takes infinitive and present root. Use for unpredictable verbs, e.g. دانستن with present stem دان, or irregular, e.g. کردن with present stem کن.
= \s1, s2 -> lin V (mkVerb s1 s2)
} ;
mkV_2 : Str -> V
= \s -> mkVerb2 s ** {lock_V = <>} ;
haveVerb : V = lin V M.haveVerb ; -- The verb "have", to be used for light verb constructions: e.g. compoundV "دوست" haveVerb. NB. this has different imperative and VV forms from StructuralPes.have_V2.
beVerb : V = lin V M.beVerb ; -- The verb "be", to be used for light verb constructions: e.g. compoundV "عاشق" beVerb.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.