mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
completed Paradigms documentation for Cat,Ita,Nor,Spa,Dan
This commit is contained in:
@@ -121,7 +121,7 @@ rulesTable aexx hasEx isLatex cs file = do
|
||||
|
||||
getRules :: ApiExx -> FilePath -> IO Rules
|
||||
getRules aexx file = do
|
||||
ss <- readFileC file >>= return . filter (not . hiddenLine) . lines
|
||||
ss <- readFileC (coding file) file >>= return . filter (not . hiddenLine) . lines
|
||||
return $ getrs [] ss
|
||||
where
|
||||
getrs rs ss = case ss of
|
||||
@@ -311,7 +311,18 @@ showTyp cs = unwords . map f . words
|
||||
&& isUpper (head cat)
|
||||
|
||||
-- to work around GHC 6.12 file input
|
||||
readFileC file = do
|
||||
readFileC cod file = do
|
||||
let tmp = file ++ ".tmp"
|
||||
system $ "iconv -f ISO-8859-1 -t UTF-8 " ++ file ++ " >" ++ tmp
|
||||
readFile tmp
|
||||
case cod of
|
||||
"utf8" -> readFile file
|
||||
_ -> do
|
||||
system $ "iconv -f ISO-8859-1 -t UTF-8 " ++ file ++ " >" ++ tmp
|
||||
readFile tmp
|
||||
|
||||
coding file = case language file of
|
||||
"Pol" -> "utf8"
|
||||
"Rus" -> "utf8"
|
||||
_ -> "latin1"
|
||||
|
||||
language = reverse . take 3 . drop 3 . reverse
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,11 +58,11 @@ oper
|
||||
-- amalgamate with the following word (the 'genitive' "de" and the
|
||||
-- 'dative' "a").
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
accusative : Prep ; -- direct object
|
||||
genitive : Prep ; -- preposition "de"
|
||||
dative : Prep ; -- preposition "a"
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : Str -> Prep ; -- other preposition
|
||||
|
||||
|
||||
--2 Nouns
|
||||
@@ -77,15 +77,15 @@ oper
|
||||
-- those ending with "z" have "ces" in plural; all other nouns
|
||||
-- have "es" as plural ending. The accent is not dealt with. TODO
|
||||
|
||||
mkN : (llum : Str) -> N ;
|
||||
mkN : (llum : Str) -> N ; -- regular, with heuristics for plural and gender
|
||||
|
||||
-- A different gender can be forced.
|
||||
|
||||
mkN : Str -> Gender -> N ;
|
||||
mkN : Str -> Gender -> N ; -- force gender
|
||||
|
||||
-- The worst case has two forms (singular + plural) and the gender.
|
||||
|
||||
mkN : (disc,discos : Str) -> Gender -> N
|
||||
mkN : (disc,discos : Str) -> Gender -> N -- worst case
|
||||
} ;
|
||||
|
||||
|
||||
@@ -96,24 +96,24 @@ oper
|
||||
-- They could be formed in syntax, but we give a shortcut here since
|
||||
-- they are frequent in lexica.
|
||||
|
||||
compN : N -> Str -> N ;
|
||||
compN : N -> Str -> N ; -- compound, e.g. "número" + "de telèfon"
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns ("filla de x") need a case and a preposition.
|
||||
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
mkN2 : N -> Prep -> N2 ; -- e.g. filla + genitive
|
||||
|
||||
-- The most common cases are the genitive "de" and the dative "a",
|
||||
-- with the empty preposition.
|
||||
|
||||
deN2 : N -> N2 ;
|
||||
aN2 : N -> N2 ;
|
||||
deN2 : N -> N2 ; -- relation with genitive
|
||||
aN2 : N -> N2 ; -- relation with dative
|
||||
|
||||
-- Three-place relational nouns ("la connexió de x a y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ; -- e.g. connexió + genitive + dative
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
@@ -130,8 +130,8 @@ oper
|
||||
-- The default gender is feminine for names ending with "a", otherwise masculine. TODO
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : (Anna : Str) -> PN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN
|
||||
mkPN : (Anna : Str) -> PN ; -- feminine for "-a", otherwise masculine
|
||||
mkPN : (Pilar : Str) -> Gender -> PN -- force gender
|
||||
} ;
|
||||
|
||||
|
||||
@@ -143,17 +143,17 @@ oper
|
||||
-- masculine singular. The types of adjectives that are recognized are
|
||||
-- "alto", "fuerte", "util". Comparison is formed by "mas".
|
||||
|
||||
mkA : (sol : Str) -> A ;
|
||||
mkA : (sol : Str) -> A ; -- regular
|
||||
|
||||
-- One-place adjectives compared with "mas" need five forms in the worst
|
||||
-- case (masc and fem singular, masc plural, adverbial).
|
||||
|
||||
mkA : (fort,forta,forts,fortes,fortament : Str) -> A ;
|
||||
mkA : (fort,forta,forts,fortes,fortament : Str) -> A ; -- worst case
|
||||
|
||||
-- In the worst case, two separate adjectives are given:
|
||||
-- the positive ("bo"), and the comparative ("millor").
|
||||
|
||||
mkA : (bo : A) -> (millor : A) -> A
|
||||
mkA : (bo : A) -> (millor : A) -> A -- special comparison (default with "mas")
|
||||
} ;
|
||||
|
||||
-- The functions above create postfix adjectives. To switch
|
||||
@@ -162,14 +162,14 @@ oper
|
||||
-- provided.
|
||||
-- JS: What about vi bÛ -> bon vi ?
|
||||
|
||||
prefixA : A -> A ;
|
||||
prefixA : A -> A ; -- adjective before noun (default: after)
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ; -- e.g. "casat" + dative
|
||||
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ oper
|
||||
-- The regular verb function works for models I, IIa, IIb and IIa
|
||||
-- The module $BeschCat$ gives the complete set of "Bescherelle" conjugations.
|
||||
|
||||
mkV : (cantar : Str) -> V ;
|
||||
mkV : (cantar : Str) -> V ; -- regular in models I, IIa, IIb
|
||||
|
||||
-- Verbs with vowel alternatition in the stem - easiest to give with
|
||||
-- two forms, e.g. "mostrar"/"muestro". TODO
|
||||
@@ -208,17 +208,17 @@ oper
|
||||
-- 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
|
||||
mkV : Verbum -> V -- use verb constructed in BeschCat
|
||||
} ;
|
||||
|
||||
-- To form reflexive verbs:
|
||||
|
||||
reflV : V -> V ;
|
||||
reflV : V -> V ; -- reflexive verb
|
||||
|
||||
-- Verbs with a deviant passive participle: just give the participle
|
||||
-- in masculine singular form as second argument.
|
||||
|
||||
special_ppV : V -> Str -> V ;
|
||||
special_ppV : V -> Str -> V ; --%
|
||||
|
||||
|
||||
|
||||
@@ -228,15 +228,15 @@ oper
|
||||
-- (transitive verbs).
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
mkV2 : Str -> V2 ; -- regular verb, direct object
|
||||
mkV2 : V -> V2 ; -- any verb, direct object
|
||||
mkV2 : V -> Prep -> V2 -- preposition for complement
|
||||
} ;
|
||||
|
||||
|
||||
-- You can reuse a $V2$ verb in $V$.
|
||||
|
||||
v2V : V2 -> V ;
|
||||
v2V : V2 -> V ; --%
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
@@ -252,7 +252,7 @@ oper
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkV0 : V -> V0 ; --%
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "vull parlar"
|
||||
@@ -264,18 +264,18 @@ oper
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
mkAS : A -> AS ; --%
|
||||
mkA2S : A -> Prep -> A2S ; --%
|
||||
mkAV : A -> Prep -> AV ; --%
|
||||
mkA2V : A -> Prep -> Prep -> A2V ; --%
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||
-- and the second argument is given
|
||||
-- as an adverb. Likewise
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
V0 : Type ; --%
|
||||
AS, A2S, AV, A2V : Type ; --%
|
||||
|
||||
|
||||
--.
|
||||
|
||||
@@ -40,26 +40,26 @@ resource ParadigmsDan =
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
utrum : Gender ;
|
||||
neutrum : Gender ;
|
||||
utrum : Gender ; -- "en" gender
|
||||
neutrum : Gender ; -- "et" gender
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
Number : Type ;
|
||||
Number : Type ; --%
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
singular : Number ; --%
|
||||
plural : Number ; --%
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
|
||||
Case : Type ;
|
||||
Case : Type ; --%
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
nominative : Case ; --%
|
||||
genitive : Case ; --%
|
||||
|
||||
-- Prepositions used in many-argument functions are just strings.
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : Str -> Prep ; -- e.g. "til"
|
||||
noPrep : Prep ; -- empty string
|
||||
|
||||
--2 Nouns
|
||||
@@ -71,26 +71,26 @@ oper
|
||||
-- The heuristic is that all nouns are $utrum$ with the
|
||||
-- plural ending "er" or "r".
|
||||
|
||||
mkN : (bil : Str) -> N ;
|
||||
mkN : (bil : Str) -> N ; -- regular noun: "en" gender with plural "-er" or "-r"
|
||||
|
||||
-- Giving gender manually makes the heuristic more reliable.
|
||||
|
||||
mkN : (hus : Str) -> Gender -> N ;
|
||||
mkN : (hus : Str) -> Gender -> N ; -- regular possibly of "et" gender --%
|
||||
|
||||
-- This function takes the singular indefinite and definite forms; the
|
||||
-- gender is computed from the definite form.
|
||||
|
||||
mkN : (bil,bilen : Str) -> N ;
|
||||
mkN : (bil,bilen : Str) -> N ; -- better prediction from both singular and plural
|
||||
|
||||
-- This function takes the singular indefinite and definite and the plural
|
||||
-- indefinite
|
||||
|
||||
mkN : (bil,bilen,biler : Str) -> N ;
|
||||
mkN : (bil,bilen,biler : Str) -> N ; --%
|
||||
|
||||
-- Worst case: give all four forms. The gender is computed from the
|
||||
-- last letter of the second form (if "n", then $utrum$, otherwise $neutrum$).
|
||||
|
||||
mkN : (dreng,drengen,drenge,drengene : Str) -> N ;
|
||||
mkN : (dreng,drengen,drenge,drengene : Str) -> N ; -- worst case
|
||||
} ;
|
||||
|
||||
|
||||
@@ -106,12 +106,12 @@ oper
|
||||
--
|
||||
-- Relational nouns ("datter til x") need a preposition.
|
||||
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
mkN2 : N -> Prep -> N2 ; -- e.g. datter + til
|
||||
|
||||
-- The most common preposition is "af", and the following is a
|
||||
-- shortcut for regular relational nouns with "af".
|
||||
|
||||
regN2 : Str -> Gender -> N2 ;
|
||||
regN2 : Str -> Gender -> N2 ; --%
|
||||
|
||||
-- Use the function $mkPrep$ or see the section on prepositions below to
|
||||
-- form other prepositions.
|
||||
@@ -119,7 +119,7 @@ oper
|
||||
-- Three-place relational nouns ("forbindelse fra x til y")
|
||||
-- need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ; -- e.g. forbindelse + fra + til
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
@@ -135,9 +135,9 @@ oper
|
||||
-- Proper names, with a regular genitive, are formed as follows
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ; -- utrum
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
mkPN : N -> PN ;
|
||||
mkPN : Str -> PN ; -- utrum gender
|
||||
mkPN : Str -> Gender -> PN ; -- other gender
|
||||
mkPN : N -> PN ; --%
|
||||
} ;
|
||||
|
||||
|
||||
@@ -147,22 +147,22 @@ oper
|
||||
-- with "ig". Two, five, or at worst five forms are sometimes needed.
|
||||
|
||||
mkA : overload {
|
||||
mkA : (fin : Str) -> A ;
|
||||
mkA : (fin,fint : Str) -> A ;
|
||||
mkA : (galen,galet,galne : Str) -> A ;
|
||||
mkA : (stor,stort,store,storre,storst : Str) -> A ;
|
||||
mkA : (fin : Str) -> A ; -- regular adjective
|
||||
mkA : (fin,fint : Str) -> A ; -- deviant neuter
|
||||
mkA : (galen,galet,galne : Str) -> A ; -- also deviant plural
|
||||
mkA : (stor,stort,store,storre,storst : Str) -> A ; -- worst case
|
||||
|
||||
-- If comparison is formed by "mer", "mest", as in general for
|
||||
-- long adjective, the following pattern is used:
|
||||
|
||||
mkA : A -> A ; -- -/mer/mest norsk
|
||||
mkA : A -> A ; -- force comparison with mer/mest
|
||||
} ;
|
||||
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ; -- e.g. gift + med
|
||||
|
||||
|
||||
|
||||
@@ -172,12 +172,12 @@ oper
|
||||
-- after the verb. Some can be close to the verb like the negation
|
||||
-- "ikke" (e.g. "altid").
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdV : Str -> AdV ;
|
||||
mkAdv : Str -> Adv ; -- after verb, e.g. "idag"
|
||||
mkAdV : Str -> AdV ; -- close to verb, e.g. "altid"
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
mkAdA : Str -> AdA ; -- modify adjective, e.g. "meget"
|
||||
|
||||
|
||||
--2 Verbs
|
||||
@@ -187,27 +187,27 @@ oper
|
||||
|
||||
-- The 'regular verb' function is the first conjugation.
|
||||
|
||||
mkV : (snakke : Str) -> V ;
|
||||
mkV : (snakke : Str) -> V ; -- regular verb
|
||||
|
||||
-- The almost regular verb function needs the infinitive and the preteritum.
|
||||
|
||||
mkV : (leve,levde : Str) -> V ;
|
||||
mkV : (leve,levde : Str) -> V ; -- also give past tense
|
||||
|
||||
-- There is an extensive list of irregular verbs in the module $IrregDan$.
|
||||
-- In practice, it is enough to give three forms, as in school books.
|
||||
|
||||
mkV : (drikke, drakk, drukket : Str) -> V ;
|
||||
mkV : (drikke, drakk, drukket : Str) -> V ; -- theme of irregular verb
|
||||
|
||||
-- The worst case needs six forms.
|
||||
|
||||
mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ;
|
||||
mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; -- worst case
|
||||
|
||||
|
||||
--3 Verbs with a particle.
|
||||
--
|
||||
-- The particle, such as in "lukke op", is given as a string.
|
||||
|
||||
mkV : V -> Str -> V ;
|
||||
mkV : V -> Str -> V ; -- particle verb, e.g. lukke + op
|
||||
} ;
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ oper
|
||||
--
|
||||
-- By default, the auxiliary is "have". This function changes it to "være".
|
||||
|
||||
vaereV : V -> V ;
|
||||
vaereV : V -> V ; -- force auxiliary "være"
|
||||
|
||||
|
||||
|
||||
@@ -226,8 +226,8 @@ oper
|
||||
-- Some words are used in passive forms only, e.g. "undres", some as
|
||||
-- reflexive e.g. "forestille sig".
|
||||
|
||||
depV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
depV : V -> V ; -- deponent, e.g. "undres"
|
||||
reflV : V -> V ; -- reflexive, e.g. "forestille sig"
|
||||
|
||||
|
||||
--3 Two-place verbs
|
||||
@@ -236,9 +236,9 @@ oper
|
||||
-- (transitive verbs). Notice that, if a particle is needed, it comes from the $V$.
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
mkV2 : Str -> V2 ; --%
|
||||
mkV2 : V -> V2 ; -- direct object
|
||||
mkV2 : V -> Prep -> V2 ; -- prepositional object
|
||||
} ;
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ oper
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkV0 : V -> V0 ; --%
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
@@ -266,17 +266,17 @@ oper
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
mkAS : A -> AS ; --%
|
||||
mkA2S : A -> Prep -> A2S ; --%
|
||||
mkAV : A -> AV ; --%
|
||||
mkA2V : A -> Prep -> A2V ; --%
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||
-- and the second argument is given as an adverb..
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
V0 : Type ; --%
|
||||
AS, A2S, AV, A2V : Type ; --%
|
||||
|
||||
--.
|
||||
|
||||
|
||||
@@ -40,22 +40,22 @@ oper
|
||||
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
masculine : Gender ; --%
|
||||
feminine : Gender ; --%
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
|
||||
Case : Type ;
|
||||
Case : Type ; --%
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
nominative : Case ; --%
|
||||
genitive : Case ; --%
|
||||
|
||||
-- Prepositions are used in many-argument functions for rection.
|
||||
-- The resource category $Prep$ is used.
|
||||
@@ -63,7 +63,7 @@ oper
|
||||
-- The number of a noun phrase can be extracted with the following
|
||||
-- function.
|
||||
|
||||
npNumber : NP -> Number ;
|
||||
npNumber : NP -> Number ; -- exctract the number of a noun phrase
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
@@ -58,15 +58,21 @@ oper
|
||||
|
||||
--Prep : Type ;
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
accusative : Prep ; -- direct object
|
||||
genitive : Prep ; -- preposition "di" and its contractions
|
||||
dative : Prep ; -- preposition "a" and its contractions
|
||||
|
||||
-- The following prepositions also have special contracted forms.
|
||||
|
||||
con_Prep, da_Prep, in_Prep, su_Prep : Prep ;
|
||||
con_Prep : Prep ; -- preposition "con" and its contractions
|
||||
da_Prep : Prep ; -- preposition "da" and its contractions
|
||||
in_Prep : Prep ; -- preposition "in" and its contractions
|
||||
su_Prep : Prep ; -- preposition "su" and its contractions
|
||||
|
||||
-- other prepositions
|
||||
|
||||
mkPrep : Str -> Prep ; -- other prepositions, e.g. "dopo"
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
@@ -77,22 +83,22 @@ oper
|
||||
-- The heuristic says that the gender is feminine for nouns
|
||||
-- ending with "a", and masculine for all other words.
|
||||
|
||||
mkN : (cane : Str) -> N ;
|
||||
mkN : (cane : Str) -> N ; -- regular noun; fem for -"a", masc otherwise
|
||||
|
||||
-- To force a different gender, give it explicitly.
|
||||
|
||||
mkN : (carne : Str) -> Gender -> N ;
|
||||
mkN : (carne : Str) -> Gender -> N ; -- override default gender
|
||||
|
||||
-- Worst case: give both two forms and the gender.
|
||||
|
||||
mkN : (uomo,uomini : Str) -> Gender -> N ;
|
||||
mkN : (uomo,uomini : Str) -> Gender -> N ; -- worst case
|
||||
|
||||
-- In *compound nouns*, the first part is inflected as a noun but
|
||||
-- the second part is not inflected. e.g. "numero di telefono".
|
||||
-- They could be formed in syntax, but we give a shortcut here since
|
||||
-- they are frequent in lexica.
|
||||
|
||||
mkN : N -> Str -> N
|
||||
mkN : N -> Str -> N -- compound such as "numero" + "di telefono"
|
||||
} ;
|
||||
|
||||
|
||||
@@ -104,13 +110,13 @@ oper
|
||||
-- The default is regular nouns with the genitive "di".
|
||||
|
||||
mkN2 : overload {
|
||||
mkN2 : Str -> N2 ;
|
||||
mkN2 : N -> Prep -> N2
|
||||
mkN2 : Str -> N2 ; -- regular with genitive, e.g. "figlio" + "di"
|
||||
mkN2 : N -> Prep -> N2 -- arbitrary noun and preposition
|
||||
} ;
|
||||
|
||||
-- Three-place relational nouns ("la connessione di x a y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ; -- e.g. volo + da + per
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
@@ -127,8 +133,8 @@ oper
|
||||
-- the name ends with an "a", and masculine otherwise.
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
mkPN : Str -> Gender -> PN
|
||||
mkPN : Str -> PN ; -- femininne for "-a", otherwise masculine
|
||||
mkPN : Str -> Gender -> PN -- set gender manually
|
||||
} ;
|
||||
|
||||
|
||||
@@ -140,18 +146,18 @@ oper
|
||||
-- For regular adjectives, all forms are derived from the
|
||||
-- masculine singular. Comparison is formed by "più".
|
||||
|
||||
mkA : (bianco : Str) -> A ;
|
||||
mkA : (bianco : Str) -> A ; -- predictable adjective
|
||||
|
||||
-- Five forms are needed in the worst
|
||||
-- case (masc and fem singular, masc plural, adverbial), given that
|
||||
-- comparison is formed by "più".
|
||||
|
||||
mkA : (solo,sola,soli,sole,solamente : Str) -> A ;
|
||||
mkA : (solo,sola,soli,sole,solamente : Str) -> A ; -- irregular adjective
|
||||
|
||||
-- With irregular comparison, there are as it were two adjectives:
|
||||
-- the positive ("buono") and the comparative ("migliore").
|
||||
|
||||
mkA : A -> A -> A
|
||||
mkA : A -> A -> A -- special comparison, e.g. buono - migliore
|
||||
} ;
|
||||
|
||||
-- All the functions above create postfix adjectives. To switch
|
||||
@@ -159,7 +165,8 @@ oper
|
||||
-- modification, as in "vecchia chiesa"), the following function is
|
||||
-- provided.
|
||||
|
||||
prefixA : A -> A = prefA ;
|
||||
prefixA : A -> A -- adjective that comes before noun (default: after)
|
||||
= prefA ;
|
||||
|
||||
|
||||
|
||||
@@ -167,7 +174,7 @@ oper
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ; -- e.g. divisibile + per
|
||||
|
||||
|
||||
|
||||
@@ -197,26 +204,26 @@ oper
|
||||
-- these endings, as well as the variations among
|
||||
-- "amare, cominciare, mangiare, legare, cercare".
|
||||
|
||||
mkV : Str -> V ;
|
||||
mkV : Str -> V ; -- regular verbs in "-are"/"-ire"
|
||||
|
||||
-- The module $BeschIta$ gives (almost) all the patterns of the "Bescherelle"
|
||||
-- book. To use them in the category $V$, wrap them with the function
|
||||
|
||||
mkV : Verbo -> V ;
|
||||
mkV : Verbo -> V ; -- verbs formed by BeschIta
|
||||
|
||||
-- If $BeschIta$ does not give the desired result or feels difficult
|
||||
-- to consult, here is a worst-case function for "-ire" and "-ere" verbs,
|
||||
-- taking 11 arguments.
|
||||
|
||||
mkV : (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V
|
||||
mkV : (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V -- worst case
|
||||
} ;
|
||||
|
||||
-- The function $regV$ gives all verbs the compound auxiliary "avere".
|
||||
-- To change it to "essere", use the following function.
|
||||
-- Reflexive implies "essere".
|
||||
|
||||
essereV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
essereV : V -> V ; -- force "essere" as auxiliary (default avere)
|
||||
reflV : V -> V ; -- reflexive verb (implies essere)
|
||||
|
||||
|
||||
--3 Two-place verbs
|
||||
@@ -225,14 +232,14 @@ oper
|
||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
mkV2 : Str -> V2 ; -- regular verb, direct object
|
||||
mkV2 : V -> V2 ; -- direct object
|
||||
mkV2 : V -> Prep -> V2 -- prepositional object
|
||||
} ;
|
||||
|
||||
-- You can reuse a $V2$ verb in $V$.
|
||||
|
||||
v2V : V2 -> V ;
|
||||
v2V : V2 -> V ; --%
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
@@ -249,7 +256,7 @@ oper
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkV0 : V -> V0 ; --%
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "voglio parlare"
|
||||
@@ -261,18 +268,18 @@ oper
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
mkAS : A -> AS ; --%
|
||||
mkA2S : A -> Prep -> A2S ; --%
|
||||
mkAV : A -> Prep -> AV ; --%
|
||||
mkA2V : A -> Prep -> Prep -> A2V ; --%
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||
-- and the second argument is given
|
||||
-- as an adverb. Likewise
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
V0 : Type ; --%
|
||||
AS, A2S, AV, A2V : Type ; --%
|
||||
|
||||
|
||||
--.
|
||||
|
||||
@@ -129,8 +129,8 @@ lin
|
||||
we_Pron =
|
||||
mkPronoun "noi" "ci" "ci" "ce" "noi" "nostro" "nostra" "nostri" "nostre"
|
||||
Masc Pl P1 ;
|
||||
whatSg_IP = {s = \\c => prepCase c ++ ["che cosa"] ; a = aagr Fem Sg} ;
|
||||
whatPl_IP = {s = \\c => prepCase c ++ ["che cose"] ; a = aagr Fem Pl} ; ---
|
||||
whatSg_IP = {s = \\c => prepCase c ++ ["che"] ; a = aagr Fem Sg} ;
|
||||
whatPl_IP = {s = \\c => prepCase c ++ ["che"] ; a = aagr Fem Pl} ; ---
|
||||
when_IAdv = ss "quando" ;
|
||||
when_Subj = ss "quando" ** {m = Indic} ;
|
||||
where_IAdv = ss "dove" ;
|
||||
|
||||
@@ -41,9 +41,9 @@ resource ParadigmsNor =
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
neutrum : Gender ;
|
||||
masculine : Gender ; -- the "en" gender
|
||||
feminine : Gender ; -- the "ei" gender
|
||||
neutrum : Gender ; -- the "et" gender
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
@@ -54,14 +54,14 @@ oper
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
|
||||
Case : Type ;
|
||||
Case : Type ; --%
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
nominative : Case ; --%
|
||||
genitive : Case ; --%
|
||||
|
||||
-- Prepositions used in many-argument functions are just strings.
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : Str -> Prep ; -- e.g. "etter"
|
||||
noPrep : Prep ; -- empty string
|
||||
|
||||
--2 Nouns
|
||||
@@ -78,10 +78,10 @@ oper
|
||||
-- last letter of the second form (if "n", then $utrum$, otherwise $neutrum$).
|
||||
|
||||
mkN : overload {
|
||||
mkN : Str -> N ;
|
||||
mkN : Str -> Gender -> N ;
|
||||
mkN : (bil,bilen : Str) -> N ;
|
||||
mkN : (dreng,drengen,drenger,drengene : Str) -> N
|
||||
mkN : Str -> N ; -- predictable noun, feminine for "-e" otherwise masculine
|
||||
mkN : Str -> Gender -> N ; -- force gender
|
||||
mkN : (bil,bilen : Str) -> N ; --%
|
||||
mkN : (dreng,drengen,drenger,drengene : Str) -> N -- worst case
|
||||
} ;
|
||||
|
||||
|
||||
@@ -96,12 +96,12 @@ oper
|
||||
--
|
||||
-- Relational nouns ("datter til x") need a preposition.
|
||||
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
mkN2 : N -> Prep -> N2 ; -- e.g. datter + til
|
||||
|
||||
-- The most common preposition is "av", and the following is a
|
||||
-- shortcut for regular, $nonhuman$ relational nouns with "av".
|
||||
|
||||
regN2 : Str -> Gender -> N2 ;
|
||||
regN2 : Str -> Gender -> N2 ; --%
|
||||
|
||||
-- Use the function $mkPrep$ or see the section on prepositions below to
|
||||
-- form other prepositions.
|
||||
@@ -109,7 +109,7 @@ oper
|
||||
-- Three-place relational nouns ("forbindelse fra x til y")
|
||||
-- need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ; -- e.g forbindelse + fra + til
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
@@ -127,8 +127,8 @@ oper
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ; -- masculine
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
mkPN : N -> PN ;
|
||||
mkPN : Str -> Gender -> PN ; -- force gender
|
||||
mkPN : N -> PN ; --%
|
||||
} ;
|
||||
|
||||
|
||||
@@ -138,15 +138,15 @@ oper
|
||||
-- with "ig". Two, five, or at worst five forms are sometimes needed.
|
||||
|
||||
mkA : overload {
|
||||
mkA : (fin : Str) -> A ;
|
||||
mkA : (fin,fint : Str) -> A ;
|
||||
mkA : (galen,galet,galne : Str) -> A ;
|
||||
mkA : (stor,stort,store,storre,storst : Str) -> A ;
|
||||
mkA : (fin : Str) -> A ; -- predictable adjective
|
||||
mkA : (fin,fint : Str) -> A ; -- deviant neuter
|
||||
mkA : (galen,galet,galne : Str) -> A ; -- also plural deviant
|
||||
mkA : (stor,stort,store,storre,storst : Str) -> A ; -- worst case
|
||||
|
||||
-- If comparison is formed by "mer", "mest", as in general for
|
||||
-- long adjective, the following pattern is used:
|
||||
|
||||
mkA : A -> A ; -- -/mer/mest norsk
|
||||
mkA : A -> A ; -- comparison with mer/mest, e.g. "norsk"
|
||||
} ;
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ oper
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ; -- e.g. gift + med
|
||||
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ oper
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
mkAdA : Str -> AdA ; -- e.g. mye
|
||||
|
||||
|
||||
--2 Verbs
|
||||
@@ -178,26 +178,26 @@ oper
|
||||
|
||||
-- The 'regular verb' function is the first conjugation.
|
||||
|
||||
mkV : (snakke : Str) -> V ;
|
||||
mkV : (snakke : Str) -> V ; -- regular verb (first conjugation)
|
||||
|
||||
-- The almost regular verb function needs the infinitive and the preteritum.
|
||||
|
||||
mkV : (leve,levde : Str) -> V ;
|
||||
mkV : (leve,levde : Str) -> V ; -- other past tense
|
||||
|
||||
-- There is an extensive list of irregular verbs in the module $IrregNor$.
|
||||
-- In practice, it is enough to give three forms, as in school books.
|
||||
|
||||
mkV : (drikke, drakk, drukket : Str) -> V ;
|
||||
mkV : (drikke, drakk, drukket : Str) -> V ; -- theme of irregular verb
|
||||
|
||||
-- The worst case needs six forms.
|
||||
|
||||
mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ;
|
||||
mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; -- worst case
|
||||
|
||||
--3 Verbs with a particle.
|
||||
--
|
||||
-- The particle, such as in "lukke opp", is given as a string.
|
||||
|
||||
mkV : V -> Str -> V ;
|
||||
mkV : V -> Str -> V ; -- verb with particle, e.g. lukke + opp
|
||||
} ;
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ oper
|
||||
--
|
||||
-- By default, the auxiliary is "have". This function changes it to "være".
|
||||
|
||||
vaereV : V -> V ;
|
||||
vaereV : V -> V ; -- force "være" as auxiliary (default "have")
|
||||
|
||||
|
||||
|
||||
@@ -215,8 +215,8 @@ oper
|
||||
-- Some words are used in passive forms only, e.g. "trives", some as
|
||||
-- reflexive e.g. "forestille seg".
|
||||
|
||||
depV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
depV : V -> V ; -- deponent, e.g "trives"
|
||||
reflV : V -> V ; -- reflexive, e.g. "forestille seg"
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
@@ -224,9 +224,9 @@ oper
|
||||
-- (transitive verbs). Notice that, if a particle is needed, it comes from the $V$.
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
mkV2 : Str -> V2 ; -- regular, direct object
|
||||
mkV2 : V -> V2 ; -- direct object
|
||||
mkV2 : V -> Prep -> V2 ; -- preposition for complement
|
||||
} ;
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ oper
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkV0 : V -> V0 ; --%
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
@@ -254,16 +254,16 @@ oper
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
mkAS : A -> AS ; --%
|
||||
mkA2S : A -> Prep -> A2S ; --%
|
||||
mkAV : A -> AV ; --%
|
||||
mkA2V : A -> Prep -> A2V ; --%
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$.
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
V0 : Type ; --%
|
||||
AS, A2S, AV, A2V : Type ; --%
|
||||
|
||||
|
||||
--.
|
||||
|
||||
@@ -64,6 +64,26 @@ noPrep : NCase -> Prep ;
|
||||
|
||||
--2 Nouns
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str -> N -- Singular, infers gender and Plural
|
||||
= mkSPN;
|
||||
mkN : Str -> Str -> NGender -> N -- worst case: Singular + Plural + gender
|
||||
= mkNI;
|
||||
mkN : Str -> Str -> Str -> N -- very irregular nouns - feminine
|
||||
= mkVI;
|
||||
mkN : Str -> Str -> N -- Singular + Plural, infers gender
|
||||
= mkNN;
|
||||
mkN : Str -> NGender -> N -- Singular + gender, infers Plural
|
||||
= regN;
|
||||
} ;
|
||||
|
||||
--because the plurals ending in "uri" are becoming less and less frequent for neuter nouns,
|
||||
--and because there is no way of infering the plural form by looking at the structure of the word
|
||||
--we treat this case separately :
|
||||
|
||||
mkNR : Str -> N;
|
||||
mkNR s = mkInanimate (mkNomNeut s) ** {lock_N = <>} ;
|
||||
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
@@ -147,6 +167,17 @@ lock_PN = <>
|
||||
};
|
||||
|
||||
|
||||
--3 Adjectives
|
||||
--
|
||||
mkA = overload {
|
||||
mkA : Str -> A -- regular adjectives
|
||||
= regA;
|
||||
mkA : Str -> Str -> Str -> Str -> Str -> A --worst case -- all 4 forms are needed + form for adverb
|
||||
= mk5A ;
|
||||
mkA : Str -> Str -> Str -> Str -> A -- 4 forms are needed
|
||||
= mk4A;
|
||||
};
|
||||
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
@@ -168,10 +199,10 @@ lock_PN = <>
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
mkAS : A -> AS ; --%
|
||||
mkA2S : A -> Prep -> A2S ; --%
|
||||
mkAV : A -> Prep -> AV ; --%
|
||||
mkA2V : A -> Prep -> Prep -> A2V ; --%
|
||||
|
||||
|
||||
|
||||
@@ -272,28 +303,9 @@ mkNN s ss = case s of
|
||||
}
|
||||
};
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str -> Str -> NGender -> N = mkNI; -- worst case - we need Singular + Plural form + gender
|
||||
mkN : Str -> Str -> Str -> N = mkVI; -- very irregular nouns - feminine
|
||||
mkN : Str -> Str -> N = mkNN; -- needed Singular + Plural form, infers gender
|
||||
mkN : Str -> NGender -> N = regN; -- needed Singular + gender, infers Plural form
|
||||
mkN : Str -> N = mkSPN; -- needed Singular form, infers gender and Plural form
|
||||
} ;
|
||||
|
||||
--because the plurals ending in "uri" are becoming less and less frequent for neuter nouns,
|
||||
--and because there is no way of infering the plural form by looking at the structure of the word
|
||||
--we treat this case separately :
|
||||
|
||||
mkNR : Str -> N;
|
||||
mkNR s = mkInanimate (mkNomNeut s) ** {lock_N = <>} ;
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
mkA = overload {
|
||||
mkA : Str -> Str -> Str -> Str -> Str -> A = mk5A ;--worst case -- all 4 forms are needed + form for adverb
|
||||
mkA : Str -> Str -> Str -> Str -> A = mk4A; -- 4 forms are needed
|
||||
mkA : Str -> A = regA; -- regular adjectives
|
||||
};
|
||||
|
||||
mk4A : Str -> Str -> Str -> Str -> A;
|
||||
mk4A a b c d =
|
||||
|
||||
@@ -197,9 +197,7 @@ perfective: Aspect ;
|
||||
-- Inherent aspect should also be specified.
|
||||
|
||||
-- mkVerbum : Aspect -> (presentSgP1,presentSgP2,presentSgP3,
|
||||
mkV : Aspect -> (presentSgP1,presentSgP2,presentSgP3,
|
||||
presentPlP1,presentPlP2,presentPlP3,
|
||||
pastSgMasculine,imperative,infinitive: Str) -> V ;
|
||||
mkV : Aspect -> (presSg1,presSg2,presSg3,presPl1,presPl2,presPl3,pastSgMasc,imp,inf: Str) -> V ;
|
||||
|
||||
-- Common conjugation patterns are two conjugations:
|
||||
-- first - verbs ending with "-ать/-ять" and second - "-ить/-еть".
|
||||
@@ -212,8 +210,7 @@ perfective: Aspect ;
|
||||
-- So the definition for verb "любить" looks like:
|
||||
-- regV Imperfective Second "люб" "лю" "любил" "люби" "любить";
|
||||
|
||||
regV :Aspect -> Conjugation -> (stemPresentSgP1,endingPresentSgP1,
|
||||
pastSgP1,imperative,infinitive : Str) -> V ;
|
||||
regV :Aspect -> Conjugation -> (stemPresSg1,endPresSg1,pastSg1,imp,inf : Str) -> V ;
|
||||
|
||||
|
||||
-- Two-place verbs, and the special case with direct object. Notice that
|
||||
|
||||
@@ -55,11 +55,11 @@ oper
|
||||
-- amalgamate with the following word (the 'genitive' "de" and the
|
||||
-- 'dative' "a").
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
accusative : Prep ; -- direct object
|
||||
genitive : Prep ; -- preposition "de" and its contractions
|
||||
dative : Prep ; -- preposition "a" and its contractions
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : Str -> Prep ; -- other preposition
|
||||
|
||||
|
||||
--2 Nouns
|
||||
@@ -74,15 +74,15 @@ oper
|
||||
-- those ending with "z" have "ces" in plural; all other nouns
|
||||
-- have "es" as plural ending. The accent is not dealt with.
|
||||
|
||||
mkN : (luz : Str) -> N ;
|
||||
mkN : (luz : Str) -> N ; -- predictable; feminine for "-a"/"-z", otherwise masculine
|
||||
|
||||
-- A different gender can be forced.
|
||||
|
||||
mkN : Str -> Gender -> N ;
|
||||
mkN : Str -> Gender -> N ; -- force gender
|
||||
|
||||
-- The worst case has two forms (singular + plural) and the gender.
|
||||
|
||||
mkN : (baston,bastones : Str) -> Gender -> N
|
||||
mkN : (baston,bastones : Str) -> Gender -> N -- worst case
|
||||
} ;
|
||||
|
||||
|
||||
@@ -93,24 +93,24 @@ oper
|
||||
-- They could be formed in syntax, but we give a shortcut here since
|
||||
-- they are frequent in lexica.
|
||||
|
||||
compN : N -> Str -> N ;
|
||||
compN : N -> Str -> N ; -- compound, e.g. "número" + "de teléfono"
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns ("fille de x") need a case and a preposition.
|
||||
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
mkN2 : N -> Prep -> N2 ; -- relational noun with preposition
|
||||
|
||||
-- The most common cases are the genitive "de" and the dative "a",
|
||||
-- with the empty preposition.
|
||||
|
||||
deN2 : N -> N2 ;
|
||||
aN2 : N -> N2 ;
|
||||
deN2 : N -> N2 ; -- relational noun with preposition "de"
|
||||
aN2 : N -> N2 ; -- relational noun with preposition "a"
|
||||
|
||||
-- Three-place relational nouns ("la connessione di x a y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ; -- prepositions for two complements
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
@@ -127,8 +127,8 @@ oper
|
||||
-- The default gender is feminine for names ending with "a", otherwise masculine.
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : (Anna : Str) -> PN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN
|
||||
mkPN : (Anna : Str) -> PN ; -- feminine for "-a"
|
||||
mkPN : (Pilar : Str) -> Gender -> PN -- force gender
|
||||
} ;
|
||||
|
||||
|
||||
@@ -140,17 +140,17 @@ oper
|
||||
-- masculine singular. The types of adjectives that are recognized are
|
||||
-- "alto", "fuerte", "util". Comparison is formed by "mas".
|
||||
|
||||
mkA : (util : Str) -> A ;
|
||||
mkA : (util : Str) -> A ; -- predictable adjective
|
||||
|
||||
-- One-place adjectives compared with "mas" need five forms in the worst
|
||||
-- case (masc and fem singular, masc plural, adverbial).
|
||||
|
||||
mkA : (solo,sola,solos,solas,solamente : Str) -> A ;
|
||||
mkA : (solo,sola,solos,solas,solamente : Str) -> A ; -- worst-case
|
||||
|
||||
-- In the worst case, two separate adjectives are given:
|
||||
-- the positive ("bueno"), and the comparative ("mejor").
|
||||
|
||||
mkA : (bueno : A) -> (mejor : A) -> A
|
||||
mkA : (bueno : A) -> (mejor : A) -> A -- special comparison (default with "mas")
|
||||
} ;
|
||||
|
||||
-- The functions above create postfix adjectives. To switch
|
||||
@@ -158,14 +158,14 @@ oper
|
||||
-- modification, as in "buen vino"), the following function is
|
||||
-- provided.
|
||||
|
||||
prefixA : A -> A ;
|
||||
prefixA : A -> A ; -- adjective before noun (default after noun)
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ; -- e.g. "casado" + dative
|
||||
|
||||
|
||||
|
||||
@@ -195,28 +195,28 @@ oper
|
||||
-- "actuar, cazar, guiar, pagar, sacar". The module $BeschSpa$ gives
|
||||
-- the complete set of "Bescherelle" conjugations.
|
||||
|
||||
mkV : (pagar : Str) -> V ;
|
||||
mkV : (pagar : Str) -> V ; -- regular in "-ar", "-er", ".ir"
|
||||
|
||||
-- Verbs with vowel alternatition in the stem - easiest to give with
|
||||
-- two forms, e.g. "mostrar"/"muestro".
|
||||
|
||||
mkV : (mostrar,muestro : Str) -> V ;
|
||||
mkV : (mostrar,muestro : Str) -> V ; -- regular with vowel alternation
|
||||
|
||||
-- Most irreguler verbs are found in $IrregSpa$. If this is not enough,
|
||||
-- the module $BeschSpa$ gives all the patterns of the "Bescherelle"
|
||||
-- book. To use them in the category $V$, wrap them with the function
|
||||
|
||||
mkV : Verbum -> V
|
||||
mkV : Verbum -> V -- import verb constructed with BeschSpa
|
||||
} ;
|
||||
|
||||
-- To form reflexive verbs:
|
||||
|
||||
reflV : V -> V ;
|
||||
reflV : V -> V ; -- reflexive verb
|
||||
|
||||
-- Verbs with a deviant passive participle: just give the participle
|
||||
-- in masculine singular form as second argument.
|
||||
|
||||
special_ppV : V -> Str -> V ;
|
||||
special_ppV : V -> Str -> V ; -- deviant past participle, e.g. abrir - abierto
|
||||
|
||||
|
||||
|
||||
@@ -226,31 +226,31 @@ oper
|
||||
-- (transitive verbs).
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
mkV2 : Str -> V2 ; -- regular, direct object
|
||||
mkV2 : V -> V2 ; -- direct object
|
||||
mkV2 : V -> Prep -> V2 -- other object
|
||||
} ;
|
||||
|
||||
|
||||
-- You can reuse a $V2$ verb in $V$.
|
||||
|
||||
v2V : V2 -> V ;
|
||||
v2V : V2 -> V ; --%
|
||||
|
||||
--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 ; -- hablar, a, di
|
||||
dirV3 : V -> Prep -> V3 ; -- dar,(accusative),a
|
||||
dirdirV3 : V -> V3 ; -- dar,(dative),(accusative)
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- e.g. hablar, a, di
|
||||
dirV3 : V -> Prep -> V3 ; -- e.g. dar,(accusative),a
|
||||
dirdirV3 : V -> V3 ; -- e.g. dar,(dative),(accusative)
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkV0 : V -> V0 ; --%
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "quiero hablar"
|
||||
@@ -262,18 +262,18 @@ oper
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
mkAS : A -> AS ; --%
|
||||
mkA2S : A -> Prep -> A2S ; --%
|
||||
mkAV : A -> Prep -> AV ; --%
|
||||
mkA2V : A -> Prep -> Prep -> A2V ; --%
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||
-- and the second argument is given
|
||||
-- as an adverb. Likewise
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
V0 : Type ; --%
|
||||
AS, A2S, AV, A2V : Type ; --%
|
||||
|
||||
|
||||
--.
|
||||
|
||||
@@ -49,8 +49,8 @@ oper
|
||||
|
||||
|
||||
-- Proper names
|
||||
mkPN : Str -> PN = \s -> let n
|
||||
= regNoun s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||
mkPN : Str -> PN
|
||||
= \s -> let n = regNoun s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||
personalPN : Str -> Str -> Str -> Str -> Number -> Gender -> UPerson -> Pron
|
||||
= \s1,s2,s3,sp,nn,g,p -> let n = mkPron s1 s2 s3 in {s = n.s ; a = toAgr nn p g ; ps = sp ; lock_Pron = <>};
|
||||
demoPN : Str -> Str -> Str -> Quant
|
||||
|
||||
Reference in New Issue
Block a user