@@ -16,137 +16,113 @@ resource ParadigmsPes = open
--2 Parameters
oper
Animacy : Type ; -- Argument to mkN
animate : Animacy ;
inanimate : Animacy ;
Number : Type ; -- Argument to
singular : Number ;
plural : Number ;
singular = Sg ; plural = Pl;
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 } ;
= \v -> v ** {c2 = {s = [] ; ra = [] ; c = VTrans} ; lock_V2 = <>} ;
mkV2 : V -> Str -> V2
= \v,ra -> v ** {c2 = {ra = ra ; s = [] ; c = VTrans} ; lock_V2 = <>} ;
mkV2 : V -> Str -> Bool -> V2
= \v,p,b -> v ** {c2 = {ra = [] ; s = p ; c = VTrans} ; lock_V2 = <>} ;
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)
} ;
mkV3 : V -> Str -> Str -> V3;
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.
mkV2 : overload {
mkV2 : Str -> V2 ; -- Predictable V2 out of string. No preposition, را for direct object.
mkV2 : V -> V2 ; -- V2 out of V. No preposition, را for direct object.
mkV2 : (listen : V) -> (to : Prep) -> V2 -- V2 out of V. Use given preposition, no را for direct object.
} ;
mkV3 : V -> Str -> Str -> V3 ; -- Takes a verb and two prepositions (can be empty), e.g. speak, with, about
mkV3 v p q = lin V3 (v ** {c2 = p ; c3 = q}) ;
mkV2V : V -> Str -> Str -> Bool -> V2V ;
mkV2V : V -> (cV : Str) -> (cN : Str) -> (isAux : Bool) -> V2V ; -- Verb, complementiser for the verb, complementiser for the noun, whether it's auxiliary.
mkV2V v s1 s2 b = lin V2V (v ** {isAux = b ; c1 = s1 ; c2 = s2}) ;
-- compund verbs
compoundV = overload {
compoundV : Str -> V -> V
= \s,v -> v ** {s = \\vf => s ++ v.s ! vf} ;
compoundV : Str -> V2 -> V
= \s,v -> lin V {s = \\vf => s ++ v.s ! vf} ;
compoundV : overload {
compoundV : Str -> V -> V -- Invariable prefix to a verb, e.g. compoundV "دوست" haveVerb
} ;
invarV : Str -> V -- for verbs like " بایستن " ("must"), which don't inflect
= \s -> lin V {s = \\_ => s} ;
----2 Adverbs
mkAdv : Str -> Adv = \str -> lin Adv {s = str} ;
mkAdv : Str -> Adv = \str -> lin Adv {s = str} ; -- Takes a string, returns an adverb.
----2 Prepositions
mkPrep : Str -> Prep ;
mkPrep : Str -> Prep ; -- Takes a string, returns a preposition.
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.