(Ara) Supporting possessive suffixes, WIP

This commit is contained in:
Inari Listenmaa
2018-10-16 17:47:35 +02:00
parent 5f39c41988
commit f5525dfbf0
6 changed files with 110 additions and 101 deletions
+27 -22
View File
@@ -6,19 +6,27 @@ lin
DetCN det cn = let {
number = sizeToNumber det.n;
state = possState det.d;
determiner : Case -> Str = \c ->
det.s ! cn.h ! (detGender cn.g det.n) ! c;
noun : Case -> NTable -> Str = \c,nt -> nt !
number ! (nounState det.d number) ! (nounCase c det.n det.d)
noun : Case -> NTable -> Str = \c,nt ->
let cas = if_then_else Case det.is1sg Bare c -- no case vowel with 1sg poss. suff.
in nt ! number
! nounState det.d number
! nounCase cas det.n det.d
} in {
s = \\c =>
case cnB4det det.isPron det.isNum det.n det.d of {
False => determiner c ++ noun c cn.s ++ noun c cn.adj ;
--FIXME use the adj -> cn -> cn rule from below instead of
--repeating code
True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c
++ cn.adj ! number ! det.d ! c
};
False => determiner c
++ noun c cn.s -- deal with poss. suffix
++ cn.adj ! number ! state ! c -- normal case+state
++ cn.np ! c ;
True => noun c cn.s -- deal with poss. suffix
-- ++ determiner c -- or this?
++ det.s ! cn.h ! cn.g ! c
++ cn.adj ! number ! state ! c -- normal case+state
++ cn.np ! c
};
a = { pgn = agrP3 cn.h cn.g number;
isPron = False }
};
@@ -70,36 +78,33 @@ lin
} ;
-}
DetQuantOrd quant num ord = {
DetQuantOrd quant num ord = quant ** {
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
++ num.s ! g ! (toDef quant.d num.n) ! c
--FIXME check this:
++ ord.s ! g ! (toDef quant.d num.n) ! c ;
n = num.n;
d = quant.d;
isPron = quant.isPron;
isNum = case num.n of {
None => ord.isNum ; -- ord may come from OrdDigits or OrdNumeral
_ => True
}
isNum = orB num.isNum ord.isNum ;
-- ord may come from OrdDigits or OrdNumeral
-- num may come from NumCard : Card -> Num
} ;
DetQuant quant num = {
DetQuant quant num = quant ** {
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
++ num.s ! g ! (toDef quant.d num.n) ! c ;
n = num.n;
d = quant.d;
isPron = quant.isPron;
isNum = -- Num may come from NumCard : Card -> Num
case num.n of {
None => False;
_ => True
_ => num.isNum
}
} ;
PossPron p = {
s = \\_,_,_,_ => p.s ! Gen;
d = Const;
d = Poss;
is1sg = case p.a.pgn of { Per1 _ => True ; _ => False } ;
isPron = True;
isNum = False } ;
@@ -152,13 +157,13 @@ lin
DefArt = {
s = \\_,_,_,_ => [];
d = Def ;
isNum,isPron = False
isNum,isPron,is1sg = False
} ;
IndefArt = {
s = \\_,_,_,_ => [];
d = Indef ;
isNum,isPron = False
isNum,isPron,is1sg = False
} ;
MassNP cn = ---- AR