1
0
forked from GitHub/gf-rgl

(Ita) Update A,A2 to not have Degree

This commit is contained in:
Inari Listenmaa
2021-09-13 15:33:40 +08:00
parent 57390d366c
commit 47ea6a6830
4 changed files with 57 additions and 52 deletions

View File

@@ -81,6 +81,8 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta,
_ => prepCase c ++ artDef False g Sg (CPrep P_di) _ => prepCase c ++ artDef False g Sg (CPrep P_di)
} ; } ;
-} -}
piuComp = "più" ;
conjunctCase : Case -> Case = \c -> case c of { conjunctCase : Case -> Case = \c -> case c of {
Nom => Nom ; Nom => Nom ;
_ => Acc _ => Acc

View File

@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! (genNum2Aform Masc Sg)) ++ td (adj.s ! genNum2Aform Masc Pl)) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! (genNum2Aform Fem Sg)) ++ td (adj.s ! genNum2Aform Fem Pl))
) )
} ; } ;

View File

@@ -15,7 +15,7 @@ oper
mkPredet = overload { mkPredet = overload {
mkPredet : A -> Predet = \adj -> lin Predet { mkPredet : A -> Predet = \adj -> lin Predet {
s = \\a,c => prepCase c ++ adj.s ! Posit ! genNum2Aform a.g a.n ; s = \\a,c => prepCase c ++ adj.s ! genNum2Aform a.g a.n ;
c = Nom ; c = Nom ;
a = PNoAg a = PNoAg
} ; } ;

View File

@@ -4,12 +4,12 @@
-- --
-- Aarne Ranta 2003 -- Aarne Ranta 2003
-- --
-- This is an API for the user of the resource grammar -- This is an API for the user of the resource grammar
-- for adding lexical items. It gives functions for forming -- for adding lexical items. It gives functions for forming
-- expressions of open categories: nouns, adjectives, verbs. -- expressions of open categories: nouns, adjectives, verbs.
-- --
-- Closed categories (determiners, pronouns, conjunctions) are -- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API, $Structural.gf$. -- accessed through the resource syntax API, $Structural.gf$.
-- --
-- The main difference with $MorphoIta.gf$ is that the types -- The main difference with $MorphoIta.gf$ is that the types
-- referred to are compiled resource grammar types. We have moreover -- referred to are compiled resource grammar types. We have moreover
@@ -25,29 +25,29 @@
-- which covers the "Bescherelle" verb conjugations. -- which covers the "Bescherelle" verb conjugations.
resource ParadigmsIta = BeschIta ** resource ParadigmsIta = BeschIta **
open open
(Predef=Predef), (Predef=Predef),
Prelude, Prelude,
MorphoIta, MorphoIta,
-- BeschIta, -- BeschIta,
CatIta in { CatIta in {
flags optimize=all ; flags optimize=all ;
coding=utf8 ; coding=utf8 ;
--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 ;
@@ -86,7 +86,7 @@ oper
mkN : overload { mkN : overload {
-- 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.
-- The heuristic says that the gender is feminine for nouns -- The heuristic says that the gender is feminine for nouns
-- ending with "a", and masculine for all other words. -- ending with "a", and masculine for all other words.
@@ -96,12 +96,12 @@ oper
mkN : (carne : Str) -> Gender -> N ; -- override default gender mkN : (carne : Str) -> Gender -> N ; -- override default gender
-- Worst case: give both two forms and the gender. -- Worst case: give both two forms and the gender.
mkN : (uomo,uomini : Str) -> Gender -> N ; -- worst case mkN : (uomo,uomini : Str) -> Gender -> N ; -- worst case
-- In *compound nouns*, the first part is inflected as a noun but -- In *compound nouns*, the first part is inflected as a noun but
-- the second part is not inflected. e.g. "numero di telefono". -- 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 could be formed in syntax, but we give a shortcut here since
-- they are frequent in lexica. -- they are frequent in lexica.
@@ -111,9 +111,9 @@ oper
--3 Relational nouns --3 Relational nouns
-- --
-- Relational nouns ("figlio di x") need a case and a preposition. -- Relational nouns ("figlio di x") need a case and a preposition.
-- The default is regular nouns with the genitive "di". -- The default is regular nouns with the genitive "di".
mkN2 : overload { mkN2 : overload {
@@ -133,7 +133,7 @@ oper
-- $N3$ are purely lexical categories. But you can use the $AdvCN$ -- $N3$ are purely lexical categories. But you can use the $AdvCN$
-- and $PrepNP$ constructions to build phrases like this. -- 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. The gender is by default feminine if -- Proper names need a string and a gender. The gender is by default feminine if
@@ -165,7 +165,7 @@ oper
mkA : (solo,sola,soli,sole,solamente : Str) -> A ; -- irregular adjective, with adverb mkA : (solo,sola,soli,sole,solamente : Str) -> A ; -- irregular adjective, with adverb
-- With irregular comparison, there are as it were two adjectives: -- With irregular comparison, there are as it were two adjectives:
-- the positive ("buono") and the comparative ("migliore"). -- the positive ("buono") and the comparative ("migliore").
mkA : A -> A -> A ; -- special comparison, e.g. buono - migliore mkA : A -> A -> A ; -- special comparison, e.g. buono - migliore
@@ -177,7 +177,7 @@ oper
-- modification, as in "vecchia chiesa"), the following function is -- modification, as in "vecchia chiesa"), the following function is
-- provided. -- provided.
prefixA : A -> A -- adjective that comes before noun (default: after) prefixA : A -> A -- adjective that comes before noun (default: after)
= prefA ; = prefA ;
@@ -193,7 +193,7 @@ oper
--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 ;
@@ -217,7 +217,7 @@ oper
-- "amare, cominciare, mangiare, legare, cercare". -- "amare, cominciare, mangiare, legare, cercare".
mkV : Str -> V ; -- regular verbs in "-are"/"-ire" mkV : Str -> V ; -- regular verbs in "-are"/"-ire"
-- The module $BeschIta$ gives (almost) all the patterns of the "Bescherelle" -- The module $BeschIta$ gives (almost) all the patterns of the "Bescherelle"
-- book. To use them in the category $V$, wrap them with the function -- book. To use them in the category $V$, wrap them with the function
@@ -246,7 +246,7 @@ oper
-- (transitive verbs). Notice that a particle comes from the $V$. -- (transitive verbs). Notice that a particle comes from the $V$.
mkV2 : overload { mkV2 : overload {
mkV2 : Str -> V2 ; -- regular verb, direct object mkV2 : Str -> V2 ; -- regular verb, direct object
mkV2 : V -> V2 ; -- direct object mkV2 : V -> V2 ; -- direct object
mkV2 : V -> Prep -> V2 -- prepositional object mkV2 : V -> Prep -> V2 -- prepositional object
} ; } ;
@@ -261,7 +261,7 @@ oper
-- the first one or both can be absent. -- the first one or both can be absent.
mkV3 : overload { mkV3 : overload {
mkV3 : V -> V3 ; -- donner (+ accusative + dative) mkV3 : V -> V3 ; -- donner (+ accusative + dative)
mkV3 : V -> Prep -> V3 ; -- placer (+ accusative) + dans mkV3 : V -> Prep -> V3 ; -- placer (+ accusative) + dans
mkV3 : V -> Prep -> Prep -> V3 -- parler + dative + genitive mkV3 : V -> Prep -> Prep -> V3 -- parler + dative + genitive
} ; } ;
@@ -304,9 +304,9 @@ oper
mkAV : A -> Prep -> AV ; --% mkAV : A -> Prep -> AV ; --%
mkA2V : A -> Prep -> Prep -> A2V ; --% mkA2V : A -> Prep -> Prep -> A2V ; --%
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$, -- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
-- and the second argument is given -- and the second argument is given
-- as an adverb. Likewise -- as an adverb. Likewise
-- $V0$ is just $V$. -- $V0$ is just $V$.
V0 : Type ; --% V0 : Type ; --%
@@ -315,7 +315,7 @@ oper
--2 Closed categories --2 Closed categories
mkPredet : Str -> Predet mkPredet : Str -> Predet
= \s -> lin Predet {s = \\a,c => prepCase c ++ s ; c = Nom ; a = PNoAg} ; = \s -> lin Predet {s = \\a,c => prepCase c ++ s ; c = Nom ; a = PNoAg} ;
--. --.
@@ -325,7 +325,7 @@ oper
-- hidden from the document. -- hidden from the document.
Gender = MorphoIta.Gender ; Gender = MorphoIta.Gender ;
Number = MorphoIta.Number ; Number = MorphoIta.Number ;
masculine = Masc ; masculine = Masc ;
feminine = Fem ; feminine = Fem ;
@@ -370,29 +370,32 @@ oper
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False} ** {lock_NP = <>} ; makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False} ** {lock_NP = <>} ;
mk5A a b c d e = mk5A a b c d e =
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ; compADeg (mkAdj a b c d e) ;
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ; regA a = compADeg (mkAdjReg a) ;
prefA a = {s = a.s ; isPre = True ; copTyp = a.copTyp ; lock_A = <>} ; prefA a = a ** {isPre = True} ;
adjCopula a cop = a ** {copTyp = cop} ; adjCopula a cop = a ** {copTyp = cop} ;
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
mkADeg a b = mkADeg a b = a ** {
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ; compar = \\num => b.s ! AF Masc num ; -- mejor, mejores
isPre = a.isPre ; copTyp = serCopula ; lock_A = <>} ; isDeg = True } ;
compADeg a = compADeg a = lin A
{s = table {Posit => a.s ! Posit ; _ => \\f => "più" ++ a.s ! Posit ! f} ; {s = a.s ;
isPre = a.isPre ; copTyp = a.copTyp ; compar = \\_ => nonExist ; --
lock_A = <>} ; isPre = False ; -- default values
copTyp = serCopula ;
isDeg = False
} ;
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 = regV x =
let let
---- are = Predef.dp 3 x ; ---- are = Predef.dp 3 x ;
ci = Predef.dp 2 (Predef.tk 3 x) ; ci = Predef.dp 2 (Predef.tk 3 x) ;
i = last ci ; i = last ci ;
@@ -417,10 +420,10 @@ oper
verboV ve = verbBesch ve ** {vtyp = VHabere ; p = [] ; lock_V = <>} ; verboV ve = verbBesch ve ** {vtyp = VHabere ; p = [] ; lock_V = <>} ;
mk11V mk11V
dovere devo deve dobbiamo dovro dovere devo deve dobbiamo dovro
dovetti dovesti dovette dovettero dovi dovuto = verboV (mkVerbo dovetti dovesti dovette dovettero dovi dovuto = verboV (mkVerbo
dovere devo deve dobbiamo dovro dovere devo deve dobbiamo dovro
dovetti dovesti dovette dovettero dovi dovuto dovetti dovesti dovette dovettero dovi dovuto
) ; ) ;
@@ -507,7 +510,7 @@ oper
regPN : Str -> PN ; -- feminine if "-a", otherwise masculine regPN : Str -> PN ; -- feminine if "-a", otherwise masculine
-- obsolete -- obsolete
makeNP : Str -> Gender -> Number -> NP ; makeNP : Str -> Gender -> Number -> NP ;
mkPN = overload { mkPN = overload {
mkPN : Str -> PN = regPN ; mkPN : Str -> PN = regPN ;
@@ -527,7 +530,7 @@ oper
prefA : A -> A ; prefA : A -> A ;
adjCopula : A -> CopulaType -> A ; adjCopula : A -> CopulaType -> A ;
mkADeg : A -> A -> A ; mkADeg : A -> A -> A ;
compADeg : A -> A ; compADeg : Adj -> A ;
regADeg : Str -> A ; regADeg : Str -> A ;
mkV = overload { mkV = overload {
@@ -536,16 +539,16 @@ oper
_ => regV s _ => regV s
} ; } ;
mkV : Verbo -> V = verboV ; mkV : Verbo -> V = verboV ;
mkV : mkV :
(udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V = mk11V ; (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V = mk11V ;
mkV : V -> Str -> V = \v,p -> v ** {p = p} ; ---- to recognize particles in dict, not yet in lincat V mkV : V -> Str -> V = \v,p -> v ** {p = p} ; ---- to recognize particles in dict, not yet in lincat V
} ; } ;
regV : Str -> V ; regV : Str -> V ;
verboV : Verbo -> V ; verboV : Verbo -> V ;
mk11V : mk11V :
(udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V ; (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V ;
mkV2 = overload { mkV2 = overload {
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;