1
0
forked from GitHub/gf-rgl

- add gennumforms to common romance

- try to make preposition contraction
- try to add detcn
This commit is contained in:
odanoburu
2018-06-04 08:47:17 -03:00
parent b78bcd16ed
commit 67b526b4e7
7 changed files with 114 additions and 81 deletions

View File

@@ -59,12 +59,6 @@ oper
}
} ;
genNumForms : Str -> Str -> Str -> Str -> Gender => Number => Str ;
genNumForms ms fs mp fp = table {
Masc => \\n => numForms ms mp ! n ;
Fem => \\n => numForms fs fp ! n
} ;
mkPass : Str -> Gender => Number => Str ;
-- passive form is highly predictable from singular masculine
mkPass p' = let p = p' + [] in case p of {

View File

@@ -6,7 +6,7 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo
coding=utf8 ;
param
Prepos = P_de | P_a ;
Prepos = P_de | P_a | P_em | P_por ;
VType = VHabere | VRefl ;
@@ -79,8 +79,11 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo
estarCopula = True ;
oper
-- the other Cases are defined in ResRomance
dative : Case = CPrep P_a ;
genitive : Case = CPrep P_de ;
locative : Case = CPrep P_em ;
ablative : Case = CPrep P_por ;
oper
vRefl _ = VRefl ;
@@ -94,40 +97,32 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo
Nom => [] ;
Acc => [] ;
CPrep P_de => "de" ;
CPrep P_a => "a"
CPrep P_a => "a" ;
CPrep P_em => "em" ;
CPrep P_por => "por"
} ;
oper
partitive = \_,c -> prepCase c ;
oper
artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
case isNP of {
True => case <g,n,c> of {
<Masc,Sg, _> => prepCase c ++ "o" ;
<Fem, Sg, _> => prepCase c ++ "a" ; ----- ??
<Masc,Pl, _> => prepCase c ++ "os" ;
<Fem ,Pl, _> => prepCase c ++ "as"
} ;
False => case <g,n,c> of {
<Masc,Sg, CPrep P_de> => "do" ;
<Masc,Sg, CPrep P_a> => "ao" ;
<Masc,Sg, _> => prepCase c ++ "o" ;
<Fem ,Sg, CPrep P_de> => "da" ;
<Fem ,Sg, CPrep P_a> => "à" ;
<Fem, Sg, _> => prepCase c ++ "a" ;
<Masc,Pl, _> => prepCase c ++ "os" ;
<Fem ,Pl, _> => prepCase c ++ "as"
}
} ;
artDef : Bool -> Gender -> Number -> Case -> Str ;
-- not sure if isNP is relevant
artDef _isNP g n c = case c of {
Nom | Acc => genNumForms "o" "a" "os" "as" ;
CPrep P_de => genNumForms "do" "da" "dos" "das" ;
CPrep P_a => genNumForms "ao" "à" "aos" "às" ;
CPrep P_em => genNumForms "no" "na" "nos" "nas" ;
CPrep P_por => genNumForms "pelo" "pela" "pelos" "pelas"
} ! g ! n ;
artIndef = \isNP,g,n,c -> case isNP of {
True => case n of {
Sg => prepCase c ++ genForms "um" "uma" ! g ;
Sg => prepCase c ++ genForms "um" "uma" ! g ;
_ => prepCase c ++ genForms "uns" "umas" ! g
} ;
_ => case n of {
Sg => prepCase c ++ genForms "um" "uma" ! g ;
Sg => prepCase c ++ genForms "um" "uma" ! g ;
_ => prepCase c
}
} ;

View File

@@ -1,2 +1,30 @@
concrete NounPor of Noun = CatPor ** NounRomance with
(ResRomance = ResPor) ;
(ResRomance = ResPor) ** open Prelude, PhonoPor in {
lin
-- not implemented for romance languages, maybe because it can't
-- be done elegantly?
CountNP det np = heavyNPpol np.isNeg
{s = \\c => det.s ! np.a.g ! c ++ elisDe ++ (np.s ! c).ton ;
a = np.a ** {n = det.n} } ;
} ;
{--
NounPhrase : Type = {
s : Case => {c1,c2,comp,ton : Str} ;
a : Agr ;
hasClit : Bool ;
isPol : Bool ; --- only needed for French complement agr
isNeg : Bool --- needed for negative NP's such as "personne"
} ;
Det = {
s : Gender => Case => Str ;
n : Number ;
s2 : Str ; -- -ci
sp : Gender => Case => Str ; -- substantival: mien, mienne
isNeg : Bool -- negative element, e.g. aucun
} ;
Bool -> {s : Case => Str ; a : Agr} -> NounPhrase
--}

View File

@@ -1,3 +1,12 @@
resource PhonoPor = open Prelude in {
}
oper
arts : pattern Str = #("o" | "os" | "a" | "as") ;
elisDe : Str ;
elisDe = pre {
#arts => "d" ++ BIND ;
_ => "de"
} ;
} ;

View File

@@ -199,16 +199,22 @@ oper
---
oper
genForms : Str -> Str -> Gender => Str = \bon,bonne ->
table {
Masc => bon ;
Fem => bonne
genForms : Str -> Str -> Gender => Str ;
genForms bon bonne = table {
Masc => bon ;
Fem => bonne
} ;
numForms : (_,_ : Str) -> Number => Str ;
-- The following macro is useful for creating the forms of
-- number-dependent tables, such as common nouns.
numForms : (_,_ : Str) -> Number => Str = \campus, campi ->
table {Sg => campus ; Pl => campi} ;
numForms campus campi = table {Sg => campus ; Pl => campi} ;
genNumForms : (_,_,_,_ : Str) -> Gender => Number => Str ;
genNumForms ms fs mp fp = table {
Masc => \\n => numForms ms mp ! n ;
Fem => \\n => numForms fs fp ! n
} ;
aagrForms : (x1,_,_,x4 : Str) -> (AAgr => Str) = \tout,toute,tous,toutes ->
table {

View File

@@ -20,6 +20,7 @@ oper
isPol : Bool ; --- only needed for French complement agr
isNeg : Bool --- needed for negative NP's such as "personne"
} ;
Pronoun : Type = {
s : Case => {c1,c2,comp,ton : Str} ;
a : Agr ;