Latvian: an optimized NP linearization type => fixed the double negation support in VPS

The flag indicating whether a NP has a negated determiner is now encapsulated in the algebraic parameter Agr, removing the extra field in the NP linearization type.
This commit is contained in:
normundsg
2013-05-02 13:17:53 +00:00
parent 0dbddbb9d7
commit 9f5c805ab5
14 changed files with 117 additions and 148 deletions

View File

@@ -14,14 +14,13 @@ lin
UseN n = { s = \\_ => n.s ; g = n.g } ;
UsePN pn = { s = pn.s ; a = agrgP3 pn.n pn.g ; isNeg = False } ;
UsePN pn = { s = pn.s ; a = AgP3 pn.n pn.g Pos } ;
UsePron p = { s = p.s ; a = p.a ; isNeg = False } ;
UsePron p = { s = p.s ; a = p.a } ;
PredetNP pred np = {
s = \\c => pred.s ! (fromAgr np.a).gend ++ np.s ! c ;
a = np.a ;
isNeg = False
a = np.a
} ;
UseN2 n = { s = \\_ => n.s ; g = n.g } ;
@@ -46,44 +45,39 @@ lin
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ;
a = np.a ;
isNeg = np.isNeg
a = np.a
} ;
RelNP np rs = {
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
a = np.a ;
isNeg = np.isNeg
a = np.a
} ;
DetCN det cn = {
s = \\c => det.s ! cn.g ! c ++ cn.s ! det.d ! det.n ! c ;
a = AgP3 det.n cn.g ;
isNeg = det.isNeg
a = AgP3 det.n cn.g det.pol
} ;
DetQuant quant num = {
s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c ;
n = num.n ;
d = quant.d ; -- FIXME: ja ir kārtas skaitļa vārds, tad tikai noteiktās formas drīkst būt
isNeg = quant.isNeg
pol = quant.pol
} ;
DetQuantOrd quant num ord = {
s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c ++ ord.s ! g ! c ;
n = num.n ;
d = quant.d ; --FIXME: ja ir kārtas skaitļa vārds, tad tikai noteiktās formas drīkst būt
isNeg = quant.isNeg
pol = quant.pol
} ;
DetNP det = {
s = \\c => det.s ! Masc ! c ;
a = AgP3 det.n Masc ;
isNeg = det.isNeg
a = AgP3 det.n Masc det.pol
} | {
s = \\c => det.s ! Fem ! c ;
a = AgP3 det.n Fem ;
isNeg = det.isNeg
a = AgP3 det.n Fem det.pol
} ;
AdjCN ap cn = {
@@ -94,25 +88,24 @@ lin
DefArt = {
s = \\_,_,_ => [] ;
d = Def ;
isNeg = False
pol = Pos
} ;
IndefArt = {
s = \\_,_,_ => [] ;
d = Indef ;
isNeg = False
pol = Pos
} ;
PossPron p = {
s = p.possessive ;
d = Def ;
isNeg = False
pol = Pos
} ;
MassNP cn = {
s = cn.s ! Indef ! Sg ; -- FIXME: a 'šis alus'? der tak gan 'zaļš alus' gan 'zaļais alus'
a = AgP3 Sg cn.g ;
isNeg = False
a = AgP3 Sg cn.g Pos
} ;
NumSg = { s = \\_,_ => [] ; n = Sg ; hasCard = False } ;
@@ -152,7 +145,7 @@ lin
} ;
RelCN cn rs = {
s = \\d, n,c => cn.s ! d ! n ! c ++ "," ++ rs.s ! AgP3 n cn.g ;
s = \\d,n,c => cn.s ! d ! n ! c ++ "," ++ rs.s ! AgP3 n cn.g Pos ;
g = cn.g
} ;
@@ -164,8 +157,7 @@ lin
-- FIXME: vajag šķirot noteikto/nenoteikto galotni..?
PPartNP np v2 = {
s = \\c => v2.s ! Pos ! (Participle TsTa (fromAgr np.a).gend (fromAgr np.a).num c) ++ np.s ! c ;
a = np.a ;
isNeg = np.isNeg
a = np.a
} ;
-- TODO: šim vajag -ts -ta divdabjus (+ noteiktās formas tiem)