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