linkparser 1.1.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ # -*- ruby -*-
2
+ #encoding: utf-8
3
+
4
+ require 'linkparser' unless defined?( LinkParser )
5
+
6
+ class LinkParser::Dictionary
7
+ extend Loggability
8
+
9
+ # Use LinkParser's logger
10
+ log_to :linkparser
11
+
12
+ end # class LinkParser::Dictionary
13
+
@@ -1,162 +1,29 @@
1
- #!/usr/bin/env ruby
1
+ # -*- ruby -*-
2
+ #encoding: utf-8
3
+
4
+ require 'yaml'
2
5
 
3
6
  require 'linkparser' unless defined?( LinkParser )
4
7
  require 'linkparser/mixins'
5
8
 
6
- #
7
- # Additional high-level functionality for LinkParser::Sentence objects.
8
- #
9
- # == Synopsis
10
- #
11
- #
12
- #
13
- # == Authors
14
- #
15
- # * Michael Granger <ged@FaerieMUD.org>
16
- #
17
- # == Version
18
- #
19
- # $Id: linkage.rb,v 507ef20fc315 2011/01/11 19:06:53 ged $
20
- #
21
- # == License
22
- #
23
- # :include: LICENSE
24
- #--
25
- #
26
- # See the LICENSE file for copyright/licensing information.
9
+ # This is the API's representation of a parse. A LinkParser::Sentence may have one or more
10
+ # of LinkParser::Linkages, each of which represents one possible structure of the sentence.
11
+ # It can be thought of as a Sentence together with a collection of links. If the parse
12
+ # has a conjunction, then the Linkage is made up of at least two "sublinkages". A
13
+ # Linkage can be pretty printed in either ASCII or Postscript format, and individual
14
+ # links can be extracted.
27
15
  class LinkParser::Linkage
28
- extend LinkParser::DeprecationUtilities
29
-
30
- ###
31
- ### Deprecated API
32
- ### These methods are going to be removed in a future version.
33
- ###
34
-
35
- ### Returns +true+ if the linkage has more than one sublinkage (i.e., the
36
- ### sentence has a conjunction).
37
- def has_conjunction?
38
- return self.num_sublinkages > 1
39
- end
40
- deprecated_method :has_conjunction?
16
+ extend Loggability,
17
+ LinkParser::DeprecationUtilities
41
18
 
42
- # These are all defined in the extension
43
- deprecated_method :num_sublinkages
44
- deprecated_method :current_sublinkage=
45
- deprecated_method :current_sublinkage
46
- deprecated_method :compute_union
47
-
48
- ### End deprecated stuff
19
+ # Use LinkParser's logger
20
+ log_to :linkparser
49
21
 
50
22
 
51
23
  # Descriptions of the linkage types, keyed by linkage symbol
