(Som) Fix bug in RelNP with pronouns

This commit is contained in:
Inari Listenmaa
2019-07-30 17:01:33 +02:00
parent 469718230a
commit 773417511a
4 changed files with 20 additions and 17 deletions

View File

@@ -10,9 +10,7 @@ lin
FocusObj np sslash = -- FIXME: preposition disappears in negative sentences FocusObj np sslash = -- FIXME: preposition disappears in negative sentences
let ss = sslash.s ! False ; let ss = sslash.s ! False ;
ssSub = sslash.s ! True ; -- the negative particle is the same as subordinate, but verb forms come from main clause ssSub = sslash.s ! True ; -- the negative particle is the same as subordinate, but verb forms come from main clause
obj = case np.isPron of { obj = objpron np ! Abs ;
True => np.empty ++ (pronTable ! np.a).sp ;
False => np.s ! Abs }
in {s = ssSub.beforeSTM ++ "waxa" ++ ssSub.stm ++ ss.afterSTM ++ obj} ; in {s = ssSub.beforeSTM ++ "waxa" ++ ssSub.stm ++ ss.afterSTM ++ obj} ;
-- FocusAdv : Adv -> S -> Utt ; -- today I will sleep -- FocusAdv : Adv -> S -> Utt ; -- today I will sleep

View File

@@ -70,7 +70,8 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- : NP -> RS -> NP ; -- Paris, which is here -- : NP -> RS -> NP ; -- Paris, which is here
RelNP np rs = np ** { RelNP np rs = np ** {
s = \\c => np.s ! c ++ rs.s ! npgender np ! c s = \\c => objpron np ! c ++ rs.s ! npgender np ! c ;
isPron = False ;
} ; } ;
-- Determiners can form noun phrases directly. -- Determiners can form noun phrases directly.
@@ -198,7 +199,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
True => qnt.shortPoss ! art ; True => qnt.shortPoss ! art ;
_ => qnt.s ! sg n2.gda ! Abs } ; _ => qnt.s ! sg n2.gda ! Abs } ;
noun = case np.isPron of { noun = case np.isPron of {
True => (pronTable ! np.a).sp ; -- long subject pronoun True => (pronTable ! np.a).sp ! Abs ; -- long subject pronoun
False => np.s ! Abs } False => np.s ! Abs }
in noun ++ cn.s ! Def num ++ BIND ++ det ; in noun ++ cn.s ! Def num ++ BIND ++ det ;
isPoss = True} ; isPoss = True} ;

View File

