1LINK-GRAMMAR(1) General Commands Manual LINK-GRAMMAR(1)
2
3
4
6 link-parser - parses natural language sentences
7
9 link-parser [language] [-pp pp_knowledge_file] [-c constituent_knowl‐
10 edge_file] [-a affix_file] [-ppoff] [-coff] [-aoff] [-batch] [-<special
11 "!" command>]
12
14 In Selator, D. and Temperly, D. "Parsing English with a Link Grammar"
15 (1991), the authors defined a new formal grammatical system called a
16 "link grammar". A sequence of words is in the language of a link gram‐
17 mar if there is a way to draw "links" between words in such a way that
18 the local requirements of each word are satisfied, the links do not
19 cross, and the words form a consistent connected graph. The authors
20 encoded English grammar into such a system, and wrote link-parser to
21 parse English using this grammar.
22
23 This package can be used for linguistic parsing for information
24 retrieval or extraction from natural language documents. Abiword also
25 uses it as a grammar checker.
26
28 -pp pp_knowledge_file
29
30 -c constituent_knowledge_file
31
32 -a affix_file
33
34 -ppoff
35
36 -coff
37
38 -aoff
39
40 -batch
41
42 -<special ! command>
43
45 link-parser, when invoked manually, will take control of the terminal;
46 link-parser will then attempt to analyze the grammar of all input,
47 unless escaped with an exclamation mark, according to the dictionary
48 file provided as an argument. If escaped, the input will be treated as
49 a "special command"; "!help" lists all special commands available.
50
51 link-parser depends on a link-grammar dictionary which contains lists
52 of words and associated metadata about their grammatical properties in
53 order to analyze sentences. A link-grammar dictionary provided by the
54 authors of link-grammar is usually included with the link-grammar pack‐
55 age, and can often be found somewhere in the /usr/share/link-grammar/
56 hierarchy. When this is the case, only the two-letter language code
57 needs to be specified on the command-line. Alternatively, a user can
58 provide their own dictionary as an argument, in which case the dictio‐
59 nary's directory should be specified. Hence, either of the commands
60
61 link-parser en
62
63 link-parser /usr/share/link-grammar/en
64 will run link-parser using the english dictionary included with
65 the parser.
66
67 While in a link-parser session, some example output could be:
68
69 linkparser> Reading a man page is informative.
70
71 ++++Time 0.00 seconds
72 (0.01 total)
73
74 Found 1 linkage (1 had no P.P. violations)
75 Unique linkage, cost vector = (UNUSED=0 DIS=0 AND=0 LEN=12)
76
77 +------------------------Xp-----------------------+
78 | +---------Ss*g---------+ |
79 | +-------Os-------+ | |
80 | | +----Ds----+ | |
81 +----Wd---+ | +--AN--+ +---Pa---+ |
82 | | | | | | | |
83
84 LEFT-WALL reading.g a man.n page.n is.v informative.a .
85
86 A P.P. violation is a post-processing violation; it is a post-linkage
87 step used to reject invalid parses. The link types shown are specific
88 to English; other langauges will have different link types.
89
90 link-parser can also be used non-interactively, either through its API,
91 or via the -batch option. When used with the -batch option,
92 link-parser passively receives input from standard input, and when the
93 stream finishes, it then outputs its analysis. So one could construct
94 an ad-hoc grammar checker by piping text through link-parser with a
95 batch option, and seeing what sentences fail to parse as valid:
96 cat thesis.txt | link-parser /usr/share/link-grammar/en/4.0.dict
97 -batch
98
100 Information on the shared-library API and the link types used in the
101 parse is avavailable at the Abiword website at
102 http://www.abisource.com/projects/link-grammar/dict/index.html
103 Peer-reviewed papers explaining link-parser can be found at the origi‐
104 nal CMU site at http://www.link.cs.cmu.edu/link/papers/index.html.
105
107 link-parser was written by Daniel Sleator <sleator@cs.cmu.edu>, Davy
108 Temperley <dtemp@theory.esm.rochester.edu>, and John Lafferty
109 <lafferty@cs.cmu.edu>
110
111 This manual page was written by Ken Bloom <kbloom@gmail.com>, for the
112 Debian project (but may be used by others).
113
114
115
116 April 18, 2008 LINK-GRAMMAR(1)