forked from GitHub/gf-rgl
- add gennumforms to common romance
- try to make preposition contraction - try to add detcn
This commit is contained in:
@@ -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 ;
|
mkPass : Str -> Gender => Number => Str ;
|
||||||
-- passive form is highly predictable from singular masculine
|
-- passive form is highly predictable from singular masculine
|
||||||
mkPass p' = let p = p' + [] in case p of {
|
mkPass p' = let p = p' + [] in case p of {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo
|
|||||||
coding=utf8 ;
|
coding=utf8 ;
|
||||||
|
|
||||||
param
|
param
|
||||||
Prepos = P_de | P_a ;
|
Prepos = P_de | P_a | P_em | P_por ;
|
||||||
|
|
||||||
VType = VHabere | VRefl ;
|
VType = VHabere | VRefl ;
|
||||||
|
|
||||||
@@ -79,8 +79,11 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo
|
|||||||
estarCopula = True ;
|
estarCopula = True ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
-- the other Cases are defined in ResRomance
|
||||||
dative : Case = CPrep P_a ;
|
dative : Case = CPrep P_a ;
|
||||||
genitive : Case = CPrep P_de ;
|
genitive : Case = CPrep P_de ;
|
||||||
|
locative : Case = CPrep P_em ;
|
||||||
|
ablative : Case = CPrep P_por ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
vRefl _ = VRefl ;
|
vRefl _ = VRefl ;
|
||||||
@@ -94,32 +97,24 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo
|
|||||||
Nom => [] ;
|
Nom => [] ;
|
||||||
Acc => [] ;
|
Acc => [] ;
|
||||||
CPrep P_de => "de" ;
|
CPrep P_de => "de" ;
|
||||||
CPrep P_a => "a"
|
CPrep P_a => "a" ;
|
||||||
|
CPrep P_em => "em" ;
|
||||||
|
CPrep P_por => "por"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
partitive = \_,c -> prepCase c ;
|
partitive = \_,c -> prepCase c ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
|
artDef : Bool -> Gender -> Number -> Case -> Str ;
|
||||||
case isNP of {
|
-- not sure if isNP is relevant
|
||||||
True => case <g,n,c> of {
|
artDef _isNP g n c = case c of {
|
||||||
<Masc,Sg, _> => prepCase c ++ "o" ;
|
Nom | Acc => genNumForms "o" "a" "os" "as" ;
|
||||||
<Fem, Sg, _> => prepCase c ++ "a" ; ----- ??
|
CPrep P_de => genNumForms "do" "da" "dos" "das" ;
|
||||||
<Masc,Pl, _> => prepCase c ++ "os" ;
|
CPrep P_a => genNumForms "ao" "à" "aos" "às" ;
|
||||||
<Fem ,Pl, _> => prepCase c ++ "as"
|
CPrep P_em => genNumForms "no" "na" "nos" "nas" ;
|
||||||
} ;
|
CPrep P_por => genNumForms "pelo" "pela" "pelos" "pelas"
|
||||||
False => case <g,n,c> of {
|
} ! g ! n ;
|
||||||
<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"
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
artIndef = \isNP,g,n,c -> case isNP of {
|
artIndef = \isNP,g,n,c -> case isNP of {
|
||||||
True => case n of {
|
True => case n of {
|
||||||
|
|||||||
@@ -1,2 +1,30 @@
|
|||||||
concrete NounPor of Noun = CatPor ** NounRomance with
|
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
|
||||||
|
--}
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
resource PhonoPor = open Prelude in {
|
resource PhonoPor = open Prelude in {
|
||||||
|
|
||||||
}
|
oper
|
||||||
|
arts : pattern Str = #("o" | "os" | "a" | "as") ;
|
||||||
|
|
||||||
|
elisDe : Str ;
|
||||||
|
elisDe = pre {
|
||||||
|
#arts => "d" ++ BIND ;
|
||||||
|
_ => "de"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|||||||
@@ -199,16 +199,22 @@ oper
|
|||||||
---
|
---
|
||||||
|
|
||||||
oper
|
oper
|
||||||
genForms : Str -> Str -> Gender => Str = \bon,bonne ->
|
genForms : Str -> Str -> Gender => Str ;
|
||||||
table {
|
genForms bon bonne = table {
|
||||||
Masc => bon ;
|
Masc => bon ;
|
||||||
Fem => bonne
|
Fem => bonne
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
numForms : (_,_ : Str) -> Number => Str ;
|
||||||
-- The following macro is useful for creating the forms of
|
-- The following macro is useful for creating the forms of
|
||||||
-- number-dependent tables, such as common nouns.
|
-- number-dependent tables, such as common nouns.
|
||||||
numForms : (_,_ : Str) -> Number => Str = \campus, campi ->
|
numForms campus campi = table {Sg => campus ; Pl => 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 ->
|
aagrForms : (x1,_,_,x4 : Str) -> (AAgr => Str) = \tout,toute,tous,toutes ->
|
||||||
table {
|
table {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ oper
|
|||||||
isPol : Bool ; --- only needed for French complement agr
|
isPol : Bool ; --- only needed for French complement agr
|
||||||
isNeg : Bool --- needed for negative NP's such as "personne"
|
isNeg : Bool --- needed for negative NP's such as "personne"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Pronoun : Type = {
|
Pronoun : Type = {
|
||||||
s : Case => {c1,c2,comp,ton : Str} ;
|
s : Case => {c1,c2,comp,ton : Str} ;
|
||||||
a : Agr ;
|
a : Agr ;
|
||||||
|
|||||||
Reference in New Issue
Block a user