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:
aarne
2014-09-12 11:59:50 +00:00
parent 6b47126c8c
commit 7ddf965061
8 changed files with 66 additions and 34 deletions

View File

@@ -20,8 +20,8 @@ oper
} ; } ;
artDef : Gender -> Number -> Case -> Str = \g,n,c -> artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
case <g,n,c> of { case <g,n,c> of { ---- TODO: check the NP forms
<Masc,Sg, CPrep P_de> => pre {"del" ; ["de l'"] / vocalForta} ; <Masc,Sg, CPrep P_de> => pre {"del" ; ["de l'"] / vocalForta} ;
<Masc,Sg, CPrep P_a> => pre {"al" ; ["a l'"] / vocalForta} ; <Masc,Sg, CPrep P_a> => pre {"al" ; ["a l'"] / vocalForta} ;
<Masc,Sg, _> => elisEl ; <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,CPrep P_de> => genForms ["d' un"] ["d' una"] ! g ;
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ; <Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
--- <Pl,CPrep P_de> => genForms ["d' uns"] ["d' unes"] ! g ; --- <Pl,CPrep P_de> => genForms ["d' uns"] ["d' unes"] ! g ;
<Pl,_> => prepCase c --- ++ genForms "uns" "unes" ! g --- take this as a determiner <Pl,_> => prepCase c --- ++ genForms "uns" "unes" ! g --- take this as a determiner
} ; }
} ;
@@ -49,7 +56,7 @@ oper
partitive = \g,c -> case c of { partitive = \g,c -> case c of {
CPrep P_de => "de" ; 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 { conjunctCase : Case -> Case = \c -> case c of {

View File

@@ -26,7 +26,7 @@ instance DiffFre of DiffRomance - [
CPrep PNul => [] 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 { case <g,n,c> of {
<Masc,Sg, CPrep P_de> => pre {"du" ; ("de l'" ++ Predef.BIND) / voyelle} ; <Masc,Sg, CPrep P_de> => pre {"du" ; ("de l'" ++ Predef.BIND) / voyelle} ;
<Masc,Sg, CPrep P_a> => pre {"au" ; ("à 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". -- 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 ; <Sg,_> => prepCase c ++ genForms "un" "une" ! g ;
<Pl,CPrep P_de> => elisDe ; <Pl,CPrep P_de> => if_then_else Str isNP (prepCase c ++ genForms "quelques-uns" "quelques-unes" ! g) elisDe ;
_ => prepCase c ++ "des" _ => if_then_else Str isNP (prepCase c ++ genForms "quelques-uns" "quelques-unes" ! g) (prepCase c ++ "des")
} ; } ;
possCase = \_,_,c -> prepCase c ; possCase = \_,_,c -> prepCase c ;
partitive = \g,c -> case c of { partitive = \g,c -> case c of {
CPrep P_de => elisDe ; 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 ; conjunctCase : Case -> Case = \c -> c ;

View File

@@ -25,8 +25,14 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
} }
} ; } ;
artDef : Gender -> Number -> Case -> Str = \g,n,c -> artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
case <g,n,c> of { 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_di> => prepArt "de" ;
<_, _, CPrep P_da> => prepArt "da" ; <_, _, CPrep P_da> => prepArt "da" ;
<_, _, CPrep P_a> => prepArt "a" ; <_, _, CPrep P_a> => prepArt "a" ;
@@ -37,7 +43,8 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
<Fem ,Sg, _> => elision "la" "l'" "la" ; <Fem ,Sg, _> => elision "la" "l'" "la" ;
<Masc,Pl, _> => elision "i" "gli" "gli" ; <Masc,Pl, _> => elision "i" "gli" "gli" ;
<Fem ,Pl, _> => "le" <Fem ,Pl, _> => "le"
} }
}
where { where {
prepArt : Tok -> Tok = \de -> case <g,n> of { prepArt : Tok -> Tok = \de -> case <g,n> of {
<Masc,Sg> => elision (de + "l") (de + "ll'") (de + "llo") ; <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". -- In these two, "de de/du/des" becomes "de".
artIndef = \g,n,c -> case <n,c> of { artIndef = \isNP, g,n,c -> case <n,isNP> of {
<Sg,_> => prepCase c ++ <Sg,True> => prepCase c ++
genForms (pre {"un" ; "uno" / sImpuro}) (elision "una" "un'" "una") ! g ; genForms "uno" "una" ! g ;
_ => prepCase c <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 { partitive = \g,c -> case c of {
CPrep P_di => "di" ; 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 { conjunctCase : Case -> Case = \c -> case c of {

View File

@@ -70,8 +70,8 @@ interface DiffRomance = open CommonRomance, Prelude in {
partitive : Gender -> Case -> Str ; partitive : Gender -> Case -> Str ;
artDef : Gender -> Number -> Case -> Str ; artDef : Bool -> Gender -> Number -> Case -> Str ;
artIndef : 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. -- This is the definite article in Italian, $prepCase c$ in French and Spanish.

View File

@@ -101,15 +101,15 @@ incomplete concrete NounRomance of Noun =
---- could be discontinuous: la terza città più grande ---- could be discontinuous: la terza città più grande
DefArt = { DefArt = {
s = \\_,n,g,c => artDef g n c ; s = \\_,n,g,c => artDef False g n c ;
sp = \\n,g,c => artDef g n c ; ---- not for Fre sp = \\n,g,c => artDef True g n c ;
s2 = [] ; s2 = [] ;
isNeg = False isNeg = False
} ; } ;
IndefArt = { IndefArt = {
s = \\b,n,g,c => if_then_Str b (prepCase c) (artIndef g n c) ; s = \\b,n,g,c => if_then_Str b (prepCase c) (artIndef False g n c) ;
sp = \\n,g,c => artIndef g n c ; ---- not for Fre sp = \\n,g,c => artIndef True g n c ;
s2 = [] ; s2 = [] ;
isNeg = False isNeg = False
} ; } ;
@@ -118,7 +118,7 @@ incomplete concrete NounRomance of Noun =
g = cn.g ; g = cn.g ;
n = Sg n = Sg
in heavyNP { 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 ; a = agrP3 g n ;
hasClit = False ; hasClit = False ;
isNeg = False isNeg = False

View File

@@ -18,7 +18,7 @@ lin
hasClit = False hasClit = False
} ; } ;
CNNumNP cn i = heavyNP { 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 ; a = agrP3 cn.g Sg ;
hasClit = False hasClit = False
} ; } ;

View File

@@ -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} ; CompAP ap = {s = \\ag => let agr = complAgr ag in ap.s ! AF agr.g agr.n} ;
CompCN cn = { s = \\ag => CompCN cn = { s = \\ag =>
let agr = complAgr ag in 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 }; --- RE 7/12/2010 -- AR added indef 2/8/2011
CompNP np = {s = \\_ => (np.s ! Nom).ton} ; CompNP np = {s = \\_ => (np.s ! Nom).ton} ;
CompAdv a = {s = \\_ => a.s} ; CompAdv a = {s = \\_ => a.s} ;

View File

@@ -21,8 +21,15 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
} ; } ;
artDef : Gender -> Number -> Case -> Str = \g,n,c -> artDef : Bool -> Gender -> Number -> Case -> Str = \isNP,g,n,c ->
case <g,n,c> of { 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_de> => "del" ;
<Masc,Sg, CPrep P_a> => "al" ; <Masc,Sg, CPrep P_a> => "al" ;
<Masc,Sg, _> => prepCase c ++ "el" ; <Masc,Sg, _> => prepCase c ++ "el" ;
@@ -31,13 +38,20 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
<Fem, Sg, _> => prepCase c ++ chooseLa ; <Fem, Sg, _> => prepCase c ++ chooseLa ;
<Masc,Pl, _> => prepCase c ++ "los" ; <Masc,Pl, _> => prepCase c ++ "los" ;
<Fem ,Pl, _> => prepCase c ++ "las" <Fem ,Pl, _> => prepCase c ++ "las"
} ; }
} ;
-- In these two, "de de/du/des" becomes "de". -- In these two, "de de/du/des" becomes "de".
artIndef = \g,n,c -> case n of { artIndef = \isNP,g,n,c -> case isNP of {
Sg => prepCase c ++ genForms "un" "una" ! g ; True => case n of {
_ => prepCase c -- ++ genForms "unos" "unas" ! g --- take this as a determiner 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 ; possCase = \_,_,c -> prepCase c ;