ParadigmsCat in next-lib updated

This commit is contained in:
aarne
2008-09-24 08:52:49 +00:00
parent 34c5617ef6
commit db15fe74be

View File

@@ -1,26 +1,29 @@
--# -path=.:../romance:../common:../abstract:../../prelude --# -path=.:../romance:../common:../abstract:../../prelude
----1 Catalan Lexical Paradigms --1 Catalan Lexical Paradigms
----
---- Aarne Ranta 2003
----
---- This is an API to the user of the resource grammar
---- for adding lexical items. It gives functions for forming
---- expressions of open categories: nouns, adjectives, verbs.
----
---- Closed categories (determiners, pronouns, conjunctions) are
---- accessed through the resource syntax API, $Structural.gf$.
----
---- The main difference with $MorphoCat.gf$ is that the types
---- referred to are compiled resource grammar types. We have moreover
---- had the design principle of always having existing forms, rather
---- than stems, as string arguments of the paradigms.
----
---- The structure of functions for each word class $C$ is the following:
---- first we give a handful of patterns that aim to cover all
---- regular cases. Then we give a worst-case function $mkC$, which serves as an
---- escape to construct the most irregular words of type $C$.
-- --
-- Aarne Ranta 2004 - 2006
-- Jordi Saludes 2008: Modified from ParadigmsSpa
--
-- This is an API for the user of the resource grammar
-- for adding lexical items. It gives functions for forming
-- expressions of open categories: nouns, adjectives, verbs.
--
-- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API, $Structural.gf$.
--
-- The main difference with $MorphoCat.gf$ is that the types
-- referred to are compiled resource grammar types. We have moreover
-- had the design principle of always having existing forms, rather
-- than stems, as string arguments of the paradigms.
--
-- The structure of functions for each word class $C$ is the following:
-- first we give a handful of patterns that aim to cover all
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
-- escape to construct the most irregular words of type $C$. For
-- verbs, there is a fairly complete list of irregular verbs in
-- [``IrregCat`` ../../catalan/IrregCat.gf].
resource ParadigmsCat = resource ParadigmsCat =
open open
(Predef=Predef), (Predef=Predef),
@@ -31,32 +34,30 @@ resource ParadigmsCat =
BeschCat, BeschCat,
CatCat in { CatCat in {
flags optimize=all ; flags optimize=all ;
--
----2 Parameters --2 Parameters
----
---- To abstract over gender names, we define the following identifiers.
-- --
-- To abstract over gender names, we define the following identifiers.
oper oper
Gender : Type ; Gender : Type ;
masculine : Gender ; masculine : Gender ;
feminine : Gender ; feminine : Gender ;
---- To abstract over number names, we define the following. -- To abstract over number names, we define the following.
--
-- Number : Type ; Number : Type ;
--
-- singular : Number ; singular : Number ;
-- plural : Number ; plural : Number ;
--
-- Prepositions used in many-argument functions are either strings -- Prepositions used in many-argument functions are either strings
-- (including the 'accusative' empty string) or strings that -- (including the 'accusative' empty string) or strings that
-- amalgamate with the following word (the 'genitive' "de" and the -- amalgamate with the following word (the 'genitive' "de" and the
-- 'dative' "a"). -- 'dative' "a").
--- Preposition : Type ;
accusative : Prep ; accusative : Prep ;
genitive : Prep ; genitive : Prep ;
dative : Prep ; dative : Prep ;
@@ -66,10 +67,7 @@ oper
--2 Nouns --2 Nouns
-- Worst case: two forms (singular + plural), mkN : overload {
-- and the gender.
mkN : (_,_ : Str) -> Gender -> N ; -- uomo, uomini, masculine
-- The regular function takes the singular form and the gender, -- The regular function takes the singular form and the gender,
-- and computes the plural and the gender by a heuristic. -- and computes the plural and the gender by a heuristic.
@@ -77,14 +75,19 @@ oper
-- ending with "a" or "z", and masculine for all other words. -- ending with "a" or "z", and masculine for all other words.
-- Nouns ending with "a", "o", "e" have the plural with "s", -- Nouns ending with "a", "o", "e" have the plural with "s",
-- those ending with "z" have "ces" in plural; all other nouns -- those ending with "z" have "ces" in plural; all other nouns
-- have "es" as plural ending. The accent is not dealt with. -- have "es" as plural ending. The accent is not dealt with. TODO
regN : Str -> N ; mkN : (llum : Str) -> N ;
-- To force a different gender, use one of the following functions. -- A different gender can be forced.
mkN : Str -> Gender -> N ;
-- The worst case has two forms (singular + plural) and the gender.
mkN : (disc,discos : Str) -> Gender -> N
} ;
mascN : N -> N ;
femN : N -> N ;
--3 Compound nouns --3 Compound nouns
-- --
@@ -93,7 +96,7 @@ oper
-- They could be formed in syntax, but we give a shortcut here since -- They could be formed in syntax, but we give a shortcut here since
-- they are frequent in lexica. -- they are frequent in lexica.
compN : N -> Str -> N ; compN : N -> Str -> N ;
--3 Relational nouns --3 Relational nouns
@@ -106,175 +109,180 @@ oper
-- with the empty preposition. -- with the empty preposition.
deN2 : N -> N2 ; deN2 : N -> N2 ;
-- aN2 : N -> N2 ; s'usa ? aN2 : N -> N2 ;
-- Three-place relational nouns ("la connexió de x a y") need two prepositions. -- Three-place relational nouns ("la connexió de x a y") need two prepositions.
mkN3 : N -> Prep -> Prep -> N3 ; mkN3 : N -> Prep -> Prep -> N3 ;
----3 Relational common noun phrases --3 Relational common noun phrases
----
---- In some cases, you may want to make a complex $CN$ into a
---- relational noun (e.g. "the old town hall of"). However, $N2$ and
---- $N3$ are purely lexical categories. But you can use the $AdvCN$
---- and $PrepNP$ constructions to build phrases like this.
-- --
---- -- In some cases, you may want to make a complex $CN$ into a
-- relational noun (e.g. "the old town hall of"). However, $N2$ and
-- $N3$ are purely lexical categories. But you can use the $AdvCN$
-- and $PrepNP$ constructions to build phrases like this.
--
--3 Proper names and noun phrases --3 Proper names and noun phrases
-- --
-- Proper names need a string and a gender. -- Proper names need a string and a gender.
-- The default gender is feminine for names ending with "a", otherwise masculine. TODO
mkPN : Str -> Gender -> PN ; -- Joan mkPN : overload {
mkPN : (Anna : Str) -> PN ;
mkPN : (Pilar : Str) -> Gender -> PN
} ;
-- To form a noun phrase that can also be plural,
-- you can use the worst-case function.
makeNP : Str -> Gender -> Number -> NP ; --2 Adjectives
----2 Adjectives mkA : overload {
--
---- Non-comparison one-place adjectives need five forms in the worst -- For regular adjectives, all forms are derived from the
---- case (masc and fem singular, masc plural, adverbial).
--
mkA : (fort,forta,forts,fortes, fortament : Str) -> A ;
--
-- For regular adjectives, all other forms are derived from the
-- masculine singular. The types of adjectives that are recognized are -- masculine singular. The types of adjectives that are recognized are
-- "alto", "fuerte", "util". -- "alto", "fuerte", "util". Comparison is formed by "mas".
regA : Str -> A ; mkA : (sol : Str) -> A ;
---- These functions create postfix adjectives. To switch -- One-place adjectives compared with "mas" need five forms in the worst
---- them to prefix ones (i.e. ones placed before the noun in -- case (masc and fem singular, masc plural, adverbial).
---- modification, as in "petite maison"), the following function is
---- provided.
--
prefA : A -> A ;
--
----3 Two-place adjectives
----
---- Two-place adjectives need a preposition for their second argument.
--
mkA2 : A -> Prep -> A2 ;
--
----3 Comparison adjectives
--
---- Comparison adjectives are in the worst case put up from two
---- adjectives: the positive ("bueno"), and the comparative ("mejor").
--
mkADeg : A -> A -> A ;
--
-- If comparison is formed by "més", as usual in Catalan,
-- the following pattern is used:
compADeg : A -> A ; mkA : (fort,forta,forts,fortes,fortament : Str) -> A ;
---- The regular pattern is the same as $regA$ for plain adjectives, -- In the worst case, two separate adjectives are given:
---- with comparison by "mas". -- the positive ("bo"), and the comparative ("millor").
mkA : (bo : A) -> (millor : A) -> A
} ;
-- The functions above create postfix adjectives. To switch
-- them to prefix ones (i.e. ones placed before the noun in
-- modification, as in "gran casa"), the following function is
-- provided.
-- JS: What about vi bó -> bon vi ?
prefixA : A -> A ;
--3 Two-place adjectives
-- --
regADeg : Str -> A ; -- Two-place adjectives need a preposition for their second argument.
--
-- mkA2 : A -> Prep -> A2 ;
----2 Adverbs
--2 Adverbs
-- Adverbs are not inflected. Most lexical ones have position -- Adverbs are not inflected. Most lexical ones have position
-- after the verb. -- after the verb.
mkAdv : Str -> Adv ; mkAdv : Str -> Adv ;
---- Some appear next to the verb (e.g. "siempre"). -- Some appear next to the verb (e.g. "sempre").
--
mkAdV : Str -> AdV ; mkAdV : Str -> AdV ;
--
---- Adverbs modifying adjectives and sentences can also be formed. -- Adverbs modifying adjectives and sentences can also be formed.
--
mkAdA : Str -> AdA ; mkAdA : Str -> AdA ;
--
--
--2 Verbs --2 Verbs
--
-- Regular verbs are ones inflected like "cantar", "servir"/"dormir", or "perdre"/"treure".
-- The regular verb function is the first conjugation ("ar") recognizes
-- the variations corresponding to the patterns
-- "actuar, cazar, guiar, pagar, sacar". The module $BeschCat$ gives
-- the complete set of "Bescherelle" conjugations.
regV : Str -> V ; mkV : overload {
---- The module $BeschCat$ gives all the patterns of the "Bescherelle" -- Regular verbs are ones inflected like "cantar", "perdre", "témer", "perdre", "servir", "dormir"
---- book. To use them in the category $V$, wrap them with the function -- The regular verb function works for models I, IIa, IIb and IIa
-- The module $BeschCat$ gives the complete set of "Bescherelle" conjugations.
verbV : Verbum -> V ; mkV : (cantar : Str) -> V ;
-- Verbs with vowel alternatition in the stem - easiest to give with
-- two forms, e.g. "mostrar"/"muestro". TODO
--JS: Needed? mkV : (mostrar,muestro : Str) -> V ;
-- Most irregular verbs are found in $IrregCat$. If this is not enough,
-- the module $BeschCat$ gives all the patterns of the "Bescherelle"
-- book. To use them in the category $V$, wrap them with the function
mkV : Verbum -> V
} ;
-- To form reflexive verbs:
reflV : V -> V ;
---- To form reflexive verbs:
--
reflV : V -> V ;
--
-- Verbs with a deviant passive participle: just give the participle -- Verbs with a deviant passive participle: just give the participle
-- in masculine singular form as second argument. -- in masculine singular form as second argument.
special_ppV : V -> Str -> V ; special_ppV : V -> Str -> V ;
--3 Two-place verbs --3 Two-place verbs
-- --
-- Two-place verbs need a preposition, except the special case with direct object. -- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$. -- (transitive verbs).
mkV2 : V -> Prep -> V2 ; mkV2 : overload {
mkV2 : Str -> V2 ;
mkV2 : V -> V2 ;
mkV2 : V -> Prep -> V2
} ;
dirV2 : V -> V2 ;
---- You can reuse a $V2$ verb in $V$. -- You can reuse a $V2$ verb in $V$.
v2V : V2 -> V ;
--3 Three-place verbs
-- --
-- v2V : V2 -> V ; -- Three-place (ditransitive) verbs need two prepositions, of which
-- -- the first one or both can be absent.
----3 Three-place verbs
----
---- Three-place (ditransitive) verbs need two prepositions, of which
---- the first one or both can be absent.
mkV3 : V -> Prep -> Prep -> V3 ; -- parlar, a, de mkV3 : V -> Prep -> Prep -> V3 ; -- parlar, a, de
dirV3 : V -> Prep -> V3 ; -- donar,_,a dirV3 : V -> Prep -> V3 ; -- donar,(accusative),a
dirdirV3 : V -> V3 ; -- donar,_,_ dirdirV3 : V -> V3 ; -- donar,(dative),(accusative)
----3 Other complement patterns --3 Other complement patterns
----
---- Verbs and adjectives can take complements such as sentences,
---- questions, verb phrases, and adjectives.
-- --
-- Verbs and adjectives can take complements such as sentences,
-- questions, verb phrases, and adjectives.
mkV0 : V -> V0 ; mkV0 : V -> V0 ;
mkVS : V -> VS ; mkVS : V -> VS ;
mkV2S : V -> Prep -> V2S ; mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ; -- plain infinitive: "je veux parler" mkVV : V -> VV ; -- plain infinitive: "vull parlar"
-- deVV : V -> VV ; -- "j'essaie de parler" deVV : V -> VV ; -- "acabar de parlar"
-- aVV : V -> VV ; -- "j'arrive à parler" aVV : V -> VV ; -- "aprendre a parlar"
mkV2V : V -> Prep -> Prep -> V2V ; mkV2V : V -> Prep -> Prep -> V2V ;
-- mkVA : V -> VA ; mkVA : V -> VA ;
mkV2A : V -> Prep -> Prep -> V2A ; mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ; mkVQ : V -> VQ ;
mkV2Q : V -> Prep -> V2Q ; mkV2Q : V -> Prep -> V2Q ;
--
mkAS : A -> AS ;
-- mkA2S : A -> Preposition -> A2S ; mkAS : A -> AS ;
mkAV : A -> Prep -> AV ; mkA2S : A -> Prep -> A2S ;
mkA2V : A -> Prep -> Prep -> A2V ; mkAV : A -> Prep -> AV ;
-- mkA2V : A -> Prep -> Prep -> A2V ;
---- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
---- just as synonyms of $V2$, and the second argument is given -- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
---- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$. -- and the second argument is given
---- $V0$ is just $V$. -- as an adverb. Likewise
-- -- $V0$ is just $V$.
V0 : Type ; V0 : Type ;
AS, A2S, AV, A2V : Type ; AS, A2S, AV, A2V : Type ;
--.
--2 The definitions of the paradigms
-- --
-- -- The definitions should not bother the user of the API. So they are
----2 The definitions of the paradigms -- hidden from the document.
----
---- The definitions should not bother the user of the API. So they are
---- hidden from the document.
----.
Gender = MorphoCat.Gender ; Gender = MorphoCat.Gender ;
Number = MorphoCat.Number ; Number = MorphoCat.Number ;
@@ -283,14 +291,13 @@ oper
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
--- Preposition = Compl ; accusative = complAcc ** {lock_Prep = <>} ;
accusative = complAcc ; genitive = complGen ** {lock_Prep = <>} ;
genitive = complGen ; dative = complDat ** {lock_Prep = <>} ;
dative = complDat ; mkPrep p = {s = p ; c = Acc ; isDir = False ; lock_Prep = <>} ;
mkPrep p = {s = p ; c = Acc ; isDir = False; lock_Prep = <>} ;
--
-- mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ;
mkN x y g = mkNounIrreg x y g ** {lock_N = <>} ;
regN x = mkNomReg x ** {lock_N = <>} ; regN x = mkNomReg x ** {lock_N = <>} ;
compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ; compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ;
femN x = {s = x.s ; g = feminine ; lock_N = <>} ; femN x = {s = x.s ; g = feminine ; lock_N = <>} ;
@@ -298,57 +305,56 @@ oper
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
deN2 n = mkN2 n genitive ; deN2 n = mkN2 n genitive ;
-- aN2 n = mkN2 n dative ; -- s'usa ? aN2 n = mkN2 n dative ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
mkPN x g = {s = x ; g = g} ** {lock_PN = <>} ; mk2PN x g = {s = x ; g = g} ** {lock_PN = <>} ;
makeNP x g n = {s = (pn2np (mkPN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; regPN x = mk2PN x g where {
-- g = case last x of {
mkA a b c d e = "a" => feminine ;
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ; _ => masculine
}
} ;
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
mk5A a b c d e =
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ; regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ;
prefA a = {s = a.s ; isPre = True ; lock_A = <>} ; prefA a = {s = a.s ; isPre = True ; lock_A = <>} ;
--
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
--
mkADeg a b = mkADeg a b =
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ; {s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ;
isPre = a.isPre ; lock_A = <>} ; isPre = a.isPre ; lock_A = <>} ;
compADeg a = compADeg a =
{s = table {Posit => a.s ! Posit ; _ => \\f => "més" ++ a.s ! Posit ! f} ; {s = table {Posit => a.s ! Posit ; _ => \\f => "más" ++ a.s ! Posit ! f} ;
isPre = a.isPre ; isPre = a.isPre ;
lock_A = <>} ; lock_A = <>} ;
regADeg a = compADeg (regA a) ; regADeg a = compADeg (regA a) ;
mkAdv x = ss x ** {lock_Adv = <>} ; mkAdv x = ss x ** {lock_Adv = <>} ;
-- mkAdV x = ss x ** {lock_AdV = <>} ; mkAdV x = ss x ** {lock_AdV = <>} ;
-- mkAdA x = ss x ** {lock_AdA = <>} ; mkAdA x = ss x ** {lock_AdA = <>} ;
--
regV x = -- cantar regV x = -- cantar, perdre, témer, dormir, (servir)
let let
ar = Predef.dp 2 x ; verb = case (Predef.dp 2 x) of {
z = Predef.dp 1 (Predef.tk 2 x) ; "re" => perdre_83 x ;
verb = case ar of { "er" => témer_107 x ;
"re" => viure_119 x ; "ir" => dormir_44 x ; -- JS TODO: Consider "servir"
"ir" => patir_81 x ; _ => cantar_15 x
_ => cantar_15 x }
}
-- "er" => deber_6 x ;
-- _ => case z of {
-- "u" => actuar_9 x ;
-- "z" => cazar_21 x ;
-- "i" => guiar_43 x ;
-- "g" => pagar_53 x ;
-- "c" => sacar_72 x ;
-- _ => cortar_5 x
-- }
in verbBesch verb ** {vtyp = VHabere ; lock_V = <>} ; in verbBesch verb ** {vtyp = VHabere ; lock_V = <>} ;
reflV v = {s = v.s ; vtyp = VRefl ; lock_V = <>} ; reflV v = {s = v.s ; vtyp = VRefl ; lock_V = <>} ;
verbV ve = verbBesch ve ** {vtyp = VHabere ; lock_V = <>} ; verbV ve = verbBesch ve ** {vtyp = VHabere ; lock_V = <>} ;
special_ppV ve pa = { reflVerbV : Verbum -> V = \ve -> reflV (verbV ve) ;
special_ppV ve pa = {
s = table { s = table {
VPart g n => (adjFort pa).s ! AF g n ; VPart g n => (adjFort pa).s ! AF g n ;
p => ve.s ! p p => ve.s ! p
@@ -357,35 +363,94 @@ oper
vtyp = VHabere vtyp = VHabere
} ; } ;
-- regAltV x y = verbV (regAlternV x y) ;
mk2V2 v p = {s = v.s ; vtyp = v.vtyp ; c2 = p ; lock_V2 = <>} ;
dirV2 v = mk2V2 v accusative ;
v2V v = v ** {lock_V = <>} ;
mkV2 v p = {s = v.s ; vtyp = v.vtyp ; c2 = p ; lock_V2 = <>} ;
dirV2 v = mkV2 v accusative ;
-- v2V v = v ** {lock_V = <>} ;
--
mkV3 v p q = {s = v.s ; vtyp = v.vtyp ; mkV3 v p q = {s = v.s ; vtyp = v.vtyp ;
c2 = p ; c3 = q ; lock_V3 = <>} ; c2 = p ; c3 = q ; lock_V3 = <>} ;
dirV3 v p = mkV3 v accusative p ; dirV3 v p = mkV3 v accusative p ;
dirdirV3 v = dirV3 v dative ; dirdirV3 v = dirV3 v dative ;
--
V0 : Type = V ; V0 : Type = V ;
AS, AV : Type = A ; AS, AV : Type = A ;
A2S, A2V : Type = A2 ; A2S, A2V : Type = A2 ;
--
mkV0 v = v ** {lock_V0 = <>} ; mkV0 v = v ** {lock_V0 = <>} ;
mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ; ---- more moods mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ; ---- more moods
mkV2S v p = mkV2 v p ** {mn,mp = Indic ; lock_V2S = <>} ; mkV2S v p = mk2V2 v p ** {mn,mp = Indic ; lock_V2S = <>} ;
mkVV v = v ** {c2 = complAcc ; lock_VV = <>} ; mkVV v = v ** {c2 = complAcc ; lock_VV = <>} ;
-- deVV v = v ** {c2 = complGen ; lock_VV = <>} ; deVV v = v ** {c2 = complGen ; lock_VV = <>} ;
-- aVV v = v ** {c2 = complDat ; lock_VV = <>} ; aVV v = v ** {c2 = complDat ; lock_VV = <>} ;
mkV2V v p t = mkV3 v p t ** { lock_V2V = <>} ; mkV2V v p t = mkV3 v p t ** {lock_V2V = <>} ;
-- mkVA v = v ** {lock_VA = <>} ; mkVA v = v ** {lock_VA = <>} ;
mkV2A v p q = mkV3 v p q ** {lock_V2A = <>} ; mkV2A v p q = mkV3 v p q ** {lock_V2A = <>} ;
mkVQ v = v ** {lock_VQ = <>} ; mkVQ v = v ** {lock_VQ = <>} ;
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ; mkV2Q v p = mk2V2 v p ** {lock_V2Q = <>} ;
--
mkAS v = v ** {lock_AS = <>} ; ---- more moods mkAS v = v ** {lock_AS = <>} ; ---- more moods
-- mkA2S v p = mkA2 v p ** {lock_A2S = <>} ; mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
mkAV v p = v ** {c = p.p1 ; s2 = p.p2 ; lock_AV = <>} ; mkAV v p = v ** {c = p.p1 ; s2 = p.p2 ; lock_AV = <>} ;
mkA2V v p q = mkA2 v p ** {s3 = q.p2 ; c3 = q.p1 ; lock_A2V = <>} ; mkA2V v p q = mkA2 v p ** {s3 = q.p2 ; c3 = q.p1 ; lock_A2V = <>} ;
--
---
mkN = overload {
mkN : (llum : Str) -> N = regN ;
mkN : Str -> Gender -> N = \s,g -> {s = (regN s).s ; g = g ; lock_N = <>};
mkN : (disc,discos : Str) -> Gender -> N = mk2N
} ;
regN : Str -> N ;
mk2N : (disc,discos : Str) -> Gender -> N ;
mascN : N -> N ;
femN : N -> N ;
mkPN = overload {
mkPN : (Anna : Str) -> PN = regPN ;
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN
} ;
mk2PN : Str -> Gender -> PN ; -- Joan
regPN : Str -> PN ; -- feminine for "-a", otherwise masculine
-- To form a noun phrase that can also be plural,
-- you can use the worst-case function.
makeNP : Str -> Gender -> Number -> NP ;
mkA = overload {
mkA : (util : Str) -> A = regA ;
mkA : (fort,forta,forts,fortes,fortament : Str) -> A = mk5A ;
mkA : (bo : A) -> (millor : A) -> A = mkADeg ;
} ;
mk5A : (fort,forta,forts,fortes,fortament : Str) -> A ;
regA : Str -> A ;
mkADeg : A -> A -> A ;
compADeg : A -> A ;
regADeg : Str -> A ;
prefA : A -> A ;
prefixA = prefA ;
mkV = overload {
mkV : (cantar : Str) -> V = regV ;
--JS mkV : (mostrar,muestro : Str) -> V = regAltV ;
mkV : Verbum -> V = verbV
} ;
regV : Str -> V ;
--JS regAltV : (mostrar,muestro : Str) -> V ;
verbV : Verbum -> V ;
mkV2 = overload {
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Prep -> V2 = mk2V2
} ;
mk2V2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
} ; } ;