working set of 8 Lang

This commit is contained in:
aarne
2005-09-03 08:30:38 +00:00
parent d268ebf84b
commit e5490a113d
9 changed files with 88 additions and 36 deletions

View File

@@ -84,8 +84,8 @@ lincat
-- = {s : Order => Bool => SForm => Str} ;
Slash = {s : QuestForm => Bool => SForm => Str ; s2 : Preposition} ;
RP = {s : Gender => Number => NPForm => Str} ;
RCl = {s : Bool => SForm => Agr => Str} ;
RS = {s : Agr => Str} ;
RCl = {s : (Bool * SForm * Agr) => Str} ;
RS = {s : Agr => Str} ;
IP = {s : NPForm => Str ; n : Number ; g : Gender} ;
IDet = {s : Str ; n : Number} ;

View File

@@ -16,8 +16,8 @@ concrete PredicEng of Predic = CategoriesEng **
Vt, VtN = \x -> x ;
Vt_ = ss [] ;
ComplNil = {s1, s2 = \\_ => []} ;
ComplNP np = {s1 = \\_ => np.s ! AccP ; s2 = \\_ => []} ;
Compl_ = {s1, s2 = \\_ => []} ;
ComplN np = {s1 = \\_ => np.s ! AccP ; s2 = \\_ => []} ;
ComplA ap = {s1 = ap.s ; s2 = \\_ => []} ;
ComplQ q = {s1 = \\_ => q.s ! DirQ ; s2 = \\_ => []} ;
ComplS s = {s1 = \\_ => "that" ++ s.s ; s2 = \\_ => []} ;
@@ -37,14 +37,14 @@ concrete PredicEng of Predic = CategoriesEng **
cprep1 verb.c (compl.s1 ! a) ++
cprep2 verb.c (compl.s2 ! a)
) ;
{- takes 80% !
RPredVerb vt np verb compl =
relVerbClause np verb
(\\a => vt.s ++
cprep1 verb.c (compl.s1 ! a) ++
cprep2 verb.c (compl.s2 ! a)
) ;
-}
IPredVerb vt verb compl =
predVerbI verb
(\\a => vt.s ++

View File

@@ -90,7 +90,7 @@ lin
UseCl tp cl = {s = tp.s ++ cl.s ! Dir ! tp.b ! VFinite tp.t tp.a} ;
UseQCl tp cl = {s = \\q => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! q} ;
UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! a} ;
UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! <tp.b, VFinite tp.t tp.a, a>} ;
UseVCl p a cl = {
s = \\v,ag => p.s ++ a.s ++ cl.s ! p.p ! a.a ! v ! ag ;
s1 = cl.s1 ! p.p

View File

@@ -1036,39 +1036,41 @@ oper
-- Relative clauses can be formed from both verb phrases ("who walks") and
-- slash expressions ("whom you see", "on which you sit" / "that you sit on").
RelClause : Type = {s : Bool => SForm => Agr => Str} ;
RelSentence : Type = {s : Agr => Str} ;
RelClause : Type = {s : (Bool * SForm * Agr) => Str} ;
RelSentence : Type = {s : Agr => Str} ;
relVerbPhrase : RelPron -> VerbGroup -> RelClause = \who,walks ->
{s = \\b,sf,a =>
let wa = fromAgr a in
(predVerbGroupClause (relNounPhrase who wa.g wa.n) walks).s ! Dir ! b ! sf
{s = \\bsfa =>
let wa = fromAgr (bsfa.p3) in
(predVerbGroupClause (relNounPhrase who wa.g wa.n) walks).s !
Dir ! bsfa.p1 ! bsfa.p2
} ;
relVerbClause : RelPron -> Verb -> Complement -> RelClause = \who,walk,here ->
{s = \\b,sf,a =>
{s = \\bsfa =>
let
wa = fromAgr a ;
wa = fromAgr bsfa.p3 ;
who : NounPhrase = relNounPhrase who wa.g wa.n ;
whowalks : Clause = predVerbClause who walk here
in
whowalks.s ! Dir ! b ! sf
whowalks.s ! Dir ! bsfa.p1 ! bsfa.p2
} ;
predBeGroupR : RelPron -> Complement -> RelClause = \who,old ->
{s = \\b,sf,a =>
{s = \\bsfa =>
let
wa = fromAgr a ;
wa = fromAgr bsfa.p3 ;
whoisold = predBeGroup (relNounPhrase who wa.g wa.n) old
in
whoisold.s ! Dir ! b ! sf
whoisold.s ! Dir ! bsfa.p1 ! bsfa.p2
} ;
relSlash : RelPron -> ClauseSlashNounPhrase -> RelClause = \who,yousee ->
{s = \\b,sf,a =>
{s = \\bsfa =>
let
whom = who.s ! (fromAgr a).g ! (fromAgr a).n ;
youSee = yousee.s ! IndirQ ! b ! sf
a = fromAgr bsfa.p3 ;
whom = who.s ! a.g ! a.n ;
youSee = yousee.s ! IndirQ ! bsfa.p1 ! bsfa.p2
in
variants {
whom ! AccP ++ youSee ++ yousee.s2 ;
@@ -1080,7 +1082,7 @@ oper
-- "number x such that x is even".
relSuch : Clause -> RelClause = \A ->
{s = \\b,sf,_ => "such" ++ "that" ++ A.s ! Dir ! b ! sf} ;
{s = \\bsfa => "such" ++ "that" ++ A.s ! Dir ! bsfa.p1 ! bsfa.p2} ;
-- The main use of relative clauses is to modify common nouns.
-- The result is a common noun, out of which noun phrases can be formed

View File

@@ -153,7 +153,7 @@ concrete ClauseFin of Clause = CategoriesFin **
sats2quest (mkSatsCopula (intNounPhrase subj) adv.s) ;
QPredProgVP np vp = sats2quest (progressiveSats (intNounPhrase np) vp) ;
-}
----- gender and number of Adj
@@ -166,7 +166,7 @@ concrete ClauseFin of Clause = CategoriesFin **
IPredV3 a verb obj1 obj2 =
sats2verbPhrase a (insertObject (mkSatsObject pronImpers verb obj1) verb.c2 verb.s5 verb.p obj2) ;
{-
IPredPassV a v =
sats2verbPhrase a (mkSatsCopula pronImpers (v.s ! VPart (pgen2gen
pronImpers.g) pronImpers.n)) ;

View File

@@ -90,8 +90,12 @@ lincat
RP = {s : RelForm => Str ; g : RelGen} ;
RS = {s : Mode => Gender => Number => Person => Str} ;
RCl = {s : Bool => ClForm => Gender => Number => Person => Str} ;
---- RCl = {s : Bool => ClForm => Gender => Number => Person => Str} ;
RCl = {
s1 : Gender => Number => Person => Str ;
s2 : Bool => ClForm => Gender => Number => Person => Str ;
s3 : Bool => Str
} ;
IP = {s : CaseA => Str ; g : Gender ; n : Number} ;
IDet = {s : Gender => Str ; n : Number} ;
QS = {s : QuestForm => Str} ;

View File

@@ -166,13 +166,14 @@ incomplete concrete ClauseRomance of Clause = CategoriesRomance **
RPredV2 np v y =
sats2rel
(\g,n,p -> mkSatsObject (relNounPhrase np g n p) v y) ;
RPredV3 subj verb obj1 obj2 =
sats2rel
(\g,n,p ->
insertObject (mkSatsObject (relNounPhrase subj g n p) verb
obj1) verb.c3 verb.s3 obj2
) ;
---- bracket these just because they are so expensive (25% of gfc)
{- ----
RPredReflV2 subj verb =
sats2rel (\g,n,p ->
mkSatsObject (relNounPhrase subj g n p)
@@ -218,7 +219,8 @@ incomplete concrete ClauseRomance of Clause = CategoriesRomance **
(mkSatsObject (relNounPhrase subj g n p) verb obj)
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen obj.g ! obj.n ! obj.p)
) ;
{- ----
-}
{- ---- some type error/bug here
RPredSubjV2V subj verb obj vp =
sats2rel (\g,n,p ->
insertExtrapos

View File

@@ -69,9 +69,15 @@ lin
UseCl tp cl =
{s = \\m => tp.s ++ cl.s ! tp.b ! useClForm tp.t tp.a m} ;
UseRCl tp cl =
{s = \\m,g,n,p => tp.s ++ cl.s ! tp.b ! useClForm tp.t tp.a m ! g ! n ! p} ;
{s = \\m,g,n,p => tp.s ++
cl.s1 ! g ! n ! p ++
cl.s2 ! tp.b ! useClForm tp.t tp.a m ! g ! n ! p ++
cl.s3 ! tp.b
} ;
UseQCl tp cl =
{s = \\q => tp.s ++ cl.s ! tp.b ! useClForm tp.t tp.a Ind ! q} ;
UseVCl po a cl =
{s = \\v,g,n,p => po.s ++ a.s ++ cl.s ! po.p ! a.a ! v ! g ! n ! p} ;
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;

View File

@@ -725,7 +725,7 @@ oper
--
-- Relative pronouns are inflected in
-- gender, number, and case. They can also have an inherent case,
-- but this case if 'variable' in the sense that it
-- but this case is 'variable' in the sense that it
-- is sometimes just mediated from the correlate
-- ("homme qui est bon"), sometimes inherent to the
-- pronominal phrase itself ("homme dont la mère est bonne").
@@ -734,7 +734,13 @@ oper
RelPron : Type = {s : RelFormA => Str ; g : RelGen} ;
RelClause : Type = {s : Bool => ClForm => Gender => Number => Person => Str} ;
---- RelClause : Type = {s : Bool => ClForm => Gender => Number => Person => Str} ;
RelClause : Type = {
s1 : Gender => Number => Person => Str ;
s2 : Bool => ClForm => Gender => Number => Person => Str ;
s3 : Bool => Str
} ;
RelSentence : Type = {s : Mode => Gender => Number => Person => Str} ;
mkGenRel : RelGen -> Gender -> Gender = \rg,g -> case rg of {
@@ -762,15 +768,18 @@ oper
-- slash expressions ("que je vois", "dont je parle").
relSlash : RelPron -> ClauseSlashNounPhrase -> RelClause = \dont,jeparle ->
{s = \\b,cl,g,n,p =>
jeparle.s2 ++ allRelForms dont g n jeparle.c ++ jeparle.s ! b ! cl
{s1 = \\g,n,p => jeparle.s2 ++ allRelForms dont g n jeparle.c ;
s2 = \\b,cl,g,n,p => jeparle.s ! b ! cl ;
s3 = \\_ => [] ---- should be parts of jeparle
} ;
-- A 'degenerate' relative clause is the one often used in mathematics, e.g.
-- "nombre x tel que x soit pair".
relSuch : Clause -> RelClause = \A ->
{s = \\b,cl,g,n,p => suchPron g n ++ embedConj ++ A.s ! b ! cl
{s1 = \\g,n,p => suchPron g n ;
s2 = \\b,cl,g,n,p => embedConj ++ A.s ! b ! cl ;
s3 = \\_ => [] ---- should be parts of A
} ;
suchPron : Gender -> Number -> Str ;
@@ -1307,17 +1316,46 @@ oper
negNe, negPas : Str ;
sats2quest : Sats -> Question = \x ->
let cl = sats2clause x
in
{s = \\b,f,_ => cl.s ! b ! f} ;
sats2rel : (Gender -> Number -> Person -> Sats) -> RelClause = \s ->
{s1 = \\g,n,p =>
let
sats = s g n p ;
in
sats.s1 ;
s2 = \\b,cf,g,n,p =>
let
sats = s g n p ;
lui = sats.s3 ;
dire = verbClForm {s = sats.s4 ; aux = sats.aux}
cf sats.g sats.n sats.p sats.g2 sats.n2 ;
ai = dire.p1 ;
toujours = sats.s5 ;
dit = dire.p2 ;
ne = if_then_Str b [] negNe ;
pas = if_then_Str b [] negPas ;
in
ne ++ lui ++ ai ++ toujours ++ pas ++ dit ;
s3 = \\b =>
let
sats = s Masc Sg P3 ;
directement = sats.s6 ;
oui = sats.s7 ! b
in
directement ++ oui
} ;
{-
sats2rel : (Gender -> Number -> Person -> Sats) -> RelClause = \sats ->
{s = \\b,f,g,n,p =>
(sats2clause (sats g n p)).s ! b ! f
} ;
-}
relNounPhrase : RelPron -> Gender -> Number -> Person -> NounPhrase =
\r,g,n,p -> {
s = \\np => r.s ! npRelForm np ;