@@ -145,9 +145,13 @@ oper
let pagr : PrepAgr = agr2pagr np.a in let pagr : PrepAgr = agr2pagr np.a in
case <np.isPron,isP3 np.a> of { case <np.isPron,isP3 np.a> of {
<False,_> => {s = np.s ! Abs ; a = pagr} ; <False,_> => {s = np.s ! Abs ; a = pagr} ;
-- <True,True> => {s = np.empty ++ (pronTable ! np.a).sp ; a = pagr} ; -- uncomment if you want to add long object pronoun for 3rd person object -- <True,True> => {s = objpron np ! Abs ; a = pagr} ; -- uncomment if you want to add long object pronoun for 3rd person object
_ => {s = np.empty ; a = pagr} } ; -- no long object for other pronouns _ => {s = np.empty ; a = pagr} } ; -- no long object for other pronouns
objpron : NounPhrase -> Case => Str = \np -> case np.isPron of {
True => \\c => np.empty ++ (pronTable ! np.a).sp ! c ;
False => np.s} ;
useN : Noun -> CNoun ** BaseNP = \n -> n ** useN : Noun -> CNoun ** BaseNP = \n -> n **
{ mod = \\_,_ => [] ; hasMod = False ; { mod = \\_,_ => [] ; hasMod = False ;
a = Sg3 (gender n) ; isPron,isPoss = False ; a = Sg3 (gender n) ; isPron,isPoss = False ;
@@ -175,61 +179,61 @@ oper
sp : GenNum => Str ; -- independent forms, e.g. M:kayga F:tayda Pl:kuwayga sp : GenNum => Str ; -- independent forms, e.g. M:kayga F:tayda Pl:kuwayga
short : DefArticle => Str -- short possessive suffix: e.g. family members, my/your name short : DefArticle => Str -- short possessive suffix: e.g. family members, my/your name
} ; } ;
sp : Str ; sp : Case => Str ;
} ; } ;
pronTable : Agreement => Pronoun = table { pronTable : Agreement => Pronoun = table {
Sg1 => { Sg1 => {
s = table {Nom => "aan" ; Abs => "i"} ; s = table {Nom => "aan" ; Abs => "i"} ;
a = Sg1 ; isPron = True ; sp = "aniga" ; a = Sg1 ; isPron = True ; sp = table {Nom => "anigu" ; _ =>"aniga"} ;
empty = [] ; empty = [] ;
poss = {s = quantTable "ayg" "ayd" ; short = quantTable "ay" ; sp = gnTable "ayg" "ayd" "uwayg"} poss = {s = quantTable "ayg" "ayd" ; short = quantTable "ay" ; sp = gnTable "ayg" "ayd" "uwayg"}
} ; } ;
Sg2 => { Sg2 => {
s = table {Nom => "aad" ; Abs => "ku"} ; s = table {Nom => "aad" ; Abs => "ku"} ;
a = Sg2 ; isPron = True ; sp ="adiga" ; a = Sg2 ; isPron = True ; sp = table {Nom => "adigu" ; _ => "adiga"} ;
empty = [] ; empty = [] ;
poss = {s = quantTable "aag" "aad" ; short = quantTable "aa" ; sp = gnTable "aag" "aad" "uwaag"} poss = {s = quantTable "aag" "aad" ; short = quantTable "aa" ; sp = gnTable "aag" "aad" "uwaag"}
} ; } ;
Sg3 Masc => { Sg3 Masc => {
s = table {Nom => "uu" ; Abs => []} ; s = table {Nom => "uu" ; Abs => []} ;
a = Sg3 Masc ; isPron = True ; sp ="isaga" ; a = Sg3 Masc ; isPron = True ; sp = table {Nom => "isagu" ; _ => "isaga"} ;
empty = [] ; empty = [] ;
poss = {s, short = quantTable "iis" ; sp = gnTable "iis" "iis" "uwiis"} poss = {s, short = quantTable "iis" ; sp = gnTable "iis" "iis" "uwiis"}
} ; } ;
Sg3 Fem => { Sg3 Fem => {
s = table {Nom => "ay" ; Abs => []} ; s = table {Nom => "ay" ; Abs => []} ;
a = Sg3 Fem ; isPron = True ; sp = "iyada" ; a = Sg3 Fem ; isPron = True ; sp = table {Nom => "iyadu" ; _ => "iyada"} ;
empty = [] ; empty = [] ;
poss = {s, short = quantTable "eed" ; sp = gnTable "eed" "eed" "uweed"} poss = {s, short = quantTable "eed" ; sp = gnTable "eed" "eed" "uweed"}
} ; } ;
Pl1 Excl => { Pl1 Excl => {
s = table {Nom => "aan" ; Abs => "na"} ; s = table {Nom => "aan" ; Abs => "na"} ;
a = Pl1 Excl ; isPron = True ; sp ="annaga" ; a = Pl1 Excl ; isPron = True ; sp = table {Nom => "annagu" ; _ => "annaga"} ;
empty = [] ; empty = [] ;
poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"} poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"}
} ; } ;
Pl1 Incl => { Pl1 Incl => {
s = table {Nom => "aynu" ; Abs => "ina"} ; s = table {Nom => "aynu" ; Abs => "ina"} ;
a = Pl1 Incl ; isPron = True ; sp ="innaga" ; a = Pl1 Incl ; isPron = True ; sp = table {Nom => "innagu" ; _ => "innaga"} ;
empty = [] ; empty = [] ;
poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"} poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"}
} ; } ;
Pl2 => { Pl2 => {
s = table {Nom => "aad" ; Abs => "idin"} ; s = table {Nom => "aad" ; Abs => "idin"} ;
a = Pl2 ; isPron = True ; sp ="idinka" ; a = Pl2 ; isPron = True ; sp = table {Nom => "idinku" ; _ => "idinka"} ;
empty = [] ; empty = [] ;
poss = {s = quantTable "iinn" ; short = quantTable "iin" ; sp = gnTable "iinn" "iinn" "uwiinn"} poss = {s = quantTable "iinn" ; short = quantTable "iin" ; sp = gnTable "iinn" "iinn" "uwiinn"}
} ; } ;
Pl3 => { Pl3 => {
s = table {Nom => "ay" ; Abs => []} ; s = table {Nom => "ay" ; Abs => []} ;
a = Pl3 ; isPron = True ; sp = "iyaga" ; a = Pl3 ; isPron = True ; sp = table {Nom => "iyagu" ; _ => "iyaga"} ;
empty = [] ; empty = [] ;
poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"} poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"}
} ; } ;
Impers => { Impers => {
s = table {Nom => "la" ; Abs => "la"} ; s = table {Nom => "la" ; Abs => "la"} ;
a = Impers ; isPron = True ; sp = "" ; a = Impers ; isPron = True ; sp = \\_ => "" ;
empty = [] ; empty = [] ;
poss = {s, short = quantTable "??" ; sp = gnTable "??" "??" "??"} poss = {s, short = quantTable "??" ; sp = gnTable "??" "??" "??"}
} }

View File

@@ -118,7 +118,7 @@ lin with_Prep = mkPrep la ;
-- Pron -- Pron
-- Pronouns are closed class, no constructor in ParadigmsSom. -- Pronouns are closed class, no constructor in ParadigmsSom.
it_Pron = he_Pron ** {s = \\_ => [] ; sp = [] ; a = Impers} ; it_Pron = he_Pron ** {s = \\_ => [] ; sp = \\_ => [] ; a = Impers} ;
i_Pron = pronTable ! Sg1 ; i_Pron = pronTable ! Sg1 ;
youPol_Pron, youPol_Pron,
youSg_Pron = pronTable ! Sg2 ; youSg_Pron = pronTable ! Sg2 ;