mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
reflexive and deponent as verb features added
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
concrete BasicEng of Basic = CatEng ** open ParadigmsEng in {
|
||||
|
||||
flags
|
||||
startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||
optimize=all ;
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
airplane_N = regN "airplane" ;
|
||||
|
||||
@@ -189,7 +189,7 @@ oper
|
||||
--- The particle always appears right after the verb.
|
||||
|
||||
verbPart : Verb -> Str -> Verb = \v,p ->
|
||||
{s = \\f => v.s ! f ++ p} ;
|
||||
{s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ;
|
||||
|
||||
verbNoPart : Verb -> Verb = \v -> verbPart v [] ;
|
||||
|
||||
|
||||
@@ -235,6 +235,12 @@ oper
|
||||
|
||||
partV : V -> Str -> V ;
|
||||
|
||||
--3 Reflexive verbs
|
||||
--
|
||||
-- By default, verbs are not reflexive; this function makes them that.
|
||||
|
||||
reflV : V -> V ;
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
@@ -423,6 +429,7 @@ oper
|
||||
mkV fit (fit + "s") y z fitting ;
|
||||
|
||||
partV v p = verbPart v p ** {lock_V = <>} ;
|
||||
reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ;
|
||||
|
||||
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v [] ;
|
||||
|
||||
@@ -41,7 +41,7 @@ resource ResEng = ParamEng ** open Prelude in {
|
||||
}
|
||||
} ;
|
||||
|
||||
mkVerb : (_,_,_,_,_ : Str) -> {s : VForm => Str} =
|
||||
mkVerb : (_,_,_,_,_ : Str) -> Verb =
|
||||
\go,goes,went,gone,going -> {
|
||||
s = table {
|
||||
VInf => go ;
|
||||
@@ -49,7 +49,8 @@ resource ResEng = ParamEng ** open Prelude in {
|
||||
VPast => went ;
|
||||
VPPart => gone ;
|
||||
VPresPart => going
|
||||
}
|
||||
} ;
|
||||
isRefl = False
|
||||
} ;
|
||||
|
||||
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||
@@ -77,7 +78,7 @@ resource ResEng = ParamEng ** open Prelude in {
|
||||
regA : Str -> {s : AForm => Str} = \warm ->
|
||||
mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ;
|
||||
|
||||
regV : Str -> {s : VForm => Str} = \walk ->
|
||||
regV : Str -> Verb = \walk ->
|
||||
mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ;
|
||||
|
||||
regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n ->
|
||||
@@ -97,7 +98,8 @@ resource ResEng = ParamEng ** open Prelude in {
|
||||
-- For $Verb$.
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str
|
||||
s : VForm => Str ;
|
||||
isRefl : Bool
|
||||
} ;
|
||||
|
||||
VerbForms : Type =
|
||||
@@ -138,7 +140,7 @@ resource ResEng = ParamEng ** open Prelude in {
|
||||
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
|
||||
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
|
||||
} ;
|
||||
s2 = \\_ => []
|
||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
||||
} ;
|
||||
|
||||
predAux : Aux -> VP = \verb -> {
|
||||
|
||||
@@ -27,7 +27,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
|
||||
|
||||
PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ;
|
||||
|
||||
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to"
|
||||
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to"
|
||||
|
||||
CompAP ap = ap ;
|
||||
CompNP np = {s = \\_ => np.s ! Acc} ;
|
||||
|
||||
@@ -175,6 +175,10 @@ oper
|
||||
seinV : V -> V ;
|
||||
habenV : V -> V ;
|
||||
|
||||
-- Reflexive verbs can take reflexive pronouns of different cases.
|
||||
|
||||
reflV : V -> Case -> V ;
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object
|
||||
@@ -332,16 +336,21 @@ oper
|
||||
in
|
||||
mkV singen singt sing sang saenge gesungen ;
|
||||
|
||||
prefixV p v = {s = v.s ; prefix = p ; lock_V = v.lock_V ; aux = v.aux} ;
|
||||
habenV v = {s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben} ;
|
||||
seinV v = {s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VSein} ;
|
||||
prefixV p v =
|
||||
{s = v.s ; prefix = p ; lock_V = v.lock_V ; aux = v.aux ; vtype = v.vtype} ;
|
||||
habenV v =
|
||||
{s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = v.vtype} ;
|
||||
seinV v =
|
||||
{s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VSein ; vtype = v.vtype} ;
|
||||
reflV v c =
|
||||
{s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = VRefl c} ;
|
||||
|
||||
no_geV v = let vs = v.s in {
|
||||
s = table {
|
||||
p@(VPastPart _) => Predef.drop 2 (vs ! p) ;
|
||||
p => vs ! p
|
||||
} ;
|
||||
prefix = v.prefix ; lock_V = v.lock_V ; aux = v.aux
|
||||
prefix = v.prefix ; lock_V = v.lock_V ; aux = v.aux ; vtype = v.vtype
|
||||
} ;
|
||||
|
||||
mkV2 v c = v ** {c2 = c ; lock_V2 = <>} ;
|
||||
|
||||
@@ -57,6 +57,8 @@ resource ParamGer = ParamX ** {
|
||||
|
||||
param VAux = VHaben | VSein ;
|
||||
|
||||
param VType = VAct | VRefl Case ;
|
||||
|
||||
-- The order of sentence is depends on whether it is used as a main
|
||||
-- clause, inverted, or subordinate.
|
||||
|
||||
|
||||
@@ -62,7 +62,12 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
-- suffixes "t" and "st". Auxiliaries like "sein" will have to
|
||||
-- make extra cases even for this.
|
||||
|
||||
Verb : Type = {s : VForm => Str ; prefix : Str ; aux : VAux} ;
|
||||
Verb : Type = {
|
||||
s : VForm => Str ;
|
||||
prefix : Str ;
|
||||
aux : VAux ;
|
||||
vtype : VType
|
||||
} ;
|
||||
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Str -> VAux -> Verb =
|
||||
\geben,gebe,gibst,gibt,gebt,gib,gab,gabst,gaben,gabt,gaebe,gegeben,ein,aux ->
|
||||
@@ -91,7 +96,8 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
VPastPart a => (regA gegeben).s ! Posit ! a
|
||||
} ;
|
||||
prefix = ein ;
|
||||
aux = aux
|
||||
aux = aux ;
|
||||
vtype = VAct
|
||||
} ;
|
||||
|
||||
-- These functions cover many regular cases; full coverage inflectional patterns are
|
||||
@@ -237,7 +243,10 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
VPInfinit Anter => vf [] (vpart ++ haben)
|
||||
} ;
|
||||
a1 : Polarity => Str = negation ;
|
||||
n2 : Agr => Str = \\_ => [] ;
|
||||
n2 : Agr => Str = case verb.vtype of {
|
||||
VAct => \\_ => [] ;
|
||||
VRefl c => \\a => reflPron ! a ! c
|
||||
} ;
|
||||
a2 : Str = [] ;
|
||||
ext : Str = []
|
||||
} ;
|
||||
@@ -287,7 +296,8 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
v => sein.s ! v
|
||||
} ;
|
||||
prefix = [] ;
|
||||
aux = VSein
|
||||
aux = VSein ;
|
||||
vtype = VAct
|
||||
} ;
|
||||
|
||||
auxVV : Verb -> Verb ** {isAux : Bool} = \v -> v ** {isAux = True} ;
|
||||
|
||||
@@ -25,8 +25,8 @@ interface DiffScand = open ResScand, Prelude in {
|
||||
|
||||
artIndef : Gender => Str ;
|
||||
|
||||
verbHave : {s : VForm => Str} ;
|
||||
verbBe : {s : VForm => Str} ;
|
||||
verbHave : {s : VForm => Str ; vtype : VType} ;
|
||||
verbBe : {s : VForm => Str ; vtype : VType} ;
|
||||
|
||||
auxFut : Str ;
|
||||
auxCond : Str ;
|
||||
@@ -67,9 +67,13 @@ interface DiffScand = open ResScand, Prelude in {
|
||||
|
||||
predV : Verb -> VP = \verb ->
|
||||
let
|
||||
vfin : Tense -> Str = \t -> verb.s ! vFin t Act ;
|
||||
vsup = verb.s ! VI (VSupin Act) ;
|
||||
vinf = verb.s ! VI (VInfin Act) ;
|
||||
diath = case verb.vtype of {
|
||||
VPass => Pass ;
|
||||
_ => Act
|
||||
} ;
|
||||
vfin : Tense -> Str = \t -> verb.s ! vFin t diath ;
|
||||
vsup = verb.s ! VI (VSupin diath) ;
|
||||
vinf = verb.s ! VI (VInfin diath) ;
|
||||
|
||||
har : Tense -> Str = \t -> verbHave.s ! vFin t Act ;
|
||||
ha : Str = verbHave.s ! VI (VInfin Act) ;
|
||||
@@ -90,16 +94,20 @@ interface DiffScand = open ResScand, Prelude in {
|
||||
Fut => vf auxFut (ha ++ vsup) ;
|
||||
Cond => vf auxCond (ha ++ vsup)
|
||||
} ;
|
||||
VPImperat => vf (verb.s ! VF (VImper Act)) [] ;
|
||||
VPImperat => vf (verb.s ! VF (VImper diath)) [] ;
|
||||
VPInfinit Simul => vf [] vinf ;
|
||||
VPInfinit Anter => vf [] (ha ++ vsup)
|
||||
} ;
|
||||
a1 : Polarity => Str = negation ;
|
||||
n2 : Agr => Str = \\_ => [] ;
|
||||
n2 : Agr => Str = \\a => case verb.vtype of {
|
||||
VRefl => reflPron a ;
|
||||
_ => []
|
||||
} ;
|
||||
a2 : Str = [] ;
|
||||
ext : Str = [] ;
|
||||
en2,ea2,eext : Bool = False -- indicate if the field exists
|
||||
} ;
|
||||
|
||||
reflPron : Agr -> Str ;
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ param
|
||||
| VPImperat
|
||||
| VPInfinit Anteriority ;
|
||||
|
||||
VType = VAct | VPass | VRefl ;
|
||||
|
||||
NPForm = NPNom | NPAcc | NPPoss GenNum ;
|
||||
--- AdjPronForm = APron GenNum Case ;
|
||||
--- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ;
|
||||
|
||||
@@ -38,7 +38,7 @@ resource ResScand = ParamScand ** open Prelude in {
|
||||
}
|
||||
} ;
|
||||
|
||||
mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> {s : VForm => Str} =
|
||||
mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> {s : VForm => Str ; vtype : VType} =
|
||||
\finna,finner,finn,fann,funnit,funnen,funnet,funna -> {
|
||||
s = table {
|
||||
VF (VPres Act) => finner ;
|
||||
@@ -48,7 +48,8 @@ resource ResScand = ParamScand ** open Prelude in {
|
||||
VI (VInfin v) => mkVoice v finna ;
|
||||
VI (VSupin v) => mkVoice v funnit ;
|
||||
VI (VPtPret a c)=> mkCase c (mkAdjPos a funnen funnet funna funna)
|
||||
}
|
||||
} ;
|
||||
vtype = VAct
|
||||
} ;
|
||||
|
||||
-- These are useful auxiliaries.
|
||||
@@ -81,29 +82,6 @@ resource ResScand = ParamScand ** open Prelude in {
|
||||
}
|
||||
} ;
|
||||
|
||||
-- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str} =
|
||||
-- \good,better,best,well -> {
|
||||
-- s = table {
|
||||
-- AAdj Posit => good ;
|
||||
-- AAdj Compar => better ;
|
||||
-- AAdj Superl => best ;
|
||||
-- AAdv => well
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- mkVerb : (_,_,_,_,_ : Str) -> {s : VForm => Str} =
|
||||
-- \go,goes,went,gone,going -> {
|
||||
-- s = table {
|
||||
-- VInf => go ;
|
||||
-- VPres => goes ;
|
||||
-- VPast => went ;
|
||||
-- VPPart => gone ;
|
||||
-- VPresPart => going
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||
-- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
|
||||
|
||||
-- For $Noun$.
|
||||
|
||||
@@ -137,7 +115,8 @@ resource ResScand = ParamScand ** open Prelude in {
|
||||
-- For $Verb$.
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str
|
||||
s : VForm => Str ;
|
||||
vtype : VType
|
||||
} ;
|
||||
|
||||
VP = {
|
||||
@@ -187,51 +166,9 @@ resource ResScand = ParamScand ** open Prelude in {
|
||||
eext = vp.eext
|
||||
} ;
|
||||
|
||||
-- presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
||||
-- agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
||||
|
||||
infVP : VP -> Agr -> Str = \vp,a ->
|
||||
(vp.s ! VPInfinit Simul).inf ++ vp.n2 ! a ++ vp.a2 ++ vp.ext ; --- a1
|
||||
|
||||
-- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
||||
-- case agr of {
|
||||
-- {n = Sg ; p = P3} => has ;
|
||||
-- _ => have
|
||||
-- } ;
|
||||
--
|
||||
-- have = agrVerb "has" "have" ;
|
||||
-- havent = agrVerb "hasn't" "haven't" ;
|
||||
-- does = agrVerb "does" "do" ;
|
||||
-- doesnt = agrVerb "doesn't" "don't" ;
|
||||
--
|
||||
-- Aux = {pres,past : Polarity => Agr => Str ; inf,ppart : Str} ;
|
||||
--
|
||||
-- auxBe : Aux = {
|
||||
-- pres = \\b,a => case <b,a> of {
|
||||
-- <Pos,{n = Sg ; p = P1}> => "am" ;
|
||||
-- <Neg,{n = Sg ; p = P1}> => ["am not"] ; --- am not I
|
||||
-- _ => agrVerb (posneg b "is") (posneg b "are") a
|
||||
-- } ;
|
||||
-- past = \\b,a => agrVerb (posneg b "was") (posneg b "were") a ;
|
||||
-- inf = "be" ;
|
||||
-- ppart = "been"
|
||||
-- } ;
|
||||
--
|
||||
-- posneg : Polarity -> Str -> Str = \p,s -> case p of {
|
||||
-- Pos => s ;
|
||||
-- Neg => s + "n't"
|
||||
-- } ;
|
||||
--
|
||||
-- conjThat : Str = "that" ;
|
||||
--
|
||||
-- reflPron : Agr => Str = table {
|
||||
-- {n = Sg ; p = P1} => "myself" ;
|
||||
-- {n = Sg ; p = P2} => "yourself" ;
|
||||
-- {n = Sg ; p = P3} => "itself" ; ----
|
||||
-- {n = Pl ; p = P1} => "ourselves" ;
|
||||
-- {n = Pl ; p = P2} => "yourselves" ;
|
||||
-- {n = Pl ; p = P3} => "themselves"
|
||||
-- } ;
|
||||
|
||||
-- For $Sentence$.
|
||||
|
||||
@@ -253,7 +190,6 @@ resource ResScand = ParamScand ** open Prelude in {
|
||||
}
|
||||
} ;
|
||||
|
||||
--
|
||||
---- For $Numeral$.
|
||||
--
|
||||
-- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
||||
|
||||
@@ -35,6 +35,6 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in
|
||||
PassV2 v = {s = \\_ => v.s ! VPPart} ;
|
||||
-}
|
||||
|
||||
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ;
|
||||
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; vtype = vv.vtype} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
concrete BasicSwe of Basic = CatSwe ** open ParadigmsSwe in {
|
||||
|
||||
flags
|
||||
startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||
optimize=all ;
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
airplane_N = regN "flygplan" neutrum ;
|
||||
@@ -93,8 +92,8 @@ lin
|
||||
have_V2 = dirV2 (mkV "ha" "har" "ha" "hade" "haft" "haft") ; ---- pp
|
||||
hear_V2 = dirV2 (mkV "höra" "hör" "hör" "hörde" "hört" "hörd") ;
|
||||
hill_N = regN "kulle" utrum ;
|
||||
hope_VS = mkVS ((regV "önska")) ;
|
||||
---- hope_VS = mkVS (depV (regV "hoppas")) ;
|
||||
-- hope_VS = mkVS ((regV "önska")) ;
|
||||
hope_VS = mkVS (depV (regV "hoppa")) ;
|
||||
horse_N = regN "häst" utrum ;
|
||||
hot_A = regADeg "het" ;
|
||||
house_N = regN "hus" neutrum ;
|
||||
@@ -105,7 +104,7 @@ lin
|
||||
know_V2 = dirV2 (mkV "veta" "vet" "vet" "visste" "vetat" "visst") ;
|
||||
lake_N = mkN "sjö" "sjön" "sjöar" "sjöarna" ;
|
||||
lamp_N = regN "lampa" utrum;
|
||||
learn_V2 = dirV2 (mkV "lära" "lär" "lär" "lärde" "lärt" "lärd") ; ---- refl!
|
||||
learn_V2 = dirV2 (reflV (mkV "lära" "lär" "lär" "lärde" "lärt" "lärd")) ;
|
||||
leather_N = mkN "läder" "lädret" "läder" "lädren" ;
|
||||
leave_V2 = dirV2 (regV "lämna") ;
|
||||
like_V2 = mkV2 (mk2V "tycka" "tyckte") "om" ;
|
||||
|
||||
@@ -51,6 +51,14 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
|
||||
Neutr => allt
|
||||
} ;
|
||||
|
||||
reflPron : Agr -> Str = \a -> case a of {
|
||||
{gn = Plg ; p = P1} => "oss" ;
|
||||
{gn = Plg ; p = P2} => "er" ;
|
||||
{p = P1} => "mig" ;
|
||||
{p = P2} => "dig" ;
|
||||
{p = P3} => "sig"
|
||||
} ;
|
||||
|
||||
relPron : GenNum => RCase => Str = \\gn,c => case c of {
|
||||
RNom => "som" ;
|
||||
RGen => "vars" ;
|
||||
|
||||
@@ -145,7 +145,8 @@ adj2Reg : Str -> Str -> Adjective = \vid,vitt ->
|
||||
funnet = funn ! Strong SgNeutr ! Nom ;
|
||||
funna = funn ! Strong Plg ! Nom
|
||||
in
|
||||
mkVerb finna finner finn fann funnit funnen funnet funna ;
|
||||
mkVerb finna finner finn fann funnit funnen funnet funna **
|
||||
{vtype=VAct} ;
|
||||
|
||||
ptPretForms : Str -> AFormPos => Case => Str = \funnen -> \\a,c =>
|
||||
let
|
||||
|
||||
@@ -229,9 +229,11 @@ oper
|
||||
|
||||
--3 Deponent verbs.
|
||||
--
|
||||
-- Some words are used in passive forms only, e.g. "hoppas".
|
||||
-- Some words are used in passive forms only, e.g. "hoppas", some as
|
||||
-- reflexive e.g. "ångra sig".
|
||||
|
||||
depV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
@@ -338,8 +340,9 @@ oper
|
||||
irregV x y z = irregVerb x y z
|
||||
** {s1 = [] ; lock_V = <>} ;
|
||||
|
||||
partV v p = {s = \\f => v.s ! f ++ p ; lock_V = <>} ;
|
||||
---- depV v = deponentVerb v ** {lock_V = <>} ;
|
||||
partV v p = {s = \\f => v.s ! f ++ p ; vtype = v.vtype ; lock_V = <>} ;
|
||||
depV v = {s = v.s ; vtype = VPass ; lock_V = <>} ;
|
||||
reflV v = {s = v.s ; vtype = VRefl ; lock_V = <>} ;
|
||||
|
||||
mkV2 v p = v ** {s = v.s ; c2 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v [] ;
|
||||
|
||||
Reference in New Issue
Block a user