52
- LINK_TYPES = {
53
- :A => %{connects pre-noun ("attributive") adjectives to following nouns: "The BIG DOG chased me", "The BIG BLACK UGLY DOG chased me".},
54
- :AA => %{is used in the construction "How [adj] a [noun] was it?". It connects the adjective to the following "a".},
55
- :AF => %{connects adjectives to verbs in cases where the adjective is fronted, such as questions and indirect questions: "How BIG IS it?"},
56
- :AL => %{connects a few determiners like "all" or "both" to following determiners: "ALL THE people are here".},
57
- :AM => %{connects "as" to "much" or "many": "I don't go out AS MUCH now".},
58
- :AN => %{connects noun-modifiers to following nouns: "The TAX PROPOSAL was rejected".},
59
- :AZ => %{connects the word "as" back to certain verbs that can take "[obj] as [adj]" as a complement: "He VIEWED him AS stupid".},
60
- :B => %{serves various functions involving relative clauses and questions. It connects transitive verbs back to their objects in relative clauses, questions, and indirect questions ("The DOG we CHASED", "WHO did you SEE?"); it also connects the main noun to the finite verb in subject-type relative clauses ("The DOG who CHASED me was black").},
61
- :BI => %{connects forms of the verb "be" to certain idiomatic expressions: for example, cases like "He IS PRESIDENT of the company".},
62
- :BT => %{is used with time expressions acting as fronted objects: "How many YEARS did it LAST?".},
63
- :BW => %{connects "what" to various verbs like "think", which are not really transitive but can connect back to "what" in questions: "WHAT do you THINK?"},
64
- :C => %{links conjunctions to subjects of subordinate clauses ("He left WHEN HE saw me"). it also links certain verbs to subjects of embedded clauses ("He SAID HE was sorry").},
65
- :CC => %{connects clauses to following coordinating conjunctions ("SHE left BUT we stayed").},
66
- :CO => %{connects "openers" to subjects of clauses: "APPARENTLY / ON Tuesday , THEY went to a movie".},
67
- :CP => %{connects paraphrasing or quoting verbs to the wall (and, indirectly, to the paraphrased expression): "///// That is untrue, the spokesman SAID."},
68
- :CQ => %{connects to auxiliaries in comparative constructions involving s-v inversion: "SHE has more money THAN DOES Joe".},
69
- :CX => %{is used in comparative constructions where the right half of the comparative contains only an auxiliary: "She has more money THAN he DOES".},
70
- :D => %{connects determiners to nouns: "THE DOG chased A CAT and SOME BIRDS".},
71
- :DD => %{connects definite determiners ("the", "his") to certain things like number expressions and adjectives acting as nouns: "THE POOR", "THE TWO he mentioned".},
72
- :DG => %{connects the word "The" with proper nouns: "the Riviera", "the Mississippi".},
73
- :DP => %{connects possessive determiners to gerunds: "YOUR TELLING John to leave was stupid".},
74
- :DT => %{connects determiners to nouns in idiomatic time expressions: "NEXT WEEK", "NEXT THURSDAY".},
75
- :E => %{is used for verb-modifying adverbs which precede the verb: "He is APPARENTLY LEAVING".},
76
- :EA => %{connects adverbs to adjectives: "She is a VERY GOOD player".},
77
- :EB => %{connects adverbs to forms of "be" before an object or prepositional phrase: "He IS APPARENTLY a good programmer".},
78
- :EC => %{connects adverbs to comparative adjectives: "It is MUCH BIGGER"},
79
- :EE => %{connects adverbs to other adverbs: "He ran VERY QUICKLY".},
80
- :EF => %{connects the word "enough" to preceding adjectives and adverbs: "He didn't run QUICKLY ENOUGH".},
81
- :EI => %{connects a few adverbs to "after" and "before": "I left SOON AFTER I saw you".},
82
- :EL => %{connects certain words to the word "else": something / everything / anything / nothing , somewhere (etc.), and someone (etc.).},
83
- :EN => %{connects certain adverbs to expressions of quantity: "The class has NEARLY FIFTY students".},
84
- :ER => %{is used the expression "The x-er..., the y-er...". it connects the two halfs of the expression together, via the comparative words (e.g. "The FASTER it is, the MORE they will like it").},
85
- :EZ => %{connects certain adverbs to the word "as", like "just" and "almost": "You're JUST AS good as he is."},
86
- :FL => %{connects "for" to "long": "I didn't wait FOR LONG".},
87
- :FM => %{connects the preposition "from" to various other prepositions: "We heard a scream FROM INSIDE the house".},
88
- :G => %{connects proper noun words together in series: "GEORGE HERBERT WALKER BUSH is here."},
89
- :GN => %{(stage 2 only) connects a proper noun to a preceding common noun which introduces it: "The ACTOR Eddie MURPHY attended the event".},
90
- :H => %{connects "how" to "much" or "many": "HOW MUCH money do you have".},
91
- :I => %{connects infinitive verb forms to certain words such as modal verbs and "to": "You MUST DO it", "I want TO DO it".},
92
- :ID => %{is a special class of link-types generated by the parser, with arbitrary four-letter names (such as "IDBT"), to connect together words of idiomatic expressions such as "at_hand" and "head_of_state".},
93
- :IN => %{connects the preposition "in" to certain time expressions: "We did it IN DECEMBER".},
94
- :J => %{connects prepositions to their objects: "The man WITH the HAT is here".},
95
- :JG => %{connects certain prepositions to proper-noun objects: "The Emir OF KUWAIT is here".},
96
- :JQ => %{connects prepositions to question-word determiners in "prepositional questions": "IN WHICH room were you sleeping?"},
97
- :JT => %{connects certain conjunctions to time-expressions like "last week": "UNTIL last WEEK, I thought she liked me".},
98
- :K => %{connects certain verbs with particles like "in", "out", "up" and the like: "He STOOD UP and WALKED OUT".},
99
- :L => %{connects certain determiners to superlative adjectives: "He has THE BIGGEST room".},
100
- :LE => %{is used in comparative constructions to connect an adjective to the second half of the comparative expression beyond a complement phrase: "It is more LIKELY that Joe will go THAN that Fred will go".},
101
- :LI => %{connects certain verbs to the preposition "like": "I FEEL LIKE a fool."},
102
- :M => %{connects nouns to various kinds of post-noun modifiers: prepositional phrases ("The MAN WITH the hat"), participle modifiers ("The WOMAN CARRYING the box"), prepositional relatives ("The MAN TO whom I was speaking"), and other kinds.},
103
- :MF => %{is used in the expression "Many people were injured, SOME OF THEM children".},
104
- :MG => %{allows certain prepositions to modify proper nouns: "The EMIR OF Kuwait is here".},
105
- :MV => %{connects verbs and adjectives to modifying phrases that follow, like adverbs ("The dog RAN QUICKLY"), prepositional phrases ("The dog RAN IN the yard"), subordinating conjunctions ("He LEFT WHEN he saw me"), comparatives, participle phrases with commas, and other things.},
106
- :MX => %{connects modifying phrases with commas to preceding nouns: "The DOG, a POODLE, was black". "JOHN, IN a black suit, looked great".},
107
- :N => %{connects the word "not" to preceding auxiliaries: "He DID NOT go".},
108
- :ND => %{connects numbers with expressions that require numerical determiners: "I saw him THREE WEEKS ago".},
109
- :NF => %{is used with NJ in idiomatic number expressions involving "of": "He lives two THIRDS OF a mile from here".},
110
- :NI => %{is used in a few special idiomatic number phrases: "I have BETWEEN 5 AND 20 dogs".},
111
- :NJ => %{is used with NF in idiomatic number expressions involving "of": "He lives two thirds OF a MILE from here".},
112
- :NN => %{connects number words together in series: "FOUR HUNDRED THOUSAND people live here".},
113
- :NO => %{is used on words which have no normal linkage requirement, but need to be included in the dictionary, such as "um" and "ah".},
114
- :NR => %{connects fraction words with superlatives: "It is the THIRD BIGGEST city in China".},
115
- :NS => %{connects singular numbers (one, 1, a) to idiomatic expressions requiring number determiners: "I saw him ONE WEEK ago".},
116
- :NT => %{connects "not" to "to": "I told you NOT TO come".},
117
- :NW => %{is used in idiomatic fraction expressions: "TWO THIRDS of the students were women".},
118
- :O => %{connects transitive verbs to their objects, direct or indirect: "She SAW ME", "I GAVE HIM the BOOK".},
119
- :OD => %{is used for verbs like "rise" and "fall" which can take expressions of distance as complements: "It FELL five FEET".},
120
- :OF => %{connects certain verbs and adjectives to the word "of": "She ACCUSED him OF the crime", "I'm PROUD OF you".},
121
- :ON => %{connectors the word "on" to dates or days of the week in time expressions: "We saw her again ON TUESDAY".},
122
- :OT => %{is used for verbs like "last" which can take time expressions as objects: "It LASTED five HOURS".},
123
- :OX => %{is an object connector, analogous to SF, used for special "filler" words like "it" and "there" when used as objects: "That MAKES IT unlikely that she will come".},
124
- :P => %{connects forms of the verb "be" to various words that can be its complements: prepositions, adjectives, and passive and progressive participles: "He WAS [ ANGRY / IN the yard / CHOSEN / RUNNING ]".},
125
- :PF => %{is used in certain questions with "be", when the complement need of "be" is satisfied by a preceding question word: "WHERE are you?", "WHEN will it BE?"},
126
- :PP => %{connects forms of "have" with past participles: "He HAS GONE".},
127
- :Q => %{is used in questions. It connects the wall to the auxiliary in simple yes-no questions ("///// DID you go?"); it connects the question word to the auxiliary in where-when-how questions ("WHERE DID you go").},
128
- :QI => %{connects certain verbs and adjectives to question-words, forming indirect questions: "He WONDERED WHAT she would say".},
129
- :R => %{connects nouns to relative clauses. In subject-type relatives, it connects to the relative pronoun ("The DOG WHO chased me was black"); in object-type relatives, it connects either to the relative pronoun or to the subject of the relative clause ("The DOG THAT we chased was black", "The DOG WE chased was black").},
130
- :RS => %{is used in subject-type relative clauses to connect the relative pronoun to the verb: "The dog WHO CHASED me was black".},
131
- :RW => %{connects the right-wall to the left-wall in cases where the right-wall is not needed for punctuation purposes.},
132
- :S => %{connects subject nouns to finite verbs: "The DOG CHASED the cat": "The DOG [ IS chasing / HAS chased / WILL chase ] the cat".},
133
- :SF => %{is a special connector used to connect "filler" subjects like "it" and "there" to finite verbs: "THERE IS a problem", "IT IS likely that he will go".},
134
- :SFI => %{connects "filler" subjects like "it" and "there" to verbs in cases with subject-verb inversion: "IS THERE a problem?", "IS IT likely that he will go?"},
135
- :SI => %{connects subject nouns to finite verbs in cases of subject-verb inversion: "IS JOHN coming?", "Who DID HE see?"},
136
- :SX => %{connects "I" to special first-person verbs lke "was" and "am".},
137
- :SXI => %{connects "I" to first-person verbs in cases of s-v inversion.},
138
- :TA => %{is used to connect adjectives like "late" to month names: "We did it in LATE DECEMBER".},
139
- :TD => %{connects day-of-the-week words to time expressions like "morning": "We'll do it MONDAY MORNING".},
140
- :TH => %{connects words that take "that [clause]" complements with the word "that". These include verbs ("She TOLD him THAT..."), nouns ("The IDEA THAT..."), and adjectives ("We are CERTAIN THAT").},
141
- :TI => %{is used for titles like "president", which can be used in certain cirumstances without a determiner: "AS PRESIDENT of the company, it is my decision".},
142
- :TM => %{is used to connect month names to day numbers: "It happened on JANUARY 21".},
143
- :TO => %{connects verbs and adjectives which take infinitival complements to the word "to": "We TRIED TO start the car", "We are EAGER TO do it".},
144
- :TQ => %{is the determiner connector for time expressions acting as fronted objects: "How MANY YEARS did it last".},
145
- :TS => %{connects certain verbs that can take subjunctive clauses as complements - "suggest", "require" - to the word that: "We SUGGESTED THAT he go".},
146
- :TW => %{connects days of the week to dates in time expressions: "The meeting will be on MONDAY, JANUARY 21".},
147
- :TY => %{is used for certain idiomatic usages of year numbers: "I saw him on January 21 , 1990 ". (In this case it connects the day number to the year number.)},
148
- :U => %{is a special connector on nouns, which is disjoined with both the determiner and subject-object connectors. It is used in idiomatic expressions like "What KIND_OF DOG did you buy?"},
149
- :UN => %{connects the words "until" and "since" to certain time phrases like "after [clause]": "You should wait UNTIL AFTER you talk to me".},
150
- :V => %{connects various verbs to idiomatic expressions that may be non-adjacent: "We TOOK him FOR_GRANTED", "We HELD her RESPONSIBLE".},
151
- :W => %{connects the subjects of main clauses to the wall, in ordinary declaratives, imperatives, and most questions (except yes-no questions). It also connects coordinating conjunctions to following clauses: "We left BUT SHE stayed".},
152
- :WN => %{connects the word "when" to time nouns like "year": "The YEAR WHEN we lived in England was wonderful".},
153
- :WR => %{connects the word "where" to a few verbs like "put" in questions like "WHERE did you PUT it?".},
154
- :X => %{is used with punctuation, to connect punctuation symbols either to words or to each other. For example, in this case, POODLE connects to commas on either side: "The dog , a POODLE , was black."},
155
- :Y => %{is used in certain idiomatic time and place expressions, to connect quantity expressions to the head word of the expression: "He left three HOURS AGO", "She lives three MILES FROM the station".},
156
- :YP => %{connects plural noun forms ending in s to "'" in possessive constructions: "The STUDENTS ' rooms are large".},
157
- :YS => %{connects nouns to the possessive suffix "'s": "JOHN 'S dog is black".},
158
- :Z => %{connects the preposition "as" to certain verbs: "AS we EXPECTED, he was late".},
159
- }
24
+ # Loaded from the data section of this file, which is generated with
25
+ # the experiments/build_linktype_hash.rb script
26
+ LINK_TYPES = YAML.load( IO.read(__FILE__).split(/^__END__/, 2).last )
160
27
 
