forked from GitHub/gf-core
separate independent (NP without CN) forms of IndefArt and DefArt in Romance languages. The choice of words was unsure in some cases, but at least this eliminates the problem of empty NP's translating to "ones".
This commit is contained in:
@@ -20,8 +20,8 @@ oper
|
||||
} ;
|
||||
|
||||
|
||||
artDef : Gender -> Number -> Case -> Str = \g,n,c ->
|
||||
case <g,n,c> of {
|
||||
artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
|
||||
case <g,n,c> of { ---- TODO: check the NP forms
|
||||
<Masc,Sg, CPrep P_de> => pre {"del" ; ["de l'"] / vocalForta} ;
|
||||
<Masc,Sg, CPrep P_a> => pre {"al" ; ["a l'"] / vocalForta} ;
|
||||
<Masc,Sg, _> => elisEl ;
|
||||
@@ -36,12 +36,19 @@ oper
|
||||
|
||||
|
||||
|
||||
artIndef = \g,n,c -> case <n,c> of {
|
||||
artIndef = \isNP,g,n,c -> case isNP of {
|
||||
_ => case <n,c> of {
|
||||
<Sg,CPrep P_de> => genForms ["d' un"] ["d' una"] ! g ;
|
||||
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
|
||||
<Pl,_> => prepCase c ++ genForms "uns" "unes" ! g
|
||||
} ;
|
||||
_ => case <n,c> of {
|
||||
<Sg,CPrep P_de> => genForms ["d' un"] ["d' una"] ! g ;
|
||||
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
|
||||
--- <Pl,CPrep P_de> => genForms ["d' uns"] ["d' unes"] ! g ;
|
||||
<Pl,_> => prepCase c --- ++ genForms "uns" "unes" ! g --- take this as a determiner
|
||||
} ;
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +56,7 @@ oper
|
||||
|
||||
partitive = \g,c -> case c of {
|
||||
CPrep P_de => "de" ;
|
||||
_ => prepCase c ++ artDef g Sg (CPrep P_de)
|
||||
_ => prepCase c ++ artDef False g Sg (CPrep P_de)
|
||||
} ;
|
||||
|
||||
conjunctCase : Case -> Case = \c -> case c of {
|
||||
|
||||
@@ -26,7 +26,7 @@ instance DiffFre of DiffRomance - [
|
||||
CPrep PNul => []
|
||||
} ;
|
||||
|
||||
artDef : Gender -> Number -> Case -> Str = \g,n,c ->
|
||||
artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
|
||||
case <g,n,c> of {
|
||||
<Masc,Sg, CPrep P_de> => pre {"du" ; ("de l'" ++ Predef.BIND) / voyelle} ;
|
||||
<Masc,Sg, CPrep P_a> => pre {"au" ; ("à l'" ++ Predef.BIND) / voyelle} ;
|
||||
@@ -39,17 +39,17 @@ instance DiffFre of DiffRomance - [
|
||||
|
||||
-- In these two, "de de/du/des" becomes "de".
|
||||
|
||||
artIndef = \g,n,c -> case <n,c> of {
|
||||
artIndef = \isNP,g,n,c -> case <n,c> of {
|
||||
<Sg,_> => prepCase c ++ genForms "un" "une" ! g ;
|
||||
<Pl,CPrep P_de> => elisDe ;
|
||||
_ => prepCase c ++ "des"
|
||||
<Pl,CPrep P_de> => if_then_else Str isNP (prepCase c ++ genForms "quelques-uns" "quelques-unes" ! g) elisDe ;
|
||||
_ => if_then_else Str isNP (prepCase c ++ genForms "quelques-uns" "quelques-unes" ! g) (prepCase c ++ "des")
|
||||
} ;
|
||||
|
||||
possCase = \_,_,c -> prepCase c ;
|
||||
|
||||
partitive = \g,c -> case c of {
|
||||
CPrep P_de => elisDe ;
|
||||
_ => prepCase c ++ artDef g Sg (CPrep P_de)
|
||||
_ => prepCase c ++ artDef False g Sg (CPrep P_de)
|
||||
} ;
|
||||
|
||||
conjunctCase : Case -> Case = \c -> c ;
|
||||
|
||||
@@ -25,8 +25,14 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
|
||||
}
|
||||
} ;
|
||||
|
||||
artDef : Gender -> Number -> Case -> Str = \g,n,c ->
|
||||
case <g,n,c> of {
|
||||
artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
|
||||
case isNP of {
|
||||
True => prepCase c ++ case <g,n> of {
|
||||
<Masc,Sg> => "lui" ;
|
||||
<Fem ,Sg> => "lei" ;
|
||||
<_,Pl> => "loro"
|
||||
} ;
|
||||
_ => case <g,n,c> of {
|
||||
<_, _, CPrep P_di> => prepArt "de" ;
|
||||
<_, _, CPrep P_da> => prepArt "da" ;
|
||||
<_, _, CPrep P_a> => prepArt "a" ;
|
||||
@@ -37,7 +43,8 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
|
||||
<Fem ,Sg, _> => elision "la" "l'" "la" ;
|
||||
<Masc,Pl, _> => elision "i" "gli" "gli" ;
|
||||
<Fem ,Pl, _> => "le"
|
||||
}
|
||||
}
|
||||
}
|
||||
where {
|
||||
prepArt : Tok -> Tok = \de -> case <g,n> of {
|
||||
<Masc,Sg> => elision (de + "l") (de + "ll'") (de + "llo") ;
|
||||
@@ -50,17 +57,21 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
|
||||
|
||||
-- In these two, "de de/du/des" becomes "de".
|
||||
|
||||
artIndef = \g,n,c -> case <n,c> of {
|
||||
<Sg,_> => prepCase c ++
|
||||
genForms (pre {"un" ; "uno" / sImpuro}) (elision "una" "un'" "una") ! g ;
|
||||
_ => prepCase c
|
||||
artIndef = \isNP, g,n,c -> case <n,isNP> of {
|
||||
<Sg,True> => prepCase c ++
|
||||
genForms "uno" "una" ! g ;
|
||||
<Sg,_> => prepCase c ++
|
||||
genForms (pre {"un" ; "uno" / sImpuro}) (elision "una" "un'" "una") ! g ;
|
||||
<Pl,True> => prepCase c ++
|
||||
genForms "alcuni" "alcune" ! g ;
|
||||
_ => prepCase c
|
||||
} ;
|
||||
|
||||
possCase = artDef ;
|
||||
possCase = artDef False ;
|
||||
|
||||
partitive = \g,c -> case c of {
|
||||
CPrep P_di => "di" ;
|
||||
_ => prepCase c ++ artDef g Sg (CPrep P_di)
|
||||
_ => prepCase c ++ artDef False g Sg (CPrep P_di)
|
||||
} ;
|
||||
|
||||
conjunctCase : Case -> Case = \c -> case c of {
|
||||
|
||||
@@ -70,8 +70,8 @@ interface DiffRomance = open CommonRomance, Prelude in {
|
||||
|
||||
partitive : Gender -> Case -> Str ;
|
||||
|
||||
artDef : Gender -> Number -> Case -> Str ;
|
||||
artIndef : Gender -> Number -> Case -> Str ;
|
||||
artDef : Bool -> Gender -> Number -> Case -> Str ;
|
||||
artIndef : Bool -> Gender -> Number -> Case -> Str ; -- True = used as NP, False = used as Det
|
||||
|
||||
-- This is the definite article in Italian, $prepCase c$ in French and Spanish.
|
||||
|
||||
|
||||
@@ -101,15 +101,15 @@ incomplete concrete NounRomance of Noun =
|
||||
---- could be discontinuous: la terza città più grande
|
||||
|
||||
DefArt = {
|
||||
s = \\_,n,g,c => artDef g n c ;
|
||||
sp = \\n,g,c => artDef g n c ; ---- not for Fre
|
||||
s = \\_,n,g,c => artDef False g n c ;
|
||||
sp = \\n,g,c => artDef True g n c ;
|
||||
s2 = [] ;
|
||||
isNeg = False
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
s = \\b,n,g,c => if_then_Str b (prepCase c) (artIndef g n c) ;
|
||||
sp = \\n,g,c => artIndef g n c ; ---- not for Fre
|
||||
s = \\b,n,g,c => if_then_Str b (prepCase c) (artIndef False g n c) ;
|
||||
sp = \\n,g,c => artIndef True g n c ;
|
||||
s2 = [] ;
|
||||
isNeg = False
|
||||
} ;
|
||||
@@ -118,7 +118,7 @@ incomplete concrete NounRomance of Noun =
|
||||
g = cn.g ;
|
||||
n = Sg
|
||||
in heavyNP {
|
||||
s = table {Nom => artDef g n Nom ++ cn.s ! n ; c => partitive g c ++ cn.s ! n} ; -- le vin est bon ; je bois du vin
|
||||
s = table {Nom => artDef False g n Nom ++ cn.s ! n ; c => partitive g c ++ cn.s ! n} ; -- le vin est bon ; je bois du vin
|
||||
a = agrP3 g n ;
|
||||
hasClit = False ;
|
||||
isNeg = False
|
||||
|
||||
@@ -18,7 +18,7 @@ lin
|
||||
hasClit = False
|
||||
} ;
|
||||
CNNumNP cn i = heavyNP {
|
||||
s = \\c => artDef cn.g Sg c ++ cn.s ! Sg ++ i.s ! Masc ;
|
||||
s = \\c => artDef False cn.g Sg c ++ cn.s ! Sg ++ i.s ! Masc ;
|
||||
a = agrP3 cn.g Sg ;
|
||||
hasClit = False
|
||||
} ;
|
||||
|
||||
@@ -94,7 +94,7 @@ incomplete concrete VerbRomance of Verb =
|
||||
CompAP ap = {s = \\ag => let agr = complAgr ag in ap.s ! AF agr.g agr.n} ;
|
||||
CompCN cn = { s = \\ag =>
|
||||
let agr = complAgr ag in
|
||||
artIndef cn.g agr.n Nom ++ cn.s ! agr.n
|
||||
artIndef False cn.g agr.n Nom ++ cn.s ! agr.n
|
||||
}; --- RE 7/12/2010 -- AR added indef 2/8/2011
|
||||
CompNP np = {s = \\_ => (np.s ! Nom).ton} ;
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
@@ -21,8 +21,15 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
|
||||
} ;
|
||||
|
||||
|
||||
artDef : Gender -> Number -> Case -> Str = \g,n,c ->
|
||||
case <g,n,c> of {
|
||||
artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
|
||||
case isNP of {
|
||||
True => case <g,n,c> of {
|
||||
<Masc,Sg, _> => prepCase c ++ "el" ;
|
||||
<Fem, Sg, _> => prepCase c ++ "la" ; ----- ??
|
||||
<Masc,Pl, _> => prepCase c ++ "los" ;
|
||||
<Fem ,Pl, _> => prepCase c ++ "las"
|
||||
} ;
|
||||
_ => case <g,n,c> of {
|
||||
<Masc,Sg, CPrep P_de> => "del" ;
|
||||
<Masc,Sg, CPrep P_a> => "al" ;
|
||||
<Masc,Sg, _> => prepCase c ++ "el" ;
|
||||
@@ -31,13 +38,20 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
|
||||
<Fem, Sg, _> => prepCase c ++ chooseLa ;
|
||||
<Masc,Pl, _> => prepCase c ++ "los" ;
|
||||
<Fem ,Pl, _> => prepCase c ++ "las"
|
||||
} ;
|
||||
}
|
||||
} ;
|
||||
|
||||
-- In these two, "de de/du/des" becomes "de".
|
||||
|
||||
artIndef = \g,n,c -> case n of {
|
||||
Sg => prepCase c ++ genForms "un" "una" ! g ;
|
||||
_ => prepCase c -- ++ genForms "unos" "unas" ! g --- take this as a determiner
|
||||
artIndef = \isNP,g,n,c -> case isNP of {
|
||||
True => case n of {
|
||||
Sg => prepCase c ++ genForms "uno" "una" ! g ;
|
||||
_ => prepCase c ++ genForms "unos" "unas" ! g
|
||||
} ;
|
||||
_ => case n of {
|
||||
Sg => prepCase c ++ genForms "un" "una" ! g ;
|
||||
_ => prepCase c
|
||||
}
|
||||
} ;
|
||||
|
||||
possCase = \_,_,c -> prepCase c ;
|
||||
|
||||
Reference in New Issue
Block a user