forked from GitHub/gf-core
aux and slash
This commit is contained in:
@@ -64,17 +64,15 @@ fun
|
|||||||
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
||||||
-- $Clause$ (shallow many-place predication structure).
|
-- $Clause$ (shallow many-place predication structure).
|
||||||
|
|
||||||
PredAS : AS -> S -> Cl ; -- "it is good that he comes"
|
PredAS : AS -> S -> Cl ; -- "it is good that he comes"
|
||||||
PredV0 : V0 -> Cl ; -- "it is raining"
|
PredV0 : V0 -> Cl ; -- "it is raining"
|
||||||
|
|
||||||
-- Partial saturation.
|
-- Partial saturation.
|
||||||
|
|
||||||
UseV2 : V2 -> V ; -- "loves"
|
UseV2 : V2 -> V ; -- "loves"
|
||||||
ComplV3 : V3 -> NP -> V2 ; -- "prefers wine (to beer)"
|
ComplV3 : V3 -> NP -> V2 ; -- "prefers wine (to beer)"
|
||||||
|
|
||||||
ComplA2S : A2S -> NP -> AS ; -- "good for John"
|
ComplA2S : A2S -> NP -> AS ; -- "good for John"
|
||||||
|
|
||||||
TransVV2 : VV -> V2 -> V2 ; -- (which song do you) want to play
|
|
||||||
|
|
||||||
UseV2V : V2V -> VV ;
|
UseV2V : V2V -> VV ;
|
||||||
UseV2S : V2S -> VS ;
|
UseV2S : V2S -> VS ;
|
||||||
@@ -118,13 +116,15 @@ fun
|
|||||||
--3 Sentences and relative clauses
|
--3 Sentences and relative clauses
|
||||||
--
|
--
|
||||||
|
|
||||||
SlashV2 : NP -> V2 -> Slash ; -- "John doesn't love"
|
SlashV2 : NP -> V2 -> Slash ; -- "(whom) John doesn't love"
|
||||||
|
SlashVV2 : NP -> VV -> V2 -> Slash ; -- "(which song do you) want to play"
|
||||||
|
SlashAdv : Cl -> Prep -> Slash ; -- "(whom) John walks with"
|
||||||
|
|
||||||
IdRP : RP ; -- "which"
|
IdRP : RP ; -- "which"
|
||||||
FunRP : N2 -> RP -> RP ; -- "the successor of which"
|
FunRP : N2 -> RP -> RP ; -- "the successor of which"
|
||||||
RelSlash : RP -> Slash -> RCl ; -- "that I wait for"/"for which I wait"
|
RelSlash : RP -> Slash -> RCl ; -- "that I wait for"/"for which I wait"
|
||||||
ModRS : CN -> RS -> CN ; -- "man who walks"
|
ModRS : CN -> RS -> CN ; -- "man who walks"
|
||||||
RelCl : Cl -> RCl ; -- "such that it is even"
|
RelCl : Cl -> RCl ; -- "such that it is even"
|
||||||
|
|
||||||
--!
|
--!
|
||||||
--3 Questions and imperatives
|
--3 Questions and imperatives
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ lincat
|
|||||||
-- = Verb ** {s3 : Preposition} ;
|
-- = Verb ** {s3 : Preposition} ;
|
||||||
V3 = TransVerb ** {s4 : Preposition} ;
|
V3 = TransVerb ** {s4 : Preposition} ;
|
||||||
VS = Verb ;
|
VS = Verb ;
|
||||||
VV = Verb ** {isAux : Bool} ;
|
VV = AuxVerb ** {isAux : Bool} ;
|
||||||
|
|
||||||
VS = Verb ;
|
VS = Verb ;
|
||||||
VQ = Verb ;
|
VQ = Verb ;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ concrete ClauseEng of Clause = CategoriesEng **
|
|||||||
SPredV2 np v x = predVerbClause np v (complTransVerb v x) ;
|
SPredV2 np v x = predVerbClause np v (complTransVerb v x) ;
|
||||||
SPredReflV2 np v = predVerbClause np v (reflTransVerb v) ;
|
SPredReflV2 np v = predVerbClause np v (reflTransVerb v) ;
|
||||||
SPredVS np v x = predVerbClause np v (complSentVerb v x) ;
|
SPredVS np v x = predVerbClause np v (complSentVerb v x) ;
|
||||||
SPredVV np v x = predVerbClause np v (complVerbVerb v x) ;
|
SPredVV np v x = predVerbClause np (aux2verb v) (complVerbVerb v x) ;
|
||||||
SPredVQ np v x = predVerbClause np v (complQuestVerb v x) ;
|
SPredVQ np v x = predVerbClause np v (complQuestVerb v x) ;
|
||||||
SPredVA np v x = predVerbClause np v (complAdjVerb v x) ;
|
SPredVA np v x = predVerbClause np v (complAdjVerb v x) ;
|
||||||
SPredV2A np v x y = predVerbClause np v (complDitransAdjVerb v x y) ;
|
SPredV2A np v x y = predVerbClause np v (complDitransAdjVerb v x y) ;
|
||||||
@@ -37,7 +37,7 @@ concrete ClauseEng of Clause = CategoriesEng **
|
|||||||
QPredV2 np v x = intVerbClause np v (complTransVerb v x) ;
|
QPredV2 np v x = intVerbClause np v (complTransVerb v x) ;
|
||||||
QPredReflV2 np v = intVerbClause np v (reflTransVerb v) ;
|
QPredReflV2 np v = intVerbClause np v (reflTransVerb v) ;
|
||||||
QPredVS np v x = intVerbClause np v (complSentVerb v x) ;
|
QPredVS np v x = intVerbClause np v (complSentVerb v x) ;
|
||||||
QPredVV np v x = intVerbClause np v (complVerbVerb v x) ;
|
QPredVV np v x = intVerbClause np (aux2verb v) (complVerbVerb v x) ;
|
||||||
QPredVQ np v x = intVerbClause np v (complQuestVerb v x) ;
|
QPredVQ np v x = intVerbClause np v (complQuestVerb v x) ;
|
||||||
QPredVA np v x = intVerbClause np v (complAdjVerb v x) ;
|
QPredVA np v x = intVerbClause np v (complAdjVerb v x) ;
|
||||||
QPredV2A np v x y = intVerbClause np v (complDitransAdjVerb v x y) ;
|
QPredV2A np v x y = intVerbClause np v (complDitransAdjVerb v x y) ;
|
||||||
|
|||||||
@@ -178,9 +178,9 @@ oper
|
|||||||
mkVerbP3worst : (_,_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone,going ->
|
mkVerbP3worst : (_,_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone,going ->
|
||||||
{s = table {
|
{s = table {
|
||||||
InfImp => go ;
|
InfImp => go ;
|
||||||
Indic P3 => goes ;
|
Indic Sg => goes ;
|
||||||
Indic _ => go ;
|
Indic _ => go ;
|
||||||
Pastt _ => went ;
|
Pastt => went ;
|
||||||
PPart => gone ;
|
PPart => gone ;
|
||||||
PresPart => going
|
PresPart => going
|
||||||
}
|
}
|
||||||
@@ -246,22 +246,62 @@ oper
|
|||||||
|
|
||||||
verbP3Do = mkVerbP3 "do" "does" "did" "done" ;
|
verbP3Do = mkVerbP3 "do" "does" "did" "done" ;
|
||||||
|
|
||||||
verbBe : VerbP3 = {s = table {
|
auxVerbBe : AuxVerb = {s = table {
|
||||||
InfImp => "be" ;
|
AInfImp => "be" ;
|
||||||
Indic P1 => "am" ;
|
AIndic P1 b => if_then_Str b "am" ["am not"] ;
|
||||||
Indic P2 => "are" ;
|
AIndic P2 b => negAux b "are" ;
|
||||||
Indic P3 => "is" ;
|
AIndic P3 b => negAux b "is" ;
|
||||||
Pastt Sg => "was" ;
|
APastt Sg b => negAux b "was" ;
|
||||||
Pastt Pl => "were" ;
|
APastt Pl b => negAux b "were" ;
|
||||||
PPart => "been" ;
|
APPart => "been" ;
|
||||||
PresPart => "being"
|
APresPart => "being"
|
||||||
}} ;
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- The negative forms are not used;
|
||||||
|
--- the particle $want.s1$ disappears - is it ever needed?
|
||||||
|
|
||||||
|
verb2aux : Verb -> AuxVerb = \want -> {s = table {
|
||||||
|
AInfImp => want.s ! InfImp ;
|
||||||
|
AIndic P3 b => want.s ! Indic Sg ;
|
||||||
|
AIndic _ b => want.s ! Indic Pl ;
|
||||||
|
APastt _ b => want.s ! Pastt ;
|
||||||
|
APPart => want.s ! PPart ;
|
||||||
|
APresPart => want.s ! PresPart
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
aux2verb : AuxVerb -> Verb = \want -> {s = table {
|
||||||
|
InfImp => want.s ! AInfImp ;
|
||||||
|
Indic Sg => want.s ! AIndic P3 True ;
|
||||||
|
Indic _ => want.s ! AIndic P2 True ;
|
||||||
|
Pastt => want.s ! APastt Pl True ;
|
||||||
|
PPart => want.s ! APPart ;
|
||||||
|
PresPart => want.s ! APresPart
|
||||||
|
} ;
|
||||||
|
s1 = []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- The three most important example auxiliaries.
|
||||||
|
|
||||||
|
mkVerbAux : (_,_,_,_: Str) -> AuxVerb = \beable, can, could, beenable ->
|
||||||
|
{s = table {
|
||||||
|
AInfImp => beable ;
|
||||||
|
AIndic _ b => negAux b can ;
|
||||||
|
APastt _ b => negAux b could ;
|
||||||
|
APPart => beenable ;
|
||||||
|
APrepPart => nonExist ---- fix!
|
||||||
|
} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
verbPart : VerbP3 -> Particle -> Verb = \v,p ->
|
verbPart : VerbP3 -> Particle -> Verb = \v,p ->
|
||||||
v ** {s1 = p} ;
|
v ** {s1 = p} ;
|
||||||
|
|
||||||
verbNoPart : VerbP3 -> Verb = \v -> verbPart v [] ;
|
verbNoPart : VerbP3 -> Verb = \v -> verbPart v [] ;
|
||||||
|
|
||||||
|
negAux : Bool -> Str -> Str = \b,is -> if_then_Str b is (is + "n't") ;
|
||||||
|
|
||||||
-- The optional negation contraction is a useful macro e.g. for "do".
|
-- The optional negation contraction is a useful macro e.g. for "do".
|
||||||
|
|
||||||
contractNot : Str -> Str = \is -> variants {is ++ "not" ; is + "n't"} ;
|
contractNot : Str -> Str = \is -> variants {is ++ "not" ; is + "n't"} ;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ oper
|
|||||||
|
|
||||||
-- The verbs "be" and "have" are special.
|
-- The verbs "be" and "have" are special.
|
||||||
|
|
||||||
vBe : V ;
|
---- vBe : V ;
|
||||||
vHave : V ;
|
vHave : V ;
|
||||||
|
|
||||||
-- Verbs with a particle.
|
-- Verbs with a particle.
|
||||||
@@ -281,7 +281,6 @@ oper
|
|||||||
mkV2 = \v,p -> v ** {lock_V2 = <> ; s3 = p} ;
|
mkV2 = \v,p -> v ** {lock_V2 = <> ; s3 = p} ;
|
||||||
tvPartReg = \get, along, to -> mkV2 (vPartReg get along) to ;
|
tvPartReg = \get, along, to -> mkV2 (vPartReg get along) to ;
|
||||||
|
|
||||||
vBe = verbBe ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
|
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
|
||||||
tvGen = \s,p -> mkV2 (vGen s) p ;
|
tvGen = \s,p -> mkV2 (vGen s) p ;
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ oper
|
|||||||
mkV0 v = v ** {lock_V0 = <>} ;
|
mkV0 v = v ** {lock_V0 = <>} ;
|
||||||
mkVS v = v ** {lock_VS = <>} ;
|
mkVS v = v ** {lock_VS = <>} ;
|
||||||
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
||||||
mkVV v = v ** {isAux = False ; lock_VV = <>} ;
|
mkVV v = verb2aux v ** {isAux = False ; lock_VV = <>} ;
|
||||||
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
|
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
|
||||||
mkVA v = v ** {lock_VA = <>} ;
|
mkVA v = v ** {lock_VA = <>} ;
|
||||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ lin
|
|||||||
|
|
||||||
ComplA2S = predAdjSent2 ;
|
ComplA2S = predAdjSent2 ;
|
||||||
|
|
||||||
TransVV2 = transVerbVerb ;
|
|
||||||
AdjPart = adjPastPart ;
|
AdjPart = adjPastPart ;
|
||||||
|
|
||||||
UseV2V x = x ** {isAux = False} ;
|
UseV2V x = x ** {isAux = False} ;
|
||||||
@@ -120,6 +119,8 @@ lin
|
|||||||
--
|
--
|
||||||
|
|
||||||
SlashV2 = slashTransVerbCl ;
|
SlashV2 = slashTransVerbCl ;
|
||||||
|
SlashVV2 = slashVerbVerb ;
|
||||||
|
SlashAdv cl p = slashAdverb cl p.s ;
|
||||||
|
|
||||||
IdRP = identRelPron ;
|
IdRP = identRelPron ;
|
||||||
FunRP = funRelPron ;
|
FunRP = funRelPron ;
|
||||||
@@ -197,16 +198,12 @@ lin
|
|||||||
|
|
||||||
OneNP = nameNounPhrase (nameReg "one" human) ;
|
OneNP = nameNounPhrase (nameReg "one" human) ;
|
||||||
|
|
||||||
ExistCN A = predVerbClause
|
ExistCN A = predBeGroup
|
||||||
(nameNounPhrase (nameReg "there" Neutr))
|
(nameNounPhrase (nameReg "there" Neutr))
|
||||||
(mkTransVerbDir verbBe)
|
(complNounPhrase (indefNounPhrase singular A)) ;
|
||||||
(complTransVerb (mkTransVerbDir verbBe)
|
|
||||||
(indefNounPhrase singular A)) ;
|
|
||||||
ExistNumCN nu A =
|
ExistNumCN nu A =
|
||||||
predVerbClause
|
predBeGroup
|
||||||
(nameNounPhrasePl (nameReg "there" Neutr))
|
(nameNounPhrasePl (nameReg "there" Neutr))
|
||||||
(mkTransVerbDir verbBe)
|
(complNounPhrase (indefNounPhraseNum plural nu A)) ;
|
||||||
(complTransVerb (mkTransVerbDir verbBe)
|
|
||||||
(indefNounPhraseNum plural nu A)) ;
|
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ concrete StructuralEng of Structural =
|
|||||||
to_Prep = ss "to" ;
|
to_Prep = ss "to" ;
|
||||||
under_Prep = ss "under" ;
|
under_Prep = ss "under" ;
|
||||||
very_Adv = ss "very" ;
|
very_Adv = ss "very" ;
|
||||||
want_VV = verbNoPart (regVerbP3 "want") ** {isAux = False} ;
|
want_VV = verb2aux (verbNoPart (regVerbP3 "want")) ** {isAux = False} ;
|
||||||
we_NP = pronNounPhrase pronWe ;
|
we_NP = pronNounPhrase pronWe ;
|
||||||
what8many_IP = intPronWhat plural ;
|
what8many_IP = intPronWhat plural ;
|
||||||
what8one_IP = intPronWhat singular ;
|
what8one_IP = intPronWhat singular ;
|
||||||
|
|||||||
@@ -408,22 +408,6 @@ oper
|
|||||||
}
|
}
|
||||||
in negAux b has ;
|
in negAux b has ;
|
||||||
|
|
||||||
auxBe : Bool -> Tense -> Agr -> Str = \b,t,a ->
|
|
||||||
let is =
|
|
||||||
case t of {
|
|
||||||
Present => case a of {
|
|
||||||
ASgP3 _ => "is" ;
|
|
||||||
ASgP1 => "am" ;
|
|
||||||
_ => "are"
|
|
||||||
} ;
|
|
||||||
Past => case a of {
|
|
||||||
ASgP3 _ => "was" ;
|
|
||||||
_ => "were"
|
|
||||||
} ;
|
|
||||||
_ => "be" --- never used
|
|
||||||
}
|
|
||||||
in negAux b is ; ---- amn't
|
|
||||||
|
|
||||||
auxTense : Bool -> Tense -> Agr -> Str = \b,t,a ->
|
auxTense : Bool -> Tense -> Agr -> Str = \b,t,a ->
|
||||||
case t of {
|
case t of {
|
||||||
Present => negAux b (case a of {
|
Present => negAux b (case a of {
|
||||||
@@ -435,8 +419,6 @@ oper
|
|||||||
Conditional => negAux b "would"
|
Conditional => negAux b "would"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
negAux : Bool -> Str -> Str = \b,is -> if_then_Str b is (is + "n't") ;
|
|
||||||
|
|
||||||
{- --vg
|
{- --vg
|
||||||
useVerbGen : Bool -> Verb -> (Agr => Str) -> VerbGroup = \isAux,verb,arg ->
|
useVerbGen : Bool -> Verb -> (Agr => Str) -> VerbGroup = \isAux,verb,arg ->
|
||||||
let
|
let
|
||||||
@@ -527,14 +509,6 @@ oper
|
|||||||
complAdverb : PrepPhrase -> Complement = \elsewhere ->
|
complAdverb : PrepPhrase -> Complement = \elsewhere ->
|
||||||
(\\_ => elsewhere.s) ;
|
(\\_ => elsewhere.s) ;
|
||||||
|
|
||||||
{- --- compiles to 25k lines gfr 3/2/2005
|
|
||||||
predAdjSent : Adjective -> Sentence -> Clause = \bra,hansover ->
|
|
||||||
predVerbGroupClause
|
|
||||||
(pronNounPhrase pronIt)
|
|
||||||
(beGroup (
|
|
||||||
\\n => bra.s ! AAdj ++ "that" ++ hansover.s)) ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
predAdjSent : Adjective -> Sentence -> Clause = \bra,hansover ->
|
predAdjSent : Adjective -> Sentence -> Clause = \bra,hansover ->
|
||||||
predBeGroup (pronNounPhrase pronIt) (\\n => bra.s ! AAdj ++ "that" ++ hansover.s) ;
|
predBeGroup (pronNounPhrase pronIt) (\\n => bra.s ! AAdj ++ "that" ++ hansover.s) ;
|
||||||
|
|
||||||
@@ -552,47 +526,6 @@ oper
|
|||||||
s1 = if_then_Str b [] "not" ;
|
s1 = if_then_Str b [] "not" ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predBeGroup : NounPhrase -> Complement -> Clause = \itt,goo ->
|
|
||||||
let
|
|
||||||
it = itt.s ! NomP ;
|
|
||||||
good = goo ! itt.a ;
|
|
||||||
begood : Tense -> Str = \t -> case t of {
|
|
||||||
Present => good ;
|
|
||||||
Past => good ;
|
|
||||||
_ => "be" ++ good
|
|
||||||
} ;
|
|
||||||
beengood : Tense -> Str = \t -> case t of {
|
|
||||||
Future => "have" ++ "been" ++ good ;
|
|
||||||
Conditional => "have" ++ "been" ++ good ;
|
|
||||||
_ => "been" ++ good
|
|
||||||
} ;
|
|
||||||
has : Bool -> Tense -> Str = \b,t -> case t of {
|
|
||||||
Future => if_then_Str b "will" "won't" ;
|
|
||||||
Conditional => negAux b "would" ;
|
|
||||||
_ => auxHave b t itt.a
|
|
||||||
} ;
|
|
||||||
is : Bool -> Tense -> Str = \b,t -> case t of {
|
|
||||||
Future => if_then_Str b "will" "won't" ;
|
|
||||||
Conditional => negAux b "would" ;
|
|
||||||
_ => auxBe b t itt.a
|
|
||||||
}
|
|
||||||
in
|
|
||||||
{s = \\o,b,sf =>
|
|
||||||
case sf of {
|
|
||||||
VFinite t Simul => case o of {
|
|
||||||
Dir => it ++ is b t ++ begood t ;
|
|
||||||
Inv => is b t ++ it ++ begood t
|
|
||||||
} ;
|
|
||||||
VFinite t Anter => case o of {
|
|
||||||
Dir => it ++ has b t ++ beengood t ;
|
|
||||||
Inv => has b t ++ it ++ beengood t
|
|
||||||
}
|
|
||||||
--- ;
|
|
||||||
--- VInfinit Simul => it ++ begood Future ;
|
|
||||||
--- VInfinit Anter => it ++ beengood Future ;
|
|
||||||
--- VPresPart => it ++ "being" ++ good
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
predAdjSent2 : AdjCompl -> NounPhrase -> Adjective = \bra,han ->
|
predAdjSent2 : AdjCompl -> NounPhrase -> Adjective = \bra,han ->
|
||||||
@@ -778,21 +711,42 @@ oper
|
|||||||
|
|
||||||
-- This applies to non-auxiliaries.
|
-- This applies to non-auxiliaries.
|
||||||
|
|
||||||
predVerbClause : NounPhrase -> Verb -> Complement -> Clause = \np,verb,comp ->
|
predVerbClause : NounPhrase -> Verb -> Complement -> Clause = \np,verb,comp ->
|
||||||
|
let nv = predVerbClauseGen np verb comp in
|
||||||
|
{s = table {
|
||||||
|
Dir => \\b,sf => let nvg = nv ! b ! sf in nvg.p1 ++ nvg.p2 ++ nvg.p3 ;
|
||||||
|
Inv => \\b,sf => let nvg = nv ! b ! sf in
|
||||||
|
case sf of {
|
||||||
|
VFinite t Simul => case b of {
|
||||||
|
True => auxTense b t np.a ++ nvg.p1 ++ (nv ! False ! sf).p3 ;
|
||||||
|
_ => nvg.p2 ++ nvg.p1 ++ nvg.p3
|
||||||
|
} ;
|
||||||
|
_ => nvg.p2 ++ nvg.p1 ++ nvg.p3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
predClauseGroup : Verb -> Complement -> VerbGroup = \verb,comp ->
|
||||||
|
let
|
||||||
|
nvg : Agr -> (Bool => SForm => (Str * Str * Str)) =
|
||||||
|
\ag -> predVerbClauseGen {s = \\_ => [] ; a = ag} verb comp
|
||||||
|
in
|
||||||
|
{s = \\b,f,a => (nvg a ! b ! f).p2 ;
|
||||||
|
s2 = \\b,f,a => (nvg a ! b ! f).p3 ;
|
||||||
|
isAux = False ----
|
||||||
|
} ;
|
||||||
|
|
||||||
|
predVerbClauseGen : NounPhrase -> Verb -> Complement -> (Bool =>
|
||||||
|
SForm => (Str * Str * Str)) = \np,verb,comp ->
|
||||||
let
|
let
|
||||||
it = np.s ! NomP ;
|
it = np.s ! NomP ;
|
||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
itgoes : Order -> Str -> Str -> Str = \o,x,y -> case o of {
|
goes : Tense -> Str = \t -> verb.s ! case t of {
|
||||||
Dir => it ++ x ++ y ;
|
Present => case agr of {
|
||||||
Inv => x ++ it ++ y
|
ASgP3 _ => Indic Sg ;
|
||||||
} ;
|
_ => Indic Pl
|
||||||
goes : Tense -> Str = \t -> verb.s ! case <t,agr> of {
|
} ;
|
||||||
<Present,ASgP1> => Indic P1 ;
|
_ => Pastt --- Future doesn't matter
|
||||||
<Present,ASgP3 _> => Indic P3 ;
|
|
||||||
<Present,_> => Indic P2 ;
|
|
||||||
<Past,ASgP1> => Pastt Pl ;
|
|
||||||
<Past,ASgP3 _> => Pastt Sg ;
|
|
||||||
_ => Pastt Pl --- Future doesn't matter
|
|
||||||
} ;
|
} ;
|
||||||
off = comp ! agr ;
|
off = comp ! agr ;
|
||||||
go = verb.s ! InfImp ++ off ;
|
go = verb.s ! InfImp ++ off ;
|
||||||
@@ -801,59 +755,102 @@ oper
|
|||||||
have = "have" ;
|
have = "have" ;
|
||||||
has : Bool -> Tense -> Str = \b,t -> auxHave b t agr ;
|
has : Bool -> Tense -> Str = \b,t -> auxHave b t agr ;
|
||||||
does : Bool -> Tense -> Str = \b,t -> auxTense b t agr
|
does : Bool -> Tense -> Str = \b,t -> auxTense b t agr
|
||||||
in
|
in
|
||||||
{s = \\o,b,sf =>
|
\\b => table {
|
||||||
let
|
|
||||||
neg = if_then_Str b [] "not" ;
|
|
||||||
in
|
|
||||||
case sf of {
|
|
||||||
VFinite Present Simul => case b of {
|
VFinite Present Simul => case b of {
|
||||||
True => case o of {
|
True => <it,goes Present,off> ;
|
||||||
Dir => it ++ goes Present ++ off ;
|
---- does b Present ++ it ++ go
|
||||||
Inv => does b Present ++ it ++ go
|
False => <it,does b Present, go>
|
||||||
} ;
|
|
||||||
False => itgoes o (does b Present) go
|
|
||||||
} ;
|
} ;
|
||||||
VFinite Past Simul => case b of {
|
VFinite Past Simul => case b of {
|
||||||
True => case o of {
|
True => <it,goes Past,off> ;
|
||||||
Dir => it ++ goes Past ++ off ;
|
---- does b Present ++ it ++ go
|
||||||
Inv => does b Past ++ it ++ go
|
False => <it,does b Past, go>
|
||||||
} ;
|
|
||||||
False => itgoes o (does b Past) go
|
|
||||||
} ;
|
} ;
|
||||||
VFinite t Simul => itgoes o (does b t) go ;
|
VFinite t Simul => <it,does b t, go> ;
|
||||||
VFinite Present Anter => itgoes o (has b Present) gone ;
|
VFinite Present Anter => <it,has b Present, gone> ;
|
||||||
VFinite Past Anter => itgoes o (has b Past) gone ;
|
VFinite Past Anter => <it,has b Past, gone> ;
|
||||||
VFinite t Anter => itgoes o (does b t) (have ++ gone)
|
VFinite t Anter => <it,does b t, have ++ gone>
|
||||||
--- ;
|
--- ;
|
||||||
--- VInfinit Simul => it ++ neg ++ go ;
|
--- VInfinit Simul => it ++ neg ++ go ;
|
||||||
--- VInfinit Anter => it ++ neg ++ (have ++ gone) ;
|
--- VInfinit Anter => it ++ neg ++ (have ++ gone) ;
|
||||||
--- VPresPart => it ++ neg ++ going
|
--- VPresPart => it ++ neg ++ going
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
{- --vg
|
|
||||||
predVerbGroupClause : NounPhrase -> VerbGroup -> Clause =
|
-- This is for auxiliaries.
|
||||||
\yo,dosleep -> {
|
|
||||||
s = \\o,b,c =>
|
predBeGroup : NounPhrase -> Complement -> Clause = \np,comp ->
|
||||||
let
|
let nv = predAuxClauseGen np auxVerbBe comp in
|
||||||
a = yo.a ;
|
{s = table {
|
||||||
you = yo.s ! NomP ;
|
Dir => \\b,sf => let nvg = nv ! b ! sf in nvg.p1 ++ nvg.p2 ++ nvg.p3 ;
|
||||||
do = dosleep.s ! b ! c ! a ;
|
Inv => \\b,sf => let nvg = nv ! b ! sf in nvg.p2 ++ nvg.p1 ++ nvg.p3
|
||||||
sleeps = dosleep.s2 ! b ! c ! a ;
|
}
|
||||||
does = auxTense b Present a ;
|
} ;
|
||||||
did = auxTense b Past a ;
|
|
||||||
sleep = dosleep.s2 ! False ! c ! a
|
{- ---
|
||||||
in
|
predClauseGroup : Verb -> Complement -> VerbGroup = \verb,comp ->
|
||||||
case o of {
|
let
|
||||||
Dir => you ++ do ++ sleeps ;
|
nvg : Agr -> (Bool => SForm => (Str * Str * Str)) =
|
||||||
Inv => case <c,dosleep.isAux> of {
|
\ag -> predVerbClauseGen {s = \\_ => [] ; a = ag} verb comp
|
||||||
<VFinite Present Simul,False> => does ++ you ++ sleep ;
|
in
|
||||||
<VFinite Past Simul,False> => did ++ you ++ sleep ;
|
{s = \\b,f,a => (nvg a ! b ! f).p2 ;
|
||||||
_ => do ++ you ++ sleeps
|
s2 = \\b,f,a => (nvg a ! b ! f).p3 ;
|
||||||
}
|
isAux = True
|
||||||
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
predAuxClauseGen : NounPhrase -> AuxVerb -> Complement ->
|
||||||
|
(Bool => SForm => (Str * Str * Str)) = \np,verb,comp ->
|
||||||
|
let
|
||||||
|
it = np.s ! NomP ;
|
||||||
|
ita = np.a ;
|
||||||
|
been = verb.s ! APPart ;
|
||||||
|
good = comp ! ita ;
|
||||||
|
begood : Tense -> Str = \t -> case t of {
|
||||||
|
Present => good ;
|
||||||
|
Past => good ;
|
||||||
|
_ => verb.s ! AInfImp ++ good
|
||||||
|
} ;
|
||||||
|
beengood : Tense -> Str = \t -> case t of {
|
||||||
|
Future => "have" ++ been ++ good ;
|
||||||
|
Conditional => "have" ++ been ++ good ;
|
||||||
|
_ => been ++ good
|
||||||
|
} ;
|
||||||
|
has : Bool -> Tense -> Str = \b,t -> case t of {
|
||||||
|
Future => if_then_Str b "will" "won't" ;
|
||||||
|
Conditional => negAux b "would" ;
|
||||||
|
_ => auxHave b t ita
|
||||||
|
} ;
|
||||||
|
is : Bool -> Tense -> Str = \b,t -> case t of {
|
||||||
|
Future => if_then_Str b "will" "won't" ;
|
||||||
|
Conditional => negAux b "would" ;
|
||||||
|
_ => auxVerbForm verb b t ita
|
||||||
}
|
}
|
||||||
|
in
|
||||||
|
\\b =>
|
||||||
|
table {
|
||||||
|
VFinite t Simul => <it, is b t, begood t> ;
|
||||||
|
VFinite t Anter => <it, has b t, beengood t>
|
||||||
|
--- VInfinit Simul => it ++ begood Future ;
|
||||||
|
--- VInfinit Anter => it ++ beengood Future ;
|
||||||
|
--- VPresPart => it ++ "being" ++ good
|
||||||
} ;
|
} ;
|
||||||
-- vg -}
|
|
||||||
|
auxVerbForm : AuxVerb -> Bool -> Tense -> Agr -> Str = \verb,b,t,a ->
|
||||||
|
case t of {
|
||||||
|
Present => case a of {
|
||||||
|
ASgP3 _ => verb.s ! AIndic P3 b ;
|
||||||
|
ASgP1 => verb.s ! AIndic P1 b ;
|
||||||
|
_ => verb.s ! AIndic P2 b
|
||||||
|
} ;
|
||||||
|
Past => case a of {
|
||||||
|
ASgP3 _ => verb.s ! APastt Sg b ;
|
||||||
|
_ => verb.s ! APastt Pl b
|
||||||
|
} ;
|
||||||
|
_ => verb.s ! AInfImp --- never used
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--3 Sentence-complement verbs
|
--3 Sentence-complement verbs
|
||||||
--
|
--
|
||||||
@@ -891,7 +888,7 @@ oper
|
|||||||
-- the construction can be iterated, and the corresponding complication
|
-- the construction can be iterated, and the corresponding complication
|
||||||
-- in the parameter structure.
|
-- in the parameter structure.
|
||||||
|
|
||||||
VerbVerb : Type = Verb ** {isAux : Bool} ;
|
VerbVerb : Type = AuxVerb ** {isAux : Bool} ;
|
||||||
|
|
||||||
-- To generate "can walk"/"can't walk"; "tries to walk"/"does not try to walk":
|
-- To generate "can walk"/"can't walk"; "tries to walk"/"does not try to walk":
|
||||||
-- The contraction of "not" is not provided, since it would require changing
|
-- The contraction of "not" is not provided, since it would require changing
|
||||||
@@ -906,26 +903,13 @@ oper
|
|||||||
in
|
in
|
||||||
---- if_then_else VerbGroup taux
|
---- if_then_else VerbGroup taux
|
||||||
---- (useVerbAux try torun)
|
---- (useVerbAux try torun)
|
||||||
(mkComp try torun) ;
|
(mkComp (aux2verb try) torun) ; ----
|
||||||
|
|
||||||
-- The three most important example auxiliaries.
|
|
||||||
|
|
||||||
mkVerbAux : (_,_,_,_: Str) -> VerbVerb = \beable, can, could, beenable ->
|
|
||||||
{s = table {
|
|
||||||
InfImp => beable ;
|
|
||||||
Indic _ => can ;
|
|
||||||
Pastt _ => could ;
|
|
||||||
PPart => beenable ;
|
|
||||||
PrepPart => nonExist ---- fix!
|
|
||||||
} ;
|
|
||||||
s1 = [] ;
|
|
||||||
isAux = True
|
|
||||||
} ;
|
|
||||||
|
|
||||||
---- Problem: "to" in non-present tenses comes to wrong place.
|
---- Problem: "to" in non-present tenses comes to wrong place.
|
||||||
|
--- The real problem is that these are *not* auxiliaries in all tenses.
|
||||||
|
|
||||||
vvCan : VerbVerb = mkVerbAux ["be able to"] "can" "could" ["been able to"] ;
|
vvCan : VerbVerb = mkVerbAux ["be able to"] "can" "could" ["been able to"] ** {isAux = True} ;
|
||||||
vvMust : VerbVerb = mkVerbAux ["have to"] "must" ["had to"] ["had to"] ;
|
vvMust : VerbVerb = mkVerbAux ["have to"] "must" ["had to"] ["had to"] ** {isAux = True} ;
|
||||||
|
|
||||||
-- Notice agreement to object vs. subject:
|
-- Notice agreement to object vs. subject:
|
||||||
|
|
||||||
@@ -942,13 +926,6 @@ oper
|
|||||||
(simma.s ! VIInfinit ! a)
|
(simma.s ! VIInfinit ! a)
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
transVerbVerb : VerbVerb -> TransVerb -> TransVerb = \vilja,hitta ->
|
|
||||||
{s = vilja.s ;
|
|
||||||
s1 = vilja.s1 ++ if_then_Str vilja.isAux [] "to" ++
|
|
||||||
hitta.s ! InfImp ++ hitta.s1 ;
|
|
||||||
s3 = hitta.s3
|
|
||||||
} ;
|
|
||||||
|
|
||||||
complVerbAdj : Adjective -> VerbPhrase -> Complement = \grei, simma ->
|
complVerbAdj : Adjective -> VerbPhrase -> Complement = \grei, simma ->
|
||||||
(\\a =>
|
(\\a =>
|
||||||
grei.s ! AAdj ++ simma.s1 ++
|
grei.s ! AAdj ++ simma.s1 ++
|
||||||
@@ -996,6 +973,32 @@ oper
|
|||||||
s2 = lookat.s3
|
s2 = lookat.s3
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
--- this does not give negative or anterior forms
|
||||||
|
|
||||||
|
slashVerbVerb : NounPhrase -> VerbVerb -> TransVerb -> ClauseSlashNounPhrase =
|
||||||
|
\you,want,lookat ->
|
||||||
|
let youlookat = (predVerbClause you (aux2verb want)
|
||||||
|
(complVerbVerb want (predVerbI True {s = [] ; a = Simul} lookat
|
||||||
|
(complVerb lookat)))).s
|
||||||
|
in
|
||||||
|
{s = table {
|
||||||
|
DirQ => youlookat ! Inv ;
|
||||||
|
IndirQ => youlookat ! Dir
|
||||||
|
} ;
|
||||||
|
s2 = lookat.s3
|
||||||
|
} ;
|
||||||
|
|
||||||
|
slashAdverb : Clause -> Preposition -> ClauseSlashNounPhrase =
|
||||||
|
\youwalk,by ->
|
||||||
|
{s = table {
|
||||||
|
DirQ => youwalk.s ! Inv ;
|
||||||
|
IndirQ => youwalk.s ! Dir
|
||||||
|
} ;
|
||||||
|
s2 = by
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--2 Relative pronouns and relative clauses
|
--2 Relative pronouns and relative clauses
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -63,7 +63,12 @@ oper
|
|||||||
-- in the singular; plural forms are uniformly equal to the 2nd person singular.
|
-- in the singular; plural forms are uniformly equal to the 2nd person singular.
|
||||||
|
|
||||||
param
|
param
|
||||||
VForm = InfImp | Indic Person | Pastt Number | PPart | PresPart ;
|
VForm = InfImp | Indic Number | Pastt | PPart | PresPart ;
|
||||||
|
|
||||||
|
-- This is for auxiliary verbs, which have special negated indicative forms.
|
||||||
|
|
||||||
|
AuxVerbForm = AInfImp | AIndic Person Bool | APastt Number Bool | APPart | APresPart ;
|
||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
VerbP3 : Type = {s : VForm => Str} ;
|
VerbP3 : Type = {s : VForm => Str} ;
|
||||||
@@ -73,6 +78,8 @@ oper
|
|||||||
Particle : Type = Str ;
|
Particle : Type = Str ;
|
||||||
Verb = VerbP3 ** {s1 : Particle} ;
|
Verb = VerbP3 ** {s1 : Particle} ;
|
||||||
|
|
||||||
|
AuxVerb = {s : AuxVerbForm => Str} ;
|
||||||
|
|
||||||
--
|
--
|
||||||
--3 Pronouns
|
--3 Pronouns
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ lin
|
|||||||
|
|
||||||
ComplA2S = predAdjSent2 ;
|
ComplA2S = predAdjSent2 ;
|
||||||
|
|
||||||
TransVV2 = transVerbVerb ;
|
|
||||||
AdjPart = adjPastPart ;
|
AdjPart = adjPastPart ;
|
||||||
|
|
||||||
UseV2V x = x ;
|
UseV2V x = x ;
|
||||||
@@ -102,6 +101,8 @@ lin
|
|||||||
--
|
--
|
||||||
|
|
||||||
SlashV2 = slashTransVerb ;
|
SlashV2 = slashTransVerb ;
|
||||||
|
SlashVV2 = slashVerbVerb ;
|
||||||
|
SlashAdv cl p = slashAdverb cl p.s ;
|
||||||
|
|
||||||
IdRP = identRelPron ;
|
IdRP = identRelPron ;
|
||||||
FunRP = funRelPron ;
|
FunRP = funRelPron ;
|
||||||
|
|||||||
@@ -918,7 +918,20 @@ oper
|
|||||||
slashTransVerb : NounPhrase -> TransVerb -> ClauseSlashNounPhrase =
|
slashTransVerb : NounPhrase -> TransVerb -> ClauseSlashNounPhrase =
|
||||||
\jag, se ->
|
\jag, se ->
|
||||||
predVerbGroupClause jag (useVerb se (\\_,_,_ => se.s1)) ** {s2 = se.s2} ;
|
predVerbGroupClause jag (useVerb se (\\_,_,_ => se.s1)) ** {s2 = se.s2} ;
|
||||||
|
|
||||||
|
--- this does not give negative or anterior forms
|
||||||
|
|
||||||
|
slashVerbVerb : NounPhrase -> VerbVerb -> TransVerb -> ClauseSlashNounPhrase =
|
||||||
|
\jag,vilja,se ->
|
||||||
|
predVerbGroupClause jag (useVerb vilja (\\g,n,p =>
|
||||||
|
vilja.s1 ++
|
||||||
|
vilja.s3 ++
|
||||||
|
se.s ! VI (Inf Act))
|
||||||
|
) ** {s2 = se.s2} ;
|
||||||
|
|
||||||
|
slashAdverb : Clause -> Preposition -> ClauseSlashNounPhrase =
|
||||||
|
\youwalk,by -> youwalk ** {s2 = by} ;
|
||||||
|
|
||||||
--2 Relative pronouns and relative clauses
|
--2 Relative pronouns and relative clauses
|
||||||
--
|
--
|
||||||
-- Relative pronouns can be nominative, accusative, or genitive, and
|
-- Relative pronouns can be nominative, accusative, or genitive, and
|
||||||
|
|||||||
Reference in New Issue
Block a user