1LINK-PARSER(1) General Commands Manual LINK-PARSER(1)
2
3
4
6 link-parser - parse natural language sentences using Link Grammar
7
9 link-parser --help
10 link-parser --version
11 link-parser [language|dict_location] [-<special_"!"_command>...]
12
14 link-parser is the command-line wrapper to the link-grammar natural
15 language parsing library. This library will parse English language
16 sentences, generating linkage trees showing relationships between the
17 subject, the verb, and various adjectives, adverbs, etc. in the sen‐
18 tence.
19
21 link-parser
22
23 Starts the parser interactive shell. Enter any sentence to parse:
24
25 linkparser> Reading a man page is informative.
26
27 Found 12 linkages (12 had no P.P. violations)
28 Linkage 1, cost vector = (UNUSED=0 DIS= 0.20 LEN=16)
29
30 +------------------------Xp------------------------+
31 +--------------->WV-------------->+ |
32 | +----------Ss*g---------+ |
33 | +--------Os-------+ | |
34 | | +---Ds**x---+ | |
35 +----Wd---+ | +---A--+ +---Pa---+ |
36 | | | | | | | |
37 LEFT-WALL reading.g a man.ij page.n is.v informative.a .
38
40 The link-parser command-line tool is useful for general exploration and
41 use, although it is presumed that, for the parsing of large quantities
42 of text, a custom application, making use of the link-grammar library,
43 will be written. Several such applications are described on the Link
44 Grammar web page (see SEE ALSO below); these include the AbiWord gram‐
45 mar checker, and the RelEx semantic relation extractor.
46
47 The theory of Link Grammar is explained in many academic papers. In
48 the first of these, Daniel Sleator and Davy Temperley, "Parsing English
49 with a Link Grammar" (1991), the authors defined a new formal grammati‐
50 cal system called a "link grammar". A sequence of words is in the lan‐
51 guage of a link grammar if there is a way to draw "links" between words
52 in such a way that the local requirements of each word are satisfied,
53 the links do not cross, and the words form a consistent connected
54 graph. The authors encoded English grammar into such a system, and
55 wrote link-parser to parse English using this grammar.
56
57 The engine that performs the parsing is separate from the dictionaries
58 describing a language. Currently, the most fully developed, complete
59 dictionaries are for the English and Russian languages, although exper‐
60 imental, incomplete dictionaries exist for German, and several other
61 languages.
62
63
65 link-parser, when invoked manually, starts an interactive shell, taking
66 control of the terminal. Any lines beginning with an exclamation mark
67 are assumed to be a "special command"; these are described below. The
68 command !help will provide more info; the command !variables will print
69 all of the special commands. These are also called "variables", as
70 almost all commands have a value associated with them: the command typ‐
71 ically enable or disable some function, or they alter some multi-valued
72 setting.
73
74 All other input is treated as a single, English-language sentence; it
75 is parsed, and the result of the parse is printed. The variables con‐
76 trol what is printed: By default, an ASCII-graphics linkage is
77 printed, although post-script output is also possible. The printing of
78 the constituent tree can also be enabled. Other output controls include
79 the printing of disjuncts, complete link data, and word senses.
80
81 In order to analyze sentences, link-parser depends on a link-grammar
82 dictionary. This contains lists of words and associated metadata about
83 their grammatical properties. An English language dictionary is pro‐
84 vided by default. If other language dictionaries are installed in the
85 default search locations, these may be explicitly specified by means of
86 a 2-letter ISO language code: so, for example:
87
88 link-parser de
89
90 will start the parser shell with the German dictionary.
91
92 Alternately, the dictionary location can be specified explicitly with
93 either an absolute or a relative file path; so, for example:
94
95 link-parser /usr/share/link-grammar/en
96
97 will run link-parser using the English dictionary located in the typi‐
98 cal install directory.
99
100 link-parser can also be used non-interactively, either through its API,
101 or via the -batch option. When used with the -batch option,
102 link-parser reads from standard input, generating output to standard
103 out. So, for example:
104
105 cat thesis.txt | link-parser -batch
106
107 Note that using the -batch option disables the usual ASCII-graphics
108 linkage printing. This may be re-enabled via a special command; spe‐
109 cial commands may be interspersed with the input.
110
111 Alternately, an input file may be specified with the !file special com‐
112 mand, described below.
113
114
116 --help Print usage and exit.
117
118 --version
119 Print version number and exit.
120
121
122 Special ! options
123 The special "!" options can be specified either on the command-line, on
124 startup, or set and toggled within the interactive shell itself. The
125 full option name does not need to be used; only enough letters to make
126 the option unique must be specified.
127
128 Boolean variables may be toggled simply by giving the !varname, for
129 example, !batch. Setting other variables require using an equals sign:
130 !varname=value, for example, !width=100.
131
132 The !help command will print general help, and the !variables command
133 will print all of the current variable settings. The !file command
134 will read input from a file. The !file command is not a variable; it
135 cannot be set. It can be used repeatedly.
136
137 The !exit command will cause link-parser to exit.
138
139 The dictionary entry for any given word (optionally terminated by a
140 subscript) may be examined by preceding it with two exclamation marks.
141 A wildcard character '*' can be specified as the last character of the
142 word in order to find multiple matches.
143
144 Default values of the options below are shown in parenthesis. Most of
145 them are the default ones of the link-grammar library. Boolean default
146 values are shown as on (1) or off (0).
147
148 -bad (off)
149 Enable display of bad linkages.
150
151 -batch (off)
152 Enable batch mode.
153
154 -cluster (off)
155 Use clusters to loosen parsing.
156
157 -constituents (0)
158 Generate constituent output. Its value may be:
159
160 0 Disabled
161
162 1 Treebank-style constituent tree
163
164 2 Flat, bracketed tree [A like [B this B] A]
165
166 3 Flat, treebank-style tree (A like (B this))
167
168 -cost-max (2.7)
169 Largest cost to be considered.
170
171 -disjuncts (off)
172 Display of disjuncts used.
173
174 -echo (off)
175 Echo input sentence.
176
177 -graphics (on)
178 Enable graphical display of linkage. For each linkage, the sen‐
179 tence is printed along with a graphical representation of its
180 linkage above it.
181
182 The following notations are used for words in the sentence:
183
184 [word] A word with no linkage.
185
186 word[?].x
187 An unknown word whose POS category x has been found by
188 the parser.
189
190 word[!]
191 An unknown word whose link-grammar dictionary entry has
192 been assigned by a RegEx. (Use !morphology=1 to see the
193 said dictionary entry.)
194
195 word[~]
196 There was an unknown word in this position, and it has
197 got replaced, using a spell guess with this word, that is
198 found in the link-grammar dictionary.
199
200 word[&]
201 This word is a part of an unknown word which has been
202 found to consist of two or more words that are in the
203 link-grammar dictionary.
204
205 -islands-ok (on)
206 Use null-linked islands.
207
208 -limit (1000)
209 Limit the maximum linkages processed.
210
211 -links (off)
212 Enable display of complete link data.
213
214 -null (on)
215 Allow null links.
216
217 -morphology (off)
218 Display word morphology. When a word matches a RegEx, show the
219 matching dictionary entry.
220
221 -panic (on)
222 Use "panic mode" if a parse cannot be quickly found.
223
224 -postscript (off)
225 Generate postscript output.
226
227 -senses (off)
228 Display word senses.
229
230 -short (16)
231 Maximum length of short links.
232
233 -spell (7)
234 If zero, no spell and run-on corrections of unknown words are
235 performed.
236 Else, use up to this many spell-guesses per unknown word. In
237 that case, the number of run-on corrections (word split) of
238 unknown words is not limited.
239
240 -timeout (30)
241 Abort parsing after this many seconds.
242
243 -use-sat (off)
244 Use Boolean SAT-based parser.
245
246 -verbosity (1)
247 Level of detail in output.
248
249 -walls (off)
250 Display wall words.
251
252 -width (16381)(*)
253 The width of the display.
254 * When writing to a terminal, this value is set from its width.
255
256
258 The following files are per-language, when LL is the 2-letter ISO lan‐
259 guage code.
260
261 LL/4.0.dict
262 The Link Grammar dictionary.
263
264 LL/4.0.affix
265 Values of entities used in tokenization.
266
267 LL/4.0.regex
268 Regular expressions (see regex(7)) that are used to match tokens
269 not found in the dictionary.
270
271 LL/4.0.knowledge
272 Post-processing definitions.
273
274 LL/4.0.constituent-knowledge
275 Definitions for producing a constituent tree.
276
277
278
279 The directory search order for these files is:
280 ./
281 data/
282 ../
283 ../data/
284 A custom path, as set by the API call dictionary_set_data_dir().
285 /usr/share/link-grammar/
286
287
289 Information on the link-grammar shared-library API and the link types
290 used in the parse is available at the AbiWord website
291 ⟨http://www.abisource.com/projects/link-grammar/⟩.
292
293 Peer-reviewed papers explaining Link Grammar can be found at original
294 CMU site ⟨http://www.link.cs.cmu.edu/link/papers⟩.
295
296 The source code of link-parser and the link-grammar library is located
297 at GitHub ⟨https://github.com/opencog/link-grammar⟩.
298
299 The mailing list for Link Grammar discussion is at link-grammar Google
300 group ⟨http://groups.google.com/group/link-grammar?hl=en⟩.
301
303 link-parser and the link-grammar library were written by Daniel Sleator
304 <sleator@cs.cmu.edu>, Davy Temperley <dtemp@theory.esm.rochester.edu>,
305 and John Lafferty <lafferty@cs.cmu.edu>
306
307 This manual page was written by Ken Bloom <kbloom@gmail.com>, for the
308 Debian project, and updated by Linas Vepstas <linasvepstas@gmail.com>.
309
310
311
312Version 5.3.8 2016-06-29 LINK-PARSER(1)