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