link-generator(1)

link-generator1

Generate natural language sentences using link grammar

Usage

link-generator --help

link-generator --version

Overview

link-generator is a command-line tool for generating random sentences whose syntax is determined by the specified link-grammar dictionary.

Examples

link-generator

Background

The theory of Link Grammar is explained in many academic papers. In the first of these, Daniel Sleator and Davy Temperley, "Parsing English with a Link Grammar" (1991), the authors defined a new formal grammatical system called a "link grammar". A sequence of words is in the language of a link grammar if there is a way to draw "links" between words in such a way that the local requirements of each word are satisfied, the links do not cross, and the words form a consistent connected graph. The authors encoded English grammar into such a system, and wrote the link-parser command-line tool to parse English using this grammar.

The engine that performs the parsing is separate from the dictionaries describing a language. Currently, the most fully developed, complete dictionaries are for the English and Russian languages, although experimental, incomplete dictionaries exist for German and eight other languages.

Overview

link-generator generates sentences.

Options

--help

Print usage and exit.

--version

Print program version and configuration details, and exit.

--usage

Print a short synopsis of the option flags.

-l language|dict_location, --language=language|dict_location

Specify the language to use, or the directory file-path to the dictionary to use.

-s length, --length=length

If length is 0, read a sentence template. It may consist of fully spelled-out words as well as wild-cards. The wild-card \* represents any dictionary word. Wild-card specifications like prefix\* and \*.n are also recognized.

Otherwise, it specifies the length of the sentences to generate. All generated sentences will have exactly this length.

-c count, --count=count

Specify the number of sentences to generate. If this number is less than the number of possible linkages, then a random subset of possible linkages will be generated, and one representative sentence for each linkage will be printed. The words in the representative sentence are randomly chosen from the set of words associated with each disjunct in that linkage. If the count is greater than the number of possible linkages, then one representative sentence for each linkage will be printed.

If the -x option is set, and if the count is greater than the number of possible linkages, then more than one representative sentence will be printed for each linkage. Each sentence will consist of word choices drawn randomly from the set of words associated with each disjunct. An approximately equal number of sentences will be printed for each linkage; if the count is high enough, then all possible word-choices will be printed. Note that this typically results in a combinatorial explosion!

-x, --explode

If set, and is the count is greater than the number of possible linkages, then more than one sentence will be printed for each linkage. Each sentence will have a distinct random word-choice for that linkage.

-d, --disjuncts

Display linkage disjuncts.

--no-walls

Don't attach to walls in wildcard words.

-r, --random

Use unrepeatable random numbers.

-u, --unused

Display unused disjuncts.

Releases

3 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13–Arch

Author

The link-grammar library were written by Daniel Sleator <[email protected]>, Davy Temperley <[email protected]>, and John Lafferty <[email protected]>. The link-generator tool was created by Amir Plivatsky <amirpli_at_gmail.com>.

This manual page was written by Ken Bloom <[email protected]>, for the Debian project, and updated Linas Vepstas <[email protected]>.

From link-grammar 5.13.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.