mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
adverbs
This commit is contained in:
@@ -9,6 +9,8 @@ abstract Adjective = Cat ** {
|
|||||||
|
|
||||||
ComplA2 : A2 -> NP -> AP ;
|
ComplA2 : A2 -> NP -> AP ;
|
||||||
|
|
||||||
|
ReflA2 : A2 -> AP ;
|
||||||
|
|
||||||
SentAP : AP -> S -> AP ;
|
SentAP : AP -> S -> AP ;
|
||||||
QuestAP : AP -> QS -> AP ;
|
QuestAP : AP -> QS -> AP ;
|
||||||
|
|
||||||
|
|||||||
@@ -3,32 +3,37 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
PositA a = {
|
PositA a = {
|
||||||
s = a.s ! AAdj Posit ;
|
s = \\_ => a.s ! AAdj Posit ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
ComparA a np = {
|
ComparA a np = {
|
||||||
s = a.s ! AAdj Compar ++ "than" ++ np.s ! Nom ;
|
s = \\_ => a.s ! AAdj Compar ++ "than" ++ np.s ! Nom ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
ComplA2 a np = {
|
ComplA2 a np = {
|
||||||
s = a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ;
|
s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflA2 a = {
|
||||||
|
s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SentAP ap s = {
|
SentAP ap s = {
|
||||||
s = ap.s ++ conjThat ++ s.s ;
|
s = \\a => ap.s ! a ++ conjThat ++ s.s ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
QuestAP ap qs = {
|
QuestAP ap qs = {
|
||||||
s = ap.s ++ qs.s ! QIndir ;
|
s = \\a => ap.s ! a ++ qs.s ! QIndir ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdAP ada ap = {
|
AdAP ada ap = {
|
||||||
s = ada.s ++ ap.s ;
|
s = \\a => ada.s ++ ap.s ! a ;
|
||||||
isPre = ap.isPre
|
isPre = ap.isPre
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
15
lib/resource-1.0/gf/Adverb.gf
Normal file
15
lib/resource-1.0/gf/Adverb.gf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
abstract Adverb = Cat ** {
|
||||||
|
|
||||||
|
fun
|
||||||
|
|
||||||
|
PositAdvAdj : A -> Adv ;
|
||||||
|
ComparAdvAdj : CAdv -> A -> NP -> Adv ;
|
||||||
|
ComparAdvAdjS : CAdv -> A -> S -> Adv ;
|
||||||
|
|
||||||
|
PrepNP : Prep -> NP -> Adv ;
|
||||||
|
|
||||||
|
AdAdv : AdA -> Adv -> Adv ;
|
||||||
|
|
||||||
|
SubjS : Subj -> S -> Adv ;
|
||||||
|
|
||||||
|
}
|
||||||
18
lib/resource-1.0/gf/AdverbEng.gf
Normal file
18
lib/resource-1.0/gf/AdverbEng.gf
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
concrete AdverbEng of Adverb = CatEng ** open ResEng, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PositAdvAdj a = {s = a.s ! AAdv} ;
|
||||||
|
ComparAdvAdj cadv a np = {
|
||||||
|
s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom
|
||||||
|
} ;
|
||||||
|
ComparAdvAdjS cadv a s = {
|
||||||
|
s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PrepNP prep np = {s = prep.s ++ np.s ! Acc} ;
|
||||||
|
|
||||||
|
AdAdv = cc2 ;
|
||||||
|
|
||||||
|
SubjS = cc2 ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
abstract Cat = {
|
abstract Cat = {
|
||||||
|
|
||||||
cat
|
cat
|
||||||
|
|
||||||
|
Text ;
|
||||||
|
Phr ;
|
||||||
|
Utt ;
|
||||||
|
Imp ;
|
||||||
|
|
||||||
S ;
|
S ;
|
||||||
QS ;
|
QS ;
|
||||||
RS ;
|
RS ;
|
||||||
@@ -50,8 +57,22 @@ abstract Cat = {
|
|||||||
IAdv ;
|
IAdv ;
|
||||||
IDet ;
|
IDet ;
|
||||||
|
|
||||||
RP ;
|
RP ; -- relative pronoun
|
||||||
|
|
||||||
Numeral ;
|
Numeral ; -- cardinal or ordinal, e.g. "five/fifth"
|
||||||
|
|
||||||
|
Conj ; -- conjunction, e.g. "and"
|
||||||
|
DConj ; -- distributed conj. e.g. "both - and"
|
||||||
|
PConj ; -- phrase-beginning conj.
|
||||||
|
CAdv ; -- comparative adverb e.g. "more", "less"
|
||||||
|
Subj ; -- subjunction, e.g. "if", "when"
|
||||||
|
|
||||||
|
SeqS ; -- sequence of sentences
|
||||||
|
SeqVP ; -- sequence of verb phrases
|
||||||
|
SeqAP ; -- sequence of adjectival phrases
|
||||||
|
SeqNP ; -- sequence of noun phrases
|
||||||
|
SeqAdv ; -- sequence of adverbs
|
||||||
|
|
||||||
|
Voc ; -- vocative or "please"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
concrete CatEng of Cat = open ResEng, Prelude in {
|
concrete CatEng of Cat = open ResEng, Prelude in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
Text, Phr, Utt = {s : Str} ;
|
||||||
|
|
||||||
|
Imp = {s : Polarity => Number => Str} ;
|
||||||
|
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
QS = {s : QForm => Str} ;
|
QS = {s : QForm => Str} ;
|
||||||
RS = {s : Agr => Str} ;
|
RS = {s : Agr => Str} ;
|
||||||
@@ -20,7 +24,7 @@ concrete CatEng of Cat = open ResEng, Prelude in {
|
|||||||
V2, VV = Verb ** {c2 : Str} ;
|
V2, VV = Verb ** {c2 : Str} ;
|
||||||
V3 = Verb ** {c2, c3 : Str} ;
|
V3 = Verb ** {c2, c3 : Str} ;
|
||||||
|
|
||||||
AP = {s : Str ; isPre : Bool} ;
|
AP = {s : Agr => Str ; isPre : Bool} ;
|
||||||
Comp = {s : Agr => Str} ;
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
A = {s : AForm => Str} ;
|
A = {s : AForm => Str} ;
|
||||||
@@ -46,4 +50,14 @@ concrete CatEng of Cat = open ResEng, Prelude in {
|
|||||||
|
|
||||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
|
||||||
|
CAdv = {s : Str} ;
|
||||||
|
|
||||||
|
Conj = {s : Str ; n : Number} ;
|
||||||
|
DConj = {s1,s2 : Str ; n : Number} ;
|
||||||
|
|
||||||
|
SeqS = {s1,s2 : Str} ;
|
||||||
|
SeqAdv = {s1,s2 : Str} ;
|
||||||
|
SeqNP = {s1,s2 : Case => Str ; a : Agr} ;
|
||||||
|
SeqAP = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
15
lib/resource-1.0/gf/Conjunction.gf
Normal file
15
lib/resource-1.0/gf/Conjunction.gf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
abstract Conjunction = Sequence ** {
|
||||||
|
|
||||||
|
fun
|
||||||
|
|
||||||
|
ConjS : Conj -> SeqS -> S ; -- "John walks and Mary runs"
|
||||||
|
ConjAP : Conj -> SeqAP -> AP ; -- "even and prime"
|
||||||
|
ConjNP : Conj -> SeqNP -> NP ; -- "John or Mary"
|
||||||
|
ConjAdv : Conj -> SeqAdv -> Adv ; -- "quickly or slowly"
|
||||||
|
|
||||||
|
DConjS : DConj -> SeqS -> S ; -- "either John walks or Mary runs"
|
||||||
|
DConjAP : DConj -> SeqAP -> AP ; -- "both even and prime"
|
||||||
|
DConjNP : DConj -> SeqNP -> NP ; -- "either John or Mary"
|
||||||
|
DConjAdv : DConj -> SeqAdv -> Adv ; -- "both badly and slowly"
|
||||||
|
|
||||||
|
}
|
||||||
26
lib/resource-1.0/gf/ConjunctionEng.gf
Normal file
26
lib/resource-1.0/gf/ConjunctionEng.gf
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
concrete ConjunctionEng of Conjunction =
|
||||||
|
SequenceEng ** open ResEng, Coordination in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
ConjS conj ss = {s = conjunctX conj ss} ;
|
||||||
|
DConjS conj ss = {s = conjunctDistrX conj ss} ;
|
||||||
|
|
||||||
|
ConjAdv conj ss = {s = conjunctX conj ss} ;
|
||||||
|
DConjAdv conj ss = {s = conjunctDistrX conj ss} ;
|
||||||
|
|
||||||
|
ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||||
|
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
|
} ;
|
||||||
|
DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||||
|
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjAP conj ss = conjunctTable Agr conj ss ** {
|
||||||
|
isPre = ss.isPre
|
||||||
|
} ;
|
||||||
|
DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
||||||
|
isPre = ss.isPre
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -35,7 +35,20 @@ abstract Lex = Cat ** {
|
|||||||
|
|
||||||
very_AdA : AdA ;
|
very_AdA : AdA ;
|
||||||
|
|
||||||
|
always_AdV : AdV ;
|
||||||
|
|
||||||
one_Numeral, forty_Numeral : Numeral ;
|
one_Numeral, forty_Numeral : Numeral ;
|
||||||
|
|
||||||
in_Prep, of_Prep : Prep ;
|
in_Prep, of_Prep : Prep ;
|
||||||
|
|
||||||
|
and_Conj : Conj ;
|
||||||
|
either7or_DConj : DConj ;
|
||||||
|
|
||||||
|
but_PConj : PConj ;
|
||||||
|
|
||||||
|
if_Subj, because_Subj : Subj ;
|
||||||
|
|
||||||
|
please_Voc : Voc ;
|
||||||
|
|
||||||
|
more_CAdv, less_CAdv : CAdv ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ concrete LexEng of Lex = CatEng ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
here_Adv = {s = "here"} ;
|
here_Adv = {s = "here"} ;
|
||||||
very_AdA = {s = "very"} ;
|
very_AdA = {s = "very"} ;
|
||||||
|
always_AdV = {s = "always"} ;
|
||||||
|
|
||||||
only_Predet = {s = "only"} ;
|
only_Predet = {s = "only"} ;
|
||||||
all_Predet = {s = "only"} ;
|
all_Predet = {s = "only"} ;
|
||||||
@@ -43,4 +44,17 @@ concrete LexEng of Lex = CatEng ** open ResEng, Prelude in {
|
|||||||
in_Prep = {s = "in"} ;
|
in_Prep = {s = "in"} ;
|
||||||
of_Prep = {s = "of"} ;
|
of_Prep = {s = "of"} ;
|
||||||
|
|
||||||
|
and_Conj = {s = "and" ; n = Pl} ;
|
||||||
|
either7or_DConj = {s1 = "either" ; s2 = "or" ; n = Sg} ;
|
||||||
|
|
||||||
|
if_Subj = ss "if" ;
|
||||||
|
because_Subj = ss "because" ;
|
||||||
|
|
||||||
|
but_PConj = {s = "but"} ;
|
||||||
|
|
||||||
|
please_Voc = {s = "," ++ "please"} ;
|
||||||
|
|
||||||
|
more_CAdv = ss "more" ;
|
||||||
|
less_CAdv = ss "less" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||||
ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||||
|
|
||||||
AdjCN ap cn = {s = \\n,c => preOrPost ap.isPre ap.s (cn.s ! n ! c)} ;
|
AdjCN ap cn = {
|
||||||
|
s = \\n,c => preOrPost ap.isPre (ap.s ! (agrP3 n).a) (cn.s ! n ! c)
|
||||||
|
} ;
|
||||||
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||||
|
|
||||||
SentCN cn s = {s = \\n,c => cn.s ! n ! c ++ conjThat ++ s.s} ;
|
SentCN cn s = {s = \\n,c => cn.s ! n ! c ++ conjThat ++ s.s} ;
|
||||||
|
|||||||
@@ -11,4 +11,17 @@ resource ParamX = {
|
|||||||
|
|
||||||
QForm = QDir | QIndir ;
|
QForm = QDir | QIndir ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
conjNumber : Number -> Number -> Number = \m,n ->
|
||||||
|
case <m,n> of {
|
||||||
|
<Sg,Sg> => Sg ;
|
||||||
|
_ => Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- For persons, we let the latter argument win ("either you or I am absent"
|
||||||
|
-- but "either I or you are absent"). This is not quite clear.
|
||||||
|
|
||||||
|
conjPerson : Person -> Person -> Person = \_,p ->
|
||||||
|
p ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
21
lib/resource-1.0/gf/Phrase.gf
Normal file
21
lib/resource-1.0/gf/Phrase.gf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
abstract Phrase = Cat, Tense ** {
|
||||||
|
|
||||||
|
fun
|
||||||
|
PhrUtt : PConj -> Utt -> Voc -> Phr ;
|
||||||
|
|
||||||
|
UttS : S -> Utt ;
|
||||||
|
UttQS : QS -> Utt ;
|
||||||
|
UttImpSg, UttImpPl : Pol -> Imp -> Utt ;
|
||||||
|
|
||||||
|
UttIP : IP -> Utt ;
|
||||||
|
UttIAdv : IAdv -> Utt ;
|
||||||
|
UttNP : NP -> Utt ;
|
||||||
|
UttAdv : Adv -> Utt ;
|
||||||
|
UttVP : VP -> Utt ;
|
||||||
|
|
||||||
|
NoPConj : PConj ;
|
||||||
|
PConjConj : Conj -> PConj ;
|
||||||
|
|
||||||
|
NoVoc : Voc ;
|
||||||
|
VocNP : NP -> Voc ;
|
||||||
|
}
|
||||||
22
lib/resource-1.0/gf/PhraseEng.gf
Normal file
22
lib/resource-1.0/gf/PhraseEng.gf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
concrete PhraseEng of Phrase = CatEng, TenseX ** open ResEng in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
|
|
||||||
|
UttS s = s ;
|
||||||
|
UttQS qs = {s = qs.s ! QDir} ;
|
||||||
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
|
||||||
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||||
|
|
||||||
|
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||||
|
UttIAdv iadv = iadv ;
|
||||||
|
UttNP np = {s = np.s ! Acc} ;
|
||||||
|
UttAdv adv = adv ;
|
||||||
|
|
||||||
|
NoPConj = {s = []} ;
|
||||||
|
PConjConj conj = conj ;
|
||||||
|
|
||||||
|
NoVoc = {s = []} ;
|
||||||
|
VocNP np = {s = "," ++ np.s ! Nom} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,13 +2,14 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
param
|
param
|
||||||
|
|
||||||
Case = Nom | Acc | Gen ;
|
Case = Nom | Acc | Gen ;
|
||||||
|
|
||||||
VForm = VInf | VPres | VPast | VPPart | VPresPart ;
|
VForm = VInf | VPres | VPast | VPPart | VPresPart ;
|
||||||
|
|
||||||
Ord = ODir | OQuest ;
|
Ord = ODir | OQuest ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
Agr = {n : Number ; p : Person} ;
|
Agr = {n : Number ; p : Person} ;
|
||||||
|
|
||||||
agrP3 : Number -> {a : Agr} = \n -> {a = {n = n ; p = P3}} ;
|
agrP3 : Number -> {a : Agr} = \n -> {a = {n = n ; p = P3}} ;
|
||||||
@@ -52,6 +53,8 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- For $Verb$.
|
||||||
|
|
||||||
Verb : Type = {
|
Verb : Type = {
|
||||||
s : VForm => Str
|
s : VForm => Str
|
||||||
} ;
|
} ;
|
||||||
@@ -63,7 +66,7 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
predV : Verb -> VP = \verb -> {
|
predV : Verb -> VP = \verb -> {
|
||||||
s = \\t,ant,b,ord,agr =>
|
s = \\t,ant,b,ord,agr =>
|
||||||
let
|
let
|
||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
fin = presVerb verb agr ;
|
fin = presVerb verb agr ;
|
||||||
past = verb.s ! VPast ;
|
past = verb.s ! VPast ;
|
||||||
@@ -105,10 +108,10 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
{fin = x ; inf = y} ;
|
{fin = x ; inf = y} ;
|
||||||
in
|
in
|
||||||
case <t,ant,b,ord> of {
|
case <t,ant,b,ord> of {
|
||||||
<Pres,Simul,_, _> => vf fin [] ;
|
<Pres,Simul,_, _> => vf fin [] ;
|
||||||
<Pres,Anter,Pos,_> => vf (have agr) part ;
|
<Pres,Anter,Pos,_> => vf (have agr) part ;
|
||||||
<Pres,Anter,Neg,_> => vf (havent agr) part ;
|
<Pres,Anter,Neg,_> => vf (havent agr) part ;
|
||||||
<Past,Simul,_, _> => vf fin [] ;
|
<Past,Simul,_, _> => vf fin [] ;
|
||||||
<Past,Anter,Pos,_> => vf "had" part ;
|
<Past,Anter,Pos,_> => vf "had" part ;
|
||||||
<Past,Anter,Neg,_> => vf "hadn't" part ;
|
<Past,Anter,Neg,_> => vf "hadn't" part ;
|
||||||
<Fut, Simul,Pos,_> => vf "will" inf ;
|
<Fut, Simul,Pos,_> => vf "will" inf ;
|
||||||
@@ -128,6 +131,11 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
s2 = \\a => vp.s2 ! a ++ obj ! a
|
s2 = \\a => vp.s2 ! a ++ obj ! a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
||||||
|
s = vp.s ;
|
||||||
|
s2 = vp.s2
|
||||||
|
} ;
|
||||||
|
|
||||||
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
||||||
agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
||||||
|
|
||||||
@@ -148,7 +156,11 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
Aux = {pres,past : Polarity => Agr => Str ; inf,ppart : Str} ;
|
Aux = {pres,past : Polarity => Agr => Str ; inf,ppart : Str} ;
|
||||||
|
|
||||||
auxBe : Aux = {
|
auxBe : Aux = {
|
||||||
pres = \\b,a => agrVerb (posneg b "is") (posneg b "are") a ;
|
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 ;
|
past = \\b,a => agrVerb (posneg b "was") (posneg b "were") a ;
|
||||||
inf = "be" ;
|
inf = "be" ;
|
||||||
ppart = "been"
|
ppart = "been"
|
||||||
@@ -161,6 +173,15 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
conjThat : Str = "that" ;
|
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 $Adjective$.
|
-- For $Adjective$.
|
||||||
|
|
||||||
param
|
param
|
||||||
@@ -181,6 +202,15 @@ oper
|
|||||||
param
|
param
|
||||||
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
||||||
|
|
||||||
|
-- For $Coord$.
|
||||||
|
|
||||||
|
oper
|
||||||
|
conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
||||||
|
n = conjNumber a.n b.n ;
|
||||||
|
p = conjPerson a.p b.p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- For $Numeral$.
|
-- For $Numeral$.
|
||||||
|
|
||||||
param
|
param
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ abstract Sentence = Cat ** {
|
|||||||
|
|
||||||
PredVP : NP -> VP -> Cl ;
|
PredVP : NP -> VP -> Cl ;
|
||||||
|
|
||||||
SlashV2 : NP -> V2 -> Slash ;
|
ImpVP : VP -> Imp ;
|
||||||
|
|
||||||
AdvSlash : Slash -> Adv -> Slash ;
|
|
||||||
|
|
||||||
|
SlashV2 : NP -> V2 -> Slash ;
|
||||||
|
AdvSlash : Slash -> Adv -> Slash ;
|
||||||
SlashPrep : Cl -> Prep -> Slash ;
|
SlashPrep : Cl -> Prep -> Slash ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ concrete SentenceEng of Sentence = CatEng ** open ResEng in {
|
|||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||||
subj = np.s ! Nom ;
|
subj = np.s ! Nom ;
|
||||||
compl = vp.s2 ! agr
|
compl = vp.s2 ! agr
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
ODir => subj ++ verb.fin ++ verb.inf ++ compl ;
|
ODir => subj ++ verb.fin ++ verb.inf ++ compl ;
|
||||||
@@ -17,6 +17,19 @@ concrete SentenceEng of Sentence = CatEng ** open ResEng in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
ImpVP vp = {
|
||||||
|
s = \\pol,n =>
|
||||||
|
let
|
||||||
|
agr = {n = n ; p = P2} ;
|
||||||
|
verb = infVP vp agr ;
|
||||||
|
dont = case pol of {
|
||||||
|
Neg => "don't" ;
|
||||||
|
_ => []
|
||||||
|
}
|
||||||
|
in
|
||||||
|
dont ++ verb
|
||||||
|
} ;
|
||||||
|
|
||||||
SlashV2 np v2 = {
|
SlashV2 np v2 = {
|
||||||
s = \\t,a,b,o =>
|
s = \\t,a,b,o =>
|
||||||
let
|
let
|
||||||
|
|||||||
13
lib/resource-1.0/gf/Sequence.gf
Normal file
13
lib/resource-1.0/gf/Sequence.gf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
abstract Sequence = Cat ** {
|
||||||
|
|
||||||
|
fun
|
||||||
|
TwoS : S -> S -> SeqS ;
|
||||||
|
AddS : SeqS -> S -> SeqS ;
|
||||||
|
TwoAdv : Adv -> Adv -> SeqAdv ;
|
||||||
|
AddAdv : SeqAdv -> Adv -> SeqAdv ;
|
||||||
|
TwoNP : NP -> NP -> SeqNP ;
|
||||||
|
AddNP : SeqNP -> NP -> SeqNP ;
|
||||||
|
TwoAP : AP -> AP -> SeqAP ;
|
||||||
|
AddAP : SeqAP -> AP -> SeqAP ;
|
||||||
|
|
||||||
|
}
|
||||||
15
lib/resource-1.0/gf/SequenceEng.gf
Normal file
15
lib/resource-1.0/gf/SequenceEng.gf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
concrete SequenceEng of Sequence =
|
||||||
|
CatEng ** open ResEng, Coordination, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
TwoS = twoSS ;
|
||||||
|
AddS = consSS comma ;
|
||||||
|
TwoAdv = twoSS ;
|
||||||
|
AddAdv = consSS comma ;
|
||||||
|
TwoNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||||
|
AddNP xs x = consTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||||
|
TwoAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
||||||
|
AddAP xs x = consTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,10 +2,13 @@ abstract Test =
|
|||||||
Noun,
|
Noun,
|
||||||
Verb,
|
Verb,
|
||||||
Adjective,
|
Adjective,
|
||||||
|
Adverb,
|
||||||
-- Numeral,
|
-- Numeral,
|
||||||
Sentence,
|
Sentence,
|
||||||
Question,
|
Question,
|
||||||
Relative,
|
Relative,
|
||||||
|
Conjunction,
|
||||||
|
Phrase,
|
||||||
Untensed,
|
Untensed,
|
||||||
-- Tensed,
|
-- Tensed,
|
||||||
Lex
|
Lex
|
||||||
|
|||||||
@@ -4,11 +4,18 @@ concrete TestEng of Test =
|
|||||||
NounEng,
|
NounEng,
|
||||||
VerbEng,
|
VerbEng,
|
||||||
AdjectiveEng,
|
AdjectiveEng,
|
||||||
|
AdverbEng,
|
||||||
-- NumeralEng,
|
-- NumeralEng,
|
||||||
SentenceEng,
|
SentenceEng,
|
||||||
QuestionEng,
|
QuestionEng,
|
||||||
RelativeEng,
|
RelativeEng,
|
||||||
|
ConjunctionEng,
|
||||||
|
PhraseEng,
|
||||||
UntensedEng,
|
UntensedEng,
|
||||||
-- TensedEng,
|
-- TensedEng,
|
||||||
LexEng
|
LexEng
|
||||||
** {} ;
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ;
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|||||||
@@ -7,8 +7,14 @@ abstract Verb = Cat ** {
|
|||||||
ComplVV : VV -> VP -> VP ;
|
ComplVV : VV -> VP -> VP ;
|
||||||
ComplVS : VS -> S -> VP ;
|
ComplVS : VS -> S -> VP ;
|
||||||
ComplVQ : VQ -> QS -> VP ;
|
ComplVQ : VQ -> QS -> VP ;
|
||||||
|
|
||||||
|
ReflV2 : V2 -> VP ;
|
||||||
|
PassV2 : V2 -> Comp ; --- overgen (V2 with prep)
|
||||||
|
|
||||||
UseComp : Comp -> VP ;
|
UseComp : Comp -> VP ;
|
||||||
AdvVP : VP -> Adv -> VP ;
|
|
||||||
|
AdvVP : VP -> Adv -> VP ; -- here
|
||||||
|
AdVVP : AdV -> VP -> VP ; -- always
|
||||||
|
|
||||||
UseVV : VV -> V2 ;
|
UseVV : VV -> V2 ;
|
||||||
UseVQ : VQ -> V2 ;
|
UseVQ : VQ -> V2 ;
|
||||||
|
|||||||
@@ -5,18 +5,24 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
|
|||||||
lin
|
lin
|
||||||
UseV = predV ;
|
UseV = predV ;
|
||||||
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
||||||
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
|
||||||
ComplV3 v np np2 =
|
ComplV3 v np np2 =
|
||||||
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
||||||
ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
||||||
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
||||||
ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
||||||
|
|
||||||
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
||||||
|
|
||||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||||
|
---- AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
|
ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
||||||
|
|
||||||
|
PassV2 v = {s = \\_ => v.s ! VPPart} ;
|
||||||
|
|
||||||
UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to"
|
UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to"
|
||||||
|
|
||||||
CompAP ap = {s = \\_ => ap.s} ;
|
CompAP ap = ap ;
|
||||||
CompNP np = {s = \\_ => np.s ! Acc} ;
|
CompNP np = {s = \\_ => np.s ! Acc} ;
|
||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
|
|||||||
6
lib/resource-1.0/gf/problems.txt
Normal file
6
lib/resource-1.0/gf/problems.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Serious problems with resource.
|
||||||
|
|
||||||
|
29/11: Can't lin AdV properly (parsing; adverbs "always" relative to auxiliary)
|
||||||
|
|
||||||
|
29/11/2005: ResEng.reflPron - not enough agreement features.
|
||||||
|
|
||||||
Reference in New Issue
Block a user