mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-17 00:39:32 -06:00
VP romance
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete ClauseFre of Clause = CategoriesFre **
|
||||
ClauseRomance with (SyntaxRomance=SyntaxFre) ;
|
||||
ClauseI with (Rules=RulesFre), (Verbphrase=VerbphraseFre) ;
|
||||
---- ClauseRomance with (SyntaxRomance=SyntaxFre) ;
|
||||
|
||||
@@ -104,8 +104,10 @@ oper
|
||||
|
||||
negVerb = \va -> elisNe ++ va ++ "pas" ;
|
||||
|
||||
-- copula = \b,w -> let etre = (predVerb verbEtre).s in etre ! b ! Masc ! w ;
|
||||
copula = verbEtre ;
|
||||
|
||||
|
||||
isClitCase = \c -> case c of {
|
||||
Acc => True ;
|
||||
Dat => True ;
|
||||
|
||||
3
lib/resource/french/VerbphraseFre.gf
Normal file
3
lib/resource/french/VerbphraseFre.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
concrete VerbphraseFre of Verbphrase = CategoriesFre **
|
||||
VerbphraseRomance with (SyntaxScand=SyntaxFre) ;
|
||||
@@ -406,6 +406,10 @@ oper
|
||||
VPF _ f => nombreVerb f
|
||||
} ;
|
||||
|
||||
personVerbPhrase : VPForm -> Person = \v -> case v of {
|
||||
VPF _ f => personVerb f
|
||||
} ;
|
||||
|
||||
isNotImperative : VPForm -> Bool = \v -> case v of {
|
||||
VPF _ (VImper _) => False ;
|
||||
_ => True
|
||||
@@ -724,33 +728,32 @@ param
|
||||
oper
|
||||
Clause = {s : Bool => ClForm => Str} ;
|
||||
|
||||
{-
|
||||
predVerbPhrase : NounPhrase -> VerbPhrase -> Sentence = \jean,dort ->
|
||||
{s = \\m => jean.s ! unstressed nominative ++
|
||||
dort.s ! pgen2gen jean.g ! VPF Simul (VFin (VPres m) jean.n jean.p)
|
||||
---- VIForm = VIInfinit | VIImperat Bool Number ;
|
||||
predVerbGroup : Bool -> {s : Str ; a : Anteriority} -> VerbGroup -> VerbPhrase =
|
||||
\b,ant,vg ->
|
||||
{s = \\vi,g,n,p => ant.s ++ vg.s ! b ! g ! VPF ant.a VInfin ---- imper
|
||||
} ;
|
||||
|
||||
predVerbGroup : Bool -> VerbGroup -> VerbPhrase = \b,vg -> {
|
||||
s = vg.s ! b
|
||||
} ;
|
||||
|
||||
|
||||
oper
|
||||
cl2vp : ClForm -> Number -> Person -> VPForm = \c,n,p -> case c of {
|
||||
ClPres a m => VPF a (VFin (VPres m) n p) ;
|
||||
ClImperf a m => VPF a (VFin (VImperf m) n p) ;
|
||||
ClPasse a => VPF a (VFin VPasse n p) ;
|
||||
ClFut a => VPF a (VFin VFut n p) ;
|
||||
ClCondit a => VPF a (VFin VCondit n p)
|
||||
ClCondit a => VPF a (VFin VCondit n p) ;
|
||||
ClInfinit a => VPF a VInfin
|
||||
} ;
|
||||
|
||||
predVerbGroupClause : NounPhrase -> VerbGroup -> Clause = \jean,dort ->
|
||||
{s = \\b,c =>
|
||||
jean.s ! unstressed nominative ++
|
||||
dort.s ! b ! pgen2gen jean.g ! cl2vp c jean.n jean.p
|
||||
vp2cl : VPForm -> ClForm = \vf -> case vf of {
|
||||
VPF a (VFin (VPres m) _ _) => ClPres a m ;
|
||||
VPF a (VFin (VImperf m) _ _) => ClImperf a m ;
|
||||
VPF a (VFin (VPasse) _ _) => ClPasse a ;
|
||||
VPF a (VFin (VFut) _ _) => ClFut a ;
|
||||
VPF a (VFin (VCondit) _ _) => ClCondit a ;
|
||||
VPF a VInfin => ClInfinit a ;
|
||||
_ => ClInfinit Simul ---- imper
|
||||
} ;
|
||||
-}
|
||||
|
||||
|
||||
Complemnt = Gender => Number => Person => {clit, part, compl : Str} ; ---- ment
|
||||
|
||||
predVerbClause : NounPhrase -> Verb -> Complemnt -> Clause = \np,verb,comp ->
|
||||
@@ -785,6 +788,28 @@ oper
|
||||
ClInfinit a => <jean, posNeg b (la ++ avoirr) (aimee ++ ici)>
|
||||
} ;
|
||||
|
||||
-- These three function are just to restore the $VerbGroup$ ($VP$) based structure.
|
||||
|
||||
predVerbGroupClause : NounPhrase -> VerbGroup -> Clause = \np,vp ->
|
||||
let
|
||||
it = np.s ! unstressed nominative
|
||||
in
|
||||
{s = \\b,cf => it ++ vp.s ! b ! pgen2gen np.g ! cl2vp cf np.n np.p} ;
|
||||
|
||||
predClauseGroup : Verb -> Complemnt -> VerbGroup = \verb,comp ->
|
||||
let
|
||||
nvg : PronGen -> Number -> Person -> (Bool => ClForm => (Str * Str)) =
|
||||
\g,n,p ->
|
||||
predVerbClauseGen {s = \\_ => [] ; g=g ; n=n ; p=p ; c=Clit0} verb comp
|
||||
-- clit type irrelevant in subject position
|
||||
in
|
||||
{s = \\b,g,vf =>
|
||||
(nvg (PGen g) (nombreVerbPhrase vf) (personVerbPhrase vf) ! b ! (vp2cl vf)).p2
|
||||
} ;
|
||||
|
||||
predClauseBeGroup : Complemnt -> VerbGroup =
|
||||
predClauseGroup copula ;
|
||||
|
||||
|
||||
--3 Sentence-complement verbs
|
||||
--
|
||||
|
||||
@@ -178,6 +178,11 @@ oper
|
||||
_ => singular ---
|
||||
} ;
|
||||
|
||||
personVerb : VF -> Person = \v -> case v of {
|
||||
VFin _ _ p => p ;
|
||||
_ => P3 ---
|
||||
} ;
|
||||
|
||||
presInd = VPres Ind ;
|
||||
-- The imperative forms depend on number and person.
|
||||
|
||||
|
||||
67
lib/resource/romance/VerbphraseRomance.gf
Normal file
67
lib/resource/romance/VerbphraseRomance.gf
Normal file
@@ -0,0 +1,67 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level Romance Resource Grammar: Verb Phrase Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
incomplete concrete VerbphraseRomance of Verbphrase = CategoriesRomance **
|
||||
open Prelude, SyntaxRomance in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
UseV v = predClauseGroup v (complVerb v) ;
|
||||
UsePassV v = predClauseBeGroup (passVerb v) ;
|
||||
ComplV2 v x = predClauseGroup v (complTransVerb v x) ;
|
||||
ComplReflV2 v = predClauseGroup v (reflTransVerb v) ;
|
||||
ComplVS v x = predClauseGroup v (complSentVerb v x) ;
|
||||
ComplVV v x = predClauseGroup v (complVerbVerb v x) ;
|
||||
ComplVQ v x = predClauseGroup v (complQuestVerb v x) ;
|
||||
ComplVA v x = predClauseGroup v (complAdjVerb v x) ;
|
||||
ComplV2A v x y = predClauseGroup v (complDitransAdjVerb v x y) ;
|
||||
ComplSubjV2V v x y = predClauseGroup v (complDitransVerbVerb False v x y) ;
|
||||
ComplObjV2V v x y = predClauseGroup v (complDitransVerbVerb True v x y) ;
|
||||
---- ComplV2S v x y = predClauseGroup v (complDitransSentVerb v x y) ;
|
||||
---- ComplV2Q v x y = predClauseGroup v (complDitransQuestVerb v x y) ;
|
||||
|
||||
PredAP v = predClauseBeGroup (complAdjective v) ;
|
||||
PredSuperl a = predClauseBeGroup (complAdjective (superlAdjPhrase a)) ;
|
||||
PredCN v = predClauseBeGroup (complCommNoun v) ;
|
||||
PredNP v = predClauseBeGroup (complNounPhrase v) ;
|
||||
PredPP v = predClauseBeGroup (complAdverb v) ;
|
||||
|
||||
PredAV v x = predClauseBeGroup (complVerbAdj v x) ;
|
||||
---- PredObjA2V v x y = predClauseBeGroup (complVerbAdj2 True v x y) ;
|
||||
|
||||
---- PredProgVP = progressiveVerbPhrase ;
|
||||
|
||||
---- SPredProgVP = progressiveClause ;
|
||||
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
|
||||
---- RelVP = relVerbPhrase ;
|
||||
---- IntVP = intVerbPhrase ;
|
||||
|
||||
PosVP tp = predVerbGroup True tp ;
|
||||
NegVP tp = predVerbGroup False tp ;
|
||||
|
||||
---- AdvVP = adVerbPhrase ;
|
||||
---- SubjVP = subjunctVerbPhrase ;
|
||||
}
|
||||
Reference in New Issue
Block a user