forked from GrammaticalFramework/gf-wordnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParseExtend.gf
151 lines (118 loc) · 5.83 KB
/
ParseExtend.gf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
abstract ParseExtend = Extend - [iFem_Pron, youPolFem_Pron, weFem_Pron, youPlFem_Pron, theyFem_Pron, GenNP, DetNPMasc, DetNPFem, FocusAP,
CompVP, InOrderToVP, PurposeVP, ComplGenVV, ReflRNP, ProDrop, UncontractedNeg, AdvIsNPAP, ExistCN, NominalizeVPSlashNP], Numeral - [num], Punctuation ** {
fun gen_Quant : Quant ; -- English often skips the article
-- when in Swedish and Bulgarian definite
-- article is needed. This is usually
-- for things in general.
UttAP : AP -> Utt ; -- Similar to UttAP in the RGL but in Neutr
UttAPMasc : AP -> Utt ; -- Version of UttAP in masculine
UttAPFem : AP -> Utt ; -- Version of UttAP in feminine
UttVPS : Pron -> VPS -> Utt ; -- Similar to UttVPS in the RGL but takes agreement from a pronoun
-- A version of PhrUtt which adds a punctuation mark
fun PhrUttMark : PConj -> Utt -> Voc -> Mark -> Phr ;
-- Extensions of the API for reflexive pronouns from
-- the Extend module
fun AdvRNP : NP -> Prep -> RNP -> RNP ;
AdvRVP : VP -> Prep -> RNP -> VP ;
AdvRAP : AP -> Prep -> RNP -> AP ;
PossPronRNP : Pron -> Num -> CN -> RNP -> NP ;
ReflA2 : A2 -> RNP -> AP ;
ReflVPSlash : VPSlash -> RNP -> VP ;
-- CNN is a version of CN category where the number is already
-- fixed but the quantifier is still missing.
-- This is useful mostly for coordination.
cat CNN ;
fun BaseCNN : Num -> CN -> Num -> CN -> CNN ;
DetCNN : Quant -> Conj -> CNN -> NP ;
ReflPossCNN : Conj -> CNN -> RNP ;
PossCNN_RNP : Quant -> Conj -> CNN -> RNP -> RNP ;
-- Extensions to numerals
-- The following two functions build numerals like
-- `two more` or `five less`.
fun NumLess : Num -> Num ;
NumMore : Num -> Num ;
-- The RGL supports numerals up to 999 999. With the following
-- extensions it is possible to go up to 999 999 999. We need
-- one more level to go to 999 999 999 999. There are also
-- functions for numerals `a hundred`, `a thousand` and `a million`
-- which are also missing from the RGL.
cat Sub1000000000 ;
fun pot3as4 : Sub1000000 -> Sub1000000000 ; -- coercion of 1..999999
pot4 : Sub1000 -> Sub1000000000 ; -- m * 1000000000
pot4plus : Sub1000 -> Sub1000000 -> Sub1000000000 ; -- m * 1000000000 + n
pot21 : Sub1000 ; -- a hundred
pot31 : Sub1000000 ; -- a thousand
pot41 : Sub1000000000 ; -- a million
num : Sub1000000000 -> Numeral ;
-- Some cardinals like `many` permit modifications with AdA,
-- i.e. `too many`, `very many`.
fun UseACard : ACard -> Card ;
UseAdAACard : AdA -> ACard -> Card ;
fun -- Version of RelNP from the RGL but without comma
RelNP : NP -> RS -> NP ;
-- the same as the RGL's RelNP, just renamed
-- for consistency with ExtAdvNP for instance.
ExtRelNP : NP -> RS -> NP ;
-- make it possible insert comma between adjective and adverb
fun ExtAdvAP : AP -> Adv -> AP ;
-- Use N2 as a plain N. The RGL has UseN2 but this doesn't
-- allow us to use N2 in compound nouns.
fun BareN2 : N2 -> N ;
-- A generalization of the CAdv API from the RGL
-- which permits negation, i.e. `no more efficient than ..`.
-- The argument of the CAdv is now an arbitrary complement.
fun ComparAdv : Pol -> CAdv -> Adv -> Comp -> Adv ;
CAdvAP : Pol -> CAdv -> AP -> Comp -> AP ;
AdnCAdv : Pol -> CAdv -> AdN ;
-- the word `enough` has a special syntax in English
-- when it is used with adjectives,
-- i.e. `smart enough to find the solution`.
fun EnoughAP : AP -> Ant -> Pol -> VP -> AP ;
EnoughAdv : Adv -> Adv ;
-- TimeNP is really overgenerating and is only a temporary
-- place holder. It is used when a noun phrase describing
-- time is used as an adverb.
fun TimeNP : NP -> Adv ;
-- Sometimes one adverb modifies another. I am not sure
-- if this is a regular pattern or the function must be revised.
fun AdvAdv : Adv -> Adv -> Adv ;
-- UseDAP replaces DetNP from the RGL which is more limited.
-- Instead of (DetNP d) use (UseDAP (DetDAP d)). The advantage
-- is that now we can also have an adjective inserted, i.e.
-- (UseDAP (AdjDAP (DetDAP d) a). There are also versions of
-- UseDAP for different genders.
fun UseDAP : DAP -> NP ;
UseDAPMasc : DAP -> NP ;
UseDAPFem : DAP -> NP ;
-- Make it possible to insert an adverb in front of an imperative
fun AdvImp : Adv -> Imp -> Imp ;
-- gender specific version of whatSg_IP.
fun whatSgFem_IP : IP ;
whatSgNeut_IP : IP ;
-- reexport Extra.that_RP here since the rest of the Extra module
-- is not used in the Parse grammar.
fun that_RP : RP ;
-- generalize several function that take infinitive VP as argument
-- to also support anteriority and polarity.
fun EmbedVP : Ant -> Pol -> Pron -> VP -> SC ;
ComplVV : VV -> Ant -> Pol -> VP -> VP ;
SlashVV : VV -> Ant -> Pol -> VPSlash -> VPSlash ;
SlashV2V : V2V -> Ant -> Pol -> VP -> VPSlash ;
SlashV2VNP : V2V -> NP -> Ant -> Pol -> VPSlash -> VPSlash ;
InOrderToVP : Ant -> Pol -> Pron -> VP -> Adv ;
CompVP : Ant -> Pol -> Pron -> VP -> Comp ;
UttVP : Ant -> Pol -> Pron -> VP -> Utt ;
-- reciprocal verbs i.e.
-- `We love each other` or `We love one another`.
fun RecipVPSlash : VPSlash -> VP ;
RecipVPSlashCN : VPSlash -> CN -> VP ;
-- A clause which uses copula but the complement
-- is shifted to the front.
fun FocusComp : Comp -> NP -> Cl ;
-- Conjunction of copula complements
cat [Comp]{2} ;
fun ConjComp : Conj -> ListComp -> Comp ;
-- Conjunction of imperatives
cat [Imp] {2} ;
fun ConjImp : Conj -> ListImp -> Imp ;
}