161
28
  # Link struct (:lword, :rword, :length, :label, :llabel, :rlabel, :desc)
162
29
  Link = Struct.new( "LinkParserLink", :lword, :rword, :length, :label, :llabel, :rlabel, :desc )
@@ -186,7 +53,7 @@ class LinkParser::Linkage
186
53
  self.link_label(index),
187
54
  self.link_llabel(index),
188
55
  self.link_rlabel(index),
189
- LINK_TYPES[ self.link_label(index).gsub(/[^A-Z]+/, '').to_sym ]
56
+ LINK_TYPES[ self.link_label(index).gsub(/[^A-Z]+/, '') ]
190
57
  )
191
58
  end
192
59
 
@@ -200,7 +67,7 @@ class LinkParser::Linkage
200
67
  end
201
68
 
202
69
 
203
- ### Return an Array of parsed (well, just split on whitespace for now) disjunct strings
70
+ ### Return an Array of parsed (well, just split on whitespace for now) disjunct strings
204
71
  ### for the linkage.
205
72
  def disjuncts
206
73
  return self.disjunct_strings.collect do |dstr|
@@ -214,30 +81,30 @@ class LinkParser::Linkage
214
81
 
215
82
 
216
83
  ### Return the verb word from the linkage.
217
- def verb
218
- if verblink = self.links.find {|link| link.llabel =~ /^(O([DFNTX]?)|P|BI|K|LI|MV|Q)[a-z\*]*/ }
219
- # $deferr.puts "Picking %s: LL of %p is %s" % [ link.lword, link, link.llabel ]
220
- return verblink.lword.sub( /\.v(-d)?$/, '' )
221
- elsif verblink = self.links.find {|link| link.rlabel =~ /^(SI|S|AF)[a-z\*]*/ }
222
- # $deferr.puts "Picking %s: RL of %p is %s" % [ link.rword, link, link.rlabel ]
223
- return verblink.rword.sub( /\.v(-d)?$/, '' )
224
- else
225
- return nil
226
- end
84
+ def verb( keep_subscript: false )
85
+ word = if verblink = self.links.find {|link| link.llabel =~ /^(O([DFNTX]?)|P|BI|K|LI|MV|Q)[a-z\*]*/ }
86
+ verblink.lword
87
+ elsif verblink = self.links.find {|link| link.rlabel =~ /^(SI|S|AF)[a-z\*]*/ }
88
+ verblink.rword
89
+ else
90
+ nil
91
+ end
92
+
93
+ return with_subscript( word, keep_subscript )
227
94
  end
228
95
 
229
96
 
230
97
  ### Return the subject from the linkage.
231
- def subject
98
+ def subject( keep_subscript: false )
232
99
  subjlink = self.links.find {|link| link.llabel[0] == ?S } or return nil
233
- return subjlink.lword.sub( /\.[np](?:-\w)?$/, '' )
100
+ return with_subscript( subjlink.lword, keep_subscript )
234
101
  end
235
102
 
236
103
 
237
104
  ### Return the object from the linkage.
238
- def object
105
+ def object( keep_subscript: false )
239
106
  objlink = self.links.find {|link| link.rlabel[0] == ?O } or return nil
240
- return objlink.rword.sub( /\.[np](?:-\w)?$/, '' )
107
+ return with_subscript( objlink.rword, keep_subscript )
241
108
  end
242
109
 
243
110
 
@@ -260,5 +127,249 @@ class LinkParser::Linkage
260
127
  true : false
261
128
  end
262
129
 
130
+
131
+ #######
132
+ private
133
+ #######
134
+
135
+
136
+ ### Return the specified +word+ with the part-of-speech subscript removed.
137
+ def with_subscript( word, keep_subscript )
138
+ return unless word
139
+ return word if keep_subscript
140
+ return word.sub( /\.[\p{alpha}\-]+$/, '' )
141
+ end
142
+
263
143
  end # class Sentence
264
144
 
145
+
146
+ __END__
147
+ ---
148
+ A: 'connects pre-noun ("attributive") adjectives to following nouns: "The BIG DOG
149
+ chased me", "The BIG BLACK UGLY DOG chased me".'
150
+ AA: is used in the construction "How [adj] a [noun] was it?". It connects the adjective
151
+ to the following "a".
152
+ AF: 'connects adjectives to verbs in cases where the adjective is fronted, such as
153
+ questions and indirect questions: "How BIG IS it?"'
154
+ AJ: 'connects adjectives to conjunctions to form a modifier phrase: "The BLACK AND
155
+ WHITE cat sleeps."'
156
+ AL: 'connects a few determiners like "all" or "both" to following determiners: "ALL
157
+ THE people are here".'
158
+ AM: 'connects "as" to "much" or "many": "I don''t go out AS MUCH now".'
159
+ AN: 'connects noun-modifiers to following nouns: "The TAX PROPOSAL was rejected".'
160
+ AZ: 'connects the word "as" back to certain verbs that can take "[obj] as [adj]" as
161
+ a complement: "He VIEWED him AS stupid".'
162
+ B: serves various functions involving relative clauses and questions. It connects
163
+ transitive verbs back to their objects in relative clauses, questions, and indirect
164
+ questions ("The DOG we CHASED", "WHO did you SEE?"); it also connects the main noun
165
+ to the finite verb in subject-type relative clauses ("The DOG who CHASED me was
166
+ black").
167
+ BI: 'connects forms of the verb "be" to certain idiomatic expressions: for example,
168
+ cases like "He IS PRESIDENT of the company".'
169
+ BT: 'is used with time expressions acting as fronted objects: "How many YEARS did
170
+ it LAST?".'
171
+ BW: 'connects "what" to various verbs like "think", which are not really transitive
172
+ but can connect back to "what" in questions: "WHAT do you THINK?"'
173
+ C: links conjunctions to subjects of subordinate clauses ("He left WHEN HE saw me").
174
+ it also links certain verbs to subjects of embedded clauses ("He SAID HE was sorry").
175
+ CC: connects clauses to following coordinating conjunctions ("SHE left BUT we stayed").
176
+ CO: 'connects "openers" to subjects of clauses: "APPARENTLY / ON Tuesday , THEY went
177
+ to a movie".'
178
+ CP: 'connects paraphrasing or quoting verbs to the wall (and, indirectly, to the paraphrased
179
+ expression): "///// That is untrue, the spokesman SAID."'
180
+ CQ: 'connects to auxiliaries in comparative constructions involving s-v inversion:
181
+ "SHE has more money THAN DOES Joe".'
182
+ CV: connects the verbs of subordinate clauses to the subordinating word.
183
+ CX: 'is used in comparative constructions where the right half of the comparative
184
+ contains only an auxiliary: "She has more money THAN he DOES".'
185
+ D: 'connects determiners to nouns: "THE DOG chased A CAT and SOME BIRDS".'
186
+ DD: 'connects definite determiners ("the", "his") to certain things like number expressions
187
+ and adjectives acting as nouns: "THE POOR", "THE TWO he mentioned".'
188
+ DG: 'connects the word "The" with proper nouns: "the Riviera", "the Mississippi".'
189
+ DP: 'connects possessive determiners to gerunds: "YOUR TELLING John to leave was stupid".'
190
+ DT: 'connects determiners to nouns in idiomatic time expressions: "NEXT WEEK", "NEXT
191
+ THURSDAY".'
192
+ E: 'is used for verb-modifying adverbs which precede the verb: "He is APPARENTLY LEAVING".'
193
+ EA: 'connects adverbs to adjectives: "She is a VERY GOOD player".'
194
+ EB: 'connects adverbs to forms of "be" before an object or prepositional phrase: "He
195
+ IS APPARENTLY a good programmer".'
196
+ EC: 'connects adverbs to comparative adjectives: "It is MUCH BIGGER"'
197
+ EE: 'connects adverbs to other adverbs: "He ran VERY QUICKLY".'
198
+ EF: 'connects the word "enough" to preceding adjectives and adverbs: "He didn''t run
199
+ QUICKLY ENOUGH".'
200
+ EI: 'connects a few adverbs to "after" and "before": "I left SOON AFTER I saw you".'
201
+ EL: 'connects certain words to the word "else": something / everything / anything
202
+ / nothing , somewhere (etc.), and someone (etc.).'
203
+ EN: 'connects certain adverbs to expressions of quantity: "The class has NEARLY FIFTY
204
+ students".'
205
+ EQ: 'connects parts of an equation together: "Phosphorylation was observed (P = 0.06)".'
206
+ ER: is used the expression "The x-er..., the y-er...". it connects the two halfs of
207
+ the expression together, via the comparative words (e.g. "The FASTER it is, the
208
+ MORE they will like it").
209
+ EZ: 'connects certain adverbs to the word "as", like "just" and "almost": "You''re
210
+ JUST AS good as he is."'
211
+ FL: 'connects "for" to "long": "I didn''t wait FOR LONG".'
212
+ FM: 'connects the preposition "from" to various other prepositions: "We heard a scream
213
+ FROM INSIDE the house".'
214
+ G: 'connects proper noun words together in series: "GEORGE HERBERT WALKER BUSH is
215
+ here."'
216
+ GN: '(stage 2 only) connects a proper noun to a preceding common noun which introduces
217
+ it: "The ACTOR Eddie MURPHY attended the event".'
218
+ H: 'connects "how" to "much" or "many": "HOW MUCH money do you have".'
219
+ HA: 'connects "how" to "a": "HOW big A dog was it?"'
220
+ I: 'connects infinitive verb forms to certain words such as modal verbs and "to":
221
+ "You MUST DO it", "I want TO DO it".'
222
+ ID: |-
223
+ is a special class of link-types generated by the parser, with arbitrary
224
+ four-letter names (such as "IDBT"), to connect together words of
225
+ idiomatic expressions such as "at_hand" and "head_of_state".
226
+ IN: 'connects the preposition "in" to certain time expressions: "We did it IN DECEMBER".'
227
+ IV: connects the infinitive verb to the clause that starts the infinitive.
228
+ J: 'connects prepositions to their objects: "The man WITH the HAT is here".'
229
+ JG: 'connects certain prepositions to proper-noun objects: "The Emir OF KUWAIT is
230
+ here".'
231
+ JQ: 'connects prepositions to question-word determiners in "prepositional questions":
232
+ "IN WHICH room were you sleeping?"'
233
+ JT: 'connects certain conjunctions to time-expressions like "last week": "UNTIL last
234
+ WEEK, I thought she liked me".'
235
+ K: 'connects certain verbs with particles like "in", "out", "up" and the like: "He
236
+ STOOD UP and WALKED OUT".'
237
+ L: 'connects certain determiners to superlative adjectives: "He has THE BIGGEST room".'
238
+ LE: 'is used in comparative constructions to connect an adjective to the second half
239
+ of the comparative expression beyond a complement phrase: "It is more LIKELY that
240
+ Joe will go THAN that Fred will go".'
241
+ LI: 'connects certain verbs to the preposition "like": "I FEEL LIKE a fool."'
242
+ M: 'connects nouns to various kinds of post-noun modifiers: prepositional phrases
243
+ ("The MAN WITH the hat"), participle modifiers ("The WOMAN CARRYING the box"), prepositional
244
+ relatives ("The MAN TO whom I was speaking"), and other kinds.'
245
+ MF: is used in the expression "Many people were injured, SOME OF THEM children".
246
+ MG: 'allows certain prepositions to modify proper nouns: "The EMIR OF Kuwait is here".'
247
+ MJ: 'connects prepositions and other post-nominal modifiers to conjunctions to form
248
+ a prepositional or modifier phrase: "It is hidden somewhere IN OR NEAR the house."'
249
+ MV: connects verbs and adjectives to modifying phrases that follow, like adverbs ("The
250
+ dog RAN QUICKLY"), prepositional phrases ("The dog RAN IN the yard"), subordinating
251
+ conjunctions ("He LEFT WHEN he saw me"), comparatives, participle phrases with commas,
252
+ and other things.
253
+ MX: 'connects modifying phrases with commas to preceding nouns: "The DOG, a POODLE,
254
+ was black". "JOHN, IN a black suit, looked great".'
255
+ N: 'connects the word "not" to preceding auxiliaries: "He DID NOT go".'
256
+ NA: 'connects numbers used in spelled-out dates: "The war started in NINETEEN FOURTEEN".'
257
+ ND: 'connects numbers with expressions that require numerical determiners: "I saw
258
+ him THREE WEEKS ago".'
259
+ NF: 'is used with NJ in idiomatic number expressions involving "of": "He lives two
260
+ THIRDS OF a mile from here".'
261
+ NI: 'is used in a few special idiomatic number phrases: "I have BETWEEN 5 AND 20 dogs".'
262
+ NJ: 'is used with NF in idiomatic number expressions involving "of": "He lives two
263
+ thirds OF a MILE from here".'
264
+ NM: 'connects certain idiomatic numerical modifiers: "He is on FLIGHT 714", "That
265
+ will cost $300".'
266
+ NN: 'connects number words together in series: "FOUR HUNDRED THOUSAND people live
267
+ here".'
268
+ 'NO': is used on words which have no normal linkage requirement, but need to be included
269
+ in the dictionary, such as "um" and "ah".
270
+ NR: 'connects fraction words with superlatives: "It is the THIRD BIGGEST city in China".'
271
+ NS: 'connects singular numbers (one, 1, a) to idiomatic expressions requiring number
272
+ determiners: "I saw him ONE WEEK ago".'
273
+ NT: 'connects "not" to "to": "I told you NOT TO come".'
274
+ NW: 'is used in idiomatic fraction expressions: "TWO THIRDS of the students were women".'
275
+ O: 'connects transitive verbs to their objects, direct or indirect: "She SAW ME",
276
+ "I GAVE HIM the BOOK".'
277
+ OD: 'is used for verbs like "rise" and "fall" which can take expressions of distance
278
+ as complements: "It FELL five FEET".'
279
+ OF: 'connects certain verbs and adjectives to the word "of": "She ACCUSED him OF the
280
+ crime", "I''m PROUD OF you".'
281
+ 'ON': 'connectors the word "on" to dates or days of the week in time expressions:
282
+ "We saw her again ON TUESDAY".'
283
+ OT: 'is used for verbs like "last" which can take time expressions as objects: "It
284
+ LASTED five HOURS".'
285
+ OX: 'is an object connector, analogous to SF, used for special "filler" words like
286
+ "it" and "there" when used as objects: "That MAKES IT unlikely that she will come".'
287
+ P: 'connects forms of the verb "be" to various words that can be its complements:
288
+ prepositions, adjectives, and passive and progressive participles: "He WAS [ ANGRY
289
+ / IN the yard / CHOSEN / RUNNING ]".'
290
+ PF: 'is used in certain questions with "be", when the complement need of "be" is satisfied
291
+ by a preceding question word: "WHERE are you?", "WHEN will it BE?"'
292
+ PH: 'is used to enforce phonetic agreement in the usage of "a" and "an" with words
293
+ that begin with consonants and vowels. So: "I ate AN apple." "I ate A green apple."'
294
+ PP: 'connects forms of "have" with past participles: "He HAS GONE".'
295
+ Q: is used in questions. It connects the wall to the auxiliary in simple yes-no questions
296
+ ("///// DID you go?"); it connects the question word to the auxiliary in where-when-how
297
+ questions ("WHERE DID you go").
298
+ QI: 'connects certain verbs and adjectives to question-words, forming indirect questions:
299
+ "He WONDERED WHAT she would say".'
300
+ QJ: 'connects question words to conjunctions to form a question phrase: "WHEN AND
301
+ WHERE is the party?"'
302
+ R: connects nouns to relative clauses. In subject-type relatives, it connects to the
303
+ relative pronoun ("The DOG WHO chased me was black"); in object-type relatives,
304
+ it connects either to the relative pronoun or to the subject of the relative clause
305
+ ("The DOG THAT we chased was black", "The DOG WE chased was black").
306
+ RJ: 'provides support for conjoining adverbs and other miscellaneous phrases: "She
307
+ handled it QUICKLY AND GRACEFULLY"'
308
+ RS: 'is used in subject-type relative clauses to connect the relative pronoun to the
309
+ verb: "The dog WHO CHASED me was black".'
310
+ RW: connects the right-wall to the left-wall in cases where the right-wall is not
311
+ needed for punctuation purposes.
312
+ S: 'connects subject nouns to finite verbs: "The DOG CHASED the cat": "The DOG [ IS
313
+ chasing / HAS chased / WILL chase ] the cat".'
314
+ SF: 'is a special connector used to connect "filler" subjects like "it" and "there"
315
+ to finite verbs: "THERE IS a problem", "IT IS likely that he will go".'
316
+ SFI: 'connects "filler" subjects like "it" and "there" to verbs in cases with subject-verb
317
+ inversion: "IS THERE a problem?", "IS IT likely that he will go?"'
318
+ SI: 'connects subject nouns to finite verbs in cases of subject-verb inversion: "IS
319
+ JOHN coming?", "Who DID HE see?"'
320
+ SJ: 'connects nouns to conjunctions to form a noun phrase: "I have the BALL AND CHAIN
321
+ with me tonight."'
322
+ SX: connects "I" to special first-person verbs lke "was" and "am".
323
+ SXI: connects "I" to first-person verbs in cases of s-v inversion.
324
+ TA: 'is used to connect adjectives like "late" to month names: "We did it in LATE
325
+ DECEMBER".'
326
+ TD: 'connects day-of-the-week words to time expressions like "morning": "We''ll do
327
+ it MONDAY MORNING".'
328
+ TH: connects words that take "that [clause]" complements with the word "that". These
329
+ include verbs ("She TOLD him THAT..."), nouns ("The IDEA THAT..."), and adjectives
330
+ ("We are CERTAIN THAT").
331
+ TI: 'is used for titles like "president", which can be used in certain cirumstances
332
+ without a determiner: "AS PRESIDENT of the company, it is my decision".'
333
+ TM: 'is used to connect month names to day numbers: "It happened on JANUARY 21".'
334
+ TO: 'connects verbs and adjectives which take infinitival complements to the word
335
+ "to": "We TRIED TO start the car", "We are EAGER TO do it".'
336
+ TQ: 'is the determiner connector for time expressions acting as fronted objects: "How
337
+ MANY YEARS did it last".'
338
+ TR: 'connects determiners to comparatives: "The better the computer, the faster the
339
+ program."'
340
+ TS: 'connects certain verbs that can take subjunctive clauses as complements - "suggest",
341
+ "require" - to the word that: "We SUGGESTED THAT he go".'
342
+ TW: 'connects days of the week to dates in time expressions: "The meeting will be
343
+ on MONDAY, JANUARY 21".'
344
+ TY: 'is used for certain idiomatic usages of year numbers: "I saw him on January 21
345
+ , 1990 ". (In this case it connects the day number to the year number.)'
346
+ TZ: 'is used for certain idiomatic usages of time zones: "The meeting starts at 1
347
+ p.m. EDT."'
348
+ U: is a special connector on nouns, which is disjoined with both the determiner and
349
+ subject-object connectors. It is used in idiomatic expressions like "What KIND_OF
350
+ DOG did you buy?"
351
+ UN: 'connects the words "until" and "since" to certain time phrases like "after [clause]":
352
+ "You should wait UNTIL AFTER you talk to me".'
353
+ V: 'connects various verbs to idiomatic expressions that may be non-adjacent: "We
354
+ TOOK him FOR_GRANTED", "We HELD her RESPONSIBLE".'
355
+ VJ: 'connects verbs to conjunctions: "He RAN AND JUMPED".'
356
+ W: 'connects the subjects of main clauses to the wall, in ordinary declaratives, imperatives,
357
+ and most questions (except yes-no questions). It also connects coordinating conjunctions
358
+ to following clauses: "We left BUT SHE stayed".'
359
+ WN: 'connects the word "when" to time nouns like "year": "The YEAR WHEN we lived in
360
+ England was wonderful".'
361
+ WR: connects the word "where" to a few verbs like "put" in questions like "WHERE did
362
+ you PUT it?".
363
+ WV: connects the verbs of main clauses to the wall.
364
+ X: 'is used with punctuation, to connect punctuation symbols either to words or to
365
+ each other. For example, in this case, POODLE connects to commas on either side:
366
+ "The dog , a POODLE , was black."'
367
+ XJ: 'provides support for various idiomatic coordinating expressions, such as "...
368
+ NOT ONLY x, BUT y": "You should NOT ONLY ask for your money back, BUT demand it."'
369
+ Y: 'is used in certain idiomatic time and place expressions, to connect quantity expressions
370
+ to the head word of the expression: "He left three HOURS AGO", "She lives three
371
+ MILES FROM the station".'
372
+ YP: 'connects plural noun forms ending in s to "''" in possessive constructions: "The
373
+ STUDENTS '' rooms are large".'
374
+ YS: 'connects nouns to the possessive suffix "''s": "JOHN ''S dog is black".'
375
+ Z: 'connects the preposition "as" to certain verbs: "AS we EXPECTED, he was late".'